##// END OF EJS Templates
phases: allow phase name in phases.new-commit settings...
Pierre-Yves David -
r16030:30840667 stable
parent child Browse files
Show More
@@ -1268,8 +1268,7 b' class localrepository(repo.repository):'
1268 parent2=xp2, pending=p)
1268 parent2=xp2, pending=p)
1269 self.changelog.finalize(trp)
1269 self.changelog.finalize(trp)
1270 # set the new commit is proper phase
1270 # set the new commit is proper phase
1271 targetphase = self.ui.configint('phases', 'new-commit',
1271 targetphase = phases.newcommitphase(self.ui)
1272 phases.draft)
1273 if targetphase:
1272 if targetphase:
1274 # retract boundary do not alter parent changeset.
1273 # retract boundary do not alter parent changeset.
1275 # if a parent have higher the resulting phase will
1274 # if a parent have higher the resulting phase will
@@ -298,3 +298,20 b' def newheads(repo, heads, roots):'
298 heads, roots, roots, heads)
298 heads, roots, roots, heads)
299 return [c.node() for c in revset]
299 return [c.node() for c in revset]
300
300
301
302 def newcommitphase(ui):
303 """helper to get the target phase of new commit
304
305 Handle all possible values for the phases.new-commit options.
306
307 """
308 v = ui.config('phases', 'new-commit', draft)
309 try:
310 return phasenames.index(v)
311 except ValueError:
312 try:
313 return int(v)
314 except ValueError:
315 msg = _("phases.new-commit: not a valid phase name ('%s')")
316 raise error.ConfigError(msg % v)
317
@@ -42,7 +42,7 b' Draft commit are properly created over p'
42
42
43 Test creating changeset as secret
43 Test creating changeset as secret
44
44
45 $ mkcommit E --config phases.new-commit=2
45 $ mkcommit E --config phases.new-commit='secret'
46 $ hglog
46 $ hglog
47 4 2 E
47 4 2 E
48 3 1 D
48 3 1 D
General Comments 0
You need to be logged in to leave comments. Login now