comparison mercurial/localrepo.py @ 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 7fba5a245acc
children 5b384b7f48d5
comparison
equal deleted inserted replaced
15705:e34f4d1f0dbb 15706:ebaefd8c6028
1249 p = lambda: self.changelog.writepending() and self.root or "" 1249 p = lambda: self.changelog.writepending() and self.root or ""
1250 xp1, xp2 = p1.hex(), p2 and p2.hex() or '' 1250 xp1, xp2 = p1.hex(), p2 and p2.hex() or ''
1251 self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1, 1251 self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1,
1252 parent2=xp2, pending=p) 1252 parent2=xp2, pending=p)
1253 self.changelog.finalize(trp) 1253 self.changelog.finalize(trp)
1254 # ensure the new commit is 1-phase 1254 # set the new commit is proper phase
1255 phases.retractboundary(self, 1, [n]) 1255 targetphase = self.ui.configint('phases', 'new-commit', 1)
1256 if targetphase:
1257 # retract boundary do not alter parent changeset.
1258 # if a parent have higher the resulting phase will
1259 # be compliant anyway
1260 #
1261 # if minimal phase was 0 we don't need to retract anything
1262 phases.retractboundary(self, targetphase, [n])
1256 tr.close() 1263 tr.close()
1257 1264
1258 if self._branchcache: 1265 if self._branchcache:
1259 self.updatebranchcache() 1266 self.updatebranchcache()
1260 return n 1267 return n