tests/test-revset.t
author Yuya Nishihara <yuya@tcha.org>
Sat, 13 Feb 2016 19:25:11 +0900
changeset 28423 0d79d91ba7e3
parent 28394 dcb4209bd30d
child 28424 534f968d33e5
permissions -rw-r--r--
revset: add extra data to filteredset for better inspection A filteredset is heavily used, but it cannot provide a printable information how given set is filtered because a condition is an arbitrary callable object. This patch adds an optional "condrepr" object that is used only by repr(). To minimize the maintaining/runtime overhead of "condrepr", its type is overloaded as follows: type example -------- --------------------------------- tuple ('<not %r>', other) str '<branch closed>' callable lambda: '<branch %r>' % sorted(b) object other
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
     1
  $ HGENCODING=utf-8
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
     2
  $ export HGENCODING
24940
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
     3
  $ cat > testrevset.py << EOF
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
     4
  > import mercurial.revset
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
     5
  > 
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
     6
  > baseset = mercurial.revset.baseset
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
     7
  > 
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
     8
  > def r3232(repo, subset, x):
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
     9
  >     """"simple revset that return [3,2,3,2]
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
    10
  > 
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
    11
  >     revisions duplicated on purpose.
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
    12
  >     """
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
    13
  >     if 3 not in subset:
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
    14
  >        if 2 in subset:
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
    15
  >            return baseset([2,2])
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
    16
  >        return baseset()
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
    17
  >     return baseset([3,3,2,2])
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
    18
  > 
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
    19
  > mercurial.revset.symbols['r3232'] = r3232
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
    20
  > EOF
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
    21
  $ cat >> $HGRCPATH << EOF
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
    22
  > [extensions]
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
    23
  > testrevset=$TESTTMP/testrevset.py
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
    24
  > EOF
11409
7a6ac83a15b0 revset: add some tests
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    25
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    26
  $ try() {
14098
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
    27
  >   hg debugrevspec --debug "$@"
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    28
  > }
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    29
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    30
  $ log() {
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    31
  >   hg log --template '{rev}\n' -r "$1"
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    32
  > }
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
    33
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    34
  $ hg init repo
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    35
  $ cd repo
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
    36
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    37
  $ echo a > a
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    38
  $ hg branch a
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    39
  marked working directory as branch a
15615
41885892796e branch: warn on branching
Matt Mackall <mpm@selenic.com>
parents: 14723
diff changeset
    40
  (branches are permanent and global, did you want a bookmark?)
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    41
  $ hg ci -Aqm0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    42
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    43
  $ echo b > b
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    44
  $ hg branch b
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    45
  marked working directory as branch b
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    46
  $ hg ci -Aqm1
11409
7a6ac83a15b0 revset: add some tests
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    47
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    48
  $ rm a
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    49
  $ hg branch a-b-c-
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    50
  marked working directory as branch a-b-c-
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    51
  $ hg ci -Aqm2 -u Bob
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
    52
16661
de4b42daf396 revset: add function for matching extra data (issue2767)
Henrik Stuart <hg@hstuart.dk>
parents: 16640
diff changeset
    53
  $ hg log -r "extra('branch', 'a-b-c-')" --template '{rev}\n'
de4b42daf396 revset: add function for matching extra data (issue2767)
Henrik Stuart <hg@hstuart.dk>
parents: 16640
diff changeset
    54
  2
de4b42daf396 revset: add function for matching extra data (issue2767)
Henrik Stuart <hg@hstuart.dk>
parents: 16640
diff changeset
    55
  $ hg log -r "extra('branch')" --template '{rev}\n'
de4b42daf396 revset: add function for matching extra data (issue2767)
Henrik Stuart <hg@hstuart.dk>
parents: 16640
diff changeset
    56
  0
de4b42daf396 revset: add function for matching extra data (issue2767)
Henrik Stuart <hg@hstuart.dk>
parents: 16640
diff changeset
    57
  1
de4b42daf396 revset: add function for matching extra data (issue2767)
Henrik Stuart <hg@hstuart.dk>
parents: 16640
diff changeset
    58
  2
16824
f3b8c82a559c revset: add pattern matching to 'extra' revset expression
Simon King <simon@simonking.org.uk>
parents: 16823
diff changeset
    59
  $ hg log -r "extra('branch', 're:a')" --template '{rev} {branch}\n'
f3b8c82a559c revset: add pattern matching to 'extra' revset expression
Simon King <simon@simonking.org.uk>
parents: 16823
diff changeset
    60
  0 a
f3b8c82a559c revset: add pattern matching to 'extra' revset expression
Simon King <simon@simonking.org.uk>
parents: 16823
diff changeset
    61
  2 a-b-c-
16661
de4b42daf396 revset: add function for matching extra data (issue2767)
Henrik Stuart <hg@hstuart.dk>
parents: 16640
diff changeset
    62
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    63
  $ hg co 1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    64
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    65
  $ hg branch +a+b+c+
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    66
  marked working directory as branch +a+b+c+
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    67
  $ hg ci -Aqm3
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
    68
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    69
  $ hg co 2  # interleave
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    70
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    71
  $ echo bb > b
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    72
  $ hg branch -- -a-b-c-
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    73
  marked working directory as branch -a-b-c-
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    74
  $ hg ci -Aqm4 -d "May 12 2005"
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
    75
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    76
  $ hg co 3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    77
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
16851
c739227b5eea test-revset: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16824
diff changeset
    78
  $ hg branch !a/b/c/
