# HG changeset patch # User Pierre-Yves David # Date 1493808851 -7200 # Node ID e16f6bef5848b1c43db117ae87648347ced8f72d # Parent 2e0a15985657ebda0c8126287e7cb068f03b46d8 compat: make obscache code compatible with Mercurial version prior to 4.2 the phasecache.getrevset method is new in 4.2. diff -r 2e0a15985657 -r e16f6bef5848 hgext3rd/evolve/obscache.py --- a/hgext3rd/evolve/obscache.py Wed May 03 12:41:54 2017 +0200 +++ b/hgext3rd/evolve/obscache.py Wed May 03 12:54:11 2017 +0200 @@ -17,6 +17,7 @@ obsolete, phases, node, + util, ) from . import ( @@ -329,7 +330,11 @@ """the set of obsolete revisions""" obs = set() repo = repo.unfiltered() - notpublic = repo._phasecache.getrevset(repo, (phases.draft, phases.secret)) + if util.safehasattr(repo._phasecache, 'getrevset'): + notpublic = repo._phasecache.getrevset(repo, (phases.draft, phases.secret)) + else: + # < hg-4.2 compat + notpublic = repo.revs("not public()") if notpublic: obscache = repo.obsstore.obscache # Since we warm the cache at the end of every transaction, the cache