[PATCH 3 of 9 phases] phases: add a phases command to display and manipulate phases

Matt Mackall mpm at selenic.com
Thu Jan 5 22:04:39 CST 2012


On Thu, 2012-01-05 at 02:25 +0100, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
> # Date 1325725909 -3600
> # Node ID a05126892848ccaaf8b94a23b91776c6530b85bf
> # Parent  6b569ff0bd5dbe065e6f10bdd0c008a1039ce79b
> phases: add a phases command to display and manipulate phases
> 
> This changeset only introduce changeset related code. working directory related
> one will the added by a later commit.

I'm not sure I like the working-directory attached state idea yet, so
please don't mention it at all in the docs/code here.

> diff --git a/mercurial/commands.py b/mercurial/commands.py
> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -18,6 +18,7 @@
>  import minirst, revset, fileset
>  import dagparser, context, simplemerge
>  import random, setdiscovery, treediscovery, dagutil
> +import phases as phasesmod
>  
>  table = {}
>  
> @@ -4210,6 +4211,75 @@
>                  ui.write("%s\n" % name)
>              else:
>                  ui.write("%s = %s\n" % (name, util.hidepassword(path)))
> + at command('^phases',
> +    [('p', 'public', False, _('Set changeset to public')),
> +     ('d', 'draft', False, _('Set changeset to draft')),
> +     ('s', 'secret', False, _('Set changeset to secret')),
> +     ('C', 'clean', False, _('Clear phase data for the next commit')),
> +     ('f', 'force', False, _('allow to move boundary backward')),

Inconsistent caps. 

A subtle point of English: s/to move/moving/.

We allow beeping
They allow you to beep
We are smiling
We are going to smile

> +     ('r', 'rev', [], _('target revision')),
> +    ],
> +    _('[-p|-d|-s] [-f] [-C] [-r] [REV]'))
> +def phases(ui, repo, *revs, **opts):
> +    """set or show the current phase name
> +
> +    See :hg:`help phase-concept` for more information about phases if you are
> +    not familliar with this concept.

ENOENT, and an unlikely-to-be-approved name.

> +    With no argument, show the phase name of specified revision or of the next
> +    commit when no revision is provided.
> +
> +    With on one of `--public`, `--draft` or `--secret`, change the phase value.

on?

> +    Setting the phase of working directory will change the phase of the next
> +    commit.
> +
> +    .. note:: By default a commit will be at least in a the ``draft`` phase.
> +              This default value may be altered with the phases.new-commit
> +              option.
> +
> +    Unless -f/--force is specified, phase will never let you move phase in an

Is the command singular or plural?

> +    unusual direction: Phase are ordered  public as follow < draft < secret.

s/an unusual/the wrong/

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list