c739227b5eea test-revset: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16824
diff changeset
    79
  marked working directory as branch !a/b/c/
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    80
  $ hg ci -Aqm"5 bug"
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    81
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    82
  $ hg merge 4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    83
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    84
  (branch merge, don't forget to commit)
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    85
  $ hg branch _a_b_c_
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    86
  marked working directory as branch _a_b_c_
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    87
  $ hg ci -Aqm"6 issue619"
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
    88
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    89
  $ hg branch .a.b.c.
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    90
  marked working directory as branch .a.b.c.
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    91
  $ hg ci -Aqm7
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    92
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    93
  $ hg branch all
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    94
  marked working directory as branch all
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
    95
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    96
  $ hg co 4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    97
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    98
  $ hg branch é
12942
05fffd665170 tests: use (esc) for all non-ASCII test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12786
diff changeset
    99
  marked working directory as branch \xc3\xa9 (esc)
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   100
  $ hg ci -Aqm9
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
   101
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   102
  $ hg tag -r6 1.0
24904
b5c227f3e461 revset: id() called with 40-byte strings should give the same results as for short strings
Alexander Drozdov <al.drozdov@gmail.com>
parents: 24892
diff changeset
   103
  $ hg bookmark -r6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
   104
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   105
  $ hg clone --quiet -U -r 7 . ../remote1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   106
  $ hg clone --quiet -U -r 8 . ../remote2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   107
  $ echo "[paths]" >> .hg/hgrc
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   108
  $ echo "default = ../remote1" >> .hg/hgrc
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   109
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   110
trivial
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   111
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   112
  $ try 0:1
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   113
  (range
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   114
    ('symbol', '0')
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   115
    ('symbol', '1'))
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   116
  * set:
24459
7d369fae098e revset: optimize "x & fullreposet" case
Yuya Nishihara <yuya@tcha.org>
parents: 24458
diff changeset
   117
  <spanset+ 0:1>
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   118
  0
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   119
  1
25819
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   120
  $ try --optimize :
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   121
  (rangeall
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   122
    None)
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   123
  * optimized:
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   124
  (range
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   125
    ('string', '0')
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   126
    ('string', 'tip'))
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   127
  * set:
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   128
  <spanset+ 0:9>
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   129
  0
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   130
  1
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   131
  2
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   132
  3
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   133
  4
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   134
  5
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   135
  6
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   136
  7
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   137
  8
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   138
  9
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   139
  $ try 3::6
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   140
  (dagrange
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   141
    ('symbol', '3')
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   142
    ('symbol', '6'))
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   143
  * set:
26061
be8a4e0800d8 reachableroots: use baseset lazy sorting
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26020
diff changeset
   144
  <baseset+ [3, 5, 6]>
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   145
  3
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   146
  5
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   147
  6
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   148
  $ try '0|1|2'
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   149
  (or
25309
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
   150
    ('symbol', '0')
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
   151
    ('symbol', '1')
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   152
    ('symbol', '2'))
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   153
  * set:
25343
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
   154
  <baseset [0, 1, 2]>
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   155
  0
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   156
  1
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   157
  2
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   158
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   159
names that should work without quoting
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
   160
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   161
  $ try a
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   162
  ('symbol', 'a')
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   163
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   164
  <baseset [0]>
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   165
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   166
  $ try b-a
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   167
  (minus
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   168
    ('symbol', 'b')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   169
    ('symbol', 'a'))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   170
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   171
  <filteredset
28423
0d79d91ba7e3 revset: add extra data to filteredset for better inspection
Yuya Nishihara <yuya@tcha.org>
parents: 28394
diff changeset
   172
    <baseset [1]>,
0d79d91ba7e3 revset: add extra data to filteredset for better inspection
Yuya Nishihara <yuya@tcha.org>
parents: 28394
diff changeset
   173
    <not
0d79d91ba7e3 revset: add extra data to filteredset for better inspection
Yuya Nishihara <yuya@tcha.org>
parents: 28394
diff changeset
   174
      <baseset [0]>>>
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   175
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   176
  $ try _a_b_c_
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   177
  ('symbol', '_a_b_c_')
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   178
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   179
  <baseset [6]>
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   180
  6
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   181
  $ try _a_b_c_-a
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   182
  (minus
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   183
    ('symbol', '_a_b_c_')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   184
    ('symbol', 'a'))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   185
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   186
  <filteredset
28423
0d79d91ba7e3 revset: add extra data to filteredset for better inspection
Yuya Nishihara <yuya@tcha.org>
parents: 28394
diff changeset
   187
    <baseset [6]>,
0d79d91ba7e3 revset: add extra data to filteredset for better inspection
Yuya Nishihara <yuya@tcha.org>
parents: 28394
diff changeset
   188
    <not
0d79d91ba7e3 revset: add extra data to filteredset for better inspection
Yuya Nishihara <yuya@tcha.org>
parents: 28394
diff changeset
   189
      <baseset [0]>>>
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   190
  6
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   191
  $ try .a.b.c.
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   192
  ('symbol', '.a.b.c.')
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   193
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   194
  <baseset [7]>
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   195
  7
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   196
  $ try .a.b.c.-a
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   197
  (minus
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   198
    ('symbol', '.a.b.c.')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   199
    ('symbol', 'a'))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   200
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   201
  <filteredset
28423
0d79d91ba7e3 revset: add extra data to filteredset for better inspection
Yuya Nishihara <yuya@tcha.org>
parents: 28394
diff changeset
   202
    <baseset [7]>,
0d79d91ba7e3 revset: add extra data to filteredset for better inspection
Yuya Nishihara <yuya@tcha.org>
parents: 28394
diff changeset
   203
    <not
0d79d91ba7e3 revset: add extra data to filteredset for better inspection
Yuya Nishihara <yuya@tcha.org>
parents: 28394
diff changeset
   204
      <baseset [0]>>>
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   205
  7
25901
0203c50a589f debugrevspec: pass lookup function to visualize fallback mechanism
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
   206
0203c50a589f debugrevspec: pass lookup function to visualize fallback mechanism
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
   207
names that should be caught by fallback mechanism
0203c50a589f debugrevspec: pass lookup function to visualize fallback mechanism
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
   208
0203c50a589f debugrevspec: pass lookup function to visualize fallback mechanism
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
   209
  $ try -- '-a-b-c-'
25902
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   210
  ('symbol', '-a-b-c-')
25901
0203c50a589f debugrevspec: pass lookup function to visualize fallback mechanism
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
   211
  * set:
0203c50a589f debugrevspec: pass lookup function to visualize fallback mechanism
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
   212
  <baseset [4]>
0203c50a589f debugrevspec: pass lookup function to visualize fallback mechanism
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
   213
  4
0203c50a589f debugrevspec: pass lookup function to visualize fallback mechanism
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
   214
  $ log -a-b-c-
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   215
  4
25902
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   216
  $ try '+a+b+c+'
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   217
  ('symbol', '+a+b+c+')
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   218
  * set:
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   219
  <baseset [3]>
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   220
  3
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   221
  $ try '+a+b+c+:'
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   222
  (rangepost
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   223
    ('symbol', '+a+b+c+'))
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   224
  * set:
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   225
  <spanset+ 3:9>
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   226
  3
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   227
  4
25902
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   228
  5
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   229
  6
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   230
  7
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   231
  8
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   232
  9
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   233
  $ try ':+a+b+c+'
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   234
  (rangepre
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   235
    ('symbol', '+a+b+c+'))
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   236
  * set:
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   237
  <spanset+ 0:3>
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   238
  0
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   239
  1
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   240
  2
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   241
  3
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   242
  $ try -- '-a-b-c-:+a+b+c+'
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   243
  (range
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   244
    ('symbol', '-a-b-c-')
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   245
    ('symbol', '+a+b+c+'))
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   246
  * set:
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   247
  <spanset- 3:4>
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   248
  4
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   249
  3
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   250
  $ log '-a-b-c-:+a+b+c+'
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   251
  4
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   252
  3
20781
8ecfa225bd16 revrange: pass repo to revset parser
Matt Mackall <mpm@selenic.com>
parents: 20736
diff changeset
   253
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   254
  $ try -- -a-b-c--a # complains
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   255
  (minus
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   256
    (minus
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   257
      (minus
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   258
        (negate
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   259
          ('symbol', 'a'))
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   260
        ('symbol', 'b'))
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   261
      ('symbol', 'c'))
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   262
    (negate
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   263
      ('symbol', 'a')))
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   264
  abort: unknown revision '-a'!
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12105
diff changeset
   265
  [255]
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   266
  $ try é
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   267
  ('symbol', '\xc3\xa9')
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   268
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   269
  <baseset [9]>
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   270
  9
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
   271
20781
8ecfa225bd16 revrange: pass repo to revset parser
Matt Mackall <mpm@selenic.com>
parents: 20736
diff changeset
   272
no quoting needed
8ecfa225bd16 revrange: pass repo to revset parser
Matt Mackall <mpm@selenic.com>
parents: 20736
diff changeset
   273
8ecfa225bd16 revrange: pass repo to revset parser
Matt Mackall <mpm@selenic.com>
parents: 20736
diff changeset
   274
  $ log ::a-b-c-
8ecfa225bd16 revrange: pass repo to revset parser
Matt Mackall <mpm@selenic.com>
parents: 20736
diff changeset
   275
  0
8ecfa225bd16 revrange: pass repo to revset parser
Matt Mackall <mpm@selenic.com>
parents: 20736
diff changeset
   276
  1
8ecfa225bd16 revrange: pass repo to revset parser
Matt Mackall <mpm@selenic.com>
parents: 20736
diff changeset
   277
  2
8ecfa225bd16 revrange: pass repo to revset parser
Matt Mackall <mpm@selenic.com>
parents: 20736
diff changeset
   278
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   279
quoting needed
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
   280
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   281
  $ try '"-a-b-c-"-a'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   282
  (minus
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   283
    ('string', '-a-b-c-')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   284
    ('symbol', 'a'))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   285
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   286
  <filteredset
28423
0d79d91ba7e3 revset: add extra data to filteredset for better inspection
Yuya Nishihara <yuya@tcha.org>
parents: 28394
diff changeset
   287
    <baseset [4]>,
0d79d91ba7e3 revset: add extra data to filteredset for better inspection
Yuya Nishihara <yuya@tcha.org>
parents: 28394
diff changeset
   288
    <not
0d79d91ba7e3 revset: add extra data to filteredset for better inspection
Yuya Nishihara <yuya@tcha.org>
parents: 28394
diff changeset
   289
      <baseset [0]>>>
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   290
  4
11882
b75dea24e296 revset: fix outgoing argument handling
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 11650
diff changeset
   291
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   292
  $ log '1 or 2'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   293
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   294
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   295
  $ log '1|2'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   296
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   297
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   298
  $ log '1 and 2'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   299
  $ log '1&2'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   300
  $ try '1&2|3' # precedence - and is higher
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   301
  (or
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   302
    (and
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   303
      ('symbol', '1')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   304
      ('symbol', '2'))
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   305
    ('symbol', '3'))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   306
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   307
  <addset
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   308
    <baseset []>,
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   309
    <baseset [3]>>
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   310
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   311
  $ try '1|2&3'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   312
  (or
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   313
    ('symbol', '1')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   314
    (and
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   315
      ('symbol', '2')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   316
      ('symbol', '3')))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   317
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   318
  <addset
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   319
    <baseset [1]>,
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   320
    <baseset []>>
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   321
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   322
  $ try '1&2&3' # associativity
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   323
  (and
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   324
    (and
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   325
      ('symbol', '1')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   326
      ('symbol', '2'))
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   327
    ('symbol', '3'))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   328
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   329
  <baseset []>
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   330
  $ try '1|(2|3)'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   331
  (or
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   332
    ('symbol', '1')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   333
    (group
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   334
      (or
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   335
        ('symbol', '2')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   336
        ('symbol', '3'))))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   337
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   338
  <addset
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   339
    <baseset [1]>,
25343
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
   340
    <baseset [2, 3]>>
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   341
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   342
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   343
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   344
  $ log '1.0' # tag
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   345
  6
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   346
  $ log 'a' # branch
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   347
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   348
  $ log '2785f51ee'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   349
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   350
  $ log 'date(2005)'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   351
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   352
  $ log 'date(this is a test)'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   353
  hg: parse error at 10: unexpected token: symbol
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12105
diff changeset
   354
  [255]
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   355
  $ log 'date()'
12736
7e14e67e6622 revset: use 'requires' instead of 'wants' in error message
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 12716
diff changeset
   356
  hg: parse error: date requires a string
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12105
diff changeset
   357
  [255]
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   358
  $ log 'date'
24932
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   359
  abort: unknown revision 'date'!
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12105
diff changeset
   360
  [255]
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   361
  $ log 'date('
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   362
  hg: parse error at 5: not a prefix: end
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12105
diff changeset
   363
  [255]
26232
43f9976346e9 revset: handle error of string unescaping
Yuya Nishihara <yuya@tcha.org>
parents: 26061
diff changeset
   364
  $ log 'date("\xy")'
43f9976346e9 revset: handle error of string unescaping
Yuya Nishihara <yuya@tcha.org>
parents: 26061
diff changeset
   365
  hg: parse error: invalid \x escape
43f9976346e9 revset: handle error of string unescaping
Yuya Nishihara <yuya@tcha.org>
parents: 26061
diff changeset
   366
  [255]
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   367
  $ log 'date(tip)'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   368
  abort: invalid date: 'tip'
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12105
diff changeset
   369
  [255]
24932
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   370
  $ log '0:date'
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   371
  abort: unknown revision 'date'!
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   372
  [255]
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   373
  $ log '::"date"'
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   374
  abort: unknown revision 'date'!
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12105
diff changeset
   375
  [255]
24932
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   376
  $ hg book date -r 4
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   377
  $ log '0:date'
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   378
  0
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   379
  1
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   380
  2
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   381
  3
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   382
  4
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   383
  $ log '::date'
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   384
  0
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   385
  1
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   386
  2
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   387
  4
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   388
  $ log '::"date"'
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   389
  0
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   390
  1
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   391
  2
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   392
  4
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   393
  $ log 'date(2005) and 1::'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   394
  4
24932
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   395
  $ hg book -d date
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   396
25704
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   397
keyword arguments
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   398
25706
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   399
  $ log 'extra(branch, value=a)'
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   400
  0
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   401
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   402
  $ log 'extra(branch, a, b)'
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   403
  hg: parse error: extra takes at most 2 arguments
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   404
  [255]
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   405
  $ log 'extra(a, label=b)'
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   406
  hg: parse error: extra got multiple values for keyword argument 'label'
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   407
  [255]
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   408
  $ log 'extra(label=branch, default)'
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   409
  hg: parse error: extra got an invalid argument
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   410
  [255]
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   411
  $ log 'extra(branch, foo+bar=baz)'
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   412
  hg: parse error: extra got an invalid argument
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   413
  [255]
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   414
  $ log 'extra(unknown=branch)'
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   415
  hg: parse error: extra got an unexpected keyword argument 'unknown'
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   416
  [255]
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   417
25704
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   418
  $ try 'foo=bar|baz'
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   419
  (keyvalue
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   420
    ('symbol', 'foo')
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   421
    (or
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   422
      ('symbol', 'bar')
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   423
      ('symbol', 'baz')))
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   424
  hg: parse error: can't use a key-value pair in this context
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   425
  [255]
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   426
24932
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   427
Test that symbols only get parsed as functions if there's an opening
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   428
parenthesis.
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   429
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   430
  $ hg book only -r 9
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   431
  $ log 'only(only)'   # Outer "only" is a function, inner "only" is the bookmark
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   432
  8
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   433
  9
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
   434
18536
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
   435
ancestor can accept 0 or more arguments
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
   436
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
   437
  $ log 'ancestor()'
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   438
  $ log 'ancestor(1)'
18536
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
   439
  1
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   440
  $ log 'ancestor(4,5)'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   441
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   442
  $ log 'ancestor(4,5) and 4'
18536
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
   443
  $ log 'ancestor(0,0,1,3)'
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
   444
  0
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
   445
  $ log 'ancestor(3,1,5,3,5,1)'
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
   446
  1
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
   447
  $ log 'ancestor(0,1,3,5)'
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
   448
  0
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
   449
  $ log 'ancestor(1,2,3,4,5)'
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
   450
  1
24940
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
   451
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
   452
test ancestors
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
   453
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   454
  $ log 'ancestors(5)'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   455
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   456
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   457
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   458
  5
18536
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
   459
  $ log 'ancestor(ancestors(5))'
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
   460
  0
24940
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
   461
  $ log '::r3232()'
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
   462
  0
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
   463
  1
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
   464
  2
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
   465
  3
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
   466
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   467
  $ log 'author(bob)'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   468
  2
16823
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
   469
  $ log 'author("re:bob|test")'
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
   470
  0
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
   471
  1
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
   472
  2
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
   473
  3
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
   474
  4
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
   475
  5
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
   476
  6
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
   477
  7
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
   478
  8
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
   479
  9
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   480
  $ log 'branch(é)'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   481
  8
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   482
  9
16821
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
   483
  $ log 'branch(a)'
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
   484
  0
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
   485
  $ hg log -r 'branch("re:a")' --template '{rev} {branch}\n'
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
   486
  0 a
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
   487
  2 a-b-c-
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
   488
  3 +a+b+c+
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
   489
  4 -a-b-c-
16851
c739227b5eea test-revset: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16824
diff changeset
   490
  5 !a/b/c/
16821
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
   491
  6 _a_b_c_
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
   492
  7 .a.b.c.
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   493
  $ log 'children(ancestor(4,5))'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   494
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   495
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   496
  $ log 'closed()'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   497
  $ log 'contains(a)'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   498
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   499
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   500
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   501
  5
20286
760151697a4f revset: make default kind of pattern for "contains()" rooted at cwd
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19706
diff changeset
   502
  $ log 'contains("../repo/a")'
760151697a4f revset: make default kind of pattern for "contains()" rooted at cwd
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19706
diff changeset
   503
  0
760151697a4f revset: make default kind of pattern for "contains()" rooted at cwd
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19706
diff changeset
   504
  1
760151697a4f revset: make default kind of pattern for "contains()" rooted at cwd
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19706
diff changeset
   505
  3
760151697a4f revset: make default kind of pattern for "contains()" rooted at cwd
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19706
diff changeset
   506
  5
14650
93731b3efd0d revset: add desc(string) to search in commit messages
Thomas Arendsen Hein <thomas@intevation.de>
parents: 14153
diff changeset
   507
  $ log 'desc(B)'
93731b3efd0d revset: add desc(string) to search in commit messages
Thomas Arendsen Hein <thomas@intevation.de>
parents: 14153
diff changeset
   508
  5
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   509
  $ log 'descendants(2 or 3)'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   510
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   511
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   512
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   513
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   514
  6
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   515
  7
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   516
  8
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   517
  9
16411
4c2edcd84175 graphlog: correctly handle calls in subdirectories
Patrick Mezard <patrick@mezard.eu>
parents: 16218
diff changeset
   518
  $ log 'file("b*")'
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   519
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   520
  4
20288
b61ad01c4e73 revset: use "canonpath()" for "filelog()" pattern without explicit kind
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20286
diff changeset
   521
  $ log 'filelog("b")'
b61ad01c4e73 revset: use "canonpath()" for "filelog()" pattern without explicit kind
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20286
diff changeset
   522
  1
b61ad01c4e73 revset: use "canonpath()" for "filelog()" pattern without explicit kind
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20286
diff changeset
   523
  4
b61ad01c4e73 revset: use "canonpath()" for "filelog()" pattern without explicit kind
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20286
diff changeset
   524
  $ log 'filelog("../repo/b")'
b61ad01c4e73 revset: use "canonpath()" for "filelog()" pattern without explicit kind
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20286
diff changeset
   525
  1
b61ad01c4e73 revset: use "canonpath()" for "filelog()" pattern without explicit kind
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20286
diff changeset
   526
  4
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   527
  $ log 'follow()'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   528
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   529
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   530
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   531
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   532
  8
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   533
  9
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   534
  $ log 'grep("issue\d+")'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   535
  6
12321
11db6fa2961e merge with stable
Martin Geisler <mg@aragost.com>
parents: 12320 12316
diff changeset
   536
  $ try 'grep("(")' # invalid regular expression
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   537
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   538
    ('symbol', 'grep')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   539
    ('string', '('))
12321
11db6fa2961e merge with stable
Martin Geisler <mg@aragost.com>
parents: 12320 12316
diff changeset
   540
  hg: parse error: invalid match pattern: unbalanced parenthesis
11db6fa2961e merge with stable
Martin Geisler <mg@aragost.com>
parents: 12320 12316
diff changeset
   541
  [255]
12408
78a97859b90d revset: support raw string literals
Brodie Rao <brodie@bitheap.org>
parents: 12321
diff changeset
   542
  $ try 'grep("\bissue\d+")'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   543
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   544
    ('symbol', 'grep')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   545
    ('string', '\x08issue\\d+'))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   546
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   547
  <filteredset
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   548
    <fullreposet+ 0:9>>
12408
78a97859b90d revset: support raw string literals
Brodie Rao <brodie@bitheap.org>
parents: 12321
diff changeset
   549
  $ try 'grep(r"\bissue\d+")'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   550
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   551
    ('symbol', 'grep')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   552
    ('string', '\\bissue\\d+'))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   553
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   554
  <filteredset
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   555
    <fullreposet+ 0:9>>
12408
78a97859b90d revset: support raw string literals
Brodie Rao <brodie@bitheap.org>
parents: 12321
diff changeset
   556
  6
78a97859b90d revset: support raw string literals
Brodie Rao <brodie@bitheap.org>
parents: 12321
diff changeset
   557
  $ try 'grep(r"\")'
78a97859b90d revset: support raw string literals
Brodie Rao <brodie@bitheap.org>
parents: 12321
diff changeset
   558
  hg: parse error at 7: unterminated string
78a97859b90d revset: support raw string literals
Brodie Rao <brodie@bitheap.org>
parents: 12321
diff changeset
   559
  [255]
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   560
  $ log 'head()'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   561
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   562
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   563
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   564
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   565
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   566
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   567
  6
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   568
  7
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   569
  9
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   570
  $ log 'heads(6::)'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   571
  7
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   572
  $ log 'keyword(issue)'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   573
  6
19706
26ddce1a2a55 revset: fix wrong keyword() behaviour for strings with spaces
Alexander Plavin <alexander@plav.in>
parents: 18955
diff changeset
   574
  $ log 'keyword("test a")'
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   575
  $ log 'limit(head(), 1)'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   576
  0
26638
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
   577
  $ log 'limit(author("re:bob|test"), 3, 5)'
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
   578
  5
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
   579
  6
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
   580
  7
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
   581
  $ log 'limit(author("re:bob|test"), offset=6)'
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
   582
  6
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
   583
  $ log 'limit(author("re:bob|test"), offset=10)'
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
   584
  $ log 'limit(all(), 1, -1)'
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
   585
  hg: parse error: negative offset
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
   586
  [255]
16447
60c379da12aa tests: add tests for matching keyword
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 16415
diff changeset
   587
  $ log 'matching(6)'
60c379da12aa tests: add tests for matching keyword
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 16415
diff changeset
   588
  6
60c379da12aa tests: add tests for matching keyword
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 16415
diff changeset
   589
  $ log 'matching(6:7, "phase parents user date branch summary files description substate")'
60c379da12aa tests: add tests for matching keyword
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 16415
diff changeset
   590
  6
60c379da12aa tests: add tests for matching keyword
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 16415
diff changeset
   591
  7
20863
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   592
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   593
Testing min and max
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   594
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   595
max: simple
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   596
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   597
  $ log 'max(contains(a))'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   598
  5
20863
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   599
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   600
max: simple on unordered set)
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   601
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   602
  $ log 'max((4+0+2+5+7) and contains(a))'
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   603
  5
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   604
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   605
max: no result
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   606
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   607
  $ log 'max(contains(stringthatdoesnotappearanywhere))'
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   608
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   609
max: no result on unordered set
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   610
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   611
  $ log 'max((4+0+2+5+7) and contains(stringthatdoesnotappearanywhere))'
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   612
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   613
min: simple
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   614
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   615
  $ log 'min(contains(a))'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   616
  0
20863
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   617
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   618
min: simple on unordered set
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   619
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   620
  $ log 'min((4+0+2+5+7) and contains(a))'
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   621
  0
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   622
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   623
min: empty
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   624
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   625
  $ log 'min(contains(stringthatdoesnotappearanywhere))'
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   626
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   627
min: empty on unordered set
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   628
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   629
  $ log 'min((4+0+2+5+7) and contains(stringthatdoesnotappearanywhere))'
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   630
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
   631
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   632
  $ log 'merge()'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   633
  6
17753
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
   634
  $ log 'branchpoint()'
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
   635
  1
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
   636
  4
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   637
  $ log 'modifies(b)'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   638
  4
16521
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
   639
  $ log 'modifies("path:b")'
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
   640
  4
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
   641
  $ log 'modifies("*")'
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
   642
  4
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
   643
  6
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
   644
  $ log 'modifies("set:modified()")'
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
   645
  4
12716
c7e619e30ba3 revset: add id() and rev() to allow explicitly referring to changes by hash or rev
Augie Fackler <durin42@gmail.com>
parents: 12715
diff changeset
   646
  $ log 'id(5)'
c7e619e30ba3 revset: add id() and rev() to allow explicitly referring to changes by hash or rev
Augie Fackler <durin42@gmail.com>
parents: 12715
diff changeset
   647
  2
