mercurial/phases.py
changeset 15695 1b9dcf2eb011
parent 15659 7fba5a245acc
child 15696 0cb45fef99ba
--- a/mercurial/phases.py	Sun Dec 18 23:15:12 2011 +0100
+++ b/mercurial/phases.py	Mon Dec 19 11:29:39 2011 +0100
@@ -153,6 +153,7 @@
     in the target phase or kept in a *lower* phase.
 
     Simplify boundary to contains phase roots only."""
+    delroots = [] # set of root deleted by this path
     for phase in xrange(targetphase + 1, len(allphases)):
         # filter nodes that are not in a compatible phase already
         # XXX rev phase cache might have been invalidated by a previous loop
@@ -170,6 +171,12 @@
             if '_phaserev' in vars(repo):
                 del repo._phaserev
             repo._dirtyphases = True
+            # some roots may need to be declared for lower phases
+            delroots.extend(olds - roots)
+        # declare deleted root in the target phase
+        if targetphase != 0:
+            retractboundary(repo, targetphase, delroots)
+
 
 def retractboundary(repo, targetphase, nodes):
     """Set nodes back to a phase changing other nodes phases if necessary.