Patchwork D3824: cleanupnodes: preserve phase of parents of new nodes

login
register
mail settings
Submitter phabricator
Date June 22, 2018, 11:44 a.m.
Message ID <e153caa67186dcd3b1af3fce84d53890@localhost.localdomain>
Download mbox | patch
Permalink /patch/32370/
State Not Applicable
Headers show

Comments

phabricator - June 22, 2018, 11:44 a.m.
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




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

Patch

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)