Skip to content

Instantly share code, notes, and snippets.

@palfrey
Created January 30, 2011 19:19
Show Gist options
  • Select an option

  • Save palfrey/803140 to your computer and use it in GitHub Desktop.

Select an option

Save palfrey/803140 to your computer and use it in GitHub Desktop.
Revset boilerplate
try:
from mercurial import ui, hg, revset
except ImportError:
raise Exception, "Need mercurial >=1.6 for revset!"
def revs(repo, spec, items = None):
ret = []
if items == None:
items = range(len(repo))
m = revset.match(spec)
for r in m(repo, items):
ret += [r]
return ret
repo = hg.repository(ui.ui(), '.')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment