hgext3rd/topic/compat.py
changeset 3560 f61a23a84dac
parent 3094 e11e018e8338
child 3570 2477bcdd95ff
--- a/hgext3rd/topic/compat.py	Mon Mar 12 23:26:25 2018 -0700
+++ b/hgext3rd/topic/compat.py	Fri Mar 16 10:22:27 2018 -0700
@@ -27,6 +27,14 @@
 if successorssets is None:
     successorssets = obsolete.successorssets
 
+# Wrap obsolete.creatmarkers and make it accept but ignore "operation" argument
+# for hg < 4.3
+createmarkers = obsolete.createmarkers
+if obsolete.createmarkers.__code__.co_argcount < 6:
+    def createmarkers(repo, relations, flag=0, date=None, metadata=None,
+                      operation=None):
+        return obsolete.createmarkers(repo, relations, flag, date, metadata)
+
 def startpager(ui, cmd):
     """function to start a pager in case ui.pager() exists"""
     try:
@@ -44,4 +52,4 @@
     else:
         relations = [(repo[o], tuple(repo[n] for n in new))
                      for (o, new) in replacements.iteritems()]
-        obsolete.createmarkers(repo, relations)
+        createmarkers(repo, relations)