20613
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
   648
  $ log 'only(9)'
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
   649
  8
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
   650
  9
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
   651
  $ log 'only(8)'
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
   652
  8
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
   653
  $ log 'only(9, 5)'
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
   654
  2
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
   655
  4
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
   656
  8
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
   657
  9
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
   658
  $ log 'only(7 + 9, 5 + 2)'
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
   659
  4
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
   660
  6
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
   661
  7
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
   662
  8
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
   663
  9
21925
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
   664
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
   665
Test empty set input
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
   666
  $ log 'only(p2())'
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
   667
  $ log 'only(p1(), p2())'
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
   668
  0
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
   669
  1
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
   670
  2
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
   671
  4
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
   672
  8
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
   673
  9
23062
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
   674
23765
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   675
Test '%' operator
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   676
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   677
  $ log '9%'
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   678
  8
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   679
  9
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   680
  $ log '9%5'
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   681
  2
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   682
  4
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   683
  8
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   684
  9
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   685
  $ log '(7 + 9)%(5 + 2)'
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   686
  4
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   687
  6
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   688
  7
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   689
  8
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   690
  9
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   691
25094
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
   692
Test opreand of '%' is optimized recursively (issue4670)
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
   693
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
   694
  $ try --optimize '8:9-8%'
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
   695
  (onlypost
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
   696
    (minus
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
   697
      (range
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
   698
        ('symbol', '8')
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
   699
        ('symbol', '9'))
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
   700
      ('symbol', '8')))
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
   701
  * optimized:
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
   702
  (func
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
   703
    ('symbol', 'only')
28217
d2ac8b57a75d revset: use smartset minus operator
Durham Goode <durham@fb.com>
parents: 28015
diff changeset
   704
    (difference
25094
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
   705
      (range
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
   706
        ('symbol', '8')
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
   707
        ('symbol', '9'))
28217
d2ac8b57a75d revset: use smartset minus operator
Durham Goode <durham@fb.com>
parents: 28015
diff changeset
   708
      ('symbol', '8')))
25094
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
   709
  * set:
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
   710
  <baseset+ [8, 9]>
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
   711
  8
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
   712
  9
25105
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
   713
  $ try --optimize '(9)%(5)'
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
   714
  (only
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
   715
    (group
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
   716
      ('symbol', '9'))
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
   717
    (group
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
   718
      ('symbol', '5')))
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
   719
  * optimized:
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
   720
  (func
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
   721
    ('symbol', 'only')
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
   722
    (list
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
   723
      ('symbol', '9')
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
   724
      ('symbol', '5')))
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
   725
  * set:
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
   726
  <baseset+ [8, 9, 2, 4]>
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
   727
  2
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
   728
  4
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
   729
  8
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
   730
  9
25094
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
   731
23765
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   732
Test the order of operations
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   733
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   734
  $ log '7 + 9%5 + 2'
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   735
  7
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   736
  2
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   737
  4
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   738
  8
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   739
  9
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
   740
23062
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
   741
Test explicit numeric revision
23954
310222feb9a8 revset: allow rev(-1) to indicate null revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 23846
diff changeset
   742
  $ log 'rev(-2)'
23062
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
   743
  $ log 'rev(-1)'
23954
310222feb9a8 revset: allow rev(-1) to indicate null revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 23846
diff changeset
   744
  -1
23062
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
   745
  $ log 'rev(0)'
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
   746
  0
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
   747
  $ log 'rev(9)'
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
   748
  9
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
   749
  $ log 'rev(10)'
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
   750
  $ log 'rev(tip)'
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
   751
  hg: parse error: rev expects a number
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
   752
  [255]
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
   753
24904
b5c227f3e461 revset: id() called with 40-byte strings should give the same results as for short strings
Alexander Drozdov <al.drozdov@gmail.com>
parents: 24892
diff changeset
   754
Test hexadecimal revision
b5c227f3e461 revset: id() called with 40-byte strings should give the same results as for short strings
Alexander Drozdov <al.drozdov@gmail.com>
parents: 24892
diff changeset
   755
  $ log 'id(2)'
b5c227f3e461 revset: id() called with 40-byte strings should give the same results as for short strings
Alexander Drozdov <al.drozdov@gmail.com>
parents: 24892
diff changeset
   756
  abort: 00changelog.i@2: ambiguous identifier!
b5c227f3e461 revset: id() called with 40-byte strings should give the same results as for short strings
Alexander Drozdov <al.drozdov@gmail.com>
parents: 24892
diff changeset
   757
  [255]
b5c227f3e461 revset: id() called with 40-byte strings should give the same results as for short strings
Alexander Drozdov <al.drozdov@gmail.com>
parents: 24892
diff changeset
   758
  $ log 'id(23268)'
b5c227f3e461 revset: id() called with 40-byte strings should give the same results as for short strings
Alexander Drozdov <al.drozdov@gmail.com>
parents: 24892
diff changeset
   759
  4
b5c227f3e461 revset: id() called with 40-byte strings should give the same results as for short strings
Alexander Drozdov <al.drozdov@gmail.com>
parents: 24892
diff changeset
   760
  $ log 'id(2785f51eece)'
b5c227f3e461 revset: id() called with 40-byte strings should give the same results as for short strings
Alexander Drozdov <al.drozdov@gmail.com>
parents: 24892
diff changeset
   761
  0
b5c227f3e461 revset: id() called with 40-byte strings should give the same results as for short strings
Alexander Drozdov <al.drozdov@gmail.com>
parents: 24892
diff changeset
   762
  $ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532c)'
b5c227f3e461 revset: id() called with 40-byte strings should give the same results as for short strings
Alexander Drozdov <al.drozdov@gmail.com>
parents: 24892
diff changeset
   763
  8
b5c227f3e461 revset: id() called with 40-byte strings should give the same results as for short strings
Alexander Drozdov <al.drozdov@gmail.com>
parents: 24892
diff changeset
   764
  $ log 'id(d5d0dcbdc4a)'
b5c227f3e461 revset: id() called with 40-byte strings should give the same results as for short strings
Alexander Drozdov <al.drozdov@gmail.com>
parents: 24892
diff changeset
   765
  $ log 'id(d5d0dcbdc4w)'
b5c227f3e461 revset: id() called with 40-byte strings should give the same results as for short strings
Alexander Drozdov <al.drozdov@gmail.com>
parents: 24892
diff changeset
   766
  $ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532d)'
b5c227f3e461 revset: id() called with 40-byte strings should give the same results as for short strings
Alexander Drozdov <al.drozdov@gmail.com>
parents: 24892
diff changeset
   767
  $ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532q)'
b5c227f3e461 revset: id() called with 40-byte strings should give the same results as for short strings
Alexander Drozdov <al.drozdov@gmail.com>
parents: 24892
diff changeset
   768
  $ log 'id(1.0)'
b5c227f3e461 revset: id() called with 40-byte strings should give the same results as for short strings
Alexander Drozdov <al.drozdov@gmail.com>
parents: 24892
diff changeset
   769
  $ log 'id(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)'
b5c227f3e461 revset: id() called with 40-byte strings should give the same results as for short strings
Alexander Drozdov <al.drozdov@gmail.com>
parents: 24892
diff changeset
   770
23956
b1e026c25552 revset: fix ancestors(null) to include null revision (issue4512)
Yuya Nishihara <yuya@tcha.org>
parents: 23954
diff changeset
   771
Test null revision
24204
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
   772
  $ log '(null)'
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
   773
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
   774
  $ log '(null:0)'
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
   775
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
   776
  0
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
   777
  $ log '(0:null)'
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
   778
  0
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
   779
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
   780
  $ log 'null::0'
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
   781
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
   782
  0
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
   783
  $ log 'null:tip - 0:'
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
   784
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
   785
  $ log 'null: and null::' | head -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
   786
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
   787
  $ log 'null: or 0:' | head -2
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
   788
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
   789
  0
23956
b1e026c25552 revset: fix ancestors(null) to include null revision (issue4512)
Yuya Nishihara <yuya@tcha.org>
parents: 23954
diff changeset
   790
  $ log 'ancestors(null)'
b1e026c25552 revset: fix ancestors(null) to include null revision (issue4512)
Yuya Nishihara <yuya@tcha.org>
parents: 23954
diff changeset
   791
  -1
24204
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
   792
  $ log 'reverse(null:)' | tail -2
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
   793
  0
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
   794
  -1
25265
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
   795
BROKEN: should be '-1'
24204
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
   796
  $ log 'first(null:)'
25265
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
   797
BROKEN: should be '-1'
24204
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
   798
  $ log 'min(null:)'
24202
2de9ee016425 revset: have all() filter out null revision
Yuya Nishihara <yuya@tcha.org>
parents: 24175
diff changeset
   799
  $ log 'tip:null and all()' | tail -2
2de9ee016425 revset: have all() filter out null revision
Yuya Nishihara <yuya@tcha.org>
parents: 24175
diff changeset
   800
  1
2de9ee016425 revset: have all() filter out null revision
Yuya Nishihara <yuya@tcha.org>
parents: 24175
diff changeset
   801
  0
23956
b1e026c25552 revset: fix ancestors(null) to include null revision (issue4512)
Yuya Nishihara <yuya@tcha.org>
parents: 23954
diff changeset
   802
24419
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 24222
diff changeset
   803
Test working-directory revision
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 24222
diff changeset
   804
  $ hg debugrevspec 'wdir()'
25765
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
   805
  2147483647
24419
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 24222
diff changeset
   806
  $ hg debugrevspec 'tip or wdir()'
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 24222
diff changeset
   807
  9
25765
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
   808
  2147483647
24419
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 24222
diff changeset
   809
  $ hg debugrevspec '0:tip and wdir()'
25766
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
   810
  $ log '0:wdir()' | tail -3
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
   811
  8
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
   812
  9
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
   813
  2147483647
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
   814
  $ log 'wdir():0' | head -3
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
   815
  2147483647
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
   816
  9
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
   817
  8
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
   818
  $ log 'wdir():wdir()'
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
   819
  2147483647
25765
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
   820
  $ log '(all() + wdir()) & min(. + wdir())'
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
   821
  9
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
   822
  $ log '(all() + wdir()) & max(. + wdir())'
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
   823
  2147483647
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
   824
  $ log '(all() + wdir()) & first(wdir() + .)'
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
   825
  2147483647
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
   826
  $ log '(all() + wdir()) & last(. + wdir())'
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
   827
  2147483647
24419
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 24222
diff changeset
   828
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   829
  $ log 'outgoing()'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   830
  8
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   831
  9
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   832
  $ log 'outgoing("../remote1")'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   833
  8
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   834
  9
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   835
  $ log 'outgoing("../remote2")'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   836
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   837
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   838
  6
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   839
  7
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   840
  9
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   841
  $ log 'p1(merge())'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   842
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   843
  $ log 'p2(merge())'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   844
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   845
  $ log 'parents(merge())'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   846
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   847
  5
17753
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
   848
  $ log 'p1(branchpoint())'
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
   849
  0
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
   850
  2
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
   851
  $ log 'p2(branchpoint())'
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
   852
  $ log 'parents(branchpoint())'
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
   853
  0
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
   854
  2
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   855
  $ log 'removes(a)'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   856
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   857
  6
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   858
  $ log 'roots(all())'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   859
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   860
  $ log 'reverse(2 or 3 or 4 or 5)'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   861
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   862
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   863
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   864
  2
17100
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
   865
  $ log 'reverse(all())'
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
   866
  9
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
   867
  8
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
   868
  7
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
   869
  6
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
   870
  5
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
   871
  4
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
   872
  3
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
   873
  2
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
   874
  1
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
   875
  0
23826
c90d195320c5 revset: fix spanset.isascending() to honor sort() or reverse() request
Yuya Nishihara <yuya@tcha.org>
parents: 23062
diff changeset
   876
  $ log 'reverse(all()) & filelog(b)'
c90d195320c5 revset: fix spanset.isascending() to honor sort() or reverse() request
Yuya Nishihara <yuya@tcha.org>
parents: 23062
diff changeset
   877
  4
c90d195320c5 revset: fix spanset.isascending() to honor sort() or reverse() request
Yuya Nishihara <yuya@tcha.org>
parents: 23062
diff changeset
   878
  1
12716
c7e619e30ba3 revset: add id() and rev() to allow explicitly referring to changes by hash or rev
Augie Fackler <durin42@gmail.com>
parents: 12715
diff changeset
   879
  $ log 'rev(5)'
c7e619e30ba3 revset: add id() and rev() to allow explicitly referring to changes by hash or rev
Augie Fackler <durin42@gmail.com>
parents: 12715
diff changeset
   880
  5
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   881
  $ log 'sort(limit(reverse(all()), 3))'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   882
  7
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   883
  8
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   884
  9
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   885
  $ log 'sort(2 or 3 or 4 or 5, date)'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   886
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   887
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   888
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   889
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   890
  $ log 'tagged()'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   891
  6
12715
33820dccbea4 revset: rename tagged() to tag() and allow it to take an optional tag name
Augie Fackler <durin42@gmail.com>
parents: 12616
diff changeset
   892
  $ log 'tag()'
33820dccbea4 revset: rename tagged() to tag() and allow it to take an optional tag name
Augie Fackler <durin42@gmail.com>
parents: 12616
diff changeset
   893
  6
33820dccbea4 revset: rename tagged() to tag() and allow it to take an optional tag name
Augie Fackler <durin42@gmail.com>
parents: 12616
diff changeset
   894
  $ log 'tag(1.0)'
33820dccbea4 revset: rename tagged() to tag() and allow it to take an optional tag name
Augie Fackler <durin42@gmail.com>
parents: 12616
diff changeset
   895
  6
33820dccbea4 revset: rename tagged() to tag() and allow it to take an optional tag name
Augie Fackler <durin42@gmail.com>
parents: 12616
diff changeset
   896
  $ log 'tag(tip)'
33820dccbea4 revset: rename tagged() to tag() and allow it to take an optional tag name
Augie Fackler <durin42@gmail.com>
parents: 12616
diff changeset
   897
  9
16820
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
   898
20717
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   899
test sort revset
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   900
--------------------------------------------
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   901
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   902
test when adding two unordered revsets
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   903
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   904
  $ log 'sort(keyword(issue) or modifies(b))'
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   905
  4
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   906
  6
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   907
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   908
test when sorting a reversed collection in the same way it is
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   909
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   910
  $ log 'sort(reverse(all()), -rev)'
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   911
  9
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   912
  8
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   913
  7
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   914
  6
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   915
  5
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   916
  4
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   917
  3
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   918
  2
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   919
  1
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   920
  0
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   921
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   922
test when sorting a reversed collection
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   923
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   924
  $ log 'sort(reverse(all()), rev)'
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   925
  0
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   926
  1
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   927
  2
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   928
  3
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   929
  4
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   930
  5
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   931
  6
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   932
  7
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   933
  8
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   934
  9
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   935
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   936
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   937
test sorting two sorted collections in different orders
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   938
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   939
  $ log 'sort(outgoing() or reverse(removes(a)), rev)'
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   940
  2
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   941
  6
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   942
  8
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   943
  9
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   944
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   945
test sorting two sorted collections in different orders backwards
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   946
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   947
  $ log 'sort(outgoing() or reverse(removes(a)), -rev)'
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   948
  9
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   949
  8
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   950
  6
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   951
  2
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
   952
21024
7731a2281cf0 spelling: fixes from spell checker
Mads Kiilerich <madski@unity3d.com>
parents: 20894
diff changeset
   953
test subtracting something from an addset
20736
b0203624ab20 revset: extend sorting tests
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20717
diff changeset
   954
