[PATCH 2 of 4 phases] Add a phases.new-commit option to control minimal phase of new commit
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Mon Dec 19 18:52:44 CST 2011
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1324341085 -3600
# Node ID fbf8de1d2819433acb949a1febbee1c27b6f0e64
# Parent a4a139f6a32c800e93cd16401d525e777c69ad86
Add a phases.new-commit option to control minimal phase of new commit
this option is both intended for human and internal code usage.
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -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:
More information about the Mercurial-devel
mailing list