comparison mercurial/commands.py @ 39300:1ea6772fb415

phase: handle phase with no command flag Before this changeset, all existing phases have a corresponding flag on the `hg phase` command. (eg: `hg phase --draft`). After this changeset, a phase can exists without having an associated flag. This is useful to introduce a new internal phase that we do not want to expose to user.
author Boris Feld <boris.feld@octobus.net>
date Thu, 23 Aug 2018 01:15:19 +0200
parents 5797b0bbdd1d
children 337443f09fc8
comparison
equal deleted inserted replaced
39299:160bd45cc6af 39300:1ea6772fb415
4028 """ 4028 """
4029 opts = pycompat.byteskwargs(opts) 4029 opts = pycompat.byteskwargs(opts)
4030 # search for a unique phase argument 4030 # search for a unique phase argument
4031 targetphase = None 4031 targetphase = None
4032 for idx, name in enumerate(phases.phasenames): 4032 for idx, name in enumerate(phases.phasenames):
4033 if opts[name]: 4033 if opts.get(name, False):
4034 if targetphase is not None: 4034 if targetphase is not None:
4035 raise error.Abort(_('only one phase can be specified')) 4035 raise error.Abort(_('only one phase can be specified'))
4036 targetphase = idx 4036 targetphase = idx
4037 4037
4038 # look for specified revision 4038 # look for specified revision