b0203624ab20 revset: extend sorting tests
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20717
diff changeset
   955
  $ log '(outgoing() or removes(a)) - removes(a)'
b0203624ab20 revset: extend sorting tests
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20717
diff changeset
   956
  8
b0203624ab20 revset: extend sorting tests
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20717
diff changeset
   957
  9
b0203624ab20 revset: extend sorting tests
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20717
diff changeset
   958
b0203624ab20 revset: extend sorting tests
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20717
diff changeset
   959
test intersecting something with an addset
b0203624ab20 revset: extend sorting tests
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20717
diff changeset
   960
b0203624ab20 revset: extend sorting tests
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20717
diff changeset
   961
  $ log 'parents(outgoing() or removes(a))'
b0203624ab20 revset: extend sorting tests
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20717
diff changeset
   962
  1
b0203624ab20 revset: extend sorting tests
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20717
diff changeset
   963
  4
b0203624ab20 revset: extend sorting tests
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20717
diff changeset
   964
  5
22712
093df3b77f27 revert: bring back usage of `subset & ps` in `parents`
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22450
diff changeset
   965
  8
20736
b0203624ab20 revset: extend sorting tests
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20717
diff changeset
   966
22861
546fa6576815 revset: restore order of `or` operation as in Mercurial 2.9
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22712
diff changeset
   967
test that `or` operation combines elements in the right order:
546fa6576815 revset: restore order of `or` operation as in Mercurial 2.9
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22712
diff changeset
   968
546fa6576815 revset: restore order of `or` operation as in Mercurial 2.9
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22712
diff changeset
   969
  $ log '3:4 or 2:5'
546fa6576815 revset: restore order of `or` operation as in Mercurial 2.9
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22712
diff changeset
   970
  3
546fa6576815 revset: restore order of `or` operation as in Mercurial 2.9
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22712
diff changeset
   971
  4
546fa6576815 revset: restore order of `or` operation as in Mercurial 2.9
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22712
diff changeset
   972
  2
546fa6576815 revset: restore order of `or` operation as in Mercurial 2.9
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22712
diff changeset
   973
  5
546fa6576815 revset: restore order of `or` operation as in Mercurial 2.9
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22712
diff changeset
   974
  $ log '3:4 or 5:2'
546fa6576815 revset: restore order of `or` operation as in Mercurial 2.9
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22712
diff changeset
   975
  3
546fa6576815 revset: restore order of `or` operation as in Mercurial 2.9
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22712
diff changeset
   976
  4
546fa6576815 revset: restore order of `or` operation as in Mercurial 2.9
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22712
diff changeset
   977
  5
546fa6576815 revset: restore order of `or` operation as in Mercurial 2.9
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22712
diff changeset
   978
  2
546fa6576815 revset: restore order of `or` operation as in Mercurial 2.9
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22712
diff changeset
   979
  $ log 'sort(3:4 or 2:5)'
546fa6576815 revset: restore order of `or` operation as in Mercurial 2.9
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22712
diff changeset
   980
  2
546fa6576815 revset: restore order of `or` operation as in Mercurial 2.9
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22712
diff changeset
   981
  3
546fa6576815 revset: restore order of `or` operation as in Mercurial 2.9
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22712
diff changeset
   982
  4
546fa6576815 revset: restore order of `or` operation as in Mercurial 2.9
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22712
diff changeset
   983
  5
546fa6576815 revset: restore order of `or` operation as in Mercurial 2.9
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22712
diff changeset
   984
  $ log 'sort(3:4 or 5:2)'
546fa6576815 revset: restore order of `or` operation as in Mercurial 2.9
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22712
diff changeset
   985
  2
546fa6576815 revset: restore order of `or` operation as in Mercurial 2.9
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22712
diff changeset
   986
  3
546fa6576815 revset: restore order of `or` operation as in Mercurial 2.9
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22712
diff changeset
   987
  4
546fa6576815 revset: restore order of `or` operation as in Mercurial 2.9
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22712
diff changeset
   988
  5
546fa6576815 revset: restore order of `or` operation as in Mercurial 2.9
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22712
diff changeset
   989
25383
5909ac39b86a revrange: drop unnecessary deduplication of revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25344
diff changeset
   990
test that more than one `-r`s are combined in the right order and deduplicated:
5909ac39b86a revrange: drop unnecessary deduplication of revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25344
diff changeset
   991
5909ac39b86a revrange: drop unnecessary deduplication of revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25344
diff changeset
   992
  $ hg log -T '{rev}\n' -r 3 -r 3 -r 4 -r 5:2 -r 'ancestors(4)'
5909ac39b86a revrange: drop unnecessary deduplication of revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25344
diff changeset
   993
  3
5909ac39b86a revrange: drop unnecessary deduplication of revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25344
diff changeset
   994
  4
5909ac39b86a revrange: drop unnecessary deduplication of revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25344
diff changeset
   995
  5
5909ac39b86a revrange: drop unnecessary deduplication of revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25344
diff changeset
   996
  2
5909ac39b86a revrange: drop unnecessary deduplication of revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25344
diff changeset
   997
  0
5909ac39b86a revrange: drop unnecessary deduplication of revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25344
diff changeset
   998
  1
5909ac39b86a revrange: drop unnecessary deduplication of revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25344
diff changeset
   999
25024
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1000
test that `or` operation skips duplicated revisions from right-hand side
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1001
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1002
  $ try 'reverse(1::5) or ancestors(4)'
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1003
  (or
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1004
    (func
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1005
      ('symbol', 'reverse')
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1006
      (dagrange
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1007
        ('symbol', '1')
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1008
        ('symbol', '5')))
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1009
    (func
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1010
      ('symbol', 'ancestors')
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1011
      ('symbol', '4')))
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1012
  * set:
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1013
  <addset
26061
be8a4e0800d8 reachableroots: use baseset lazy sorting
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26020
diff changeset
  1014
    <baseset- [1, 3, 5]>,
25129
40a2cf1c765b revset: drop redundant filteredset from right-hand side set of "or" operation
Yuya Nishihara <yuya@tcha.org>
parents: 25105
diff changeset
  1015
    <generatorset+>>
25024
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1016
  5
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1017
  3
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1018
  1
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1019
  0
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1020
  2
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1021
  4
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1022
  $ try 'sort(ancestors(4) or reverse(1::5))'
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1023
  (func
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1024
    ('symbol', 'sort')
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1025
    (or
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1026
      (func
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1027
        ('symbol', 'ancestors')
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1028
        ('symbol', '4'))
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1029
      (func
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1030
        ('symbol', 'reverse')
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1031
        (dagrange
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1032
          ('symbol', '1')
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1033
          ('symbol', '5')))))
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1034
  * set:
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1035
  <addset+
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1036
    <generatorset+>,
26061
be8a4e0800d8 reachableroots: use baseset lazy sorting
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26020
diff changeset
  1037
    <baseset- [1, 3, 5]>>
25024
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1038
  0
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1039
  1
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1040
  2
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1041
  3
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1042
  4
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1043
  5
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  1044
25343
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1045
test optimization of trivial `or` operation
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1046
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1047
  $ try --optimize '0|(1)|"2"|-2|tip|null'
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1048
  (or
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1049
    ('symbol', '0')
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1050
    (group
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1051
      ('symbol', '1'))
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1052
    ('string', '2')
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1053
    (negate
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1054
      ('symbol', '2'))
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1055
    ('symbol', 'tip')
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1056
    ('symbol', 'null'))
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1057
  * optimized:
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1058
  (func
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1059
    ('symbol', '_list')
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1060
    ('string', '0\x001\x002\x00-2\x00tip\x00null'))
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1061
  * set:
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1062
  <baseset [0, 1, 2, 8, 9, -1]>
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1063
  0
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1064
  1
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1065
  2
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1066
  8
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1067
  9
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1068
  -1
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1069
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1070
  $ try --optimize '0|1|2:3'
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1071
  (or
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1072
    ('symbol', '0')
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1073
    ('symbol', '1')
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1074
    (range
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1075
      ('symbol', '2')
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1076
      ('symbol', '3')))
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1077
  * optimized:
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1078
  (or
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1079
    (func
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1080
      ('symbol', '_list')
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1081
      ('string', '0\x001'))
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1082
    (range
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1083
      ('symbol', '2')
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1084
      ('symbol', '3')))
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1085
  * set:
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1086
  <addset
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1087
    <baseset [0, 1]>,
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1088
    <spanset+ 2:3>>
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1089
  0
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1090
  1
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1091
  2
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1092
  3
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1093
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1094
  $ try --optimize '0:1|2|3:4|5|6'
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1095
  (or
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1096
    (range
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1097
      ('symbol', '0')
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1098
      ('symbol', '1'))
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1099
    ('symbol', '2')
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1100
    (range
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1101
      ('symbol', '3')
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1102
      ('symbol', '4'))
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1103
    ('symbol', '5')
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1104
    ('symbol', '6'))
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1105
  * optimized:
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1106
  (or
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1107
    (range
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1108
      ('symbol', '0')
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1109
      ('symbol', '1'))
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1110
    ('symbol', '2')
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1111
    (range
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1112
      ('symbol', '3')
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1113
      ('symbol', '4'))
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1114
    (func
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1115
      ('symbol', '_list')
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1116
      ('string', '5\x006')))
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1117
  * set:
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1118
  <addset
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1119
    <addset
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1120
      <spanset+ 0:1>,
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1121
      <baseset [2]>>,
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1122
    <addset
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1123
      <spanset+ 3:4>,
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1124
      <baseset [5, 6]>>>
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1125
  0
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1126
  1
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1127
  2
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1128
  3
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1129
  4
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1130
  5
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1131
  6
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1132
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1133
test that `_list` should be narrowed by provided `subset`
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1134
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1135
  $ log '0:2 and (null|1|2|3)'
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1136
  1
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1137
  2
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1138
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1139
test that `_list` should remove duplicates
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1140
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1141
  $ log '0|1|2|1|2|-1|tip'
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1142
  0
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1143
  1
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1144
  2
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1145
  9
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1146
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1147
test unknown revision in `_list`
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1148
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1149
  $ log '0|unknown'
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1150
  abort: unknown revision 'unknown'!
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1151
  [255]
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1152
25344
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  1153
test integer range in `_list`
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  1154
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  1155
  $ log '-1|-10'
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  1156
  9
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  1157
  0
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  1158
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  1159
  $ log '-10|-11'
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  1160
  abort: unknown revision '-11'!
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  1161
  [255]
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  1162
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  1163
  $ log '9|10'
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  1164
  abort: unknown revision '10'!
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  1165
  [255]
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  1166
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  1167
test '0000' != '0' in `_list`
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  1168
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  1169
  $ log '0|0000'
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  1170
  0
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  1171
  -1
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  1172
27517
c60a9c16ae25 revset: add hint for list error to use or
timeless <timeless@mozdev.org>
parents: 26638
diff changeset
  1173
test ',' in `_list`
c60a9c16ae25 revset: add hint for list error to use or
timeless <timeless@mozdev.org>
parents: 26638
diff changeset
  1174
  $ log '0,1'
c60a9c16ae25 revset: add hint for list error to use or
timeless <timeless@mozdev.org>
parents: 26638
diff changeset
  1175
  hg: parse error: can't use a list in this context
c60a9c16ae25 revset: add hint for list error to use or
timeless <timeless@mozdev.org>
parents: 26638
diff changeset
  1176
  (see hg help "revsets.x or y")
c60a9c16ae25 revset: add hint for list error to use or
timeless <timeless@mozdev.org>
parents: 26638
diff changeset
  1177
  [255]
27987
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  1178
  $ try '0,1,2'
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  1179
  (list
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  1180
    ('symbol', '0')
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  1181
    ('symbol', '1')
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  1182
    ('symbol', '2'))
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  1183
  hg: parse error: can't use a list in this context
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  1184
  (see hg help "revsets.x or y")
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  1185
  [255]
27517
c60a9c16ae25 revset: add hint for list error to use or
timeless <timeless@mozdev.org>
parents: 26638
diff changeset
  1186
25309
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1187
test that chained `or` operations make balanced addsets
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1188
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1189
  $ try '0:1|1:2|2:3|3:4|4:5'
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1190
  (or
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1191
    (range
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1192
      ('symbol', '0')
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1193
      ('symbol', '1'))
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1194
    (range
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1195
      ('symbol', '1')
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1196
      ('symbol', '2'))
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1197
    (range
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1198
      ('symbol', '2')
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1199
      ('symbol', '3'))
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1200
    (range
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1201
      ('symbol', '3')
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1202
      ('symbol', '4'))
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1203
    (range
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1204
      ('symbol', '4')
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1205
      ('symbol', '5')))
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1206
  * set:
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1207
  <addset
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1208
    <addset
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1209
      <spanset+ 0:1>,
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1210
      <spanset+ 1:2>>,
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1211
    <addset
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1212
      <spanset+ 2:3>,
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1213
      <addset
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1214
        <spanset+ 3:4>,
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1215
        <spanset+ 4:5>>>>
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1216
  0
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1217
  1
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1218
  2
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1219
  3
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1220
  4
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1221
  5
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1222
25996
b12e00a05d57 revset: prevent crash caused by empty group expression while optimizing "or"
Yuya Nishihara <yuya@tcha.org>
parents: 25995
diff changeset
  1223
no crash by empty group "()" while optimizing `or` operations
b12e00a05d57 revset: prevent crash caused by empty group expression while optimizing "or"
Yuya Nishihara <yuya@tcha.org>
parents: 25995
diff changeset
  1224
b12e00a05d57 revset: prevent crash caused by empty group expression while optimizing "or"
Yuya Nishihara <yuya@tcha.org>
parents: 25995
diff changeset
  1225
  $ try --optimize '0|()'
b12e00a05d57 revset: prevent crash caused by empty group expression while optimizing "or"
Yuya Nishihara <yuya@tcha.org>
parents: 25995
diff changeset
  1226
  (or
b12e00a05d57 revset: prevent crash caused by empty group expression while optimizing "or"
Yuya Nishihara <yuya@tcha.org>
parents: 25995
diff changeset
  1227
    ('symbol', '0')
b12e00a05d57 revset: prevent crash caused by empty group expression while optimizing "or"
Yuya Nishihara <yuya@tcha.org>
parents: 25995
diff changeset
  1228
    (group
b12e00a05d57 revset: prevent crash caused by empty group expression while optimizing "or"
Yuya Nishihara <yuya@tcha.org>
parents: 25995
diff changeset
  1229
      None))
b12e00a05d57 revset: prevent crash caused by empty group expression while optimizing "or"
Yuya Nishihara <yuya@tcha.org>
parents: 25995
diff changeset
  1230
  * optimized:
b12e00a05d57 revset: prevent crash caused by empty group expression while optimizing "or"
Yuya Nishihara <yuya@tcha.org>
parents: 25995
diff changeset
  1231
  (or
b12e00a05d57 revset: prevent crash caused by empty group expression while optimizing "or"
Yuya Nishihara <yuya@tcha.org>
parents: 25995
diff changeset
  1232
    ('symbol', '0')
b12e00a05d57 revset: prevent crash caused by empty group expression while optimizing "or"
Yuya Nishihara <yuya@tcha.org>
parents: 25995
diff changeset
  1233
    None)
b12e00a05d57 revset: prevent crash caused by empty group expression while optimizing "or"
Yuya Nishihara <yuya@tcha.org>
parents: 25995
diff changeset
  1234
  hg: parse error: missing argument
b12e00a05d57 revset: prevent crash caused by empty group expression while optimizing "or"
Yuya Nishihara <yuya@tcha.org>
parents: 25995
diff changeset
  1235
  [255]
