Commit Graph

20 Commits

Author SHA1 Message Date
Mads Kiilerich
ed0023acf6 revset: fix aliases with 0 or more than 2 parameters
The existing code seemed to have incorrect assumptions about how parameter
lists are represented by the parser.

Now the match and replace functions have been merged and simplified by using
getlist().
2011-06-22 01:55:00 +02:00
Thomas Arendsen Hein
282b06cd6f revset: add desc(string) to search in commit messages
Like keyword(), but does not search in filenames and users.
No grepdesc() or descgrep() added, because it might be bad to introduce
grepfoo() versions of too many string searches.
2011-06-16 22:47:34 +02:00
Mads Kiilerich
6cadc46456 revset: avoid over-aggresive optimizations of non-filtering functions (issue2549)
When limit, last, min and max were evaluated they worked on a reduced set in the
wrong way. Now they work on an unrestricted set (the whole repo) and get
limited later on.
2011-05-01 17:35:05 +02:00
Alexander Solovyov
2f6ab6bf04 revset aliases 2011-04-30 18:30:14 +02:00
Kevin Gessner
9374e33026 revset: add tests for multiple and mixed ^ and ~ operators 2011-04-30 18:53:56 +02:00
Kevin Gessner
c6374d2d98 revset: add ^ and ~ operators from parentrevspec extension
^ (Nth parent) and ~ (Nth first ancestor) are infix operators that match
certain ancestors of the set:

  set^0
  the set

  set^1 (also available as set^)
  the first parent of every changeset in set

  set^2
  the second parent of every changeset in set

  set~0
  the set

  set~1
  the first ancestor (i.e. the first parent) of every changeset in set

  set~2
  the second ancestor (i.e. first parent of first parent) of every changeset
  in set

  set~N
  the Nth ancestor (following first parents only) of every changeset in set;
  set~N is equivalent to set^1^1..., with ^1 repeated N times.
2011-04-30 17:43:04 +02:00
Augie Fackler
52f8941398 revsets: preserve ordering with the or operator
This is valuable because now revsets like 'bookmarks() or tip' will
always show tip after bookmarks unless tip was itself a bookmark. This
is a somewhat contrived example, but this behavior is useful for
"where am I" type aliases that use log and revsets.
2011-04-13 12:30:41 -05:00
Idan Kamara
3828767e58 tests: add tests for non-existant branch/tag/bookmark 2011-04-10 11:30:53 +03:00
Bernhard Leiner
baf797018e revset: report a parse error if a revset is not parsed completely (issue2654) 2011-03-16 23:09:14 +01:00
Mads Kiilerich
635406bf76 tests: use (esc) for all non-ASCII test output 2010-11-08 01:41:41 +01:00
Wagner Bruna
d4398837df revset: disable subset optimization for parents() and children() (issue2437)
For the boolean operators, the subset optimization works by calculating
the cheaper argument first, and passing the subset to the second
argument to restrict the revision domain. This works well for filtering
predicates.

But parents() don't work like a filter: it may return revisions outside the
specified set. So, combining it with boolean operators may easily yield
incorrect results. For instance, for the following revision graph:

0 -- 1

the expression '0 and parents(1)' should evaluate as follows:

0 and parents(1) ->
0 and 0 ->
0

But since [0] is passed to parents() as a subset, we get instead:

0 and parents(1 and 0) ->
0 and parents([]) ->
0 and [] ->
[]

This also affects children(), p1() and p2(), for the same reasons.
Predicates that call these (like heads()) are also affected.

We work around this issue by ignoring the subset when propagating
the call inside those predicates.
2010-10-15 03:30:38 -03:00
Benoit Boissinot
d7dc2daaa0 revset: use 'requires' instead of 'wants' in error message 2010-10-16 18:50:53 +02:00
Augie Fackler
5fe5470142 revset: add id() and rev() to allow explicitly referring to changes by hash or rev 2010-10-11 09:44:19 -05:00
Augie Fackler
4a386faa07 revset: rename tagged() to tag() and allow it to take an optional tag name 2010-10-10 12:41:36 -05:00
Matt Mackall
67a62aa820 revset: lower precedence of minus infix (issue2361) 2010-10-07 11:45:17 -05:00
Brodie Rao
2104af5ee2 revset: support raw string literals
This adds support for r'...' and r"..." as string literals. Strings
with the "r" prefix will not have their escape characters interpreted.

This is especially useful for grep(), where, with regular string
literals, \number is interpreted as an octal escape code, and \b is
interpreted as the backspace character (\x08).
2010-09-24 15:36:53 -05:00
Martin Geisler
989dda555a merge with stable 2010-09-20 15:42:58 +02:00
Matt Mackall
08439e0f2d tests: add exit codes to unified tests 2010-09-16 17:51:32 -05:00
Nicolas Dumazet
90787c08f9 util: get rid of extra trailing whitespace in parsedate abort message 2010-08-30 13:29:44 +09:00
Nicolas Dumazet
77b77244a8 tests: unify test-revset 2010-08-30 13:23:32 +09:00