# HG changeset patch # User Alain Leufroy # Date 1338280053 -7200 # Node ID 470232cea50324561fec76df827df3ae6d97d651 # Parent a60d11973ff3a0018acde22ac54c343493b01ae8 [obsolete] fix new api: use the new phase cache api Introduced by `b6081c2c4647@mercurial `_ diff -r a60d11973ff3 -r 470232cea503 hgext/obsolete.py --- a/hgext/obsolete.py Wed May 30 14:17:33 2012 +0200 +++ b/hgext/obsolete.py Tue May 29 10:27:33 2012 +0200 @@ -96,6 +96,7 @@ from mercurial import phases from mercurial.node import hex, bin, short, nullid from mercurial.lock import release +from mercurial import localrepo try: from mercurial.localrepo import storecache @@ -140,7 +141,14 @@ def revsetobsolete(repo, subset, x): """obsolete changesets""" args = revset.getargs(x, 0, 0, 'obsolete takes no argument') - return [r for r in subset if r in repo._obsoleteset and repo._phaserev[r] > 0] + return [r for r in subset if r in repo._obsoleteset and repo._phasecache.phase(repo, r) > 0] + +# XXX Backward compatibility, to be removed once stabilized +if '_phasecache' not in vars(localrepo.localrepository): # new api + def revsetobsolete(repo, subset, x): + """obsolete changesets""" + args = revset.getargs(x, 0, 0, 'obsolete takes no argument') + return [r for r in subset if r in repo._obsoleteset and repo._phaserev[r] > 0] def revsetunstable(repo, subset, x): """non obsolete changesets descendant of obsolete one"""