compat: fix topicset for mercurial 4.1
The 'getrevset' method is not available there.
--- 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