# HG changeset patch # User Pierre-Yves David # Date 1409127690 -7200 # Node ID 356552e55489099cd1fb783fe35a81de8b316506 # Parent 9f87b103f7b55ede818986864508d595ae1b1bfb evolve: always use the transaction version of phase movement This drop compat with all known released version of Mercurial. diff -r 9f87b103f7b5 -r 356552e55489 README --- 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 diff -r 9f87b103f7b5 -r 356552e55489 hgext/evolve.py --- 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()