b12e00a05d57 revset: prevent crash caused by empty group expression while optimizing "or"
Yuya Nishihara <yuya@tcha.org>
parents: 25995
diff changeset
  1236
25309
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1237
test that chained `or` operations never eat up stack (issue4624)
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1238
(uses `0:1` instead of `0` to avoid future optimization of trivial revisions)
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1239
27991
5daf1a8c5f1d tests: avoid nested quoting on command line for portability
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27623
diff changeset
  1240
  $ hg log -T '{rev}\n' -r `python -c "print '+'.join(['0:1'] * 500)"`
25309
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1241
  0
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1242
  1
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1243
25385
a26a55406c0a revrange: build balanced tree of addsets from revisions (issue4565)
Yuya Nishihara <yuya@tcha.org>
parents: 25383
diff changeset
  1244
test that repeated `-r` options never eat up stack (issue4565)
a26a55406c0a revrange: build balanced tree of addsets from revisions (issue4565)
Yuya Nishihara <yuya@tcha.org>
parents: 25383
diff changeset
  1245
(uses `-r 0::1` to avoid possible optimization at old-style parser)
a26a55406c0a revrange: build balanced tree of addsets from revisions (issue4565)
Yuya Nishihara <yuya@tcha.org>
parents: 25383
diff changeset
  1246
a26a55406c0a revrange: build balanced tree of addsets from revisions (issue4565)
Yuya Nishihara <yuya@tcha.org>
parents: 25383
diff changeset
  1247
  $ hg log -T '{rev}\n' `python -c "for i in xrange(500): print '-r 0::1 ',"`
a26a55406c0a revrange: build balanced tree of addsets from revisions (issue4565)
Yuya Nishihara <yuya@tcha.org>
parents: 25383
diff changeset
  1248
  0
a26a55406c0a revrange: build balanced tree of addsets from revisions (issue4565)
Yuya Nishihara <yuya@tcha.org>
parents: 25383
diff changeset
  1249
  1
a26a55406c0a revrange: build balanced tree of addsets from revisions (issue4565)
Yuya Nishihara <yuya@tcha.org>
parents: 25383
diff changeset
  1250
21893
e967c3b08705 revset: replace _missingancestors optimization with only revset
Siddharth Agarwal <sid0@fb.com>
parents: 21870
diff changeset
  1251
check that conversion to only works
20499
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1252
  $ try --optimize '::3 - ::1'
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1253
  (minus
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1254
    (dagrangepre
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1255
      ('symbol', '3'))
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1256
    (dagrangepre
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1257
      ('symbol', '1')))
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1258
  * optimized:
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1259
  (func
21893
e967c3b08705 revset: replace _missingancestors optimization with only revset
Siddharth Agarwal <sid0@fb.com>
parents: 21870
diff changeset
  1260
    ('symbol', 'only')
20499
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1261
    (list
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1262
      ('symbol', '3')
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1263
      ('symbol', '1')))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1264
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1265
  <baseset+ [3]>
20499
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1266
  3
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1267
  $ try --optimize 'ancestors(1) - ancestors(3)'
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1268
  (minus
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1269
    (func
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1270
      ('symbol', 'ancestors')
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1271
      ('symbol', '1'))
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1272
    (func
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1273
      ('symbol', 'ancestors')
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1274
      ('symbol', '3')))
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1275
  * optimized:
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1276
  (func
21893
e967c3b08705 revset: replace _missingancestors optimization with only revset
Siddharth Agarwal <sid0@fb.com>
parents: 21870
diff changeset
  1277
    ('symbol', 'only')
20499
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1278
    (list
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1279
      ('symbol', '1')
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1280
      ('symbol', '3')))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1281
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1282
  <baseset+ []>
20499
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1283
  $ try --optimize 'not ::2 and ::6'
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1284
  (and
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1285
    (not
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1286
      (dagrangepre
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1287
        ('symbol', '2')))
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1288
    (dagrangepre
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1289
      ('symbol', '6')))
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1290
  * optimized:
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1291
  (func
21893
e967c3b08705 revset: replace _missingancestors optimization with only revset
Siddharth Agarwal <sid0@fb.com>
parents: 21870
diff changeset
  1292
    ('symbol', 'only')
20499
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1293
    (list
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1294
      ('symbol', '6')
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1295
      ('symbol', '2')))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1296
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1297
  <baseset+ [3, 4, 5, 6]>
20499
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1298
  3
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1299
  4
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1300
  5
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1301
  6
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1302
  $ try --optimize 'ancestors(6) and not ancestors(4)'
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1303
  (and
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1304
    (func
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1305
      ('symbol', 'ancestors')
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1306
      ('symbol', '6'))
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1307
    (not
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1308
      (func
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1309
        ('symbol', 'ancestors')
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1310
        ('symbol', '4'))))
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1311
  * optimized:
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1312
  (func
21893
e967c3b08705 revset: replace _missingancestors optimization with only revset
Siddharth Agarwal <sid0@fb.com>
parents: 21870
diff changeset
  1313
    ('symbol', 'only')
20499
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1314
    (list
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1315
      ('symbol', '6')
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1316
      ('symbol', '4')))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1317
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1318
  <baseset+ [3, 5, 6]>
20499
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1319
  3
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1320
  5
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1321
  6
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  1322
25995
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  1323
no crash by empty group "()" while optimizing to "only()"
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  1324
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  1325
  $ try --optimize '::1 and ()'
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  1326
  (and
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  1327
    (dagrangepre
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  1328
      ('symbol', '1'))
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  1329
    (group
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  1330
      None))
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  1331
  * optimized:
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  1332
  (and
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  1333
    None
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  1334
    (func
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  1335
      ('symbol', 'ancestors')
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  1336
      ('symbol', '1')))
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  1337
  hg: parse error: missing argument
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  1338
  [255]
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  1339
16820
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
  1340
we can use patterns when searching for tags
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
  1341
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
  1342
  $ log 'tag("1..*")'
23978
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23956
diff changeset
  1343
  abort: tag '1..*' does not exist!
16820
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
  1344
  [255]
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
  1345
  $ log 'tag("re:1..*")'
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
  1346
  6
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
  1347
  $ log 'tag("re:[0-9].[0-9]")'
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
  1348
  6
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
  1349
  $ log 'tag("literal:1.0")'
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
  1350
  6
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
  1351
  $ log 'tag("re:0..*")'
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
  1352
13925
c315ffc13a25 tests: add tests for non-existant branch/tag/bookmark
Idan Kamara <idankk86@gmail.com>
parents: 13665
diff changeset
  1353
  $ log 'tag(unknown)'
23978
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23956
diff changeset
  1354
  abort: tag 'unknown' does not exist!
13925
c315ffc13a25 tests: add tests for non-existant branch/tag/bookmark
Idan Kamara <idankk86@gmail.com>
parents: 13665
diff changeset
  1355
  [255]
23978
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23956
diff changeset
  1356
  $ log 'tag("re:unknown")'
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23956
diff changeset
  1357
  $ log 'present(tag("unknown"))'
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23956
diff changeset
  1358
  $ log 'present(tag("re:unknown"))'
13925
c315ffc13a25 tests: add tests for non-existant branch/tag/bookmark
Idan Kamara <idankk86@gmail.com>
parents: 13665
diff changeset
  1359
  $ log 'branch(unknown)'
c315ffc13a25 tests: add tests for non-existant branch/tag/bookmark
Idan Kamara <idankk86@gmail.com>
parents: 13665
diff changeset
  1360
  abort: unknown revision 'unknown'!
c315ffc13a25 tests: add tests for non-existant branch/tag/bookmark
Idan Kamara <idankk86@gmail.com>
parents: 13665
diff changeset
  1361
  [255]
26537
832feae7c986 revset: do not fall through to revspec for literal: branch (issue4838)
Yuya Nishihara <yuya@tcha.org>
parents: 26232
diff changeset
  1362
  $ log 'branch("literal:unknown")'
832feae7c986 revset: do not fall through to revspec for literal: branch (issue4838)
Yuya Nishihara <yuya@tcha.org>
parents: 26232
diff changeset
  1363
  abort: branch 'unknown' does not exist!
832feae7c986 revset: do not fall through to revspec for literal: branch (issue4838)
Yuya Nishihara <yuya@tcha.org>
parents: 26232
diff changeset
  1364
  [255]
23978
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23956
diff changeset
  1365
  $ log 'branch("re:unknown")'
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23956
diff changeset
  1366
  $ log 'present(branch("unknown"))'
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23956
diff changeset
  1367
  $ log 'present(branch("re:unknown"))'
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1368
  $ log 'user(bob)'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1369
  2
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
  1370
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1371
  $ log '4::8'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1372
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1373
  8
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1374
  $ log '4:8'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1375
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1376
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1377
  6
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1378
  7
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1379
  8
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
  1380
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1381
  $ log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1382
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1383
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1384
  5
11456
88abbb046e66 revset: deal with empty sets in range endpoints
Matt Mackall <mpm@selenic.com>
parents: 11419
diff changeset
  1385
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1386
  $ log 'not 0 and 0:2'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1387
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1388
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1389
  $ log 'not 1 and 0:2'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1390
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1391
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1392
  $ log 'not 2 and 0:2'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1393
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1394
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1395
  $ log '(1 and 2)::'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1396
  $ log '(1 and 2):'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1397
  $ log '(1 and 2):3'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1398
  $ log 'sort(head(), -rev)'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1399
  9
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1400
  7
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1401
  6
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1402
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1403
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1404
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1405
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1406
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1407
  0
12616
e797fdf91df4 revset: lower precedence of minus infix (issue2361)
Matt Mackall <mpm@selenic.com>
parents: 12408
diff changeset
  1408
  $ log '4::8 - 8'
e797fdf91df4 revset: lower precedence of minus infix (issue2361)
Matt Mackall <mpm@selenic.com>
parents: 12408
diff changeset
  1409
  4
16640
592e0beee8b0 revset: make matching() preserve input revision order
Patrick Mezard <patrick@mezard.eu>
parents: 16521
diff changeset
  1410
  $ log 'matching(1 or 2 or 3) and (2 or 3 or 1)'
592e0beee8b0 revset: make matching() preserve input revision order
Patrick Mezard <patrick@mezard.eu>
parents: 16521
diff changeset
  1411
  2
592e0beee8b0 revset: make matching() preserve input revision order
Patrick Mezard <patrick@mezard.eu>
parents: 16521
diff changeset
  1412
  3
592e0beee8b0 revset: make matching() preserve input revision order
Patrick Mezard <patrick@mezard.eu>
parents: 16521
diff changeset
  1413
  1
12786
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  1414
23978
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23956
diff changeset
  1415
  $ log 'named("unknown")'
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23956
diff changeset
  1416
  abort: namespace 'unknown' does not exist!
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23956
diff changeset
  1417
  [255]
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23956
diff changeset
  1418
  $ log 'named("re:unknown")'
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23956
diff changeset
  1419
  abort: no namespace exists that match 'unknown'!
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23956
diff changeset
  1420
  [255]
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23956
diff changeset
  1421
  $ log 'present(named("unknown"))'
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23956
diff changeset
  1422
  $ log 'present(named("re:unknown"))'
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23956
diff changeset
  1423
24008
873eb5db89c8 revset: get revision number of each node from target namespaces
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  1424
  $ log 'tag()'
873eb5db89c8 revset: get revision number of each node from target namespaces
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  1425
  6
873eb5db89c8 revset: get revision number of each node from target namespaces
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  1426
  $ log 'named("tags")'
873eb5db89c8 revset: get revision number of each node from target namespaces
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  1427
  6
873eb5db89c8 revset: get revision number of each node from target namespaces
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  1428
12786
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  1429
issue2437
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  1430
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  1431
  $ log '3 and p1(5)'
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  1432
  3
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  1433
  $ log '4 and p2(6)'
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  1434
  4
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  1435
  $ log '1 and parents(:2)'
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  1436
  1
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  1437
  $ log '2 and children(1:)'
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  1438
  2
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  1439
  $ log 'roots(all()) or roots(all())'
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  1440
  0
16394
f3df7d34791e revset: do not ignore input revisions in roots()
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1441
  $ hg debugrevspec 'roots(all()) or roots(all())'
f3df7d34791e revset: do not ignore input revisions in roots()
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1442
  0
12786
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  1443
  $ log 'heads(branch(é)) or heads(branch(é))'
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  1444
  9
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  1445
  $ log 'ancestors(8) and (heads(branch("-a-b-c-")) or heads(branch(é)))'
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  1446
  4
13665
e798e430c5e5 revset: report a parse error if a revset is not parsed completely (issue2654)
Bernhard Leiner <bleiner@gmail.com>
parents: 12942
diff changeset
  1447
e798e430c5e5 revset: report a parse error if a revset is not parsed completely (issue2654)
Bernhard Leiner <bleiner@gmail.com>
parents: 12942
diff changeset
  1448
issue2654: report a parse error if the revset was not completely parsed
e798e430c5e5 revset: report a parse error if a revset is not parsed completely (issue2654)
Bernhard Leiner <bleiner@gmail.com>
parents: 12942
diff changeset
  1449
e798e430c5e5 revset: report a parse error if a revset is not parsed completely (issue2654)
Bernhard Leiner <bleiner@gmail.com>
parents: 12942
diff changeset
  1450
  $ log '1 OR 2'
e798e430c5e5 revset: report a parse error if a revset is not parsed completely (issue2654)
Bernhard Leiner <bleiner@gmail.com>
parents: 12942
diff changeset
  1451
  hg: parse error at 2: invalid token
e798e430c5e5 revset: report a parse error if a revset is not parsed completely (issue2654)
Bernhard Leiner <bleiner@gmail.com>
parents: 12942
diff changeset
  1452
  [255]
e798e430c5e5 revset: report a parse error if a revset is not parsed completely (issue2654)
Bernhard Leiner <bleiner@gmail.com>
parents: 12942
diff changeset
  1453
13932
34f577007ffe revsets: preserve ordering with the or operator
Augie Fackler <durin42@gmail.com>
parents: 13925
diff changeset
  1454
or operator should preserve ordering:
34f577007ffe revsets: preserve ordering with the or operator
Augie Fackler <durin42@gmail.com>
parents: 13925
diff changeset
  1455
  $ log 'reverse(2::4) or tip'
34f577007ffe revsets: preserve ordering with the or operator
Augie Fackler <durin42@gmail.com>
parents: 13925
diff changeset
  1456
  4
34f577007ffe revsets: preserve ordering with the or operator
Augie Fackler <durin42@gmail.com>
parents: 13925
diff changeset
  1457
  2
34f577007ffe revsets: preserve ordering with the or operator
Augie Fackler <durin42@gmail.com>
parents: 13925
diff changeset
  1458
  9
14070
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1459
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1460
parentrevspec
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1461
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1462
  $ log 'merge()^0'
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1463
  6
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1464
  $ log 'merge()^'
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1465
  5
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1466
  $ log 'merge()^1'
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1467
  5
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1468
  $ log 'merge()^2'
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1469
  4
14080
debe5083a84e revset: add tests for multiple and mixed ^ and ~ operators
Kevin Gessner <kevin@kevingessner.com>
parents: 14070
diff changeset
  1470
  $ log 'merge()^^'
debe5083a84e revset: add tests for multiple and mixed ^ and ~ operators
Kevin Gessner <kevin@kevingessner.com>
parents: 14070
diff changeset
  1471
  3
debe5083a84e revset: add tests for multiple and mixed ^ and ~ operators
Kevin Gessner <kevin@kevingessner.com>
parents: 14070
diff changeset
  1472
  $ log 'merge()^1^'
