[PATCH STABLE v2] mq: fix qapplied --last and qprev documentation (issue3282)

John Coomes John.Coomes at oracle.com
Mon Feb 27 14:26:28 CST 2012


Patrick Mezard (patrick at mezard.eu) wrote:
> # HG changeset patch
> # User Patrick Mezard <patrick at mezard.eu>
> # Date 1330363398 -3600
> # Branch stable
> # Node ID 673713c957f2b0925df7c22df2d63daaf9470a9e
> # Parent  280e834c9d15b0d65a0ee24374671e0cd2147f4e
> mq: fix qapplied --last and qprev documentation (issue3282)
> 
> qapplied --last is qprev not qtop.

I think the behavior (qapplied --last == qprev) is broken, not the
documentation.

'qapplied --last' should behave as it reads and show the last applied
patch (qtip).  The fact that -1 is short for --last also indicates it
should be qtip, for consistency with a rev of -1 denoting tip.

If an equivalent to qprev is needed, it should be written
'qapplied --prev' with a short option of '2' (if any).

-John

> v2:
> - Replace "previous" with "preceding" as suggested here and there
> 
> diff --git a/hgext/mq.py b/hgext/mq.py
> --- a/hgext/mq.py
> +++ b/hgext/mq.py
> @@ -1929,7 +1929,7 @@
>      return 0
>  
>  @command("qapplied",
> -         [('1', 'last', None, _('show only the last patch'))
> +         [('1', 'last', None, _('show only the preceding applied patch'))
>            ] + seriesopts,
>           _('hg qapplied [-1] [-s] [PATCH]'))
>  def applied(ui, repo, patch=None, **opts):
> @@ -2224,7 +2224,7 @@
>  
>  @command("qprev", seriesopts, _('hg qprev [-s]'))
>  def prev(ui, repo, **opts):
> -    """print the name of the previous applied patch
> +    """print the name of the preceding applied patch
>  
>      Returns 0 on success."""
>      q = repo.mq
> diff --git a/tests/test-mq.t b/tests/test-mq.t
> --- a/tests/test-mq.t
> +++ b/tests/test-mq.t
> @@ -74,7 +74,7 @@
>     qnew          create a new patch
>     qnext         print the name of the next pushable patch
>     qpop          pop the current patch off the stack
> -   qprev         print the name of the previous applied patch
> +   qprev         print the name of the preceding applied patch
>     qpush         push the next patch onto the stack
>     qqueue        manage multiple patch queues
>     qrefresh      update the current patch
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list