evolve: always use the transaction version of phase movement
authorPierre-Yves David <pierre-yves.david@fb.com>
Wed, 27 Aug 2014 10:21:30 +0200
changeset 1069 356552e55489
parent 1068 9f87b103f7b5
child 1070 527b12a59628
evolve: always use the transaction version of phase movement This drop compat with all known released version of Mercurial.
README
hgext/evolve.py
--- a/README	Wed Aug 27 10:29:31 2014 +0200
+++ b/README	Wed Aug 27 10:21:30 2014 +0200
@@ -57,6 +57,10 @@
 Changelog
 =========
 
+5.0.0 --
+
+- drop compat with Mercurial pre 3.2
+
 4.2.0 --
 
 - uncommit: add a --rev argument
--- a/hgext/evolve.py	Wed Aug 27 10:29:31 2014 +0200
+++ b/hgext/evolve.py	Wed Aug 27 10:21:30 2014 +0200
@@ -19,7 +19,7 @@
     - improves some aspect of the early implementation in Mercurial core
 '''
 
-testedwith = '3.0.1 3.1'
+testedwith = ''
 buglink = 'http://bz.selenic.com/'
 
 import sys
@@ -95,19 +95,6 @@
 
 
 #####################################################################
-### Compatibility with core                                       ###
-#####################################################################
-
-
-def retractboundary(repo, tr, targetphase, nodes):
-    """Older mercurial version does not move phase within a transaction"""
-    try:
-        return phases.retractboundary(repo, tr, targetphase, nodes)
-    except TypeError:
-        return phases.retractboundary(repo, targetphase, nodes)
-
-
-#####################################################################
 ### Extension helper                                              ###
 #####################################################################
 
@@ -909,7 +896,7 @@
             raise
         oldbookmarks = repo.nodebookmarks(nodesrc)
         if nodenew is not None:
-            retractboundary(repo, tr, destphase, [nodenew])
+            phases.retractboundary(repo, tr, destphase, [nodenew])
             createmarkers(repo, [(repo[nodesrc], (repo[nodenew],))])
             for book in oldbookmarks:
                 repo._bookmarks[book] = nodenew
@@ -1514,7 +1501,7 @@
             createmarkers(repo, [(tmpctx, ())])
             newid = prec.node()
         else:
-            retractboundary(repo, tr, bumped.phase(), [newid])
+            phases.retractboundary(repo, tr, bumped.phase(), [newid])
             createmarkers(repo, [(tmpctx, (repo[newid],))],
                                    flag=obsolete.bumpedfix)
         bmupdate(newid)
@@ -1620,7 +1607,7 @@
         else:
             new = repo['.']
         createmarkers(repo, [(other, (new,))])
-        retractboundary(repo, tr, other.phase(), [new.node()])
+        phases.retractboundary(repo, tr, other.phase(), [new.node()])
         tr.close()
     finally:
         tr.release()
@@ -2051,7 +2038,7 @@
                              hint=_("use --all to uncommit all files"))
         # Move local changes on filtered changeset
         createmarkers(repo, [(old, (repo[newid],))])
-        retractboundary(repo, tr, oldphase, [newid])
+        phases.retractboundary(repo, tr, oldphase, [newid])
         repo.dirstate.setparents(newid, node.nullid)
         _uncommitdirstate(repo, old, match)
         updatebookmarks(newid)
@@ -2137,7 +2124,7 @@
                 newmapping[ctx.node()] = new
                 if not duplicate:
                     createmarkers(repo, [(ctx, (repo[new],))])
-                retractboundary(repo, tr, ctx.phase(), [new])
+                phases.retractboundary(repo, tr, ctx.phase(), [new])
                 if ctx in repo[None].parents():
                     repo.dirstate.setparents(new, node.nullid)
             tr.close()
@@ -2240,7 +2227,7 @@
             newid, unusedvariable = rewrite(repo, root, allctx, head,
                                             [root.p1().node(), root.p2().node()],
                                             commitopts=commitopts)
-            retractboundary(repo, tr, targetphase, [newid])
+            phases.retractboundary(repo, tr, targetphase, [newid])
             createmarkers(repo, [(ctx, (repo[newid],))
                                  for ctx in allctx])
             tr.close()