debe5083a84e revset: add tests for multiple and mixed ^ and ~ operators
Kevin Gessner <kevin@kevingessner.com>
parents: 14070
diff changeset
  1473
  3
debe5083a84e revset: add tests for multiple and mixed ^ and ~ operators
Kevin Gessner <kevin@kevingessner.com>
parents: 14070
diff changeset
  1474
  $ log 'merge()^^^'
debe5083a84e revset: add tests for multiple and mixed ^ and ~ operators
Kevin Gessner <kevin@kevingessner.com>
parents: 14070
diff changeset
  1475
  1
14070
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1476
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1477
  $ log 'merge()~0'
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1478
  6
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1479
  $ log 'merge()~1'
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1480
  5
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1481
  $ log 'merge()~2'
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1482
  3
14080
debe5083a84e revset: add tests for multiple and mixed ^ and ~ operators
Kevin Gessner <kevin@kevingessner.com>
parents: 14070
diff changeset
  1483
  $ log 'merge()~2^1'
debe5083a84e revset: add tests for multiple and mixed ^ and ~ operators
Kevin Gessner <kevin@kevingessner.com>
parents: 14070
diff changeset
  1484
  1
14070
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1485
  $ log 'merge()~3'
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1486
  1
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1487
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1488
  $ log '(-3:tip)^'
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1489
  4
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1490
  6
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1491
  8
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1492
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1493
  $ log 'tip^foo'
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1494
  hg: parse error: ^ expects a number 0, 1, or 2
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  1495
  [255]
14098
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  1496
24220
fe195d41f7d2 test-revset: add tests for missing function output
Augie Fackler <augie@google.com>
parents: 24204
diff changeset
  1497
Bogus function gets suggestions
fe195d41f7d2 test-revset: add tests for missing function output
Augie Fackler <augie@google.com>
parents: 24204
diff changeset
  1498
  $ log 'add()'
24222
02d7b5cd373b dispatch: offer suggestions of similar-named commands
Augie Fackler <augie@google.com>
parents: 24221
diff changeset
  1499
  hg: parse error: unknown identifier: add
27623
b3376fba4ab9 dispatch: report similar names consistently
Bryan O'Sullivan <bos@serpentine.com>
parents: 27586
diff changeset
  1500
  (did you mean adds?)
24220
fe195d41f7d2 test-revset: add tests for missing function output
Augie Fackler <augie@google.com>
parents: 24204
diff changeset
  1501
  [255]
fe195d41f7d2 test-revset: add tests for missing function output
Augie Fackler <augie@google.com>
parents: 24204
diff changeset
  1502
  $ log 'added()'
24222
02d7b5cd373b dispatch: offer suggestions of similar-named commands
Augie Fackler <augie@google.com>
parents: 24221
diff changeset
  1503
  hg: parse error: unknown identifier: added
27623
b3376fba4ab9 dispatch: report similar names consistently
Bryan O'Sullivan <bos@serpentine.com>
parents: 27586
diff changeset
  1504
  (did you mean adds?)
24220
fe195d41f7d2 test-revset: add tests for missing function output
Augie Fackler <augie@google.com>
parents: 24204
diff changeset
  1505
  [255]
fe195d41f7d2 test-revset: add tests for missing function output
Augie Fackler <augie@google.com>
parents: 24204
diff changeset
  1506
  $ log 'remo()'
24222
02d7b5cd373b dispatch: offer suggestions of similar-named commands
Augie Fackler <augie@google.com>
parents: 24221
diff changeset
  1507
  hg: parse error: unknown identifier: remo
24221
4e240d6ab898 dispatch: offer near-edit-distance suggestions for {file,rev}set functions
Augie Fackler <augie@google.com>
parents: 24220
diff changeset
  1508
  (did you mean one of remote, removes?)
24220
fe195d41f7d2 test-revset: add tests for missing function output
Augie Fackler <augie@google.com>
parents: 24204
diff changeset
  1509
  [255]
fe195d41f7d2 test-revset: add tests for missing function output
Augie Fackler <augie@google.com>
parents: 24204
diff changeset
  1510
  $ log 'babar()'
24222
02d7b5cd373b dispatch: offer suggestions of similar-named commands
Augie Fackler <augie@google.com>
parents: 24221
diff changeset
  1511
  hg: parse error: unknown identifier: babar
24220
fe195d41f7d2 test-revset: add tests for missing function output
Augie Fackler <augie@google.com>
parents: 24204
diff changeset
  1512
  [255]
fe195d41f7d2 test-revset: add tests for missing function output
Augie Fackler <augie@google.com>
parents: 24204
diff changeset
  1513
25632
015c0d1087a3 revset: don't suggest private or undocumented queries
Matt Harbison <matt_harbison@yahoo.com>
parents: 25385
diff changeset
  1514
Bogus function with a similar internal name doesn't suggest the internal name
015c0d1087a3 revset: don't suggest private or undocumented queries
Matt Harbison <matt_harbison@yahoo.com>
parents: 25385
diff changeset
  1515
  $ log 'matches()'
015c0d1087a3 revset: don't suggest private or undocumented queries
Matt Harbison <matt_harbison@yahoo.com>
parents: 25385
diff changeset
  1516
  hg: parse error: unknown identifier: matches
27623
b3376fba4ab9 dispatch: report similar names consistently
Bryan O'Sullivan <bos@serpentine.com>
parents: 27586
diff changeset
  1517
  (did you mean matching?)
25632
015c0d1087a3 revset: don't suggest private or undocumented queries
Matt Harbison <matt_harbison@yahoo.com>
parents: 25385
diff changeset
  1518
  [255]
015c0d1087a3 revset: don't suggest private or undocumented queries
Matt Harbison <matt_harbison@yahoo.com>
parents: 25385
diff changeset
  1519
015c0d1087a3 revset: don't suggest private or undocumented queries
Matt Harbison <matt_harbison@yahoo.com>
parents: 25385
diff changeset
  1520
Undocumented functions aren't suggested as similar either
015c0d1087a3 revset: don't suggest private or undocumented queries
Matt Harbison <matt_harbison@yahoo.com>
parents: 25385
diff changeset
  1521
  $ log 'wdir2()'
015c0d1087a3 revset: don't suggest private or undocumented queries
Matt Harbison <matt_harbison@yahoo.com>
parents: 25385
diff changeset
  1522
  hg: parse error: unknown identifier: wdir2
015c0d1087a3 revset: don't suggest private or undocumented queries
Matt Harbison <matt_harbison@yahoo.com>
parents: 25385
diff changeset
  1523
  [255]
015c0d1087a3 revset: don't suggest private or undocumented queries
Matt Harbison <matt_harbison@yahoo.com>
parents: 25385
diff changeset
  1524
20798
170d6d591a7d scmutil: fix revrange when multiple revs are specified
Durham Goode <durham@fb.com>
parents: 20781
diff changeset
  1525
multiple revspecs
170d6d591a7d scmutil: fix revrange when multiple revs are specified
Durham Goode <durham@fb.com>
parents: 20781
diff changeset
  1526
170d6d591a7d scmutil: fix revrange when multiple revs are specified
Durham Goode <durham@fb.com>
parents: 20781
diff changeset
  1527
  $ hg log -r 'tip~1:tip' -r 'tip~2:tip~1' --template '{rev}\n'
170d6d591a7d scmutil: fix revrange when multiple revs are specified
Durham Goode <durham@fb.com>
parents: 20781
diff changeset
  1528
  8
170d6d591a7d scmutil: fix revrange when multiple revs are specified
Durham Goode <durham@fb.com>
parents: 20781
diff changeset
  1529
  9
170d6d591a7d scmutil: fix revrange when multiple revs are specified
Durham Goode <durham@fb.com>
parents: 20781
diff changeset
  1530
  4
170d6d591a7d scmutil: fix revrange when multiple revs are specified
Durham Goode <durham@fb.com>
parents: 20781
diff changeset
  1531
  5
170d6d591a7d scmutil: fix revrange when multiple revs are specified
Durham Goode <durham@fb.com>
parents: 20781
diff changeset
  1532
  6
170d6d591a7d scmutil: fix revrange when multiple revs are specified
Durham Goode <durham@fb.com>
parents: 20781
diff changeset
  1533
  7
170d6d591a7d scmutil: fix revrange when multiple revs are specified
Durham Goode <durham@fb.com>
parents: 20781
diff changeset
  1534
20862
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1535
test usage in revpair (with "+")
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1536
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1537
(real pair)
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1538
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1539
  $ hg diff -r 'tip^^' -r 'tip'
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1540
  diff -r 2326846efdab -r 24286f4ae135 .hgtags
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1541
  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1542
  +++ b/.hgtags	Thu Jan 01 00:00:00 1970 +0000
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1543
  @@ -0,0 +1,1 @@
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1544
  +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1545
  $ hg diff -r 'tip^^::tip'
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1546
  diff -r 2326846efdab -r 24286f4ae135 .hgtags
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1547
  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1548
  +++ b/.hgtags	Thu Jan 01 00:00:00 1970 +0000
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1549
  @@ -0,0 +1,1 @@
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1550
  +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1551
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1552
(single rev)
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1553
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1554
  $ hg diff -r 'tip^' -r 'tip^'
26020
cc3a30ff9490 revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents: 25998
diff changeset
  1555
  $ hg diff -r 'tip^:tip^'
20862
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1556
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1557
(single rev that does not looks like a range)
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1558
26020
cc3a30ff9490 revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents: 25998
diff changeset
  1559
  $ hg diff -r 'tip^::tip^ or tip^'
cc3a30ff9490 revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents: 25998
diff changeset
  1560
  diff -r d5d0dcbdc4d9 .hgtags
cc3a30ff9490 revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents: 25998
diff changeset
  1561
  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
cc3a30ff9490 revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents: 25998
diff changeset
  1562
  +++ b/.hgtags	* (glob)
cc3a30ff9490 revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents: 25998
diff changeset
  1563
  @@ -0,0 +1,1 @@
cc3a30ff9490 revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents: 25998
diff changeset
  1564
  +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
20862
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1565
  $ hg diff -r 'tip^ or tip^'
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1566
  diff -r d5d0dcbdc4d9 .hgtags
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1567
  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1568
  +++ b/.hgtags	* (glob)
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1569
  @@ -0,0 +1,1 @@
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1570
  +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1571
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1572
(no rev)
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1573
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1574
  $ hg diff -r 'author("babar") or author("celeste")'
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1575
  abort: empty revision range
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1576
  [255]
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  1577
14098
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  1578
aliases:
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  1579
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  1580
  $ echo '[revsetalias]' >> .hg/hgrc
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  1581
  $ echo 'm = merge()' >> .hg/hgrc
24883
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1582
(revset aliases can override builtin revsets)
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1583
  $ echo 'p2($1) = p1($1)' >> .hg/hgrc
16096
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1584
  $ echo 'sincem = descendants(m)' >> .hg/hgrc
14098
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  1585
  $ echo 'd($1) = reverse(sort($1, date))' >> .hg/hgrc
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  1586
  $ echo 'rs(ARG1, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc
14723
b9faf94ee196 revset: fix aliases with 0 or more than 2 parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 14650
diff changeset
  1587
  $ echo 'rs4(ARG1, ARGA, ARGB, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc
14098
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  1588
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  1589
  $ try m
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  1590
  ('symbol', 'm')
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1591
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1592
    ('symbol', 'merge')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1593
    None)
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1594
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1595
  <filteredset
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1596
    <fullreposet+ 0:9>>
14098
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  1597
  6
16096
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1598
24892
8cc6036bca53 tests: make tests with temporary environment setting portable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24883
diff changeset
  1599
  $ HGPLAIN=1
8cc6036bca53 tests: make tests with temporary environment setting portable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24883
diff changeset
  1600
  $ export HGPLAIN
8cc6036bca53 tests: make tests with temporary environment setting portable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24883
diff changeset
  1601
  $ try m
24883
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1602
  ('symbol', 'm')
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1603
  abort: unknown revision 'm'!
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1604
  [255]
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1605
24892
8cc6036bca53 tests: make tests with temporary environment setting portable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24883
diff changeset
  1606
  $ HGPLAINEXCEPT=revsetalias
8cc6036bca53 tests: make tests with temporary environment setting portable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24883
diff changeset
  1607
  $ export HGPLAINEXCEPT
8cc6036bca53 tests: make tests with temporary environment setting portable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24883
diff changeset
  1608
  $ try m
24883
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1609
  ('symbol', 'm')
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1610
  (func
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1611
    ('symbol', 'merge')
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1612
    None)
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1613
  * set:
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1614
  <filteredset
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1615
    <fullreposet+ 0:9>>
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1616
  6
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1617
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1618
  $ unset HGPLAIN
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1619
  $ unset HGPLAINEXCEPT
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1620
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1621
  $ try 'p2(.)'
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1622
  (func
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1623
    ('symbol', 'p2')
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1624
    ('symbol', '.'))
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1625
  (func
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1626
    ('symbol', 'p1')
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1627
    ('symbol', '.'))
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1628
  * set:
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1629
  <baseset+ [8]>
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1630
  8
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1631
24892
8cc6036bca53 tests: make tests with temporary environment setting portable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24883
diff changeset
  1632
  $ HGPLAIN=1
8cc6036bca53 tests: make tests with temporary environment setting portable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24883
diff changeset
  1633
  $ export HGPLAIN
8cc6036bca53 tests: make tests with temporary environment setting portable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24883
diff changeset
  1634
  $ try 'p2(.)'
24883
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1635
  (func
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1636
    ('symbol', 'p2')
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1637
    ('symbol', '.'))
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1638
  * set:
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1639
  <baseset+ []>
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1640
24892
8cc6036bca53 tests: make tests with temporary environment setting portable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24883
diff changeset
  1641
  $ HGPLAINEXCEPT=revsetalias
8cc6036bca53 tests: make tests with temporary environment setting portable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24883
diff changeset
  1642
  $ export HGPLAINEXCEPT
8cc6036bca53 tests: make tests with temporary environment setting portable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24883
diff changeset
  1643
  $ try 'p2(.)'
24883
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1644
  (func
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1645
    ('symbol', 'p2')
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1646
    ('symbol', '.'))
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1647
  (func
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1648
    ('symbol', 'p1')
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1649
    ('symbol', '.'))
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1650
  * set:
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1651
  <baseset+ [8]>
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1652
  8
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1653
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1654
  $ unset HGPLAIN
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1655
  $ unset HGPLAINEXCEPT
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  1656
16096
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1657
test alias recursion
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1658
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1659
  $ try sincem
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1660
  ('symbol', 'sincem')
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1661
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1662
    ('symbol', 'descendants')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1663
    (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1664
      ('symbol', 'merge')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1665
      None))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1666
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1667
  <addset+
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1668
    <filteredset
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1669
      <fullreposet+ 0:9>>,
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1670
    <generatorset+>>
14098
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  1671
  6
16096
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1672
  7
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1673
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1674
test infinite recursion
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1675
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1676
  $ echo 'recurse1 = recurse2' >> .hg/hgrc
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1677
  $ echo 'recurse2 = recurse1' >> .hg/hgrc
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1678
  $ try recurse1
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1679
  ('symbol', 'recurse1')
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1680
  hg: parse error: infinite expansion of revset alias "recurse1" detected
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1681
  [255]
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1682
16772
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  1683
  $ echo 'level1($1, $2) = $1 or $2' >> .hg/hgrc
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  1684
  $ echo 'level2($1, $2) = level1($2, $1)' >> .hg/hgrc
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  1685
  $ try "level2(level1(1, 2), 3)"
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  1686
  (func
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  1687
    ('symbol', 'level2')
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  1688
    (list
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  1689
      (func
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  1690
        ('symbol', 'level1')
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  1691
        (list
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  1692
          ('symbol', '1')
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  1693
          ('symbol', '2')))
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  1694
      ('symbol', '3')))
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  1695
  (or
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  1696
    ('symbol', '3')
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  1697
    (or
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  1698
      ('symbol', '1')
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  1699
      ('symbol', '2')))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1700
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1701
  <addset
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1702
    <baseset [3]>,
