Patchwork [01,of,11] phase: put retractboundary out of the loop in advanceboundary

login
register
mail settings
Submitter Boris Feld
Date July 14, 2017, 1:25 p.m.
Message ID <8c771f0d6e8d70b088ab.1500038735@FB>
Download mbox | patch
Permalink /patch/22320/
State Accepted
Headers show

Comments

Boris Feld - July 14, 2017, 1:25 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1499718162 -7200
#      Mon Jul 10 22:22:42 2017 +0200
# Node ID 8c771f0d6e8d70b088abc2c31dc59be0d58ab9fa
# Parent  50243c975fc2ee605ebac493f4ab18d37117e46a
# EXP-Topic tr.changes.phases
phase: put retractboundary out of the loop in advanceboundary

It seems that we were calling retractboundary for each phases to process.
Putting the retractboundary out of the loop reduce the number of calls,
helping tracking the phases changes.

Patch

diff -r 50243c975fc2 -r 8c771f0d6e8d mercurial/phases.py
--- a/mercurial/phases.py	Tue Jul 11 05:06:01 2017 +0200
+++ b/mercurial/phases.py	Mon Jul 10 22:22:42 2017 +0200
@@ -301,9 +301,9 @@ 
                 self._updateroots(phase, roots, tr)
                 # some roots may need to be declared for lower phases
                 delroots.extend(olds - roots)
-            # declare deleted root in the target phase
-            if targetphase != 0:
-                self.retractboundary(repo, tr, targetphase, delroots)
+        # declare deleted root in the target phase
+        if targetphase != 0:
+            self.retractboundary(repo, tr, targetphase, delroots)
         repo.invalidatevolatilesets()
 
     def retractboundary(self, repo, tr, targetphase, nodes):