##// END OF EJS Templates
patch: always raise PatchError with a message, simplify handling
patch: always raise PatchError with a message, simplify handling

File last commit:

r12667:f5735bb8 default
r12674:aa2fe1f5 default
Show More
revsets.txt
197 lines | 4.8 KiB | text/plain | TextLexer
Martin Geisler
help: new revsets topic...
r11382 Mercurial supports a functional language for selecting a set of
revisions.
The language supports a number of predicates which are joined by infix
operators. Parenthesis can be used for grouping.
Identifiers such as branch names must be quoted with single or double
Matt Mackall
revset: improve help on strings
r11420 quotes if they contain characters outside of
``[._a-zA-Z0-9\x80-\xff]`` or if they match one of the predefined
Brodie Rao
revset: support raw string literals...
r12408 predicates.
Special characters can be used in quoted identifiers by escaping them,
e.g., ``\n`` is interpreted as a newline. To prevent them from being
interpreted, strings can be prefixed with ``r``, e.g. ``r'...'``.
Martin Geisler
help: new revsets topic...
r11382
There is a single prefix operator:
``not x``
Changesets not in x. Short form is ``! x``.
These are the supported infix operators:
``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
Julian Cowley
revset: fix spelling typo
r11450 is left out it is equivalent to ``descendants(x)``.
Martin Geisler
help: new revsets topic...
r11382
An alternative syntax is ``x..y``.
``x:y``
All changesets with revision numbers between x and y, both
inclusive. Either endpoint can be left out, they default to 0 and
tip.
``x and y``
The intersection of changesets in x and y. Short form 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 - y``
Changesets in x but not in y.
The following predicates are supported:
``adds(pattern)``
Changesets that add a file matching pattern.
``all()``
All changesets, the same as ``0:tip``.
``ancestor(single, single)``
Greatest common ancestor of the two changesets.
``ancestors(set)``
Changesets that are ancestors of a changeset in set.
``author(string)``
Alias for ``user(string)``.
``branch(set)``
Patrick Mezard
revsets.txt: minor improvements
r11684 All changesets belonging to the branches of changesets in set.
Martin Geisler
help: new revsets topic...
r11382
``children(set)``
Child changesets of changesets in set.
``closed()``
Changeset is closed.
``contains(pattern)``
Revision contains pattern.
``date(interval)``
Changesets within the interval, see :hg:`help dates`.
``descendants(set)``
Patrick Mezard
revsets.txt: minor improvements
r11684 Changesets which are descendants of changesets in set.
Martin Geisler
help: new revsets topic...
r11382
``file(pattern)``
Patrick Mezard
revsets.txt: minor improvements
r11684 Changesets affecting files matched by pattern.
Martin Geisler
help: new revsets topic...
r11382
``follow()``
An alias for ``::.`` (ancestors of the working copy's first parent).
``grep(regex)``
Brodie Rao
revset: support raw string literals...
r12408 Like ``keyword(string)`` but accepts a regex. Use ``grep(r'...')``
to ensure special escape characters are handled correctly.
Martin Geisler
help: new revsets topic...
r11382
``head()``
Brodie Rao
revsets: clarify in the help that head() returns named branch heads
r12657 Changeset is a named branch head.
Martin Geisler
help: new revsets topic...
r11382
``heads(set)``
Members of set with no children in set.
``keyword(string)``
Search commit message, user name, and names of changed files for
string.
``limit(set, n)``
First n members of set.
``max(set)``
Changeset with highest revision number in set.
Nicolas Dumazet
revset: add min function
r11708 ``min(set)``
Changeset with lowest revision number in set.
Martin Geisler
help: new revsets topic...
r11382 ``merge()``
Changeset is a merge changeset.
``modifies(pattern)``
Patrick Mezard
revsets.txt: minor improvements
r11684 Changesets modifying files matched by pattern.
Martin Geisler
help: new revsets topic...
r11382
``outgoing([path])``
Patrick Mezard
revsets.txt: minor improvements
r11684 Changesets not found in the specified destination repository, or the
default push location.
Martin Geisler
help: new revsets topic...
r11382
``p1(set)``
First parent of changesets in set.
``p2(set)``
Second parent of changesets in set.
``parents(set)``
The set of all parents for all changesets in set.
Wagner Bruna
revset: predicate to avoid lookup errors...
r11944 ``present(set)``
An empty set, if any revision in set isn't found; otherwise,
all revisions in set.
Martin Geisler
help: new revsets topic...
r11382 ``removes(pattern)``
Changesets which remove files matching pattern.
``reverse(set)``
Reverse order of set.
``roots(set)``
Changesets with no parent changeset in set.
``sort(set[, [-]key...])``
Sort set by keys. The default sort order is ascending, specify a key
as ``-key`` to sort in descending order.
The keys can be:
- ``rev`` for the revision number,
- ``branch`` for the branch name,
- ``desc`` for the commit message (description),
- ``user`` for user name (``author`` can be used as an alias),
- ``date`` for the commit date
``tagged()``
Changeset is tagged.
``user(string)``
User name is string.
Command line equivalents for :hg:`log`::
-f -> ::.
-d x -> date(x)
-k x -> keyword(x)
-m -> merge()
-u x -> user(x)
-b x -> branch(x)
-P x -> !::x
-l x -> limit(expr, x)
Brodie Rao
revsets: add descriptions for sample queries in the help
r12659 Some sample queries:
- Changesets on the default branch::
hg log -r 'branch(default)'
- Changesets on the default branch since tag 1.5 (excluding merges)::
hg log -r 'branch(default) and 1.5:: and not merge()'
Martin Geisler
help: new revsets topic...
r11382
Brodie Rao
revsets: add a sample query to the help for getting active branches
r12660 - Open branch heads::
hg log -r 'head() and not closed()'
Brodie Rao
revsets: add descriptions for sample queries in the help
r12659 - Changesets between tags 1.3 and 1.5 mentioning "bug" that affect
Martin Geisler
revsets: fix stray * in help topic
r12667 ``hgext/*``::
Brodie Rao
revsets: add descriptions for sample queries in the help
r12659
hg log -r '1.3::1.5 and keyword(bug) and file("hgext/*")'
- Changesets in committed May 2008, sorted by user::
hg log -r 'sort(date("May 2008"), user)'
- Changesets mentioning "bug" or "issue" that are not in a tagged
release::
hg log -r '(keyword(bug) or keyword(issue)) and not ancestors(tagged())'