changeset 15706:ebaefd8c6028

Add a phases.new-commit option to control minimal phase of new commit this option is both intended for human and internal code usage.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Tue, 20 Dec 2011 01:31:25 +0100
parents e34f4d1f0dbb
children dc3eefe0c80e
files mercurial/localrepo.py
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Tue Dec 20 01:34:12 2011 +0100
+++ b/mercurial/localrepo.py	Tue Dec 20 01:31:25 2011 +0100
@@ -1251,8 +1251,15 @@
             self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1,
                       parent2=xp2, pending=p)
             self.changelog.finalize(trp)
-            # ensure the new commit is 1-phase
-            phases.retractboundary(self, 1, [n])
+            # set the new commit is proper phase
+            targetphase = self.ui.configint('phases', 'new-commit', 1)
+            if targetphase:
+                # retract boundary do not alter parent changeset.
+                # if a parent have higher the resulting phase will
+                # be compliant anyway
+                #
+                # if minimal phase was 0 we don't need to retract anything
+                phases.retractboundary(self, targetphase, [n])
             tr.close()
 
             if self._branchcache: