diff hgext3rd/evolve/evolvecmd.py @ 3560:f61a23a84dac

compat: add wrapper for obsolete.createmarkers() that accepts "operation" arg I want to start passing the operation argument, but hg < 4.3 does not support it, so we need a compat wrapper. For older hg, the operation is simply ignored.
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 16 Mar 2018 10:22:27 -0700
parents cec6e21b3bcf
children fe16284cd95a
line wrap: on
line diff
--- a/hgext3rd/evolve/evolvecmd.py	Mon Mar 12 23:26:25 2018 -0700
+++ b/hgext3rd/evolve/evolvecmd.py	Fri Mar 16 10:22:27 2018 -0700
@@ -235,7 +235,7 @@
             tmpid = relocate(repo, bumped, prec.p1())
             if tmpid is not None:
                 tmpctx = repo[tmpid]
-                obsolete.createmarkers(repo, [(bumped, (tmpctx,))])
+                compat.createmarkers(repo, [(bumped, (tmpctx,))])
         except MergeFailure:
             repo.vfs.write('graftstate', bumped.hex() + '\n')
             repo.ui.write_err(_('evolution failed!\n'))
@@ -280,12 +280,12 @@
 
         newid = repo.commitctx(new)
     if newid is None:
-        obsolete.createmarkers(repo, [(tmpctx, ())])
+        compat.createmarkers(repo, [(tmpctx, ())])
         newid = prec.node()
     else:
         phases.retractboundary(repo, tr, bumped.phase(), [newid])
-        obsolete.createmarkers(repo, [(tmpctx, (repo[newid],))],
-                               flag=obsolete.bumpedfix)
+        compat.createmarkers(repo, [(tmpctx, (repo[newid],))],
+                             flag=obsolete.bumpedfix)
     bmupdate(newid)
     repo.ui.status(_('committed as %s\n') % node.short(newid))
     # reroute the working copy parent to the new changeset
@@ -408,7 +408,7 @@
             # no changes
         else:
             new = repo['.']
-        obsolete.createmarkers(repo, [(other, (new,))])
+        compat.createmarkers(repo, [(other, (new,))])
         phases.retractboundary(repo, tr, other.phase(), [new.node()])
         return (True, new.node())
     finally:
@@ -546,11 +546,11 @@
     bmchanges = []
 
     if nodenew is not None:
-        obsolete.createmarkers(repo, [(repo[nodesrc], (repo[nodenew],))])
+        compat.createmarkers(repo, [(repo[nodesrc], (repo[nodenew],))])
         for book in oldbookmarks:
             bmchanges.append((book, nodenew))
     else:
-        obsolete.createmarkers(repo, [(repo[nodesrc], ())])
+        compat.createmarkers(repo, [(repo[nodesrc], ())])
         # Behave like rebase, move bookmarks to dest
         for book in oldbookmarks:
             bmchanges.append((book, dest.node()))
@@ -1222,9 +1222,9 @@
         # resolving conflicts can lead to empty wdir and node can be None in
         # those cases
         if node is not None:
-            obsolete.createmarkers(repo, [(ctx, (repo[node],))])
+            compat.createmarkers(repo, [(ctx, (repo[node],))])
         else:
-            obsolete.createmarkers(repo, [(ctx, (repo['.'],))])
+            compat.createmarkers(repo, [(ctx, (repo['.'],))])
 
         # make sure we are continuing evolve and not `hg next --evolve`
         if evolvestate['command'] == 'evolve':