--- a/hgext3rd/topic/compat.py Fri Oct 20 18:56:15 2017 +0200
+++ b/hgext3rd/topic/compat.py Fri Oct 20 19:29:56 2017 +0200
@@ -7,7 +7,11 @@
"""
from __future__ import absolute_import
-from mercurial import obsolete
+from mercurial import (
+ obsolete,
+ scmutil,
+ util,
+)
getmarkers = None
successorssets = None
@@ -29,3 +33,15 @@
ui.pager(cmd)
except AttributeError:
pass
+
+def cleanupnodes(repo, replacements, operation, moves=None):
+ # create obsmarkers and move bookmarks
+ # XXX we should be creating marker as we go instead of only at the end,
+ # this makes the operations more modulars
+ if util.safehasattr(scmutil, 'cleanupnodes'):
+ scmutil.cleanupnodes(repo, replacements, 'changetopics',
+ moves=moves)
+ else:
+ relations = [(repo[o], tuple(repo[n] for n in new))
+ for (o, new) in replacements.iteritems()]
+ obsolete.createmarkers(repo, relations)