25343
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  1703
    <baseset [1, 2]>>
16772
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  1704
  3
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  1705
  1
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  1706
  2
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  1707
16096
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1708
test nesting and variable passing
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1709
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1710
  $ echo 'nested($1) = nested2($1)' >> .hg/hgrc
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1711
  $ echo 'nested2($1) = nested3($1)' >> .hg/hgrc
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1712
  $ echo 'nested3($1) = max($1)' >> .hg/hgrc
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1713
  $ try 'nested(2:5)'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1714
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1715
    ('symbol', 'nested')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1716
    (range
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1717
      ('symbol', '2')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1718
      ('symbol', '5')))
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1719
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1720
    ('symbol', 'max')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1721
    (range
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1722
      ('symbol', '2')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1723
      ('symbol', '5')))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1724
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1725
  <baseset [5]>
16096
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1726
  5
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1727
25309
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1728
test chained `or` operations are flattened at parsing phase
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1729
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1730
  $ echo 'chainedorops($1, $2, $3) = $1|$2|$3' >> .hg/hgrc
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1731
  $ try 'chainedorops(0:1, 1:2, 2:3)'
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1732
  (func
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1733
    ('symbol', 'chainedorops')
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1734
    (list
27987
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  1735
      (range
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  1736
        ('symbol', '0')
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  1737
        ('symbol', '1'))
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  1738
      (range
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  1739
        ('symbol', '1')
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  1740
        ('symbol', '2'))
25309
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1741
      (range
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1742
        ('symbol', '2')
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1743
        ('symbol', '3'))))
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1744
  (or
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1745
    (range
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1746
      ('symbol', '0')
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1747
      ('symbol', '1'))
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1748
    (range
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1749
      ('symbol', '1')
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1750
      ('symbol', '2'))
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1751
    (range
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1752
      ('symbol', '2')
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1753
      ('symbol', '3')))
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1754
  * set:
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1755
  <addset
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1756
    <spanset+ 0:1>,
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1757
    <addset
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1758
      <spanset+ 1:2>,
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1759
      <spanset+ 2:3>>>
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1760
  0
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1761
  1
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1762
  2
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1763
  3
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  1764
16096
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1765
test variable isolation, variable placeholders are rewritten as string
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1766
then parsed and matched again as string. Check they do not leak too
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1767
far away.
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1768
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1769
  $ echo 'injectparamasstring = max("$1")' >> .hg/hgrc
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1770
  $ echo 'callinjection($1) = descendants(injectparamasstring)' >> .hg/hgrc
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1771
  $ try 'callinjection(2:5)'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1772
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1773
    ('symbol', 'callinjection')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1774
    (range
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1775
      ('symbol', '2')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1776
      ('symbol', '5')))
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1777
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1778
    ('symbol', 'descendants')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1779
    (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1780
      ('symbol', 'max')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1781
      ('string', '$1')))
16096
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1782
  abort: unknown revision '$1'!
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1783
  [255]
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  1784
16771
2f3317d53d51 revset: explicitely tag alias arguments for expansion
Patrick Mezard <patrick@mezard.eu>
parents: 16640
diff changeset
  1785
  $ echo 'injectparamasstring2 = max(_aliasarg("$1"))' >> .hg/hgrc
2f3317d53d51 revset: explicitely tag alias arguments for expansion
Patrick Mezard <patrick@mezard.eu>
parents: 16640
diff changeset
  1786
  $ echo 'callinjection2($1) = descendants(injectparamasstring2)' >> .hg/hgrc
2f3317d53d51 revset: explicitely tag alias arguments for expansion
Patrick Mezard <patrick@mezard.eu>
parents: 16640
diff changeset
  1787
  $ try 'callinjection2(2:5)'
2f3317d53d51 revset: explicitely tag alias arguments for expansion
Patrick Mezard <patrick@mezard.eu>
parents: 16640
diff changeset
  1788
  (func
2f3317d53d51 revset: explicitely tag alias arguments for expansion
Patrick Mezard <patrick@mezard.eu>
parents: 16640
diff changeset
  1789
    ('symbol', 'callinjection2')
2f3317d53d51 revset: explicitely tag alias arguments for expansion
Patrick Mezard <patrick@mezard.eu>
parents: 16640
diff changeset
  1790
    (range
2f3317d53d51 revset: explicitely tag alias arguments for expansion
Patrick Mezard <patrick@mezard.eu>
parents: 16640
diff changeset
  1791
      ('symbol', '2')
2f3317d53d51 revset: explicitely tag alias arguments for expansion
Patrick Mezard <patrick@mezard.eu>
parents: 16640
diff changeset
  1792
      ('symbol', '5')))
24222
02d7b5cd373b dispatch: offer suggestions of similar-named commands
Augie Fackler <augie@google.com>
parents: 24221
diff changeset
  1793
  abort: failed to parse the definition of revset alias "injectparamasstring2": unknown identifier: _aliasarg
16771
2f3317d53d51 revset: explicitely tag alias arguments for expansion
Patrick Mezard <patrick@mezard.eu>
parents: 16640
diff changeset
  1794
  [255]
23725
6a81f88758aa revset: delay showing parse error for the revset alias until it is referred
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23062
diff changeset
  1795
  $ hg debugrevspec --debug --config revsetalias.anotherbadone='branch(' "tip"
6a81f88758aa revset: delay showing parse error for the revset alias until it is referred
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23062
diff changeset
  1796
  ('symbol', 'tip')
23844
ddf2172e901d revset: store full detail into revsetalias.error for error source distinction
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23833
diff changeset
  1797
  warning: failed to parse the definition of revset alias "anotherbadone": at 7: not a prefix: end
24222
02d7b5cd373b dispatch: offer suggestions of similar-named commands
Augie Fackler <augie@google.com>
parents: 24221
diff changeset
  1798
  warning: failed to parse the definition of revset alias "injectparamasstring2": unknown identifier: _aliasarg
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1799
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1800
  <baseset [9]>
23725
6a81f88758aa revset: delay showing parse error for the revset alias until it is referred
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23062
diff changeset
  1801
  9
16771
2f3317d53d51 revset: explicitely tag alias arguments for expansion
Patrick Mezard <patrick@mezard.eu>
parents: 16640
diff changeset
  1802
  >>> data = file('.hg/hgrc', 'rb').read()
2f3317d53d51 revset: explicitely tag alias arguments for expansion
Patrick Mezard <patrick@mezard.eu>
parents: 16640
diff changeset
  1803
  >>> file('.hg/hgrc', 'wb').write(data.replace('_aliasarg', ''))
2f3317d53d51 revset: explicitely tag alias arguments for expansion
Patrick Mezard <patrick@mezard.eu>
parents: 16640
diff changeset
  1804
23725
6a81f88758aa revset: delay showing parse error for the revset alias until it is referred
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23062
diff changeset
  1805
  $ try 'tip'
6a81f88758aa revset: delay showing parse error for the revset alias until it is referred
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23062
diff changeset
  1806
  ('symbol', 'tip')
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1807
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1808
  <baseset [9]>
23725
6a81f88758aa revset: delay showing parse error for the revset alias until it is referred
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23062
diff changeset
  1809
  9
23846
aac4a1a7920e revset: parse alias declaration strictly by _parsealiasdecl
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23844
diff changeset
  1810
aac4a1a7920e revset: parse alias declaration strictly by _parsealiasdecl
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23844
diff changeset
  1811
  $ hg debugrevspec --debug --config revsetalias.'bad name'='tip' "tip"
aac4a1a7920e revset: parse alias declaration strictly by _parsealiasdecl
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23844
diff changeset
  1812
  ('symbol', 'tip')
aac4a1a7920e revset: parse alias declaration strictly by _parsealiasdecl
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23844
diff changeset
  1813
  warning: failed to parse the declaration of revset alias "bad name": at 4: invalid token
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1814
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1815
  <baseset [9]>
23846
aac4a1a7920e revset: parse alias declaration strictly by _parsealiasdecl
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23844
diff changeset
  1816
  9
23994
8a2156780839 revset: replace parsing alias definition by _parsealiasdefn to parse strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  1817
  $ echo 'strictreplacing($1, $10) = $10 or desc("$1")' >> .hg/hgrc
8a2156780839 revset: replace parsing alias definition by _parsealiasdefn to parse strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  1818
  $ try 'strictreplacing("foo", tip)'
8a2156780839 revset: replace parsing alias definition by _parsealiasdefn to parse strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  1819
  (func
8a2156780839 revset: replace parsing alias definition by _parsealiasdefn to parse strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  1820
    ('symbol', 'strictreplacing')
8a2156780839 revset: replace parsing alias definition by _parsealiasdefn to parse strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  1821
    (list
8a2156780839 revset: replace parsing alias definition by _parsealiasdefn to parse strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  1822
      ('string', 'foo')
8a2156780839 revset: replace parsing alias definition by _parsealiasdefn to parse strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  1823
      ('symbol', 'tip')))
8a2156780839 revset: replace parsing alias definition by _parsealiasdefn to parse strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  1824
  (or
8a2156780839 revset: replace parsing alias definition by _parsealiasdefn to parse strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  1825
    ('symbol', 'tip')
8a2156780839 revset: replace parsing alias definition by _parsealiasdefn to parse strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  1826
    (func
8a2156780839 revset: replace parsing alias definition by _parsealiasdefn to parse strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  1827
      ('symbol', 'desc')
8a2156780839 revset: replace parsing alias definition by _parsealiasdefn to parse strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  1828
      ('string', '$1')))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1829
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1830
  <addset
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1831
    <baseset [9]>,
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1832
    <filteredset
25129
40a2cf1c765b revset: drop redundant filteredset from right-hand side set of "or" operation
Yuya Nishihara <yuya@tcha.org>
parents: 25105
diff changeset
  1833
      <fullreposet+ 0:9>>>
23994
8a2156780839 revset: replace parsing alias definition by _parsealiasdefn to parse strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  1834
  9
23846
aac4a1a7920e revset: parse alias declaration strictly by _parsealiasdecl
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23844
diff changeset
  1835
14098
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  1836
  $ try 'd(2:5)'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1837
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1838
    ('symbol', 'd')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1839
    (range
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1840
      ('symbol', '2')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1841
      ('symbol', '5')))
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1842
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1843
    ('symbol', 'reverse')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1844
    (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1845
      ('symbol', 'sort')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1846
      (list
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1847
        (range
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1848
          ('symbol', '2')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1849
          ('symbol', '5'))
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1850
        ('symbol', 'date'))))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1851
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1852
  <baseset [4, 5, 3, 2]>
14098
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  1853
  4
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  1854
  5
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  1855
  3
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  1856
  2
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  1857
  $ try 'rs(2 or 3, date)'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1858
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1859
    ('symbol', 'rs')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1860
    (list
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1861
      (or
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1862
        ('symbol', '2')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1863
        ('symbol', '3'))
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1864
      ('symbol', 'date')))
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1865
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1866
    ('symbol', 'reverse')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1867
    (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1868
      ('symbol', 'sort')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1869
      (list
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1870
        (or
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1871
          ('symbol', '2')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1872
          ('symbol', '3'))
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1873
        ('symbol', 'date'))))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1874
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1875
  <baseset [3, 2]>
14098
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  1876
  3
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  1877
  2
14723
b9faf94ee196 revset: fix aliases with 0 or more than 2 parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 14650
diff changeset
  1878
  $ try 'rs()'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1879
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1880
    ('symbol', 'rs')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1881
    None)
14723
b9faf94ee196 revset: fix aliases with 0 or more than 2 parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 14650
diff changeset
  1882
  hg: parse error: invalid number of arguments: 0
b9faf94ee196 revset: fix aliases with 0 or more than 2 parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 14650
diff changeset
  1883
  [255]
b9faf94ee196 revset: fix aliases with 0 or more than 2 parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 14650
diff changeset
  1884
  $ try 'rs(2)'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1885
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1886
    ('symbol', 'rs')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1887
    ('symbol', '2'))
14723
b9faf94ee196 revset: fix aliases with 0 or more than 2 parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 14650
diff changeset
  1888
  hg: parse error: invalid number of arguments: 1
b9faf94ee196 revset: fix aliases with 0 or more than 2 parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 14650
diff changeset
  1889
  [255]
b9faf94ee196 revset: fix aliases with 0 or more than 2 parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 14650
diff changeset
  1890
  $ try 'rs(2, data, 7)'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1891
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1892
    ('symbol', 'rs')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1893
    (list
27987
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  1894
      ('symbol', '2')
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  1895
      ('symbol', 'data')
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1896
      ('symbol', '7')))
14723
b9faf94ee196 revset: fix aliases with 0 or more than 2 parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 14650
diff changeset
  1897
  hg: parse error: invalid number of arguments: 3
b9faf94ee196 revset: fix aliases with 0 or more than 2 parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 14650
diff changeset
  1898
  [255]
b9faf94ee196 revset: fix aliases with 0 or more than 2 parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 14650
diff changeset
  1899
  $ try 'rs4(2 or 3, x, x, date)'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1900
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1901
    ('symbol', 'rs4')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1902
    (list
27987
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  1903
      (or
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  1904
        ('symbol', '2')
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  1905
        ('symbol', '3'))
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  1906
      ('symbol', 'x')
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  1907
      ('symbol', 'x')
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1908
      ('symbol', 'date')))
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1909
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1910
    ('symbol', 'reverse')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1911
    (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1912
      ('symbol', 'sort')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1913
      (list
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1914
        (or
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1915
          ('symbol', '2')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1916
          ('symbol', '3'))
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1917
        ('symbol', 'date'))))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1918
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1919
  <baseset [3, 2]>
14723
b9faf94ee196 revset: fix aliases with 0 or more than 2 parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 14650
diff changeset
  1920
  3
b9faf94ee196 revset: fix aliases with 0 or more than 2 parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 14650
diff changeset
  1921
  2
14153
f8047a059ca0 revset: avoid over-aggresive optimizations of non-filtering functions (issue2549)
Mads Kiilerich <mads@kiilerich.com>
parents: 14098
diff changeset
  1922
