comparison mercurial/phases.py @ 16030:308406677e9d stable

phases: allow phase name in phases.new-commit settings Before this commit only phase index where accepted
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Mon, 30 Jan 2012 17:46:15 +0100
parents 6697498bdd83
children 2aa5b51f310f
comparison
equal deleted inserted replaced
16029:ee1c8385e5b0 16030:308406677e9d
296 * `rroots`: define the second we substract to the first""" 296 * `rroots`: define the second we substract to the first"""
297 revset = repo.set('heads((%ln + parents(%ln)) - (%ln::%ln))', 297 revset = repo.set('heads((%ln + parents(%ln)) - (%ln::%ln))',
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