changeset 2686:fc3a66ad635b

compat: fix topicset for mercurial 4.1 The 'getrevset' method is not available there.
author Boris Feld <boris.feld@octobus.net>
date Thu, 29 Jun 2017 18:22:06 +0200
parents 008f7cd1fcbe
children 4a02781d90ce
files hgext3rd/topic/revset.py
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/topic/revset.py	Mon Jun 26 17:19:03 2017 +0200
+++ b/hgext3rd/topic/revset.py	Thu Jun 29 18:22:06 2017 +0200
@@ -1,7 +1,6 @@
 from __future__ import absolute_import
 
 from mercurial import (
-    phases,
     revset,
     util,
 )
@@ -36,7 +35,17 @@
         _kind, _pattern, matcher = mkmatcher(topic)
     else:
         matcher = lambda t: bool(t)
-    mutable = repo._phasecache.getrevset(repo, (phases.draft, phases.secret))
+
+    # XXX-mercurial 4.1 compat
+    # otherwise use:
+    #
+    #   mutable = repo._phasecache.getrevset(repo, (phases.draft, phases.secret))
+    #
+    mutable = set()
+    for u in repo._phasecache._phasesets[1:]:
+        mutable.update(u)
+    mutable = revset.baseset(mutable - repo.changelog.filteredrevs)
+    mutable.sort()
 
     rawchange = repo.changelog.changelogrevision
     key = constants.extrakey