[PATCH 3 of 5] phase: handle phase with no command flag
Yuya Nishihara
yuya at tcha.org
Sat Aug 25 04:30:12 EDT 2018
On Sat, 25 Aug 2018 00:35:39 +0200, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld at octobus.net>
> # Date 1534979719 -7200
> # Thu Aug 23 01:15:19 2018 +0200
> # Node ID 93824739fc0d33ce7853ccfd57818df694f5593f
> # Parent 5ec0b78876f2fc334c57d664a67d342859fc2b47
> # EXP-Topic internal-phase.prepare
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 93824739fc0d
> 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.
>
> diff --git a/mercurial/commands.py b/mercurial/commands.py
> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -4030,7 +4030,7 @@ def phase(ui, repo, *revs, **opts):
> # search for a unique phase argument
> targetphase = None
> for idx, name in enumerate(phases.phasenames):
> - if opts[name]:
> + if opts.get(name, False):
Really minor nit, but I'd rather add an explicit list of non-internal phase
names.
More information about the Mercurial-devel
mailing list