Skip to content

Instantly share code, notes, and snippets.

@bamboo
Created March 22, 2012 18:42
Show Gist options
  • Save bamboo/2161519 to your computer and use it in GitHub Desktop.
Save bamboo/2161519 to your computer and use it in GitHub Desktop.
import System.Text.RegularExpressions
while true:
heads = /changeset:\s+(?<revision>\d+)(.|\n)+?summary:\s+.+\n/.Matches(shell("hg", "heads"))
break if len(heads) < 2
for head as Match in heads:
continue if /tag:\s+tip/.IsMatch(head.Value)
revision = head.Groups["revision"].Value
print "stripping $revision..."
print shell("hg", "strip $revision")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment