# HG changeset patch # User Sean Farley <sean@farley.io> # Date 1443138887 25200 # Thu Sep 24 16:54:47 2015 -0700 # Node ID d46938925708ca833f37359fa7bfe60883ce7825 # Parent f05962b0e78a3ca2638ea835e7847fb638c9b576 revsets: use baseset instead of raw list We fallback to using a standard set if baseset is not available diff --git a/hggit/__init__.py b/hggit/__init__.py --- a/hggit/__init__.py +++ b/hggit/__init__.py @@ -62,6 +62,14 @@ # The ignore module disappeared in Mercurial 3.5 ignoremod = False +baseset = set +try: + baseset = revset.baseset +except AttributeError: + # baseset was added in hg 3.0 + pass + + demandimport.ignore.extend([ 'collections', ]) @@ -338,7 +346,8 @@ revset.getargs(x, 0, 0, "fromgit takes no arguments") git = repo.githandler node = repo.changelog.node - return [r for r in subset if git.map_git_get(hex(node(r))) is not None] + return baseset(r for r in subset + if git.map_git_get(hex(node(r))) is not None) def revset_gitnode(repo, subset, x): '''``gitnode(hash)`` @@ -355,7 +364,7 @@ if gitnode is None: return False return rev in [gitnode, gitnode[:12]] - return [r for r in subset if matches(r)] + return baseset(r for r in subset if matches(r)) def gitnodekw(**args): """:gitnode: String. The Git changeset identification hash, as a 40 hexadecimal digit string."""