Patchwork [2,of,2,STABLE,V2] revsets: add docs for '%' operator

login
register
mail settings
Submitter Sean Farley
Date April 27, 2016, 9:16 p.m.
Message ID <afb8cf4736582dfbab2a.1461791785@laptop.office.atlassian.com>
Download mbox | patch
Permalink /patch/14817/
State Accepted
Commit 18c1b107898e8d97dded6247cda2cecdec522c15
Headers show

Comments

Sean Farley - April 27, 2016, 9:16 p.m.
# HG changeset patch
# User Sean Farley <sean@farley.io>
# Date 1461790938 25200
#      Wed Apr 27 14:02:18 2016 -0700
# Branch stable
# Node ID afb8cf4736582dfbab2a19624c859a2f7855fb44
# Parent  c94d5bcf19875b7b1b04ade9ad2bfb04f80ef1ae
# EXP-Topic doc-only-revset
revsets: add docs for '%' operator
timeless - April 28, 2016, 12:45 a.m.
We currently have:

"not x"
  Changesets not in x. Short form is "! x".

"author(string)"
  Alias for "user(string)".

"first(set, [n])"
  An alias for limit().

"follow([pattern])"
  An alias for "::." (ancestors of the working directory's first parent).
  If pattern is specified, the histories of files matching given pattern
  is followed, including copies.

"x::y"
  A DAG range, meaning all changesets that are descendants of x and
  ancestors of y, including x and y themselves. If the first endpoint is
  left out, this is equivalent to "ancestors(y)", if the second is left
  out it is equivalent to "descendants(x)".

  An alternative syntax is "x..y".

"x or y"
  The union of changesets in x and y. There are two alternative short
  forms: "x | y" and "x + y".

"x^"
  Equivalent to "x^1", the first parent of each changeset in x.

They aren't entirely consistent. But, Most start with "Alias"/"An
alias" or use "short form" as opposed to "shorthand"

On Wed, Apr 27, 2016 at 5:16 PM, Sean Farley <sean@farley.io> wrote:
> # HG changeset patch
> # User Sean Farley <sean@farley.io>
> # Date 1461790938 25200
> #      Wed Apr 27 14:02:18 2016 -0700
> # Branch stable
> # Node ID afb8cf4736582dfbab2a19624c859a2f7855fb44
> # Parent  c94d5bcf19875b7b1b04ade9ad2bfb04f80ef1ae
> # EXP-Topic doc-only-revset
> revsets: add docs for '%' operator
>
> diff --git a/mercurial/help/revsets.txt b/mercurial/help/revsets.txt
> --- a/mercurial/help/revsets.txt
> +++ b/mercurial/help/revsets.txt
> @@ -40,10 +40,15 @@ These are the supported infix operators:
>    forms: ``x | y`` and ``x + y``.
>
>  ``x - y``
>    Changesets in x but not in y.
>
> +``x % y``
> +  Changesets that are ancestors of x but not ancestors of y (i.e. ::x - ::y).
> +  This is shorthand notation for ``only(x, y)`` (see below). The second
> +  argument is optional and, if left out, is equivalent to ``only(x)``.
> +
>  ``x^n``
>    The nth parent of x, n == 0, 1, or 2.
>    For n == 0, x; for n == 1, the first parent of each changeset in x;
>    for n == 2, the second parent of changeset in x.
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Matt Mackall - April 29, 2016, 8:27 p.m.
On Wed, 2016-04-27 at 14:16 -0700, Sean Farley wrote:
> # HG changeset patch
> # User Sean Farley <sean@farley.io>
> # Date 1461790938 25200
> #      Wed Apr 27 14:02:18 2016 -0700
> # Branch stable
> # Node ID afb8cf4736582dfbab2a19624c859a2f7855fb44
> # Parent  c94d5bcf19875b7b1b04ade9ad2bfb04f80ef1ae
> # EXP-Topic doc-only-revset
> revsets: add docs for '%' operator

I've queued this second one, thanks. Going to leave the first one for part of a
bigger clean-up.

-- 
Mathematics is the supreme nostalgia of our time.

Patch

diff --git a/mercurial/help/revsets.txt b/mercurial/help/revsets.txt
--- a/mercurial/help/revsets.txt
+++ b/mercurial/help/revsets.txt
@@ -40,10 +40,15 @@  These are the supported infix operators:
   forms: ``x | y`` and ``x + y``.
 
 ``x - y``
   Changesets in x but not in y.
 
+``x % y``
+  Changesets that are ancestors of x but not ancestors of y (i.e. ::x - ::y).
+  This is shorthand notation for ``only(x, y)`` (see below). The second
+  argument is optional and, if left out, is equivalent to ``only(x)``.
+
 ``x^n``
   The nth parent of x, n == 0, 1, or 2.
   For n == 0, x; for n == 1, the first parent of each changeset in x;
   for n == 2, the second parent of changeset in x.