D3824: cleanupnodes: preserve phase of parents of new nodes

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Fri Jun 22 07:44:41 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG05b7dd11918e: cleanupnodes: preserve phase of parents of new nodes (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3824?vs=9249&id=9255

REVISION DETAIL
  https://phab.mercurial-scm.org/D3824

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -842,13 +842,13 @@
             return newphases.get(ctx.node(), ctx.phase())
         for newnode in allnewnodes:
             ctx = unfi[newnode]
+            parentphase = max(phase(p) for p in ctx.parents())
             if targetphase is None:
                 oldphase = max(unfi[oldnode].phase()
                                for oldnode in precursors[newnode])
-                parentphase = max(phase(p) for p in ctx.parents())
                 newphase = max(oldphase, parentphase)
             else:
-                newphase = targetphase
+                newphase = max(targetphase, parentphase)
             newphases[newnode] = newphase
             if newphase > ctx.phase():
                 toretract.setdefault(newphase, []).append(newnode)



To: martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list