24175
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1923
issue4553: check that revset aliases override existing hash prefix
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1924
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1925
  $ hg log -qr e
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1926
  6:e0cc66ef77e8
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1927
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1928
  $ hg log -qr e --config revsetalias.e="all()"
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1929
  0:2785f51eece5
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1930
  1:d75937da8da0
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1931
  2:5ed5505e9f1c
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1932
  3:8528aa5637f2
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1933
  4:2326846efdab
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1934
  5:904fa392b941
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1935
  6:e0cc66ef77e8
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1936
  7:013af1973af4
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1937
  8:d5d0dcbdc4d9
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1938
  9:24286f4ae135
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1939
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1940
  $ hg log -qr e: --config revsetalias.e="0"
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1941
  0:2785f51eece5
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1942
  1:d75937da8da0
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1943
  2:5ed5505e9f1c
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1944
  3:8528aa5637f2
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1945
  4:2326846efdab
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1946
  5:904fa392b941
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1947
  6:e0cc66ef77e8
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1948
  7:013af1973af4
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1949
  8:d5d0dcbdc4d9
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1950
  9:24286f4ae135
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1951
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1952
  $ hg log -qr :e --config revsetalias.e="9"
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1953
  0:2785f51eece5
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1954
  1:d75937da8da0
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1955
  2:5ed5505e9f1c
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1956
  3:8528aa5637f2
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1957
  4:2326846efdab
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1958
  5:904fa392b941
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1959
  6:e0cc66ef77e8
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1960
  7:013af1973af4
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1961
  8:d5d0dcbdc4d9
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1962
  9:24286f4ae135
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1963
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1964
  $ hg log -qr e:
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1965
  6:e0cc66ef77e8
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1966
  7:013af1973af4
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1967
  8:d5d0dcbdc4d9
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1968
  9:24286f4ae135
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1969
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1970
  $ hg log -qr :e
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1971
  0:2785f51eece5
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1972
  1:d75937da8da0
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1973
  2:5ed5505e9f1c
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1974
  3:8528aa5637f2
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1975
  4:2326846efdab
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1976
  5:904fa392b941
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1977
  6:e0cc66ef77e8
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  1978
14153
f8047a059ca0 revset: avoid over-aggresive optimizations of non-filtering functions (issue2549)
Mads Kiilerich <mads@kiilerich.com>
parents: 14098
diff changeset
  1979
issue2549 - correct optimizations
f8047a059ca0 revset: avoid over-aggresive optimizations of non-filtering functions (issue2549)
Mads Kiilerich <mads@kiilerich.com>
parents: 14098
diff changeset
  1980
f8047a059ca0 revset: avoid over-aggresive optimizations of non-filtering functions (issue2549)
Mads Kiilerich <mads@kiilerich.com>
parents: 14098
diff changeset
  1981
  $ log 'limit(1 or 2 or 3, 2) and not 2'
f8047a059ca0 revset: avoid over-aggresive optimizations of non-filtering functions (issue2549)
Mads Kiilerich <mads@kiilerich.com>
parents: 14098
diff changeset
  1982
  1
f8047a059ca0 revset: avoid over-aggresive optimizations of non-filtering functions (issue2549)
Mads Kiilerich <mads@kiilerich.com>
parents: 14098
diff changeset
  1983
  $ log 'max(1 or 2) and not 2'
f8047a059ca0 revset: avoid over-aggresive optimizations of non-filtering functions (issue2549)
Mads Kiilerich <mads@kiilerich.com>
parents: 14098
diff changeset
  1984
  $ log 'min(1 or 2) and not 1'
f8047a059ca0 revset: avoid over-aggresive optimizations of non-filtering functions (issue2549)
Mads Kiilerich <mads@kiilerich.com>
parents: 14098
diff changeset
  1985
  $ log 'last(1 or 2, 1) and not 2'
15726
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  1986
21870
dd716807fd23 revset: maintain ordering when subtracting from a baseset (issue4289)
Matt Mackall <mpm@selenic.com>
parents: 21024
diff changeset
  1987
issue4289 - ordering of built-ins
dd716807fd23 revset: maintain ordering when subtracting from a baseset (issue4289)
Matt Mackall <mpm@selenic.com>
parents: 21024
diff changeset
  1988
  $ hg log -M -q -r 3:2
dd716807fd23 revset: maintain ordering when subtracting from a baseset (issue4289)
Matt Mackall <mpm@selenic.com>
parents: 21024
diff changeset
  1989
  3:8528aa5637f2
dd716807fd23 revset: maintain ordering when subtracting from a baseset (issue4289)
Matt Mackall <mpm@selenic.com>
parents: 21024
diff changeset
  1990
  2:5ed5505e9f1c
dd716807fd23 revset: maintain ordering when subtracting from a baseset (issue4289)
Matt Mackall <mpm@selenic.com>
parents: 21024
diff changeset
  1991
17858
acd4577a568d test: add test for the issue introduced by e410be860393 (issue3669)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17753
diff changeset
  1992
test revsets started with 40-chars hash (issue3669)
acd4577a568d test: add test for the issue introduced by e410be860393 (issue3669)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17753
diff changeset
  1993
acd4577a568d test: add test for the issue introduced by e410be860393 (issue3669)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17753
diff changeset
  1994
  $ ISSUE3669_TIP=`hg tip --template '{node}'`
acd4577a568d test: add test for the issue introduced by e410be860393 (issue3669)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17753
diff changeset
  1995
  $ hg log -r "${ISSUE3669_TIP}" --template '{rev}\n'
acd4577a568d test: add test for the issue introduced by e410be860393 (issue3669)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17753
diff changeset
  1996
  9
acd4577a568d test: add test for the issue introduced by e410be860393 (issue3669)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17753
diff changeset
  1997
  $ hg log -r "${ISSUE3669_TIP}^" --template '{rev}\n'
acd4577a568d test: add test for the issue introduced by e410be860393 (issue3669)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17753
diff changeset
  1998
  8
acd4577a568d test: add test for the issue introduced by e410be860393 (issue3669)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17753
diff changeset
  1999
18473
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2000
test or-ed indirect predicates (issue3775)
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2001
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2002
  $ log '6 or 6^1' | sort
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2003
  5
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2004
  6
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2005
  $ log '6^1 or 6' | sort
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2006
  5
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2007
  6
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2008
  $ log '4 or 4~1' | sort
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2009
  2
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2010
  4
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2011
  $ log '4~1 or 4' | sort
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2012
  2
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2013
  4
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2014
  $ log '(0 or 2):(4 or 6) or 0 or 6' | sort
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2015
  0
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2016
  1
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2017
  2
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2018
  3
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2019
  4
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2020
  5
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2021
  6
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2022
  $ log '0 or 6 or (0 or 2):(4 or 6)' | sort
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2023
  0
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2024
  1
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2025
  2
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2026
  3
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2027
  4
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2028
  5
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2029
  6
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  2030
16008
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  2031
tests for 'remote()' predicate:
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  2032
#.  (csets in remote) (id)            (remote)
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  2033
1.  less than local   current branch  "default"
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  2034
2.  same with local   specified       "default"
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  2035
3.  more than local   specified       specified
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  2036
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  2037
  $ hg clone --quiet -U . ../remote3
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  2038
  $ cd ../remote3
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  2039
  $ hg update -q 7
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  2040
  $ echo r > r
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  2041
  $ hg ci -Aqm 10
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  2042
  $ log 'remote()'
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  2043
  7
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  2044
  $ log 'remote("a-b-c-")'
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  2045
  2
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  2046
  $ cd ../repo
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  2047
  $ log 'remote(".a.b.c.", "../remote3")'
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  2048
23742
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2049
tests for concatenation of strings/symbols by "##"
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2050
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2051
  $ try "278 ## '5f5' ## 1ee ## 'ce5'"
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2052
  (_concat
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2053
    (_concat
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2054
      (_concat
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2055
        ('symbol', '278')
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2056
        ('string', '5f5'))
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2057
      ('symbol', '1ee'))
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2058
    ('string', 'ce5'))
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2059
  ('string', '2785f51eece5')
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  2060
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  2061
  <baseset [0]>
23742
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2062
  0
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2063
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2064
  $ echo 'cat4($1, $2, $3, $4) = $1 ## $2 ## $3 ## $4' >> .hg/hgrc
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2065
  $ try "cat4(278, '5f5', 1ee, 'ce5')"
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2066
  (func
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2067
    ('symbol', 'cat4')
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2068
    (list
27987
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  2069
      ('symbol', '278')
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  2070
      ('string', '5f5')
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  2071
      ('symbol', '1ee')
23742
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2072
      ('string', 'ce5')))
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2073
  (_concat
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2074
    (_concat
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2075
      (_concat
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2076
        ('symbol', '278')
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2077
        ('string', '5f5'))
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2078
      ('symbol', '1ee'))
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2079
    ('string', 'ce5'))
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2080
  ('string', '2785f51eece5')
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  2081
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  2082
  <baseset [0]>
23742
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2083
  0
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2084
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2085
(check concatenation in alias nesting)
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2086
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2087
  $ echo 'cat2($1, $2) = $1 ## $2' >> .hg/hgrc
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2088
  $ echo 'cat2x2($1, $2, $3, $4) = cat2($1 ## $2, $3 ## $4)' >> .hg/hgrc
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2089
  $ log "cat2x2(278, '5f5', 1ee, 'ce5')"
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2090
  0
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2091
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2092
(check operator priority)
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2093
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2094
  $ echo 'cat2n2($1, $2, $3, $4) = $1 ## $2 or $3 ## $4~2' >> .hg/hgrc
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2095
  $ log "cat2n2(2785f5, 1eece5, 24286f, 4ae135)"
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2096
  0
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2097
  4
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  2098
15726
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2099
  $ cd ..
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2100
25265
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2101
prepare repository that has "default" branches of multiple roots
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2102
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2103
  $ hg init namedbranch
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2104
  $ cd namedbranch
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2105
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2106
  $ echo default0 >> a
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2107
  $ hg ci -Aqm0
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2108
  $ echo default1 >> a
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2109
  $ hg ci -m1
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2110
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2111
  $ hg branch -q stable
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2112
  $ echo stable2 >> a
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2113
  $ hg ci -m2
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2114
  $ echo stable3 >> a
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2115
  $ hg ci -m3
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2116
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2117
  $ hg update -q null
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2118
  $ echo default4 >> a
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2119
  $ hg ci -Aqm4
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2120
  $ echo default5 >> a
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2121
  $ hg ci -m5
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2122
25266
38117278f295 revbranchcache: return uncached branchinfo for nullrev (issue4683)
Yuya Nishihara <yuya@tcha.org>
parents: 25265
diff changeset
  2123
"null" revision belongs to "default" branch (issue4683)
38117278f295 revbranchcache: return uncached branchinfo for nullrev (issue4683)
Yuya Nishihara <yuya@tcha.org>
parents: 25265
diff changeset
  2124
38117278f295 revbranchcache: return uncached branchinfo for nullrev (issue4683)
Yuya Nishihara <yuya@tcha.org>
parents: 25265
diff changeset
  2125
  $ log 'branch(null)'
38117278f295 revbranchcache: return uncached branchinfo for nullrev (issue4683)
Yuya Nishihara <yuya@tcha.org>
parents: 25265
diff changeset
  2126
  0
38117278f295 revbranchcache: return uncached branchinfo for nullrev (issue4683)
Yuya Nishihara <yuya@tcha.org>
parents: 25265
diff changeset
  2127
  1
38117278f295 revbranchcache: return uncached branchinfo for nullrev (issue4683)
Yuya Nishihara <yuya@tcha.org>
parents: 25265
diff changeset
  2128
  4
38117278f295 revbranchcache: return uncached branchinfo for nullrev (issue4683)
Yuya Nishihara <yuya@tcha.org>
parents: 25265
diff changeset
  2129
  5
38117278f295 revbranchcache: return uncached branchinfo for nullrev (issue4683)
Yuya Nishihara <yuya@tcha.org>
parents: 25265
diff changeset
  2130
25265
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2131
"null" revision belongs to "default" branch, but it shouldn't appear in set
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2132
unless explicitly specified (issue4682)
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2133
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2134
  $ log 'children(branch(default))'
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2135
  1
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2136
  2
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2137
  5
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2138
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2139
  $ cd ..
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  2140
15726
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2141
test author/desc/keyword in problematic encoding
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2142
# unicode: cp932:
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2143
# u30A2    0x83 0x41(= 'A')
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2144
# u30C2    0x83 0x61(= 'a')
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2145
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2146
  $ hg init problematicencoding
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2147
  $ cd problematicencoding
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2148
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2149
  $ python > setup.sh <<EOF
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2150
  > print u'''
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2151
  > echo a > text
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2152
  > hg add text
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2153
  > hg --encoding utf-8 commit -u '\u30A2' -m none
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2154
  > echo b > text
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2155
  > hg --encoding utf-8 commit -u '\u30C2' -m none
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2156
  > echo c > text
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2157
  > hg --encoding utf-8 commit -u none -m '\u30A2'
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2158
  > echo d > text
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2159
  > hg --encoding utf-8 commit -u none -m '\u30C2'
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2160
  > '''.encode('utf-8')
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2161
  > EOF
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2162
  $ sh < setup.sh
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2163
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2164
test in problematic encoding
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2165
  $ python > test.sh <<EOF
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2166
  > print u'''
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2167
  > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30A2)'
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2168
  > echo ====
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2169
  > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30C2)'
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2170
  > echo ====
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2171
  > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30A2)'
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2172
  > echo ====
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2173
  > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30C2)'
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2174
  > echo ====
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2175
  > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30A2)'
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2176
  > echo ====
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2177
  > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30C2)'
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2178
  > '''.encode('cp932')
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2179
  > EOF
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2180
  $ sh < test.sh
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2181
  0
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2182
  ====
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2183
  1
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2184
  ====
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2185
  2
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2186
  ====
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2187
  3
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2188
  ====
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2189
  0
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2190
  2
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2191
  ====
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2192
  1
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2193
  3
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2194
24707
57f58f96f850 revsets: show current revset abort behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 24459
diff changeset
  2195
test error message of bad revset
57f58f96f850 revsets: show current revset abort behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 24459
diff changeset
  2196
  $ hg log -r 'foo\\'
24708
fb47816e1a9c revsets: more informative syntax error message
Ryan McElroy <rmcelroy@fb.com>
parents: 24707
diff changeset
  2197
  hg: parse error at 3: syntax error in revset 'foo\\'
24707
57f58f96f850 revsets: show current revset abort behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 24459
diff changeset
  2198
  [255]
57f58f96f850 revsets: show current revset abort behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 24459
diff changeset
  2199
15726
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  2200
  $ cd ..
27586
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  2201
28394
dcb4209bd30d revset: replace extpredicate by revsetpredicate of registrar
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28217
diff changeset
  2202
Test that revset predicate of extension isn't loaded at failure of
dcb4209bd30d revset: replace extpredicate by revsetpredicate of registrar
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28217
diff changeset
  2203
loading it
27586
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  2204
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  2205
  $ cd repo
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  2206
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  2207
  $ cat <<EOF > $TESTTMP/custompredicate.py
28394
dcb4209bd30d revset: replace extpredicate by revsetpredicate of registrar
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28217
diff changeset
  2208
  > from mercurial import error, registrar, revset
27586
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  2209
  > 
28394
dcb4209bd30d revset: replace extpredicate by revsetpredicate of registrar
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28217
diff changeset
  2210
  > revsetpredicate = registrar.revsetpredicate()
27586
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  2211
  > 
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  2212
  > @revsetpredicate('custom1()')
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  2213
  > def custom1(repo, subset, x):
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  2214
  >     return revset.baseset([1])
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  2215
  > 
28394
dcb4209bd30d revset: replace extpredicate by revsetpredicate of registrar
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28217
diff changeset
  2216
  > raise error.Abort('intentional failure of loading extension')
27586
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  2217
  > EOF
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  2218
  $ cat <<EOF > .hg/hgrc
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  2219
  > [extensions]
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  2220
  > custompredicate = $TESTTMP/custompredicate.py
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  2221
  > EOF
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  2222
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  2223
  $ hg debugrevspec "custom1()"
28394
dcb4209bd30d revset: replace extpredicate by revsetpredicate of registrar
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28217
diff changeset
  2224
  *** failed to import extension custompredicate from $TESTTMP/custompredicate.py: intentional failure of loading extension
27586
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  2225
  hg: parse error: unknown identifier: custom1
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  2226
  [255]
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  2227
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  2228
  $ cd ..