tests/test-revset.t
author Yuya Nishihara <yuya@tcha.org>
Sat, 24 Jun 2017 23:05:57 +0900
changeset 33080 a53bfc2845f2
parent 33075 d83b189aef83
child 33097 fce4ed2912bb
permissions -rw-r--r--
revset: add depth limit to descendants() (issue5374) This is naive implementation using two-pass scanning. Tracking descendants isn't an easy problem if both start and stop depths are specified. It's impractical to remember all possible depths of each node while scanning from roots to descendants because the number of depths explodes. Instead, we could cache (min, max) depths as a good approximation and track ancestors back when needed, but that's likely to have off-by-one bug. Since this implementation appears not significantly slower, and is quite straightforward, I think it's good enough for practical use cases. The time and space complexity is O(n) ish. revisions: 0) 1-pass scanning with (min, max)-depth cache (worst-case quadratic) 1) 2-pass scanning (this version) repository: mozilla-central # descendants(0) (for reference) *) 0.430353 # descendants(0, depth=1000) 0) 0.264889 1) 0.398289 # descendants(limit(tip:0, 1, offset=10000), depth=1000) 0) 0.025478 1) 0.029099 # descendants(0, depth=2000, startdepth=1000) 0) painfully slow (due to quadratic backtracking of ancestors) 1) 1.531138
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
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    34
extension to build '_intlist()' and '_hexlist()', which is necessary because
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    35
these predicates use '\0' as a separator:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    36
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    37
  $ cat <<EOF > debugrevlistspec.py
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    38
  > from __future__ import absolute_import
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    39
  > from mercurial import (
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    40
  >     node as nodemod,
32337
46ba2cdda476 registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 31920
diff changeset
    41
  >     registrar,
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    42
  >     revset,
31024
0b8356705de6 revset: split language services to revsetlang module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 30881
diff changeset
    43
  >     revsetlang,
30881
1be65deb3d54 smartset: move set classes and related functions from revset module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 30803
diff changeset
    44
  >     smartset,
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    45
  > )
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    46
  > cmdtable = {}
32337
46ba2cdda476 registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 31920
diff changeset
    47
  > command = registrar.command(cmdtable)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    48
  > @command('debugrevlistspec',
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    49
  >     [('', 'optimize', None, 'print parsed tree after optimizing'),
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    50
  >      ('', 'bin', None, 'unhexlify arguments')])
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    51
  > def debugrevlistspec(ui, repo, fmt, *args, **opts):
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    52
  >     if opts['bin']:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    53
  >         args = map(nodemod.bin, args)
31024
0b8356705de6 revset: split language services to revsetlang module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 30881
diff changeset
    54
  >     expr = revsetlang.formatspec(fmt, list(args))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    55
  >     if ui.verbose:
31024
0b8356705de6 revset: split language services to revsetlang module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 30881
diff changeset
    56
  >         tree = revsetlang.parse(expr, lookup=repo.__contains__)
0b8356705de6 revset: split language services to revsetlang module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 30881
diff changeset
    57
  >         ui.note(revsetlang.prettyformat(tree), "\n")
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    58
  >         if opts["optimize"]:
31024
0b8356705de6 revset: split language services to revsetlang module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 30881
diff changeset
    59
  >             opttree = revsetlang.optimize(revsetlang.analyze(tree))
0b8356705de6 revset: split language services to revsetlang module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 30881
diff changeset
    60
  >             ui.note("* optimized:\n", revsetlang.prettyformat(opttree),
0b8356705de6 revset: split language services to revsetlang module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 30881
diff changeset
    61
  >                     "\n")
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    62
  >     func = revset.match(ui, expr, repo)
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    63
  >     revs = func(repo)
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    64
  >     if ui.verbose:
30881
1be65deb3d54 smartset: move set classes and related functions from revset module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 30803
diff changeset
    65
  >         ui.note("* set:\n", smartset.prettyformat(revs), "\n")
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    66
  >     for c in revs:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    67
  >         ui.write("%s\n" % c)
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    68
  > EOF
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    69
  $ cat <<EOF >> $HGRCPATH
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    70
  > [extensions]
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    71
  > debugrevlistspec = $TESTTMP/debugrevlistspec.py
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    72
  > EOF
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    73
  $ trylist() {
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    74
  >   hg debugrevlistspec --debug "$@"
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    75
  > }
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    76
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    77
  $ 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
    78
  $ cd repo
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
    79
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    80
  $ 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
    81
  $ 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
    82
  marked working directory as branch a
15615
41885892796e branch: warn on branching
Matt Mackall <mpm@selenic.com>
parents: 14723
diff changeset
    83
  (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
    84
  $ 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
    85
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    86
  $ 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
    87
  $ 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
    88
  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
    89
  $ hg ci -Aqm1
11409
7a6ac83a15b0 revset: add some tests
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    90
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    91
  $ rm a
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    92
  $ 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
    93
  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
    94
  $ hg ci -Aqm2 -u Bob
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
    95
16661
de4b42daf396 revset: add function for matching extra data (issue2767)
Henrik Stuart <hg@hstuart.dk>
parents: 16640
diff changeset
    96
  $ 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
    97
  2
de4b42daf396 revset: add function for matching extra data (issue2767)
Henrik Stuart <hg@hstuart.dk>
parents: 16640
diff changeset
    98
  $ 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
    99
  0
de4b42daf396 revset: add function for matching extra data (issue2767)
Henrik Stuart <hg@hstuart.dk>
parents: 16640
diff changeset
   100
  1
de4b42daf396 revset: add function for matching extra data (issue2767)
Henrik Stuart <hg@hstuart.dk>
parents: 16640
diff changeset
   101
  2
16824
f3b8c82a559c revset: add pattern matching to 'extra' revset expression
Simon King <simon@simonking.org.uk>
parents: 16823
diff changeset
   102
  $ 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
   103
  0 a
f3b8c82a559c revset: add pattern matching to 'extra' revset expression
Simon King <simon@simonking.org.uk>
parents: 16823
diff changeset
   104
  2 a-b-c-
16661
de4b42daf396 revset: add function for matching extra data (issue2767)
Henrik Stuart <hg@hstuart.dk>
parents: 16640
diff changeset
   105
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   106
  $ 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
   107
  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
   108
  $ 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
   109
  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
   110
  $ hg ci -Aqm3
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
   111
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   112
  $ 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
   113
  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
   114
  $ 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
   115
  $ 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
   116
  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
   117
  $ hg ci -Aqm4 -d "May 12 2005"
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
   118
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   119
  $ 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
   120
  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
   121
  $ hg branch !a/b/c/
c739227b5eea test-revset: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16824
diff changeset
   122
  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
   123
  $ 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
   124
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   125
  $ 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
   126
  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
   127
  (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
   128
  $ 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
   129
  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
   130
  $ hg ci -Aqm"6 issue619"
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
   131
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   132
  $ 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
   133
  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
   134
  $ 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
   135
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   136
  $ 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
   137
  marked working directory as branch all
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
   138
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   139
  $ 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
   140
  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
   141
  $ hg branch é
12942
05fffd665170 tests: use (esc) for all non-ASCII test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12786
diff changeset
   142
  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
   143
  $ hg ci -Aqm9
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
   144
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   145
  $ 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
   146
  $ hg bookmark -r6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
   147
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   148
  $ 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
   149
  $ 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
   150
  $ 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
   151
  $ 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
   152
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   153
trivial
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   154
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   155
  $ try 0:1
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   156
  (range
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   157
    ('symbol', '0')
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   158
    ('symbol', '1'))
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   159
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   160
  <spanset+ 0:2>
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   161
  0
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   162
  1
25819
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   163
  $ try --optimize :
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   164
  (rangeall
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   165
    None)
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   166
  * optimized:
30803
d389f19f14aa revset: do not transform range* operators in parsed tree
Yuya Nishihara <yuya@tcha.org>
parents: 30783
diff changeset
   167
  (rangeall
d389f19f14aa revset: do not transform range* operators in parsed tree
Yuya Nishihara <yuya@tcha.org>
parents: 30783
diff changeset
   168
    None
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
   169
    define)
25819
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   170
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   171
  <spanset+ 0:10>
25819
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   172
  0
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   173
  1
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   174
  2
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   175
  3
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   176
  4
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   177
  5
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   178
  6
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   179
  7
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   180
  8
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   181
  9
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   182
  $ try 3::6
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   183
  (dagrange
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   184
    ('symbol', '3')
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   185
    ('symbol', '6'))
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   186
  * set:
26061
be8a4e0800d8 reachableroots: use baseset lazy sorting
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26020
diff changeset
   187
  <baseset+ [3, 5, 6]>
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   188
  3
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   189
  5
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   190
  6
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   191
  $ try '0|1|2'
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   192
  (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   193
    (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   194
      ('symbol', '0')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   195
      ('symbol', '1')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   196
      ('symbol', '2')))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   197
  * set:
25343
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
   198
  <baseset [0, 1, 2]>
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   199
  0
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   200
  1
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   201
  2
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   202
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   203
names that should work without quoting
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
   204
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   205
  $ try a
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   206
  ('symbol', 'a')
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   207
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   208
  <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
   209
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   210
  $ try b-a
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   211
  (minus
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   212
    ('symbol', 'b')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   213
    ('symbol', 'a'))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   214
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   215
  <filteredset
28423
0d79d91ba7e3 revset: add extra data to filteredset for better inspection
Yuya Nishihara <yuya@tcha.org>
parents: 28394
diff changeset
   216
    <baseset [1]>,
0d79d91ba7e3 revset: add extra data to filteredset for better inspection
Yuya Nishihara <yuya@tcha.org>
parents: 28394
diff changeset
   217
    <not
0d79d91ba7e3 revset: add extra data to filteredset for better inspection
Yuya Nishihara <yuya@tcha.org>
parents: 28394
diff changeset
   218
      <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
   219
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   220
  $ 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
   221
  ('symbol', '_a_b_c_')
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   222
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   223
  <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
   224
  6
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   225
  $ try _a_b_c_-a
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   226
  (minus
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   227
    ('symbol', '_a_b_c_')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   228
    ('symbol', 'a'))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   229
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   230
  <filteredset
28423
0d79d91ba7e3 revset: add extra data to filteredset for better inspection
Yuya Nishihara <yuya@tcha.org>
parents: 28394
diff changeset
   231
    <baseset [6]>,
0d79d91ba7e3 revset: add extra data to filteredset for better inspection
Yuya Nishihara <yuya@tcha.org>
parents: 28394
diff changeset
   232
    <not
0d79d91ba7e3 revset: add extra data to filteredset for better inspection
Yuya Nishihara <yuya@tcha.org>
parents: 28394
diff changeset
   233
      <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
   234
  6
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   235
  $ 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
   236
  ('symbol', '.a.b.c.')
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   237
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   238
  <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
   239
  7
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   240
  $ try .a.b.c.-a
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   241
  (minus
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   242
    ('symbol', '.a.b.c.')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   243
    ('symbol', 'a'))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   244
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   245
  <filteredset
28423
0d79d91ba7e3 revset: add extra data to filteredset for better inspection
Yuya Nishihara <yuya@tcha.org>
parents: 28394
diff changeset
   246
    <baseset [7]>,
0d79d91ba7e3 revset: add extra data to filteredset for better inspection
Yuya Nishihara <yuya@tcha.org>
parents: 28394
diff changeset
   247
    <not
0d79d91ba7e3 revset: add extra data to filteredset for better inspection
Yuya Nishihara <yuya@tcha.org>
parents: 28394
diff changeset
   248
      <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
   249
  7
25901
0203c50a589f debugrevspec: pass lookup function to visualize fallback mechanism
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
   250
0203c50a589f debugrevspec: pass lookup function to visualize fallback mechanism
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
   251
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
   252
0203c50a589f debugrevspec: pass lookup function to visualize fallback mechanism
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
   253
  $ 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
   254
  ('symbol', '-a-b-c-')
25901
0203c50a589f debugrevspec: pass lookup function to visualize fallback mechanism
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
   255
  * set:
0203c50a589f debugrevspec: pass lookup function to visualize fallback mechanism
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
   256
  <baseset [4]>
0203c50a589f debugrevspec: pass lookup function to visualize fallback mechanism
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
   257
  4
0203c50a589f debugrevspec: pass lookup function to visualize fallback mechanism
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
   258
  $ 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
   259
  4
25902
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   260
  $ 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
   261
  ('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
   262
  * set:
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   263
  <baseset [3]>
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   264
  3
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   265
  $ 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
   266
  (rangepost
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   267
    ('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
   268
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   269
  <spanset+ 3:10>
25902
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   270
  3
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   271
  4
25902
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   272
  5
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   273
  6
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   274
  7
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   275
  8
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   276
  9
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   277
  $ 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
   278
  (rangepre
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   279
    ('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
   280
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   281
  <spanset+ 0:4>
25902
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   282
  0
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   283
  1
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   284
  2
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   285
  3
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   286
  $ 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
   287
  (range
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   288
    ('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
   289
    ('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
   290
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   291
  <spanset- 3:5>
25902
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   292
  4
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   293
  3
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   294
  $ 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
   295
  4
5214cbdc37e5 revset: port parsing rule of old-style ranges from scmutil.revrange()
Yuya Nishihara <yuya@tcha.org>
parents: 25901
diff changeset
   296
  3
20781
8ecfa225bd16 revrange: pass repo to revset parser
Matt Mackall <mpm@selenic.com>
parents: 20736
diff changeset
   297
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   298
  $ try -- -a-b-c--a # complains
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   299
  (minus
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   300
    (minus
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   301
      (minus
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   302
        (negate
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   303
          ('symbol', 'a'))
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   304
        ('symbol', 'b'))
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   305
      ('symbol', 'c'))
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   306
    (negate
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   307
      ('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
   308
  abort: unknown revision '-a'!
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12105
diff changeset
   309
  [255]
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   310
  $ try é
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   311
  ('symbol', '\xc3\xa9')
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   312
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   313
  <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
   314
  9
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
   315
20781
8ecfa225bd16 revrange: pass repo to revset parser
Matt Mackall <mpm@selenic.com>
parents: 20736
diff changeset
   316
no quoting needed
8ecfa225bd16 revrange: pass repo to revset parser
Matt Mackall <mpm@selenic.com>
parents: 20736
diff changeset
   317
8ecfa225bd16 revrange: pass repo to revset parser
Matt Mackall <mpm@selenic.com>
parents: 20736
diff changeset
   318
  $ log ::a-b-c-
8ecfa225bd16 revrange: pass repo to revset parser
Matt Mackall <mpm@selenic.com>
parents: 20736
diff changeset
   319
  0
8ecfa225bd16 revrange: pass repo to revset parser
Matt Mackall <mpm@selenic.com>
parents: 20736
diff changeset
   320
  1
8ecfa225bd16 revrange: pass repo to revset parser
Matt Mackall <mpm@selenic.com>
parents: 20736
diff changeset
   321
  2
8ecfa225bd16 revrange: pass repo to revset parser
Matt Mackall <mpm@selenic.com>
parents: 20736
diff changeset
   322
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   323
quoting needed
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
   324
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   325
  $ try '"-a-b-c-"-a'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   326
  (minus
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   327
    ('string', '-a-b-c-')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   328
    ('symbol', 'a'))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   329
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   330
  <filteredset
28423
0d79d91ba7e3 revset: add extra data to filteredset for better inspection
Yuya Nishihara <yuya@tcha.org>
parents: 28394
diff changeset
   331
    <baseset [4]>,
0d79d91ba7e3 revset: add extra data to filteredset for better inspection
Yuya Nishihara <yuya@tcha.org>
parents: 28394
diff changeset
   332
    <not
0d79d91ba7e3 revset: add extra data to filteredset for better inspection
Yuya Nishihara <yuya@tcha.org>
parents: 28394
diff changeset
   333
      <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
   334
  4
11882
b75dea24e296 revset: fix outgoing argument handling
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 11650
diff changeset
   335
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   336
  $ 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
   337
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   338
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   339
  $ 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
   340
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   341
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   342
  $ 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
   343
  $ 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
   344
  $ try '1&2|3' # precedence - and is higher
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   345
  (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   346
    (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   347
      (and
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   348
        ('symbol', '1')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   349
        ('symbol', '2'))
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   350
      ('symbol', '3')))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   351
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   352
  <addset
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   353
    <baseset []>,
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   354
    <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
   355
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   356
  $ try '1|2&3'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   357
  (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   358
    (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   359
      ('symbol', '1')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   360
      (and
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   361
        ('symbol', '2')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   362
        ('symbol', '3'))))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   363
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   364
  <addset
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   365
    <baseset [1]>,
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   366
    <baseset []>>
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   367
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   368
  $ try '1&2&3' # associativity
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   369
  (and
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   370
    (and
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   371
      ('symbol', '1')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   372
      ('symbol', '2'))
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   373
    ('symbol', '3'))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   374
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   375
  <baseset []>
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   376
  $ try '1|(2|3)'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   377
  (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   378
    (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   379
      ('symbol', '1')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   380
      (group
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   381
        (or
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   382
          (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   383
            ('symbol', '2')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   384
            ('symbol', '3'))))))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   385
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   386
  <addset
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   387
    <baseset [1]>,
25343
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
   388
    <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
   389
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   390
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   391
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   392
  $ 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
   393
  6
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   394
  $ 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
   395
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   396
  $ log '2785f51ee'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   397
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   398
  $ 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
   399
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   400
  $ 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
   401
  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
   402
  [255]
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   403
  $ log 'date()'
12736
7e14e67e6622 revset: use 'requires' instead of 'wants' in error message
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 12716
diff changeset
   404
  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
   405
  [255]
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   406
  $ 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
   407
  abort: unknown revision 'date'!
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12105
diff changeset
   408
  [255]
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   409
  $ log 'date('
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   410
  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
   411
  [255]
26232
43f9976346e9 revset: handle error of string unescaping
Yuya Nishihara <yuya@tcha.org>
parents: 26061
diff changeset
   412
  $ log 'date("\xy")'
43f9976346e9 revset: handle error of string unescaping
Yuya Nishihara <yuya@tcha.org>
parents: 26061
diff changeset
   413
  hg: parse error: invalid \x escape
43f9976346e9 revset: handle error of string unescaping
Yuya Nishihara <yuya@tcha.org>
parents: 26061
diff changeset
   414
  [255]
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   415
  $ log 'date(tip)'
32462
bb18728ea617 util: raise ParseError when parsing dates (BC)
Boris Feld <boris.feld@octobus.net>
parents: 32442
diff changeset
   416
  hg: parse error: invalid date: 'tip'
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12105
diff changeset
   417
  [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
   418
  $ 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
   419
  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
   420
  [255]
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   421
  $ 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
   422
  abort: unknown revision 'date'!
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12105
diff changeset
   423
  [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
   424
  $ 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
   425
  $ 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
   426
  0
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   427
  1
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   428
  2
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   429
  3
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   430
  4
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 '::date'
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   432
  0
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   433
  1
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   434
  2
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   435
  4
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   436
  $ 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
   437
  0
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   438
  1
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   439
  2
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   440
  4
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   441
  $ 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
   442
  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
   443
  $ 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
   444
29441
9e8d258708bb revset: check invalid function syntax "func-name"() explicitly
Yuya Nishihara <yuya@tcha.org>
parents: 29408
diff changeset
   445
function name should be a symbol
9e8d258708bb revset: check invalid function syntax "func-name"() explicitly
Yuya Nishihara <yuya@tcha.org>
parents: 29408
diff changeset
   446
9e8d258708bb revset: check invalid function syntax "func-name"() explicitly
Yuya Nishihara <yuya@tcha.org>
parents: 29408
diff changeset
   447
  $ log '"date"(2005)'
9e8d258708bb revset: check invalid function syntax "func-name"() explicitly
Yuya Nishihara <yuya@tcha.org>
parents: 29408
diff changeset
   448
  hg: parse error: not a symbol
9e8d258708bb revset: check invalid function syntax "func-name"() explicitly
Yuya Nishihara <yuya@tcha.org>
parents: 29408
diff changeset
   449
  [255]
9e8d258708bb revset: check invalid function syntax "func-name"() explicitly
Yuya Nishihara <yuya@tcha.org>
parents: 29408
diff changeset
   450
25704
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   451
keyword arguments
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   452
25706
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   453
  $ log 'extra(branch, value=a)'
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   454
  0
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   455
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   456
  $ log 'extra(branch, a, b)'
31920
a98540ea1e42 parser: verify excessive number of args excluding kwargs in buildargsdict()
Yuya Nishihara <yuya@tcha.org>
parents: 31800
diff changeset
   457
  hg: parse error: extra takes at most 2 positional arguments
25706
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   458
  [255]
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   459
  $ log 'extra(a, label=b)'
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   460
  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
   461
  [255]
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   462
  $ log 'extra(label=branch, default)'
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   463
  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
   464
  [255]
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   465
  $ log 'extra(branch, foo+bar=baz)'
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   466
  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
   467
  [255]
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   468
  $ log 'extra(unknown=branch)'
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   469
  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
   470
  [255]
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   471
25704
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   472
  $ try 'foo=bar|baz'
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   473
  (keyvalue
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   474
    ('symbol', 'foo')
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   475
    (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   476
      (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   477
        ('symbol', 'bar')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   478
        ('symbol', 'baz'))))
25704
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   479
  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
   480
  [255]
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   481
29766
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   482
 right-hand side should be optimized recursively
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   483
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   484
  $ try --optimize 'foo=(not public())'
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   485
  (keyvalue
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   486
    ('symbol', 'foo')
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   487
    (group
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   488
      (not
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   489
        (func
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   490
          ('symbol', 'public')
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   491
          None))))
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   492
  * optimized:
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   493
  (keyvalue
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   494
    ('symbol', 'foo')
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   495
    (func
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   496
      ('symbol', '_notpublic')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
   497
      None
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
   498
      any))
29766
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   499
  hg: parse error: can't use a key-value pair in this context
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   500
  [255]
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   501
29913
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   502
parsed tree at stages:
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   503
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   504
  $ hg debugrevspec -p all '()'
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   505
  * parsed:
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   506
  (group
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   507
    None)
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   508
  * expanded:
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   509
  (group
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   510
    None)
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   511
  * concatenated:
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   512
  (group
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   513
    None)
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   514
  * analyzed:
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   515
  None
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   516
  * optimized:
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   517
  None
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   518
  hg: parse error: missing argument
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   519
  [255]
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   520
29923
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   521
  $ hg debugrevspec --no-optimized -p all '()'
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   522
  * parsed:
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   523
  (group
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   524
    None)
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   525
  * expanded:
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   526
  (group
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   527
    None)
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   528
  * concatenated:
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   529
  (group
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   530
    None)
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   531
  * analyzed:
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   532
  None
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   533
  hg: parse error: missing argument
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   534
  [255]
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   535
29913
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   536
  $ hg debugrevspec -p parsed -p analyzed -p optimized '(0|1)-1'
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   537
  * parsed:
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   538
  (minus
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   539
    (group
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   540
      (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   541
        (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   542
          ('symbol', '0')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   543
          ('symbol', '1'))))
29913
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   544
    ('symbol', '1'))
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   545
  * analyzed:
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   546
  (and
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   547
    (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   548
      (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   549
        ('symbol', '0')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
   550
        ('symbol', '1'))
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
   551
      define)
29913
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   552
    (not
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
   553
      ('symbol', '1')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
   554
      follow)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
   555
    define)
29913
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   556
  * optimized:
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   557
  (difference
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   558
    (func
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   559
      ('symbol', '_list')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
   560
      ('string', '0\x001')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
   561
      define)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
   562
    ('symbol', '1')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
   563
    define)
29913
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   564
  0
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   565
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   566
  $ hg debugrevspec -p unknown '0'
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   567
  abort: invalid stage name: unknown
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   568
  [255]
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   569
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   570
  $ hg debugrevspec -p all --optimize '0'
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   571
  abort: cannot use --optimize with --show-stage
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   572
  [255]
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   573
29924
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   574
verify optimized tree:
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   575
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   576
  $ hg debugrevspec --verify '0|1'
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   577
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   578
  $ hg debugrevspec --verify -v -p analyzed -p optimized 'r3232() & 2'
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   579
  * analyzed:
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   580
  (and
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   581
    (func
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   582
      ('symbol', 'r3232')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
   583
      None
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
   584
      define)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
   585
    ('symbol', '2')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
   586
    define)
29924
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   587
  * optimized:
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   588
  (and
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   589
    ('symbol', '2')
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   590
    (func
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   591
      ('symbol', 'r3232')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
   592
      None
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
   593
      define)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
   594
    define)
29924
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   595
  * analyzed set:
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   596
  <baseset [2]>
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   597
  * optimized set:
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   598
  <baseset [2, 2]>
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   599
  --- analyzed
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   600
  +++ optimized
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   601
   2
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   602
  +2
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   603
  [1]
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   604
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   605
  $ hg debugrevspec --no-optimized --verify-optimized '0'
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   606
  abort: cannot use --verify-optimized with --no-optimized
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   607
  [255]
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   608
24932
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   609
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
   610
parenthesis.
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   611
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   612
  $ 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
   613
  $ 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
   614
  8
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   615
  9
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
   616
30044
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   617
':y' behaves like '0:y', but can't be rewritten as such since the revision '0'
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   618
may be hidden (issue5385)
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   619
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   620
  $ try -p parsed -p analyzed ':'
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   621
  * parsed:
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   622
  (rangeall
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   623
    None)
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   624
  * analyzed:
30803
d389f19f14aa revset: do not transform range* operators in parsed tree
Yuya Nishihara <yuya@tcha.org>
parents: 30783
diff changeset
   625
  (rangeall
d389f19f14aa revset: do not transform range* operators in parsed tree
Yuya Nishihara <yuya@tcha.org>
parents: 30783
diff changeset
   626
    None
30044
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   627
    define)
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   628
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   629
  <spanset+ 0:10>
30044
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   630
  0
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   631
  1
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   632
  2
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   633
  3
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   634
  4
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   635
  5
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   636
  6
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   637
  7
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   638
  8
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   639
  9
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   640
  $ try -p analyzed ':1'
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   641
  * analyzed:
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   642
  (rangepre
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   643
    ('symbol', '1')
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   644
    define)
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   645
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   646
  <spanset+ 0:2>
30044
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   647
  0
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   648
  1
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   649
  $ try -p analyzed ':(1|2)'
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   650
  * analyzed:
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   651
  (rangepre
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   652
    (or
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   653
      (list
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   654
        ('symbol', '1')
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   655
        ('symbol', '2'))
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   656
      define)
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   657
    define)
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   658
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   659
  <spanset+ 0:3>
30044
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   660
  0
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   661
  1
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   662
  2
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   663
  $ try -p analyzed ':(1&2)'
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   664
  * analyzed:
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   665
  (rangepre
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   666
    (and
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   667
      ('symbol', '1')
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   668
      ('symbol', '2')
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   669
      define)
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   670
    define)
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   671
  * set:
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   672
  <baseset []>
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   673
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   674
infix/suffix resolution of ^ operator (issue2884):
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   675
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   676
 x^:y means (x^):y
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   677
29769
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   678
  $ try '1^:2'
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   679
  (range
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   680
    (parentpost
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   681
      ('symbol', '1'))
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   682
    ('symbol', '2'))
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   683
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   684
  <spanset+ 0:3>
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   685
  0
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   686
  1
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   687
  2
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   688
29769
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   689
  $ try '1^::2'
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   690
  (dagrange
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   691
    (parentpost
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   692
      ('symbol', '1'))
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   693
    ('symbol', '2'))
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   694
  * set:
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   695
  <baseset+ [0, 1, 2]>
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   696
  0
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   697
  1
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   698
  2
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   699
29770
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   700
  $ try '9^:'
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   701
  (rangepost
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   702
    (parentpost
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   703
      ('symbol', '9')))
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   704
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   705
  <spanset+ 8:10>
29770
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   706
  8
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   707
  9
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   708
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   709
 x^:y should be resolved before omitting group operators
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   710
29769
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   711
  $ try '1^(:2)'
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   712
  (parent
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   713
    ('symbol', '1')
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   714
    (group
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   715
      (rangepre
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   716
        ('symbol', '2'))))
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   717
  hg: parse error: ^ expects a number 0, 1, or 2
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   718
  [255]
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   719
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   720
 x^:y should be resolved recursively
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   721
29769
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   722
  $ try 'sort(1^:2)'
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   723
  (func
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   724
    ('symbol', 'sort')
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   725
    (range
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   726
      (parentpost
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   727
        ('symbol', '1'))
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   728
      ('symbol', '2')))
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   729
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   730
  <spanset+ 0:3>
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   731
  0
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   732
  1
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   733
  2
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   734
29769
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   735
  $ try '(3^:4)^:2'
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   736
  (range
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   737
    (parentpost
29769
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   738
      (group
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   739
        (range
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   740
          (parentpost
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   741
            ('symbol', '3'))
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   742
          ('symbol', '4'))))
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   743
    ('symbol', '2'))
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   744
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   745
  <spanset+ 0:3>
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   746
  0
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   747
  1
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   748
  2
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   749
29769
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   750
  $ try '(3^::4)^::2'
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   751
  (dagrange
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   752
    (parentpost
29769
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   753
      (group
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   754
        (dagrange
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   755
          (parentpost
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   756
            ('symbol', '3'))
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   757
          ('symbol', '4'))))
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   758
    ('symbol', '2'))
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   759
  * set:
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   760
  <baseset+ [0, 1, 2]>
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   761
  0
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   762
  1
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   763
  2
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   764
29770
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   765
  $ try '(9^:)^:'
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   766
  (rangepost
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   767
    (parentpost
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   768
      (group
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   769
        (rangepost
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   770
          (parentpost
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   771
            ('symbol', '9'))))))
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   772
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   773
  <spanset+ 4:10>
29770
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   774
  4
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   775
  5
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   776
  6
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   777
  7
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   778
  8
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   779
  9
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   780
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   781
 x^ in alias should also be resolved
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   782
29769
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   783
  $ try 'A' --config 'revsetalias.A=1^:2'
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   784
  ('symbol', 'A')
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   785
  * expanded:
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   786
  (range
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   787
    (parentpost
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   788
      ('symbol', '1'))
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   789
    ('symbol', '2'))
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   790
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   791
  <spanset+ 0:3>
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   792
  0
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   793
  1
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   794
  2
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   795
29769
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   796
  $ try 'A:2' --config 'revsetalias.A=1^'
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   797
  (range
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   798
    ('symbol', 'A')
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   799
    ('symbol', '2'))
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   800
  * expanded:
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   801
  (range
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   802
    (parentpost
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   803
      ('symbol', '1'))
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   804
    ('symbol', '2'))
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   805
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   806
  <spanset+ 0:3>
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   807
  0
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   808
  1
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   809
  2
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   810
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   811
 but not beyond the boundary of alias expansion, because the resolution should
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   812
 be made at the parsing stage
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   813
29769
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   814
  $ try '1^A' --config 'revsetalias.A=:2'
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   815
  (parent
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   816
    ('symbol', '1')
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   817
    ('symbol', 'A'))
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   818
  * expanded:
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   819
  (parent
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   820
    ('symbol', '1')
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   821
    (rangepre
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   822
      ('symbol', '2')))
29769
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   823
  hg: parse error: ^ expects a number 0, 1, or 2
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   824
  [255]
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   825
18536
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
   826
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
   827
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
   828
  $ 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
   829
  $ log 'ancestor(1)'
18536
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
   830
  1
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   831
  $ 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
   832
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   833
  $ 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
   834
  $ 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
   835
  0
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
   836
  $ 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
   837
  1
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
   838
  $ 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
   839
  0
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
   840
  $ 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
   841
  1
24940
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
   842
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
   843
test ancestors
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
   844
33002
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   845
  $ hg log -G -T '{rev}\n' --config experimental.graphshorten=True
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   846
  @  9
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   847
  o  8
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   848
  | o  7
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   849
  | o  6
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   850
  |/|
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   851
  | o  5
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   852
  o |  4
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   853
  | o  3
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   854
  o |  2
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   855
  |/
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   856
  o  1
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   857
  o  0
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   858
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   859
  $ 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
   860
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   861
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   862
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   863
  5
18536
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
   864
  $ log 'ancestor(ancestors(5))'
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
   865
  0
24940
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
   866
  $ log '::r3232()'
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
   867
  0
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
   868
  1
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
   869
  2
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
   870
  3
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
   871
33002
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   872
test ancestors with depth limit
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   873
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   874
 (depth=0 selects the node itself)
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   875
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   876
  $ log 'reverse(ancestors(9, depth=0))'
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   877
  9
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   878
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   879
 (interleaved: '4' would be missing if heap queue were higher depth first)
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   880
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   881
  $ log 'reverse(ancestors(8:9, depth=1))'
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   882
  9
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   883
  8
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   884
  4
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   885
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   886
 (interleaved: '2' would be missing if heap queue were higher depth first)
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   887
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   888
  $ log 'reverse(ancestors(7+8, depth=2))'
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   889
  8
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   890
  7
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   891
  6
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   892
  5
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   893
  4
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   894
  2
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   895
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   896
 (walk example above by separate queries)
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   897
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   898
  $ log 'reverse(ancestors(8, depth=2)) + reverse(ancestors(7, depth=2))'
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   899
  8
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   900
  4
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   901
  2
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   902
  7
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   903
  6
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   904
  5
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   905
33003
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
   906
 (walk 2nd and 3rd ancestors)
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
   907
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
   908
  $ log 'reverse(ancestors(7, depth=3, startdepth=2))'
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
   909
  5
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
   910
  4
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
   911
  3
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
   912
  2
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
   913
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
   914
 (interleaved: '4' would be missing if higher-depth ancestors weren't scanned)
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
   915
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
   916
  $ log 'reverse(ancestors(7+8, depth=2, startdepth=2))'
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
   917
  5
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
   918
  4
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
   919
  2
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
   920
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
   921
 (note that 'ancestors(x, depth=y, startdepth=z)' does not identical to
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
   922
 'ancestors(x, depth=y) - ancestors(x, depth=z-1)' because a node may have
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
   923
 multiple depths)
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
   924
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
   925
  $ log 'reverse(ancestors(7+8, depth=2) - ancestors(7+8, depth=1))'
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
   926
  5
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
   927
  2
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
   928
33002
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   929
test bad arguments passed to ancestors()
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   930
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   931
  $ log 'ancestors(., depth=-1)'
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   932
  hg: parse error: negative depth
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   933
  [255]
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   934
  $ log 'ancestors(., depth=foo)'
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   935
  hg: parse error: ancestors expects an integer depth
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   936
  [255]
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
   937
33074
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   938
test descendants
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   939
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   940
  $ hg log -G -T '{rev}\n' --config experimental.graphshorten=True
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   941
  @  9
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   942
  o  8
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   943
  | o  7
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   944
  | o  6
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   945
  |/|
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   946
  | o  5
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   947
  o |  4
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   948
  | o  3
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   949
  o |  2
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   950
  |/
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   951
  o  1
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   952
  o  0
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   953
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   954
 (null is ultimate root and has optimized path)
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   955
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   956
  $ log 'null:4 & descendants(null)'
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   957
  -1
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   958
  0
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   959
  1
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   960
  2
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   961
  3
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   962
  4
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   963
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   964
 (including merge)
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   965
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   966
  $ log ':8 & descendants(2)'
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   967
  2
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   968
  4
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   969
  6
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   970
  7
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   971
  8
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   972
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   973
 (multiple roots)
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   974
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   975
  $ log ':8 & descendants(2+5)'
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   976
  2
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   977
  4
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   978
  5
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   979
  6
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   980
  7
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   981
  8
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
   982
33080
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
   983
test descendants with depth limit
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
   984
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
   985
 (depth=0 selects the node itself)
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
   986
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
   987
  $ log 'descendants(0, depth=0)'
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
   988
  0
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
   989
  $ log 'null: & descendants(null, depth=0)'
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
   990
  -1
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
   991
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
   992
 (p2 = null should be ignored)
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
   993
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
   994
  $ log 'null: & descendants(null, depth=2)'
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
   995
  -1
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
   996
  0
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
   997
  1
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
   998
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
   999
 (multiple paths: depth(6) = (2, 3))
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1000
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1001
  $ log 'descendants(1+3, depth=2)'
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1002
  1
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1003
  2
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1004
  3
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1005
  4
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1006
  5
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1007
  6
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1008
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1009
 (multiple paths: depth(5) = (1, 2), depth(6) = (2, 3))
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1010
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1011
  $ log 'descendants(3+1, depth=2, startdepth=2)'
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1012
  4
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1013
  5
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1014
  6
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1015
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1016
 (multiple depths: depth(6) = (0, 2, 4), search for depth=2)
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1017
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1018
  $ log 'descendants(0+3+6, depth=3, startdepth=1)'
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1019
  1
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1020
  2
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1021
  3
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1022
  4
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1023
  5
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1024
  6
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1025
  7
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1026
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1027
 (multiple depths: depth(6) = (0, 4), no match)
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1028
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1029
  $ log 'descendants(0+6, depth=3, startdepth=1)'
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1030
  1
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1031
  2
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1032
  3
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1033
  4
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1034
  5
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1035
  7
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1036
33002
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1037
test author
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1038
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1039
  $ 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
  1040
  2
16823
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
  1041
  $ 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
  1042
  0
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
  1043
  1
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
  1044
  2
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
  1045
  3
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
  1046
  4
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
  1047
  5
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
  1048
  6
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
  1049
  7
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
  1050
  8
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
  1051
  9
30782
db38cfc7c29d revset: stop lowercasing the regex pattern for 'author'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30701
diff changeset
  1052
  $ log 'author(r"re:\S")'
db38cfc7c29d revset: stop lowercasing the regex pattern for 'author'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30701
diff changeset
  1053
  0
db38cfc7c29d revset: stop lowercasing the regex pattern for 'author'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30701
diff changeset
  1054
  1
db38cfc7c29d revset: stop lowercasing the regex pattern for 'author'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30701
diff changeset
  1055
  2
db38cfc7c29d revset: stop lowercasing the regex pattern for 'author'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30701
diff changeset
  1056
  3
db38cfc7c29d revset: stop lowercasing the regex pattern for 'author'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30701
diff changeset
  1057
  4
db38cfc7c29d revset: stop lowercasing the regex pattern for 'author'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30701
diff changeset
  1058
  5
db38cfc7c29d revset: stop lowercasing the regex pattern for 'author'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30701
diff changeset
  1059
  6
db38cfc7c29d revset: stop lowercasing the regex pattern for 'author'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30701
diff changeset
  1060
  7
db38cfc7c29d revset: stop lowercasing the regex pattern for 'author'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30701
diff changeset
  1061
  8
db38cfc7c29d revset: stop lowercasing the regex pattern for 'author'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30701
diff changeset
  1062
  9
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1063
  $ log 'branch(é)'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1064
  8
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1065
  9
16821
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
  1066
  $ log 'branch(a)'
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
  1067
  0
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
  1068
  $ 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
  1069
  0 a
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
  1070
  2 a-b-c-
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
  1071
  3 +a+b+c+
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
  1072
  4 -a-b-c-
16851
c739227b5eea test-revset: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16824
diff changeset
  1073
  5 !a/b/c/
16821
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
  1074
  6 _a_b_c_
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
  1075
  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
  1076
  $ 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
  1077
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1078
  3
30699
5bda147c3139 revset: make children() not look at p2 if null (issue5439)
Yuya Nishihara <yuya@tcha.org>
parents: 30332
diff changeset
  1079
5bda147c3139 revset: make children() not look at p2 if null (issue5439)
Yuya Nishihara <yuya@tcha.org>
parents: 30332
diff changeset
  1080
  $ log 'children(4)'
5bda147c3139 revset: make children() not look at p2 if null (issue5439)
Yuya Nishihara <yuya@tcha.org>
parents: 30332
diff changeset
  1081
  6
5bda147c3139 revset: make children() not look at p2 if null (issue5439)
Yuya Nishihara <yuya@tcha.org>
parents: 30332
diff changeset
  1082
  8
5bda147c3139 revset: make children() not look at p2 if null (issue5439)
Yuya Nishihara <yuya@tcha.org>
parents: 30332
diff changeset
  1083
  $ log 'children(null)'
5bda147c3139 revset: make children() not look at p2 if null (issue5439)
Yuya Nishihara <yuya@tcha.org>
parents: 30332
diff changeset
  1084
  0
5bda147c3139 revset: make children() not look at p2 if null (issue5439)
Yuya Nishihara <yuya@tcha.org>
parents: 30332
diff changeset
  1085
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1086
  $ log 'closed()'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1087
  $ 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
  1088
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1089
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1090
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1091
  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
  1092
  $ 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
  1093
  0
760151697a4f revset: make default kind of pattern for "contains()" rooted at cwd
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19706
diff changeset
  1094
  1
760151697a4f revset: make default kind of pattern for "contains()" rooted at cwd
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19706
diff changeset
  1095
  3
760151697a4f revset: make default kind of pattern for "contains()" rooted at cwd
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19706
diff changeset
  1096
  5
14650
93731b3efd0d revset: add desc(string) to search in commit messages
Thomas Arendsen Hein <thomas@intevation.de>
parents: 14153
diff changeset
  1097
  $ log 'desc(B)'
93731b3efd0d revset: add desc(string) to search in commit messages
Thomas Arendsen Hein <thomas@intevation.de>
parents: 14153
diff changeset
  1098
  5
30783
931a60880df4 revset: add regular expression support to 'desc'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30782
diff changeset
  1099
  $ hg log -r 'desc(r"re:S?u")' --template "{rev} {desc|firstline}\n"
931a60880df4 revset: add regular expression support to 'desc'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30782
diff changeset
  1100
  5 5 bug
931a60880df4 revset: add regular expression support to 'desc'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30782
diff changeset
  1101
  6 6 issue619
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1102
  $ 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
  1103
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1104
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1105
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1106
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1107
  6
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1108
  7
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1109
  8
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1110
  9
16411
4c2edcd84175 graphlog: correctly handle calls in subdirectories
Patrick Mezard <patrick@mezard.eu>
parents: 16218
diff changeset
  1111
  $ 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
  1112
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1113
  4
20288
b61ad01c4e73 revset: use "canonpath()" for "filelog()" pattern without explicit kind
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20286
diff changeset
  1114
  $ log 'filelog("b")'
b61ad01c4e73 revset: use "canonpath()" for "filelog()" pattern without explicit kind
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20286
diff changeset
  1115
  1
b61ad01c4e73 revset: use "canonpath()" for "filelog()" pattern without explicit kind
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20286
diff changeset
  1116
  4
b61ad01c4e73 revset: use "canonpath()" for "filelog()" pattern without explicit kind
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20286
diff changeset
  1117
  $ 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
  1118
  1
b61ad01c4e73 revset: use "canonpath()" for "filelog()" pattern without explicit kind
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20286
diff changeset
  1119
  4
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1120
  $ log 'follow()'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1121
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1122
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1123
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1124
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1125
  8
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1126
  9
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1127
  $ 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
  1128
  6
12321
11db6fa2961e merge with stable
Martin Geisler <mg@aragost.com>
parents: 12320 12316
diff changeset
  1129
  $ try 'grep("(")' # invalid regular expression
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1130
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1131
    ('symbol', 'grep')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1132
    ('string', '('))
12321
11db6fa2961e merge with stable
Martin Geisler <mg@aragost.com>
parents: 12320 12316
diff changeset
  1133
  hg: parse error: invalid match pattern: unbalanced parenthesis
11db6fa2961e merge with stable
Martin Geisler <mg@aragost.com>
parents: 12320 12316
diff changeset
  1134
  [255]
12408
78a97859b90d revset: support raw string literals
Brodie Rao <brodie@bitheap.org>
parents: 12321
diff changeset
  1135
  $ try 'grep("\bissue\d+")'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1136
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1137
    ('symbol', 'grep')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1138
    ('string', '\x08issue\\d+'))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1139
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1140
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  1141
    <fullreposet+ 0:10>,
28424
534f968d33e5 revset: add inspection data to all filter() calls
Yuya Nishihara <yuya@tcha.org>
parents: 28423
diff changeset
  1142
    <grep '\x08issue\\d+'>>
12408
78a97859b90d revset: support raw string literals
Brodie Rao <brodie@bitheap.org>
parents: 12321
diff changeset
  1143
  $ try 'grep(r"\bissue\d+")'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1144
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1145
    ('symbol', 'grep')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1146
    ('string', '\\bissue\\d+'))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1147
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1148
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  1149
    <fullreposet+ 0:10>,
28424
534f968d33e5 revset: add inspection data to all filter() calls
Yuya Nishihara <yuya@tcha.org>
parents: 28423
diff changeset
  1150
    <grep '\\bissue\\d+'>>
12408
78a97859b90d revset: support raw string literals
Brodie Rao <brodie@bitheap.org>
parents: 12321
diff changeset
  1151
  6
78a97859b90d revset: support raw string literals
Brodie Rao <brodie@bitheap.org>
parents: 12321
diff changeset
  1152
  $ try 'grep(r"\")'
78a97859b90d revset: support raw string literals
Brodie Rao <brodie@bitheap.org>
parents: 12321
diff changeset
  1153
  hg: parse error at 7: unterminated string
78a97859b90d revset: support raw string literals
Brodie Rao <brodie@bitheap.org>
parents: 12321
diff changeset
  1154
  [255]
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1155
  $ log 'head()'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1156
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1157
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1158
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1159
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1160
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1161
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1162
  6
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1163
  7
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1164
  9
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1165
  $ 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
  1166
  7
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1167
  $ 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
  1168
  6
19706
26ddce1a2a55 revset: fix wrong keyword() behaviour for strings with spaces
Alexander Plavin <alexander@plav.in>
parents: 18955
diff changeset
  1169
  $ log 'keyword("test a")'
32798
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1170
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1171
Test first (=limit) and last
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1172
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1173
  $ 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
  1174
  0
26638
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
  1175
  $ 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
  1176
  5
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
  1177
  6
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
  1178
  7
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
  1179
  $ 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
  1180
  6
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
  1181
  $ 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
  1182
  $ log 'limit(all(), 1, -1)'
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
  1183
  hg: parse error: negative offset
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
  1184
  [255]
32799
b36ec65ea583 revset: reject negative number to select first/last n members
Yuya Nishihara <yuya@tcha.org>
parents: 32798
diff changeset
  1185
  $ log 'limit(all(), -1)'
b36ec65ea583 revset: reject negative number to select first/last n members
Yuya Nishihara <yuya@tcha.org>
parents: 32798
diff changeset
  1186
  hg: parse error: negative number to select
b36ec65ea583 revset: reject negative number to select first/last n members
Yuya Nishihara <yuya@tcha.org>
parents: 32798
diff changeset
  1187
  [255]
b36ec65ea583 revset: reject negative number to select first/last n members
Yuya Nishihara <yuya@tcha.org>
parents: 32798
diff changeset
  1188
  $ log 'limit(all(), 0)'
b36ec65ea583 revset: reject negative number to select first/last n members
Yuya Nishihara <yuya@tcha.org>
parents: 32798
diff changeset
  1189
b36ec65ea583 revset: reject negative number to select first/last n members
Yuya Nishihara <yuya@tcha.org>
parents: 32798
diff changeset
  1190
  $ log 'last(all(), -1)'
b36ec65ea583 revset: reject negative number to select first/last n members
Yuya Nishihara <yuya@tcha.org>
parents: 32798
diff changeset
  1191
  hg: parse error: negative number to select
b36ec65ea583 revset: reject negative number to select first/last n members
Yuya Nishihara <yuya@tcha.org>
parents: 32798
diff changeset
  1192
  [255]
32798
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1193
  $ log 'last(all(), 0)'
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1194
  $ log 'last(all(), 1)'
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1195
  9
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1196
  $ log 'last(all(), 2)'
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1197
  8
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1198
  9
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1199
32819
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1200
Test smartset.slice() by first/last()
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1201
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1202
 (using unoptimized set, filteredset as example)
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1203
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1204
  $ hg debugrevspec --no-show-revs -s '0:7 & branch("re:")'
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1205
  * set:
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1206
  <filteredset
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1207
    <spanset+ 0:8>,
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1208
    <branch 're:'>>
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1209
  $ log 'limit(0:7 & branch("re:"), 3, 4)'
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1210
  4
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1211
  5
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1212
  6
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1213
  $ log 'limit(7:0 & branch("re:"), 3, 4)'
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1214
  3
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1215
  2
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1216
  1
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1217
  $ log 'last(0:7 & branch("re:"), 2)'
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1218
  6
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1219
  7
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1220
32820
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1221
 (using baseset)
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1222
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1223
  $ hg debugrevspec --no-show-revs -s 0+1+2+3+4+5+6+7
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1224
  * set:
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1225
  <baseset [0, 1, 2, 3, 4, 5, 6, 7]>
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1226
  $ hg debugrevspec --no-show-revs -s 0::7
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1227
  * set:
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1228
  <baseset+ [0, 1, 2, 3, 4, 5, 6, 7]>
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1229
  $ log 'limit(0+1+2+3+4+5+6+7, 3, 4)'
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1230
  4
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1231
  5
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1232
  6
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1233
  $ log 'limit(sort(0::7, rev), 3, 4)'
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1234
  4
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1235
  5
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1236
  6
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1237
  $ log 'limit(sort(0::7, -rev), 3, 4)'
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1238
  3
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1239
  2
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1240
  1
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1241
  $ log 'last(sort(0::7, rev), 2)'
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1242
  6
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1243
  7
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1244
  $ hg debugrevspec -s 'limit(sort(0::7, rev), 3, 6)'
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1245
  * set:
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1246
  <baseset+ [6, 7]>
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1247
  6
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1248
  7
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1249
  $ hg debugrevspec -s 'limit(sort(0::7, rev), 3, 9)'
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1250
  * set:
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1251
  <baseset+ []>
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1252
  $ hg debugrevspec -s 'limit(sort(0::7, -rev), 3, 6)'
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1253
  * set:
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1254
  <baseset- [0, 1]>
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1255
  1
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1256
  0
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1257
  $ hg debugrevspec -s 'limit(sort(0::7, -rev), 3, 9)'
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1258
  * set:
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1259
  <baseset- []>
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1260
  $ hg debugrevspec -s 'limit(0::7, 0)'
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1261
  * set:
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1262
  <baseset+ []>
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1263
32821
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1264
 (using spanset)
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1265
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1266
  $ hg debugrevspec --no-show-revs -s 0:7
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1267
  * set:
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1268
  <spanset+ 0:8>
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1269
  $ log 'limit(0:7, 3, 4)'
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1270
  4
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1271
  5
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1272
  6
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1273
  $ log 'limit(7:0, 3, 4)'
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1274
  3
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1275
  2
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1276
  1
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1277
  $ log 'limit(0:7, 3, 6)'
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1278
  6
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1279
  7
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1280
  $ log 'limit(7:0, 3, 6)'
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1281
  1
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1282
  0
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1283
  $ log 'last(0:7, 2)'
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1284
  6
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1285
  7
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1286
  $ hg debugrevspec -s 'limit(0:7, 3, 6)'
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1287
  * set:
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1288
  <spanset+ 6:8>
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1289
  6
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1290
  7
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1291
  $ hg debugrevspec -s 'limit(0:7, 3, 9)'
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1292
  * set:
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1293
  <spanset+ 8:8>
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1294
  $ hg debugrevspec -s 'limit(7:0, 3, 6)'
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1295
  * set:
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1296
  <spanset- 0:2>
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1297
  1
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1298
  0
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1299
  $ hg debugrevspec -s 'limit(7:0, 3, 9)'
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1300
  * set:
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1301
  <spanset- 0:0>
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1302
  $ hg debugrevspec -s 'limit(0:7, 0)'
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1303
  * set:
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1304
  <spanset+ 0:0>
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1305
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1306
Test order of first/last revisions
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1307
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1308
  $ hg debugrevspec -s 'first(4:0, 3) & 3:'
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1309
  * set:
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1310
  <filteredset
32821
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1311
    <spanset- 2:5>,
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  1312
    <spanset+ 3:10>>
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1313
  4
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1314
  3
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1315
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1316
  $ hg debugrevspec -s '3: & first(4:0, 3)'
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1317
  * set:
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1318
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  1319
    <spanset+ 3:10>,
32821
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1320
    <spanset- 2:5>>
32801
348b491c0934 revset: fix order of first/last members in compound expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32800
diff changeset
  1321
  3
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1322
  4
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1323
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1324
  $ hg debugrevspec -s 'last(4:0, 3) & :1'
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1325
  * set:
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1326
  <filteredset
32821
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1327
    <spanset- 0:3>,
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  1328
    <spanset+ 0:2>>
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1329
  1
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1330
  0
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1331
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1332
  $ hg debugrevspec -s ':1 & last(4:0, 3)'
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1333
  * set:
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1334
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  1335
    <spanset+ 0:2>,
32821
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1336
    <spanset+ 0:3>>
32801
348b491c0934 revset: fix order of first/last members in compound expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32800
diff changeset
  1337
  0
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1338
  1
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1339
32798
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1340
Test matching
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1341
16447
60c379da12aa tests: add tests for matching keyword
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 16415
diff changeset
  1342
  $ log 'matching(6)'
60c379da12aa tests: add tests for matching keyword
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 16415
diff changeset
  1343
  6
60c379da12aa tests: add tests for matching keyword
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 16415
diff changeset
  1344
  $ 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
  1345
  6
60c379da12aa tests: add tests for matching keyword
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 16415
diff changeset
  1346
  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
  1347
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1348
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
  1349
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1350
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
  1351
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1352
  $ 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
  1353
  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
  1354
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1355
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
  1356
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1357
  $ 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
  1358
  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
  1359
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1360
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
  1361
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1362
  $ 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
  1363
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1364
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
  1365
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1366
  $ 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
  1367
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1368
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
  1369
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1370
  $ 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
  1371
  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
  1372
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1373
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
  1374
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1375
  $ 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
  1376
  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
  1377
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1378
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
  1379
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1380
  $ 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
  1381
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1382
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
  1383
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1384
  $ 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
  1385
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1386
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1387
  $ log 'merge()'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1388
  6
17753
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1389
  $ log 'branchpoint()'
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1390
  1
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1391
  4
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1392
  $ 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
  1393
  4
16521
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
  1394
  $ log 'modifies("path:b")'
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
  1395
  4
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
  1396
  $ log 'modifies("*")'
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
  1397
  4
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
  1398
  6
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
  1399
  $ log 'modifies("set:modified()")'
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
  1400
  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
  1401
  $ 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
  1402
  2
20613
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1403
  $ log 'only(9)'
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1404
  8
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1405
  9
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1406
  $ log 'only(8)'
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1407
  8
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1408
  $ log 'only(9, 5)'
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1409
  2
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1410
  4
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1411
  8
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1412
  9
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1413
  $ log 'only(7 + 9, 5 + 2)'
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1414
  4
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1415
  6
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1416
  7
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1417
  8
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1418
  9
21925
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
  1419
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
  1420
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
  1421
  $ 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
  1422
  $ 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
  1423
  0
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
  1424
  1
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
  1425
  2
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
  1426
  4
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
  1427
  8
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
  1428
  9
23062
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
  1429
23765
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1430
Test '%' operator
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1431
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1432
  $ log '9%'
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1433
  8
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1434
  9
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1435
  $ log '9%5'
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1436
  2
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1437
  4
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1438
  8
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1439
  9
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1440
  $ log '(7 + 9)%(5 + 2)'
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1441
  4
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1442
  6
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1443
  7
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1444
  8
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1445
  9
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1446
30332
318a24b52eeb spelling: fixes of non-dictionary words
Mads Kiilerich <madski@unity3d.com>
parents: 30179
diff changeset
  1447
Test operand of '%' is optimized recursively (issue4670)
25094
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1448
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1449
  $ 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
  1450
  (onlypost
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1451
    (minus
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1452
      (range
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1453
        ('symbol', '8')
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1454
        ('symbol', '9'))
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1455
      ('symbol', '8')))
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1456
  * optimized:
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1457
  (func
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1458
    ('symbol', 'only')
28217
d2ac8b57a75d revset: use smartset minus operator
Durham Goode <durham@fb.com>
parents: 28015
diff changeset
  1459
    (difference
25094
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1460
      (range
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1461
        ('symbol', '8')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1462
        ('symbol', '9')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1463
        define)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1464
      ('symbol', '8')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1465
      define)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1466
    define)
25094
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1467
  * set:
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1468
  <baseset+ [8, 9]>
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1469
  8
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1470
  9
25105
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1471
  $ try --optimize '(9)%(5)'
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1472
  (only
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1473
    (group
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1474
      ('symbol', '9'))
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1475
    (group
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1476
      ('symbol', '5')))
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1477
  * optimized:
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1478
  (func
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1479
    ('symbol', 'only')
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1480
    (list
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1481
      ('symbol', '9')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1482
      ('symbol', '5'))
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1483
    define)
25105
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1484
  * set:
28785
87b89dca669d revset: stabilize repr of baseset initialized with a set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 28690
diff changeset
  1485
  <baseset+ [2, 4, 8, 9]>
25105
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1486
  2
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1487
  4
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1488
  8
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1489
  9
25094
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1490
23765
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1491
Test the order of operations
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1492
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1493
  $ log '7 + 9%5 + 2'
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1494
  7
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1495
  2
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1496
  4
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1497
  8
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1498
  9
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1499
23062
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
  1500
Test explicit numeric revision
23954
310222feb9a8 revset: allow rev(-1) to indicate null revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 23846
diff changeset
  1501
  $ 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
  1502
  $ log 'rev(-1)'
23954
310222feb9a8 revset: allow rev(-1) to indicate null revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 23846
diff changeset
  1503
  -1
23062
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
  1504
  $ 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
  1505
  0
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
  1506
  $ 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
  1507
  9
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
  1508
  $ 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
  1509
  $ 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
  1510
  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
  1511
  [255]
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
  1512
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
  1513
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
  1514
  $ 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
  1515
  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
  1516
  [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
  1517
  $ 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
  1518
  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
  1519
  $ 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
  1520
  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
  1521
  $ 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
  1522
  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
  1523
  $ 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
  1524
  $ 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
  1525
  $ 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
  1526
  $ 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
  1527
  $ 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
  1528
  $ 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
  1529
23956
b1e026c25552 revset: fix ancestors(null) to include null revision (issue4512)
Yuya Nishihara <yuya@tcha.org>
parents: 23954
diff changeset
  1530
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
  1531
  $ log '(null)'
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1532
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1533
  $ log '(null:0)'
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1534
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1535
  0
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1536
  $ log '(0:null)'
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1537
  0
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1538
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1539
  $ log 'null::0'
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1540
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1541
  0
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1542
  $ 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
  1543
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1544
  $ 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
  1545
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1546
  $ 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
  1547
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1548
  0
23956
b1e026c25552 revset: fix ancestors(null) to include null revision (issue4512)
Yuya Nishihara <yuya@tcha.org>
parents: 23954
diff changeset
  1549
  $ log 'ancestors(null)'
b1e026c25552 revset: fix ancestors(null) to include null revision (issue4512)
Yuya Nishihara <yuya@tcha.org>
parents: 23954
diff changeset
  1550
  -1
24204
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1551
  $ 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
  1552
  0
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1553
  -1
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1554
  $ log 'first(null:)'
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1555
  -1
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1556
  $ log 'min(null:)'
25265
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  1557
BROKEN: should be '-1'
24202
2de9ee016425 revset: have all() filter out null revision
Yuya Nishihara <yuya@tcha.org>
parents: 24175
diff changeset
  1558
  $ log 'tip:null and all()' | tail -2
2de9ee016425 revset: have all() filter out null revision
Yuya Nishihara <yuya@tcha.org>
parents: 24175
diff changeset
  1559
  1
2de9ee016425 revset: have all() filter out null revision
Yuya Nishihara <yuya@tcha.org>
parents: 24175
diff changeset
  1560
  0
23956
b1e026c25552 revset: fix ancestors(null) to include null revision (issue4512)
Yuya Nishihara <yuya@tcha.org>
parents: 23954
diff changeset
  1561
24419
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 24222
diff changeset
  1562
Test working-directory revision
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 24222
diff changeset
  1563
  $ hg debugrevspec 'wdir()'
25765
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
  1564
  2147483647
32404
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1565
  $ hg debugrevspec 'wdir()^'
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1566
  9
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1567
  $ hg up 7
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1568
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1569
  $ hg debugrevspec 'wdir()^'
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1570
  7
32437
f03dcb3f95a5 tests: add tests for predicates and operators which works with wdir()
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32436
diff changeset
  1571
  $ hg debugrevspec 'wdir()^0'
f03dcb3f95a5 tests: add tests for predicates and operators which works with wdir()
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32436
diff changeset
  1572
  2147483647
32441
018f638ad88e revset: add support for using ~ operator on wdir() predicate
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32440
diff changeset
  1573
  $ hg debugrevspec 'wdir()~3'
018f638ad88e revset: add support for using ~ operator on wdir() predicate
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32440
diff changeset
  1574
  5
32442
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1575
  $ hg debugrevspec 'ancestors(wdir())'
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1576
  0
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1577
  1
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1578
  2
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1579
  3
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1580
  4
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1581
  5
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1582
  6
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1583
  7
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1584
  2147483647
32437
f03dcb3f95a5 tests: add tests for predicates and operators which works with wdir()
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32436
diff changeset
  1585
  $ hg debugrevspec 'wdir()~0'
f03dcb3f95a5 tests: add tests for predicates and operators which works with wdir()
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32436
diff changeset
  1586
  2147483647
f03dcb3f95a5 tests: add tests for predicates and operators which works with wdir()
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32436
diff changeset
  1587
  $ hg debugrevspec 'p1(wdir())'
f03dcb3f95a5 tests: add tests for predicates and operators which works with wdir()
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32436
diff changeset
  1588
  7
32440
c8fb2a82b5f9 revset: add support for p2(wdir()) to get second parent of working directory
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32437
diff changeset
  1589
  $ hg debugrevspec 'p2(wdir())'
32437
f03dcb3f95a5 tests: add tests for predicates and operators which works with wdir()
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32436
diff changeset
  1590
  $ hg debugrevspec 'parents(wdir())'
f03dcb3f95a5 tests: add tests for predicates and operators which works with wdir()
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32436
diff changeset
  1591
  7
32436
f064e2f72c49 revset: add support for "wdir()^n"
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32404
diff changeset
  1592
  $ hg debugrevspec 'wdir()^1'
f064e2f72c49 revset: add support for "wdir()^n"
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32404
diff changeset
  1593
  7
f064e2f72c49 revset: add support for "wdir()^n"
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32404
diff changeset
  1594
  $ hg debugrevspec 'wdir()^2'
f064e2f72c49 revset: add support for "wdir()^n"
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32404
diff changeset
  1595
  $ hg debugrevspec 'wdir()^3'
f064e2f72c49 revset: add support for "wdir()^n"
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32404
diff changeset
  1596
  hg: parse error: ^ expects a number 0, 1, or 2
f064e2f72c49 revset: add support for "wdir()^n"
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32404
diff changeset
  1597
  [255]
32404
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1598
For tests consistency
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1599
  $ hg up 9
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1600
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
24419
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 24222
diff changeset
  1601
  $ 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
  1602
  9
25765
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
  1603
  2147483647
24419
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 24222
diff changeset
  1604
  $ 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
  1605
  $ 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
  1606
  8
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
  1607
  9
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
  1608
  2147483647
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
  1609
  $ 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
  1610
  2147483647
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
  1611
  9
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
  1612
  8
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
  1613
  $ 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
  1614
  2147483647
25765
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
  1615
  $ log '(all() + wdir()) & min(. + wdir())'
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
  1616
  9
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
  1617
  $ log '(all() + wdir()) & max(. + wdir())'
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
  1618
  2147483647
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1619
  $ log 'first(wdir() + .)'
25765
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
  1620
  2147483647
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1621
  $ log 'last(. + wdir())'
25765
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
  1622
  2147483647
24419
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 24222
diff changeset
  1623
32661
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1624
Test working-directory integer revision and node id
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1625
(BUG: '0:wdir()' is still needed to populate wdir revision)
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1626
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1627
  $ hg debugrevspec '0:wdir() & 2147483647'
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1628
  2147483647
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1629
  $ hg debugrevspec '0:wdir() & rev(2147483647)'
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1630
  2147483647
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1631
  $ hg debugrevspec '0:wdir() & ffffffffffffffffffffffffffffffffffffffff'
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1632
  2147483647
32684
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1633
  $ hg debugrevspec '0:wdir() & ffffffffffff'
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1634
  2147483647
32661
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1635
  $ hg debugrevspec '0:wdir() & id(ffffffffffffffffffffffffffffffffffffffff)'
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1636
  2147483647
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1637
  $ hg debugrevspec '0:wdir() & id(ffffffffffff)'
32684
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1638
  2147483647
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1639
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1640
  $ cd ..
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1641
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1642
Test short 'ff...' hash collision
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1643
(BUG: '0:wdir()' is still needed to populate wdir revision)
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1644
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1645
  $ hg init wdir-hashcollision
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1646
  $ cd wdir-hashcollision
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1647
  $ cat <<EOF >> .hg/hgrc
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1648
  > [experimental]
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1649
  > evolution = createmarkers
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1650
  > EOF
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1651
  $ echo 0 > a
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1652
  $ hg ci -qAm 0
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1653
  $ for i in 2463 2961 6726 78127; do
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1654
  >   hg up -q 0
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1655
  >   echo $i > a
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1656
  >   hg ci -qm $i
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1657
  > done
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1658
  $ hg up -q null
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1659
  $ hg log -r '0:wdir()' -T '{rev}:{node} {shortest(node, 3)}\n'
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1660
  0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a b4e
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1661
  1:fffbae3886c8fbb2114296380d276fd37715d571 fffba
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1662
  2:fffb6093b00943f91034b9bdad069402c834e572 fffb6
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1663
  3:fff48a9b9de34a4d64120c29548214c67980ade3 fff4
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1664
  4:ffff85cff0ff78504fcdc3c0bc10de0c65379249 ffff8
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1665
  2147483647:ffffffffffffffffffffffffffffffffffffffff fffff
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1666
  $ hg debugobsolete fffbae3886c8fbb2114296380d276fd37715d571
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1667
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1668
  $ hg debugrevspec '0:wdir() & fff'
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1669
  abort: 00changelog.i@fff: ambiguous identifier!
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1670
  [255]
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1671
  $ hg debugrevspec '0:wdir() & ffff'
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1672
  abort: 00changelog.i@ffff: ambiguous identifier!
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1673
  [255]
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1674
  $ hg debugrevspec '0:wdir() & fffb'
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1675
  abort: 00changelog.i@fffb: ambiguous identifier!
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1676
  [255]
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1677
BROKEN should be '2' (node lookup uses unfiltered repo since dc25ed84bee8)
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1678
  $ hg debugrevspec '0:wdir() & id(fffb)'
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1679
  2
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1680
  $ hg debugrevspec '0:wdir() & ffff8'
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1681
  4
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1682
  $ hg debugrevspec '0:wdir() & fffff'
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1683
  2147483647
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1684
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1685
  $ cd ..
32661
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1686
32683
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1687
Test branch() with wdir()
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1688
32684
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1689
  $ cd repo
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1690
32683
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1691
  $ log '0:wdir() & branch("literal:é")'
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1692
  8
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1693
  9
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1694
  2147483647
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1695
  $ log '0:wdir() & branch("re:é")'
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1696
  8
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1697
  9
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1698
  2147483647
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1699
  $ log '0:wdir() & branch("re:^a")'
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1700
  0
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1701
  2
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1702
  $ log '0:wdir() & branch(8)'
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1703
  8
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1704
  9
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1705
  2147483647
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1706
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1707
branch(wdir()) returns all revisions belonging to the working branch. The wdir
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1708
itself isn't returned unless it is explicitly populated.
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1709
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1710
  $ log 'branch(wdir())'
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1711
  8
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1712
  9
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1713
  $ log '0:wdir() & branch(wdir())'
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1714
  8
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1715
  9
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1716
  2147483647
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1717
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1718
  $ log 'outgoing()'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1719
  8
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1720
  9
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1721
  $ 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
  1722
  8
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1723
  9
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1724
  $ 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
  1725
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1726
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1727
  6
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1728
  7
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1729
  9
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1730
  $ 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
  1731
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1732
  $ 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
  1733
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1734
  $ 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
  1735
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1736
  5
17753
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1737
  $ log 'p1(branchpoint())'
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1738
  0
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1739
  2
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1740
  $ log 'p2(branchpoint())'
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1741
  $ log 'parents(branchpoint())'
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1742
  0
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1743
  2
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1744
  $ 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
  1745
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1746
  6
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1747
  $ 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
  1748
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1749
  $ 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
  1750
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1751
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1752
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1753
  2
17100
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1754
  $ log 'reverse(all())'
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1755
  9
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1756
  8
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1757
  7
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1758
  6
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1759
  5
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1760
  4
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1761
  3
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1762
  2
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1763
  1
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1764
  0
23826
c90d195320c5 revset: fix spanset.isascending() to honor sort() or reverse() request
Yuya Nishihara <yuya@tcha.org>
parents: 23062
diff changeset
  1765
  $ 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
  1766
  4
c90d195320c5 revset: fix spanset.isascending() to honor sort() or reverse() request
Yuya Nishihara <yuya@tcha.org>
parents: 23062
diff changeset
  1767
  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
  1768
  $ 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
  1769
  5
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1770
  $ 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
  1771
  7
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1772
  8
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1773
  9
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1774
  $ 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
  1775
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1776
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1777
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1778
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1779
  $ log 'tagged()'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1780
  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
  1781
  $ 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
  1782
  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
  1783
  $ 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
  1784
  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
  1785
  $ 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
  1786
  9
16820
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
  1787
29139
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  1788
Test order of revisions in compound expression
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  1789
----------------------------------------------
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  1790
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1791
The general rule is that only the outermost (= leftmost) predicate can
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1792
enforce its ordering requirement. The other predicates should take the
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1793
ordering defined by it.
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1794
29139
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  1795
 'A & B' should follow the order of 'A':
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  1796
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  1797
  $ log '2:0 & 0::2'
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  1798
  2
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  1799
  1
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  1800
  0
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  1801
29408
785cadec2091 revset: make head() honor order of subset
Martin von Zweigbergk <martinvonz@google.com>
parents: 29390
diff changeset
  1802
 'head()' combines sets in right order:
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1803
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1804
  $ log '2:0 & head()'
29408
785cadec2091 revset: make head() honor order of subset
Martin von Zweigbergk <martinvonz@google.com>
parents: 29390
diff changeset
  1805
  2
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1806
  1
29408
785cadec2091 revset: make head() honor order of subset
Martin von Zweigbergk <martinvonz@google.com>
parents: 29390
diff changeset
  1807
  0
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1808
29944
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1809
 'x:y' takes ordering parameter into account:
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1810
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1811
  $ try -p optimized '3:0 & 0:3 & not 2:1'
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1812
  * optimized:
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1813
  (difference
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1814
    (and
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1815
      (range
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1816
        ('symbol', '3')
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1817
        ('symbol', '0')
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1818
        define)
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1819
      (range
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1820
        ('symbol', '0')
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1821
        ('symbol', '3')
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1822
        follow)
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1823
      define)
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1824
    (range
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1825
      ('symbol', '2')
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1826
      ('symbol', '1')
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1827
      any)
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1828
    define)
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1829
  * set:
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1830
  <filteredset
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1831
    <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  1832
      <spanset- 0:4>,
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  1833
      <spanset+ 0:4>>,
29944
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1834
    <not
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  1835
      <spanset+ 1:3>>>
29944
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1836
  3
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1837
  0
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1838
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1839
 'a + b', which is optimized to '_list(a b)', should take the ordering of
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1840
 the left expression:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1841
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1842
  $ try --optimize '2:0 & (0 + 1 + 2)'
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1843
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1844
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1845
      ('symbol', '2')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1846
      ('symbol', '0'))
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1847
    (group
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1848
      (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  1849
        (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  1850
          ('symbol', '0')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  1851
          ('symbol', '1')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  1852
          ('symbol', '2')))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1853
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1854
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1855
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1856
      ('symbol', '2')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1857
      ('symbol', '0')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1858
      define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1859
    (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1860
      ('symbol', '_list')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1861
      ('string', '0\x001\x002')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1862
      follow)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1863
    define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1864
  * set:
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  1865
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  1866
    <spanset- 0:3>,
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  1867
    <baseset [0, 1, 2]>>
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  1868
  2
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1869
  1
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  1870
  0
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1871
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1872
 'A + B' should take the ordering of the left expression:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1873
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1874
  $ try --optimize '2:0 & (0:1 + 2)'
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1875
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1876
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1877
      ('symbol', '2')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1878
      ('symbol', '0'))
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1879
    (group
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1880
      (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  1881
        (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  1882
          (range
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  1883
            ('symbol', '0')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  1884
            ('symbol', '1'))
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  1885
          ('symbol', '2')))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1886
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1887
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1888
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1889
      ('symbol', '2')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1890
      ('symbol', '0')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1891
      define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1892
    (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  1893
      (list
31800
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  1894
        ('symbol', '2')
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  1895
        (range
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  1896
          ('symbol', '0')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1897
          ('symbol', '1')
31800
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  1898
          follow))
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1899
      follow)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1900
    define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1901
  * set:
29934
2c6a05b938d8 revset: fix order of nested 'or' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29932
diff changeset
  1902
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  1903
    <spanset- 0:3>,
29934
2c6a05b938d8 revset: fix order of nested 'or' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29932
diff changeset
  1904
    <addset
31800
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  1905
      <baseset [2]>,
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  1906
      <spanset+ 0:2>>>
29934
2c6a05b938d8 revset: fix order of nested 'or' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29932
diff changeset
  1907
  2
2c6a05b938d8 revset: fix order of nested 'or' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29932
diff changeset
  1908
  1
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1909
  0
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1910
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1911
 '_intlist(a b)' should behave like 'a + b':
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1912
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1913
  $ trylist --optimize '2:0 & %ld' 0 1 2
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1914
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1915
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1916
      ('symbol', '2')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1917
      ('symbol', '0'))
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1918
    (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1919
      ('symbol', '_intlist')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1920
      ('string', '0\x001\x002')))
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1921
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1922
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1923
    (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1924
      ('symbol', '_intlist')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1925
      ('string', '0\x001\x002')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1926
      follow)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1927
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1928
      ('symbol', '2')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1929
      ('symbol', '0')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1930
      define)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1931
    define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1932
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1933
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  1934
    <spanset- 0:3>,
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  1935
    <baseset+ [0, 1, 2]>>
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1936
  2
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1937
  1
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1938
  0
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1939
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1940
  $ trylist --optimize '%ld & 2:0' 0 2 1
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1941
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1942
    (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1943
      ('symbol', '_intlist')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1944
      ('string', '0\x002\x001'))
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1945
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1946
      ('symbol', '2')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1947
      ('symbol', '0')))
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1948
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1949
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1950
    (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1951
      ('symbol', '_intlist')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1952
      ('string', '0\x002\x001')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1953
      define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1954
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1955
      ('symbol', '2')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1956
      ('symbol', '0')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1957
      follow)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1958
    define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1959
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1960
  <filteredset
29944
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1961
    <baseset [0, 2, 1]>,
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  1962
    <spanset- 0:3>>
29944
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  1963
  0
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1964
  2
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1965
  1
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1966
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1967
 '_hexlist(a b)' should behave like 'a + b':
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1968
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1969
  $ trylist --optimize --bin '2:0 & %ln' `hg log -T '{node} ' -r0:2`
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1970
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1971
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1972
      ('symbol', '2')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1973
      ('symbol', '0'))
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1974
    (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1975
      ('symbol', '_hexlist')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1976
      ('string', '*'))) (glob)
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1977
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1978
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1979
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1980
      ('symbol', '2')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1981
      ('symbol', '0')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1982
      define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1983
    (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1984
      ('symbol', '_hexlist')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1985
      ('string', '*') (glob)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1986
      follow)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  1987
    define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1988
  * set:
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  1989
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  1990
    <spanset- 0:3>,
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  1991
    <baseset [0, 1, 2]>>
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  1992
  2
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1993
  1
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  1994
  0
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1995
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1996
  $ trylist --optimize --bin '%ln & 2:0' `hg log -T '{node} ' -r0+2+1`
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1997
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1998
    (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1999
      ('symbol', '_hexlist')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2000
      ('string', '*')) (glob)
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2001
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2002
      ('symbol', '2')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2003
      ('symbol', '0')))
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2004
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2005
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2006
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2007
      ('symbol', '2')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2008
      ('symbol', '0')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2009
      follow)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2010
    (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2011
      ('symbol', '_hexlist')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2012
      ('string', '*') (glob)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2013
      define)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2014
    define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2015
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2016
  <baseset [0, 2, 1]>
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2017
  0
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2018
  2
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2019
  1
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2020
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2021
 '_list' should not go through the slow follow-order path if order doesn't
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2022
 matter:
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2023
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2024
  $ try -p optimized '2:0 & not (0 + 1)'
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2025
  * optimized:
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2026
  (difference
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2027
    (range
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2028
      ('symbol', '2')
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2029
      ('symbol', '0')
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2030
      define)
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2031
    (func
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2032
      ('symbol', '_list')
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2033
      ('string', '0\x001')
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2034
      any)
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2035
    define)
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2036
  * set:
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2037
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2038
    <spanset- 0:3>,
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2039
    <not
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2040
      <baseset [0, 1]>>>
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2041
  2
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2042
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2043
  $ try -p optimized '2:0 & not (0:2 & (0 + 1))'
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2044
  * optimized:
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2045
  (difference
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2046
    (range
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2047
      ('symbol', '2')
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2048
      ('symbol', '0')
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2049
      define)
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2050
    (and
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2051
      (range
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2052
        ('symbol', '0')
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2053
        ('symbol', '2')
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2054
        any)
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2055
      (func
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2056
        ('symbol', '_list')
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2057
        ('string', '0\x001')
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2058
        any)
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2059
      any)
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2060
    define)
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2061
  * set:
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2062
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2063
    <spanset- 0:3>,
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2064
    <not
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2065
      <baseset [0, 1]>>>
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2066
  2
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2067
29943
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2068
 because 'present()' does nothing other than suppressing an error, the
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2069
 ordering requirement should be forwarded to the nested expression
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2070
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2071
  $ try -p optimized 'present(2 + 0 + 1)'
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2072
  * optimized:
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2073
  (func
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2074
    ('symbol', 'present')
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2075
    (func
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2076
      ('symbol', '_list')
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2077
      ('string', '2\x000\x001')
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2078
      define)
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2079
    define)
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2080
  * set:
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2081
  <baseset [2, 0, 1]>
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2082
  2
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2083
  0
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2084
  1
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2085
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2086
  $ try --optimize '2:0 & present(0 + 1 + 2)'
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2087
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2088
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2089
      ('symbol', '2')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2090
      ('symbol', '0'))
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2091
    (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2092
      ('symbol', 'present')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2093
      (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2094
        (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2095
          ('symbol', '0')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2096
          ('symbol', '1')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2097
          ('symbol', '2')))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2098
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2099
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2100
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2101
      ('symbol', '2')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2102
      ('symbol', '0')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2103
      define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2104
    (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2105
      ('symbol', 'present')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2106
      (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2107
        ('symbol', '_list')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2108
        ('string', '0\x001\x002')
29943
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2109
        follow)
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2110
      follow)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2111
    define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2112
  * set:
29943
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2113
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2114
    <spanset- 0:3>,
29943
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2115
    <baseset [0, 1, 2]>>
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2116
  2
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2117
  1
29943
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2118
  0
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2119
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2120
 'reverse()' should take effect only if it is the outermost expression:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2121
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2122
  $ try --optimize '0:2 & reverse(all())'
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2123
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2124
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2125
      ('symbol', '0')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2126
      ('symbol', '2'))
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2127
    (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2128
      ('symbol', 'reverse')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2129
      (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2130
        ('symbol', 'all')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2131
        None)))
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2132
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2133
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2134
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2135
      ('symbol', '0')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2136
      ('symbol', '2')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2137
      define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2138
    (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2139
      ('symbol', 'reverse')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2140
      (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2141
        ('symbol', 'all')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2142
        None
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2143
        define)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2144
      follow)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2145
    define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2146
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2147
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2148
    <spanset+ 0:3>,
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2149
    <spanset+ 0:10>>
29945
89dbae952ec1 revset: make reverse() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29944
diff changeset
  2150
  0
89dbae952ec1 revset: make reverse() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29944
diff changeset
  2151
  1
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2152
  2
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2153
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2154
 'sort()' should take effect only if it is the outermost expression:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2155
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2156
  $ try --optimize '0:2 & sort(all(), -rev)'
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2157
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2158
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2159
      ('symbol', '0')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2160
      ('symbol', '2'))
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2161
    (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2162
      ('symbol', 'sort')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2163
      (list
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2164
        (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2165
          ('symbol', 'all')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2166
          None)
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2167
        (negate
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2168
          ('symbol', 'rev')))))
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2169
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2170
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2171
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2172
      ('symbol', '0')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2173
      ('symbol', '2')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2174
      define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2175
    (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2176
      ('symbol', 'sort')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2177
      (list
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2178
        (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2179
          ('symbol', 'all')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2180
          None
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2181
          define)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2182
        ('string', '-rev'))
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2183
      follow)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2184
    define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2185
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2186
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2187
    <spanset+ 0:3>,
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2188
    <spanset+ 0:10>>
29946
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2189
  0
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2190
  1
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2191
  2
29946
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2192
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2193
 invalid argument passed to noop sort():
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2194
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2195
  $ log '0:2 & sort()'
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2196
  hg: parse error: sort requires one or two arguments
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2197
  [255]
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2198
  $ log '0:2 & sort(all(), -invalid)'
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2199
  hg: parse error: unknown sort key '-invalid'
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2200
  [255]
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2201
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2202
 for 'A & f(B)', 'B' should not be affected by the order of 'A':
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2203
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2204
  $ try --optimize '2:0 & first(1 + 0 + 2)'
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2205
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2206
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2207
      ('symbol', '2')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2208
      ('symbol', '0'))
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2209
    (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2210
      ('symbol', 'first')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2211
      (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2212
        (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2213
          ('symbol', '1')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2214
          ('symbol', '0')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2215
          ('symbol', '2')))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2216
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2217
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2218
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2219
      ('symbol', '2')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2220
      ('symbol', '0')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2221
      define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2222
    (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2223
      ('symbol', 'first')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2224
      (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2225
        ('symbol', '_list')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2226
        ('string', '1\x000\x002')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2227
        define)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2228
      follow)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2229
    define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2230
  * set:
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  2231
  <filteredset
32820
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  2232
    <baseset [1]>,
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2233
    <spanset- 0:3>>
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2234
  1
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2235
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2236
  $ try --optimize '2:0 & not last(0 + 2 + 1)'
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2237
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2238
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2239
      ('symbol', '2')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2240
      ('symbol', '0'))
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2241
    (not
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2242
      (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2243
        ('symbol', 'last')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2244
        (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2245
          (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2246
            ('symbol', '0')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2247
            ('symbol', '2')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2248
            ('symbol', '1'))))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2249
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2250
  (difference
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2251
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2252
      ('symbol', '2')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2253
      ('symbol', '0')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2254
      define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2255
    (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2256
      ('symbol', 'last')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2257
      (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2258
        ('symbol', '_list')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2259
        ('string', '0\x002\x001')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2260
        define)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2261
      any)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2262
    define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2263
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2264
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2265
    <spanset- 0:3>,
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2266
    <not
32820
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  2267
      <baseset [1]>>>
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2268
  2
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2269
  0
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2270
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2271
 for 'A & (op)(B)', 'B' should not be affected by the order of 'A':
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2272
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2273
  $ try --optimize '2:0 & (1 + 0 + 2):(0 + 2 + 1)'
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2274
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2275
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2276
      ('symbol', '2')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2277
      ('symbol', '0'))
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2278
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2279
      (group
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2280
        (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2281
          (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2282
            ('symbol', '1')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2283
            ('symbol', '0')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2284
            ('symbol', '2'))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2285
      (group
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2286
        (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2287
          (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2288
            ('symbol', '0')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2289
            ('symbol', '2')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2290
            ('symbol', '1'))))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2291
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2292
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2293
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2294
      ('symbol', '2')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2295
      ('symbol', '0')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2296
      define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2297
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2298
      (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2299
        ('symbol', '_list')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2300
        ('string', '1\x000\x002')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2301
        define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2302
      (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2303
        ('symbol', '_list')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2304
        ('string', '0\x002\x001')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2305
        define)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2306
      follow)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2307
    define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2308
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2309
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2310
    <spanset- 0:3>,
29944
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2311
    <baseset [1]>>
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2312
  1
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2313
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2314
 'A & B' can be rewritten as 'B & A' by weight, but that's fine as long as
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2315
 the ordering rule is determined before the rewrite; in this example,
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2316
 'B' follows the order of the initial set, which is the same order as 'A'
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2317
 since 'A' also follows the order:
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2318
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2319
  $ try --optimize 'contains("glob:*") & (2 + 0 + 1)'
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2320
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2321
    (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2322
      ('symbol', 'contains')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2323
      ('string', 'glob:*'))
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2324
    (group
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2325
      (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2326
        (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2327
          ('symbol', '2')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2328
          ('symbol', '0')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2329
          ('symbol', '1')))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2330
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2331
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2332
    (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2333
      ('symbol', '_list')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2334
      ('string', '2\x000\x001')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2335
      follow)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2336
    (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2337
      ('symbol', 'contains')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2338
      ('string', 'glob:*')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2339
      define)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2340
    define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2341
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2342
  <filteredset
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2343
    <baseset+ [0, 1, 2]>,
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2344
    <contains 'glob:*'>>
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2345
  0
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2346
  1
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2347
  2
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2348
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2349
 and in this example, 'A & B' is rewritten as 'B & A', but 'A' overrides
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2350
 the order appropriately:
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2351
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2352
  $ try --optimize 'reverse(contains("glob:*")) & (0 + 2 + 1)'
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2353
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2354
    (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2355
      ('symbol', 'reverse')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2356
      (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2357
        ('symbol', 'contains')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2358
        ('string', 'glob:*')))
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2359
    (group
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2360
      (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2361
        (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2362
          ('symbol', '0')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2363
          ('symbol', '2')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2364
          ('symbol', '1')))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2365
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2366
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2367
    (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2368
      ('symbol', '_list')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2369
      ('string', '0\x002\x001')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2370
      follow)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2371
    (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2372
      ('symbol', 'reverse')
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2373
      (func
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2374
        ('symbol', 'contains')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2375
        ('string', 'glob:*')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2376
        define)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2377
      define)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2378
    define)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2379
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2380
  <filteredset
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2381
    <baseset- [0, 1, 2]>,
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2382
    <contains 'glob:*'>>
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2383
  2
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2384
  1
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2385
  0
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2386
31800
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2387
 'A + B' can be rewritten to 'B + A' by weight only when the order doesn't
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2388
 matter (e.g. 'X & (A + B)' can be 'X & (B + A)', but '(A + B) & X' can't):
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2389
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2390
  $ try -p optimized '0:2 & (reverse(contains("a")) + 2)'
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2391
  * optimized:
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2392
  (and
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2393
    (range
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2394
      ('symbol', '0')
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2395
      ('symbol', '2')
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2396
      define)
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2397
    (or
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2398
      (list
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2399
        ('symbol', '2')
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2400
        (func
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2401
          ('symbol', 'reverse')
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2402
          (func
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2403
            ('symbol', 'contains')
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2404
            ('string', 'a')
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2405
            define)
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2406
          follow))
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2407
      follow)
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2408
    define)
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2409
  * set:
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2410
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2411
    <spanset+ 0:3>,
31800
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2412
    <addset
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2413
      <baseset [2]>,
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2414
      <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2415
        <fullreposet+ 0:10>,
31800
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2416
        <contains 'a'>>>>
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2417
  0
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2418
  1
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2419
  2
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2420
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2421
  $ try -p optimized '(reverse(contains("a")) + 2) & 0:2'
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2422
  * optimized:
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2423
  (and
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2424
    (range
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2425
      ('symbol', '0')
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2426
      ('symbol', '2')
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2427
      follow)
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2428
    (or
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2429
      (list
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2430
        (func
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2431
          ('symbol', 'reverse')
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2432
          (func
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2433
            ('symbol', 'contains')
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2434
            ('string', 'a')
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2435
            define)
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2436
          define)
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2437
        ('symbol', '2'))
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2438
      define)
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2439
    define)
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2440
  * set:
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2441
  <addset
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2442
    <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2443
      <spanset- 0:3>,
31800
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2444
      <contains 'a'>>,
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2445
    <baseset [2]>>
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2446
  1
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2447
  0
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2448
  2
c63cb2d10d6d revsetlang: enable optimization of 'x + y' expression
Yuya Nishihara <yuya@tcha.org>
parents: 31024
diff changeset
  2449
20717
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2450
test sort revset
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2451
--------------------------------------------
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2452
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2453
test when adding two unordered revsets
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2454
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2455
  $ log 'sort(keyword(issue) or modifies(b))'
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2456
  4
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2457
  6
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2458
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2459
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
  2460
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2461
  $ log 'sort(reverse(all()), -rev)'
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2462
  9
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2463
  8
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2464
  7
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2465
  6
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2466
  5
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2467
  4
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2468
  3
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2469
  2
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2470
  1
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2471
  0
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2472
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2473
test when sorting a reversed collection
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2474
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2475
  $ log 'sort(reverse(all()), rev)'
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2476
  0
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2477
  1
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2478
  2
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2479
  3
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2480
  4
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2481
  5
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2482
  6
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2483
  7
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2484
  8
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2485
  9
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2486
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2487
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2488
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
  2489
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2490
  $ 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
  2491
  2
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2492
  6
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2493
  8
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2494
  9
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2495
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2496
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
  2497
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2498
  $ 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
  2499
  9
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2500
  8
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2501
  6
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2502
  2
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2503
29362
ec75d77df9d7 revset: fix crash on empty sort key
Yuya Nishihara <yuya@tcha.org>
parents: 29348
diff changeset
  2504
test empty sort key which is noop
ec75d77df9d7 revset: fix crash on empty sort key
Yuya Nishihara <yuya@tcha.org>
parents: 29348
diff changeset
  2505
ec75d77df9d7 revset: fix crash on empty sort key
Yuya Nishihara <yuya@tcha.org>
parents: 29348
diff changeset
  2506
  $ log 'sort(0 + 2 + 1, "")'
ec75d77df9d7 revset: fix crash on empty sort key
Yuya Nishihara <yuya@tcha.org>
parents: 29348
diff changeset
  2507
  0
ec75d77df9d7 revset: fix crash on empty sort key
Yuya Nishihara <yuya@tcha.org>
parents: 29348
diff changeset
  2508
  2
ec75d77df9d7 revset: fix crash on empty sort key
Yuya Nishihara <yuya@tcha.org>
parents: 29348
diff changeset
  2509
  1
ec75d77df9d7 revset: fix crash on empty sort key
Yuya Nishihara <yuya@tcha.org>
parents: 29348
diff changeset
  2510
29264
22625884b15c revset: factor out reverse flag of sort() key
Yuya Nishihara <yuya@tcha.org>
parents: 29139
diff changeset
  2511
test invalid sort keys
22625884b15c revset: factor out reverse flag of sort() key
Yuya Nishihara <yuya@tcha.org>
parents: 29139
diff changeset
  2512
22625884b15c revset: factor out reverse flag of sort() key
Yuya Nishihara <yuya@tcha.org>
parents: 29139
diff changeset
  2513
  $ log 'sort(all(), -invalid)'
22625884b15c revset: factor out reverse flag of sort() key
Yuya Nishihara <yuya@tcha.org>
parents: 29139
diff changeset
  2514
  hg: parse error: unknown sort key '-invalid'
22625884b15c revset: factor out reverse flag of sort() key
Yuya Nishihara <yuya@tcha.org>
parents: 29139
diff changeset
  2515
  [255]
22625884b15c revset: factor out reverse flag of sort() key
Yuya Nishihara <yuya@tcha.org>
parents: 29139
diff changeset
  2516
29001
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2517
  $ cd ..
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2518
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2519
test sorting by multiple keys including variable-length strings
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2520
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2521
  $ hg init sorting
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2522
  $ cd sorting
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2523
  $ cat <<EOF >> .hg/hgrc
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2524
  > [ui]
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2525
  > logtemplate = '{rev} {branch|p5}{desc|p5}{author|p5}{date|hgdate}\n'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2526
  > [templatealias]
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2527
  > p5(s) = pad(s, 5)
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2528
  > EOF
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2529
  $ hg branch -qf b12
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2530
  $ hg ci -m m111 -u u112 -d '111 10800'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2531
  $ hg branch -qf b11
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2532
  $ hg ci -m m12 -u u111 -d '112 7200'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2533
  $ hg branch -qf b111
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2534
  $ hg ci -m m11 -u u12 -d '111 3600'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2535
  $ hg branch -qf b112
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2536
  $ hg ci -m m111 -u u11 -d '120 0'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2537
  $ hg branch -qf b111
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2538
  $ hg ci -m m112 -u u111 -d '110 14400'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2539
  created new head
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2540
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2541
 compare revisions (has fast path):
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2542
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2543
  $ hg log -r 'sort(all(), rev)'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2544
  0 b12  m111 u112 111 10800
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2545
  1 b11  m12  u111 112 7200
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2546
  2 b111 m11  u12  111 3600
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2547
  3 b112 m111 u11  120 0
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2548
  4 b111 m112 u111 110 14400
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2549
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2550
  $ hg log -r 'sort(all(), -rev)'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2551
  4 b111 m112 u111 110 14400
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2552
  3 b112 m111 u11  120 0
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2553
  2 b111 m11  u12  111 3600
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2554
  1 b11  m12  u111 112 7200
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2555
  0 b12  m111 u112 111 10800
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2556
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2557
 compare variable-length strings (issue5218):
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2558
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2559
  $ hg log -r 'sort(all(), branch)'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2560
  1 b11  m12  u111 112 7200
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2561
  2 b111 m11  u12  111 3600
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2562
  4 b111 m112 u111 110 14400
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2563
  3 b112 m111 u11  120 0
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2564
  0 b12  m111 u112 111 10800
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2565
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2566
  $ hg log -r 'sort(all(), -branch)'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2567
  0 b12  m111 u112 111 10800
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2568
  3 b112 m111 u11  120 0
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2569
  2 b111 m11  u12  111 3600
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2570
  4 b111 m112 u111 110 14400
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2571
  1 b11  m12  u111 112 7200
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2572
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2573
  $ hg log -r 'sort(all(), desc)'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2574
  2 b111 m11  u12  111 3600
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2575
  0 b12  m111 u112 111 10800
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2576
  3 b112 m111 u11  120 0
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2577
  4 b111 m112 u111 110 14400
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2578
  1 b11  m12  u111 112 7200
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2579
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2580
  $ hg log -r 'sort(all(), -desc)'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2581
  1 b11  m12  u111 112 7200
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2582
  4 b111 m112 u111 110 14400
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2583
  0 b12  m111 u112 111 10800
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2584
  3 b112 m111 u11  120 0
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2585
  2 b111 m11  u12  111 3600
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2586
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2587
  $ hg log -r 'sort(all(), user)'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2588
  3 b112 m111 u11  120 0
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2589
  1 b11  m12  u111 112 7200
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2590
  4 b111 m112 u111 110 14400
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2591
  0 b12  m111 u112 111 10800
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2592
  2 b111 m11  u12  111 3600
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2593
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2594
  $ hg log -r 'sort(all(), -user)'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2595
  2 b111 m11  u12  111 3600
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2596
  0 b12  m111 u112 111 10800
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2597
  1 b11  m12  u111 112 7200
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2598
  4 b111 m112 u111 110 14400
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2599
  3 b112 m111 u11  120 0
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2600
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2601
 compare dates (tz offset should have no effect):
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2602
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2603
  $ hg log -r 'sort(all(), date)'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2604
  4 b111 m112 u111 110 14400
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2605
  0 b12  m111 u112 111 10800
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2606
  2 b111 m11  u12  111 3600
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2607
  1 b11  m12  u111 112 7200
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2608
  3 b112 m111 u11  120 0
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2609
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2610
  $ hg log -r 'sort(all(), -date)'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2611
  3 b112 m111 u11  120 0
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2612
  1 b11  m12  u111 112 7200
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2613
  0 b12  m111 u112 111 10800
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2614
  2 b111 m11  u12  111 3600
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2615
  4 b111 m112 u111 110 14400
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2616
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2617
 be aware that 'sort(x, -k)' is not exactly the same as 'reverse(sort(x, k))'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2618
 because '-k' reverses the comparison, not the list itself:
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2619
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2620
  $ hg log -r 'sort(0 + 2, date)'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2621
  0 b12  m111 u112 111 10800
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2622
  2 b111 m11  u12  111 3600
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2623
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2624
  $ hg log -r 'sort(0 + 2, -date)'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2625
  0 b12  m111 u112 111 10800
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2626
  2 b111 m11  u12  111 3600
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2627
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2628
  $ hg log -r 'reverse(sort(0 + 2, date))'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2629
  2 b111 m11  u12  111 3600
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2630
  0 b12  m111 u112 111 10800
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2631
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2632
 sort by multiple keys:
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2633
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2634
  $ hg log -r 'sort(all(), "branch -rev")'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2635
  1 b11  m12  u111 112 7200
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2636
  4 b111 m112 u111 110 14400
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2637
  2 b111 m11  u12  111 3600
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2638
  3 b112 m111 u11  120 0
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2639
  0 b12  m111 u112 111 10800
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2640
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2641
  $ hg log -r 'sort(all(), "-desc -date")'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2642
  1 b11  m12  u111 112 7200
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2643
  4 b111 m112 u111 110 14400
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2644
  3 b112 m111 u11  120 0
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2645
  0 b12  m111 u112 111 10800
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2646
  2 b111 m11  u12  111 3600
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2647
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2648
  $ hg log -r 'sort(all(), "user -branch date rev")'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2649
  3 b112 m111 u11  120 0
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2650
  4 b111 m112 u111 110 14400
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2651
  1 b11  m12  u111 112 7200
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2652
  0 b12  m111 u112 111 10800
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2653
  2 b111 m11  u12  111 3600
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2654
29348
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2655
 toposort prioritises graph branches
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2656
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2657
  $ hg up 2
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2658
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2659
  $ touch a
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2660
  $ hg addremove
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2661
  adding a
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2662
  $ hg ci -m 't1' -u 'tu' -d '130 0'
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2663
  created new head
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2664
  $ echo 'a' >> a
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2665
  $ hg ci -m 't2' -u 'tu' -d '130 0'
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2666
  $ hg book book1
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2667
  $ hg up 4
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2668
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2669
  (leaving bookmark book1)
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2670
  $ touch a
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2671
  $ hg addremove
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2672
  adding a
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2673
  $ hg ci -m 't3' -u 'tu' -d '130 0'
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2674
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2675
  $ hg log -r 'sort(all(), topo)'
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2676
  7 b111 t3   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2677
  4 b111 m112 u111 110 14400
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2678
  3 b112 m111 u11  120 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2679
  6 b111 t2   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2680
  5 b111 t1   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2681
  2 b111 m11  u12  111 3600
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2682
  1 b11  m12  u111 112 7200
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2683
  0 b12  m111 u112 111 10800
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2684
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2685
  $ hg log -r 'sort(all(), -topo)'
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2686
  0 b12  m111 u112 111 10800
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2687
  1 b11  m12  u111 112 7200
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2688
  2 b111 m11  u12  111 3600
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2689
  5 b111 t1   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2690
  6 b111 t2   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2691
  3 b112 m111 u11  120 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2692
  4 b111 m112 u111 110 14400
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2693
  7 b111 t3   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2694
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2695
  $ hg log -r 'sort(all(), topo, topo.firstbranch=book1)'
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2696
  6 b111 t2   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2697
  5 b111 t1   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2698
  7 b111 t3   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2699
  4 b111 m112 u111 110 14400
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2700
  3 b112 m111 u11  120 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2701
  2 b111 m11  u12  111 3600
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2702
  1 b11  m12  u111 112 7200
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2703
  0 b12  m111 u112 111 10800
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2704
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2705
topographical sorting can't be combined with other sort keys, and you can't
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2706
use the topo.firstbranch option when topo sort is not active:
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2707
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2708
  $ hg log -r 'sort(all(), "topo user")'
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2709
  hg: parse error: topo sort order cannot be combined with other sort keys
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2710
  [255]
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2711
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2712
  $ hg log -r 'sort(all(), user, topo.firstbranch=book1)'
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2713
  hg: parse error: topo.firstbranch can only be used when using the topo sort key
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2714
  [255]
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2715
29766
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
  2716
topo.firstbranch should accept any kind of expressions:
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
  2717
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
  2718
  $ hg log -r 'sort(0, topo, topo.firstbranch=(book1))'
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
  2719
  0 b12  m111 u112 111 10800
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
  2720
29001
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2721
  $ cd ..
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2722
  $ cd repo
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2723
21024
7731a2281cf0 spelling: fixes from spell checker
Mads Kiilerich <madski@unity3d.com>
parents: 20894
diff changeset
  2724
test subtracting something from an addset
20736
b0203624ab20 revset: extend sorting tests
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20717
diff changeset
  2725
b0203624ab20 revset: extend sorting tests
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20717
diff changeset
  2726
  $ log '(outgoing() or removes(a)) - removes(a)'
b0203624ab20 revset: extend sorting tests
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20717
diff changeset
  2727
  8
b0203624ab20 revset: extend sorting tests
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20717
diff changeset
  2728
  9
b0203624ab20 revset: extend sorting tests
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20717
diff changeset
  2729
b0203624ab20 revset: extend sorting tests
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20717
diff changeset
  2730
test intersecting something with an addset
b0203624ab20 revset: extend sorting tests
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20717
diff changeset
  2731
b0203624ab20 revset: extend sorting tests
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20717
diff changeset
  2732
  $ log 'parents(outgoing() or removes(a))'
b0203624ab20 revset: extend sorting tests
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20717
diff changeset
  2733
  1
b0203624ab20 revset: extend sorting tests
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20717
diff changeset
  2734
  4
b0203624ab20 revset: extend sorting tests
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20717
diff changeset
  2735
  5
22712
093df3b77f27 revert: bring back usage of `subset & ps` in `parents`
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22450
diff changeset
  2736
  8
20736
b0203624ab20 revset: extend sorting tests
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20717
diff changeset
  2737
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
  2738
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
  2739
546fa6576815 revset: restore order of `or` operation as in Mercurial 2.9
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22712
diff changeset
  2740
  $ 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
  2741
  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
  2742
  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
  2743
  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
  2744
  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
  2745
  $ 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
  2746
  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
  2747
  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
  2748
  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
  2749
  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
  2750
  $ 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
  2751
  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
  2752
  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
  2753
  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
  2754
  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
  2755
  $ 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
  2756
  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
  2757
  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
  2758
  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
  2759
  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
  2760
25383
5909ac39b86a revrange: drop unnecessary deduplication of revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25344
diff changeset
  2761
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
  2762
5909ac39b86a revrange: drop unnecessary deduplication of revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25344
diff changeset
  2763
  $ 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
  2764
  3
5909ac39b86a revrange: drop unnecessary deduplication of revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25344
diff changeset
  2765
  4
5909ac39b86a revrange: drop unnecessary deduplication of revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25344
diff changeset
  2766
  5
5909ac39b86a revrange: drop unnecessary deduplication of revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25344
diff changeset
  2767
  2
5909ac39b86a revrange: drop unnecessary deduplication of revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25344
diff changeset
  2768
  0
5909ac39b86a revrange: drop unnecessary deduplication of revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25344
diff changeset
  2769
  1
5909ac39b86a revrange: drop unnecessary deduplication of revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25344
diff changeset
  2770
25024
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  2771
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
  2772
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  2773
  $ try 'reverse(1::5) or ancestors(4)'
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  2774
  (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2775
    (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2776
      (func
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2777
        ('symbol', 'reverse')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2778
        (dagrange
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2779
          ('symbol', '1')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2780
          ('symbol', '5')))
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2781
      (func
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2782
        ('symbol', 'ancestors')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2783
        ('symbol', '4'))))
25024
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  2784
  * set:
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  2785
  <addset
26061
be8a4e0800d8 reachableroots: use baseset lazy sorting
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26020
diff changeset
  2786
    <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
  2787
    <generatorset+>>
25024
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  2788
  5
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  2789
  3
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  2790
  1
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  2791
  0
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  2792
  2
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  2793
  4
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  2794
  $ 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
  2795
  (func
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  2796
    ('symbol', 'sort')
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  2797
    (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2798
      (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2799
        (func
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2800
          ('symbol', 'ancestors')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2801
          ('symbol', '4'))
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2802
        (func
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2803
          ('symbol', 'reverse')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2804
          (dagrange
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2805
            ('symbol', '1')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2806
            ('symbol', '5'))))))
25024
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  2807
  * set:
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  2808
  <addset+
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  2809
    <generatorset+>,
26061
be8a4e0800d8 reachableroots: use baseset lazy sorting
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26020
diff changeset
  2810
    <baseset- [1, 3, 5]>>
25024
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  2811
  0
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  2812
  1
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  2813
  2
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  2814
  3
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  2815
  4
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  2816
  5
263bbed1833c revset: test current behavior of addset class
Yuya Nishihara <yuya@tcha.org>
parents: 24940
diff changeset
  2817
25343
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2818
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
  2819
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2820
  $ 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
  2821
  (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2822
    (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2823
      ('symbol', '0')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2824
      (group
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2825
        ('symbol', '1'))
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2826
      ('string', '2')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2827
      (negate
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2828
        ('symbol', '2'))
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2829
      ('symbol', 'tip')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2830
      ('symbol', 'null')))
25343
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2831
  * optimized:
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2832
  (func
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2833
    ('symbol', '_list')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2834
    ('string', '0\x001\x002\x00-2\x00tip\x00null')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2835
    define)
25343
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2836
  * set:
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2837
  <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
  2838
  0
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2839
  1
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2840
  2
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2841
  8
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2842
  9
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2843
  -1
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2844
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2845
  $ 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
  2846
  (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2847
    (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2848
      ('symbol', '0')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2849
      ('symbol', '1')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2850
      (range
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2851
        ('symbol', '2')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2852
        ('symbol', '3'))))
25343
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2853
  * optimized:
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2854
  (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2855
    (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2856
      (func
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2857
        ('symbol', '_list')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2858
        ('string', '0\x001')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2859
        define)
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2860
      (range
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2861
        ('symbol', '2')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2862
        ('symbol', '3')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2863
        define))
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2864
    define)
25343
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2865
  * set:
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2866
  <addset
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2867
    <baseset [0, 1]>,
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2868
    <spanset+ 2:4>>
25343
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2869
  0
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2870
  1
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2871
  2
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2872
  3
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2873
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2874
  $ 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
  2875
  (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2876
    (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2877
      (range
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2878
        ('symbol', '0')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2879
        ('symbol', '1'))
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2880
      ('symbol', '2')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2881
      (range
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2882
        ('symbol', '3')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2883
        ('symbol', '4'))
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2884
      ('symbol', '5')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2885
      ('symbol', '6')))
25343
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2886
  * optimized:
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2887
  (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2888
    (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2889
      (range
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2890
        ('symbol', '0')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2891
        ('symbol', '1')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2892
        define)
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2893
      ('symbol', '2')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2894
      (range
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2895
        ('symbol', '3')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2896
        ('symbol', '4')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2897
        define)
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2898
      (func
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2899
        ('symbol', '_list')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2900
        ('string', '5\x006')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2901
        define))
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2902
    define)
25343
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2903
  * set:
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2904
  <addset
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2905
    <addset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2906
      <spanset+ 0:2>,
25343
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2907
      <baseset [2]>>,
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2908
    <addset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2909
      <spanset+ 3:5>,
25343
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2910
      <baseset [5, 6]>>>
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2911
  0
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2912
  1
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2913
  2
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2914
  3
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2915
  4
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2916
  5
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2917
  6
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2918
29923
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
  2919
unoptimized `or` looks like this
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
  2920
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
  2921
  $ try --no-optimized -p analyzed '0|1|2|3|4'
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
  2922
  * analyzed:
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
  2923
  (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2924
    (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2925
      ('symbol', '0')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2926
      ('symbol', '1')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2927
      ('symbol', '2')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2928
      ('symbol', '3')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2929
      ('symbol', '4'))
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  2930
    define)
29923
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
  2931
  * set:
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
  2932
  <addset
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
  2933
    <addset
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
  2934
      <baseset [0]>,
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
  2935
      <baseset [1]>>,
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
  2936
    <addset
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
  2937
      <baseset [2]>,
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
  2938
      <addset
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
  2939
        <baseset [3]>,
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
  2940
        <baseset [4]>>>>
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
  2941
  0
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
  2942
  1
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
  2943
  2
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
  2944
  3
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
  2945
  4
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
  2946
25343
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2947
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
  2948
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2949
  $ 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
  2950
  1
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2951
  2
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2952
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2953
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
  2954
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2955
  $ 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
  2956
  0
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2957
  1
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2958
  2
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2959
  9
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2960
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2961
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
  2962
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2963
  $ log '0|unknown'
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2964
  abort: unknown revision 'unknown'!
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2965
  [255]
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  2966
25344
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  2967
test integer range in `_list`
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  2968
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  2969
  $ log '-1|-10'
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  2970
  9
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  2971
  0
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  2972
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  2973
  $ log '-10|-11'
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  2974
  abort: unknown revision '-11'!
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  2975
  [255]
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  2976
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  2977
  $ log '9|10'
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  2978
  abort: unknown revision '10'!
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  2979
  [255]
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  2980
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  2981
test '0000' != '0' in `_list`
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  2982
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  2983
  $ log '0|0000'
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  2984
  0
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  2985
  -1
ceaf04bb14ff revset: add fast path for _list() of integer revisions
Yuya Nishihara <yuya@tcha.org>
parents: 25343
diff changeset
  2986
27517
c60a9c16ae25 revset: add hint for list error to use or
timeless <timeless@mozdev.org>
parents: 26638
diff changeset
  2987
test ',' in `_list`
c60a9c16ae25 revset: add hint for list error to use or
timeless <timeless@mozdev.org>
parents: 26638
diff changeset
  2988
  $ log '0,1'
c60a9c16ae25 revset: add hint for list error to use or
timeless <timeless@mozdev.org>
parents: 26638
diff changeset
  2989
  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
  2990
  (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
  2991
  [255]
27987
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  2992
  $ try '0,1,2'
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  2993
  (list
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  2994
    ('symbol', '0')
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  2995
    ('symbol', '1')
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  2996
    ('symbol', '2'))
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  2997
  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
  2998
  (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
  2999
  [255]
27517
c60a9c16ae25 revset: add hint for list error to use or
timeless <timeless@mozdev.org>
parents: 26638
diff changeset
  3000
25309
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3001
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
  3002
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3003
  $ 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
  3004
  (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3005
    (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3006
      (range
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3007
        ('symbol', '0')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3008
        ('symbol', '1'))
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3009
      (range
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3010
        ('symbol', '1')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3011
        ('symbol', '2'))
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3012
      (range
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3013
        ('symbol', '2')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3014
        ('symbol', '3'))
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3015
      (range
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3016
        ('symbol', '3')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3017
        ('symbol', '4'))
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3018
      (range
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3019
        ('symbol', '4')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3020
        ('symbol', '5'))))
25309
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3021
  * set:
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3022
  <addset
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3023
    <addset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  3024
      <spanset+ 0:2>,
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  3025
      <spanset+ 1:3>>,
25309
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3026
    <addset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  3027
      <spanset+ 2:4>,
25309
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3028
      <addset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  3029
        <spanset+ 3:5>,
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  3030
        <spanset+ 4:6>>>>
25309
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3031
  0
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3032
  1
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3033
  2
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3034
  3
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3035
  4
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3036
  5
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3037
25996
b12e00a05d57 revset: prevent crash caused by empty group expression while optimizing "or"
Yuya Nishihara <yuya@tcha.org>
parents: 25995
diff changeset
  3038
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
  3039
b12e00a05d57 revset: prevent crash caused by empty group expression while optimizing "or"
Yuya Nishihara <yuya@tcha.org>
parents: 25995
diff changeset
  3040
  $ try --optimize '0|()'
b12e00a05d57 revset: prevent crash caused by empty group expression while optimizing "or"
Yuya Nishihara <yuya@tcha.org>
parents: 25995
diff changeset
  3041
  (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3042
    (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3043
      ('symbol', '0')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3044
      (group
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3045
        None)))
25996
b12e00a05d57 revset: prevent crash caused by empty group expression while optimizing "or"
Yuya Nishihara <yuya@tcha.org>
parents: 25995
diff changeset
  3046
  * optimized:
b12e00a05d57 revset: prevent crash caused by empty group expression while optimizing "or"
Yuya Nishihara <yuya@tcha.org>
parents: 25995
diff changeset
  3047
  (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3048
    (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3049
      ('symbol', '0')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  3050
      None)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  3051
    define)
25996
b12e00a05d57 revset: prevent crash caused by empty group expression while optimizing "or"
Yuya Nishihara <yuya@tcha.org>
parents: 25995
diff changeset
  3052
  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
  3053
  [255]
b12e00a05d57 revset: prevent crash caused by empty group expression while optimizing "or"
Yuya Nishihara <yuya@tcha.org>
parents: 25995
diff changeset
  3054
25309
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3055
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
  3056
(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
  3057
27991
5daf1a8c5f1d tests: avoid nested quoting on command line for portability
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27623
diff changeset
  3058
  $ 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
  3059
  0
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3060
  1
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3061
25385
a26a55406c0a revrange: build balanced tree of addsets from revisions (issue4565)
Yuya Nishihara <yuya@tcha.org>
parents: 25383
diff changeset
  3062
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
  3063
(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
  3064
a26a55406c0a revrange: build balanced tree of addsets from revisions (issue4565)
Yuya Nishihara <yuya@tcha.org>
parents: 25383
diff changeset
  3065
  $ 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
  3066
  0
a26a55406c0a revrange: build balanced tree of addsets from revisions (issue4565)
Yuya Nishihara <yuya@tcha.org>
parents: 25383
diff changeset
  3067
  1
a26a55406c0a revrange: build balanced tree of addsets from revisions (issue4565)
Yuya Nishihara <yuya@tcha.org>
parents: 25383
diff changeset
  3068
21893
e967c3b08705 revset: replace _missingancestors optimization with only revset
Siddharth Agarwal <sid0@fb.com>
parents: 21870
diff changeset
  3069
check that conversion to only works
20499
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3070
  $ try --optimize '::3 - ::1'
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3071
  (minus
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3072
    (dagrangepre
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3073
      ('symbol', '3'))
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3074
    (dagrangepre
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3075
      ('symbol', '1')))
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3076
  * optimized:
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3077
  (func
21893
e967c3b08705 revset: replace _missingancestors optimization with only revset
Siddharth Agarwal <sid0@fb.com>
parents: 21870
diff changeset
  3078
    ('symbol', 'only')
20499
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3079
    (list
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3080
      ('symbol', '3')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  3081
      ('symbol', '1'))
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  3082
    define)
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3083
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3084
  <baseset+ [3]>
20499
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3085
  3
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3086
  $ try --optimize 'ancestors(1) - ancestors(3)'
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3087
  (minus
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3088
    (func
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3089
      ('symbol', 'ancestors')
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3090
      ('symbol', '1'))
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3091
    (func
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3092
      ('symbol', 'ancestors')
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3093
      ('symbol', '3')))
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3094
  * optimized:
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3095
  (func
21893
e967c3b08705 revset: replace _missingancestors optimization with only revset
Siddharth Agarwal <sid0@fb.com>
parents: 21870
diff changeset
  3096
    ('symbol', 'only')
20499
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3097
    (list
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3098
      ('symbol', '1')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  3099
      ('symbol', '3'))
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  3100
    define)
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3101
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3102
  <baseset+ []>
20499
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3103
  $ try --optimize 'not ::2 and ::6'
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3104
  (and
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3105
    (not
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3106
      (dagrangepre
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3107
        ('symbol', '2')))
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3108
    (dagrangepre
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3109
      ('symbol', '6')))
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3110
  * optimized:
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3111
  (func
21893
e967c3b08705 revset: replace _missingancestors optimization with only revset
Siddharth Agarwal <sid0@fb.com>
parents: 21870
diff changeset
  3112
    ('symbol', 'only')
20499
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3113
    (list
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3114
      ('symbol', '6')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  3115
      ('symbol', '2'))
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  3116
    define)
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3117
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3118
  <baseset+ [3, 4, 5, 6]>
20499
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3119
  3
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3120
  4
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3121
  5
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3122
  6
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3123
  $ try --optimize 'ancestors(6) and not ancestors(4)'
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3124
  (and
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3125
    (func
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3126
      ('symbol', 'ancestors')
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3127
      ('symbol', '6'))
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3128
    (not
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3129
      (func
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3130
        ('symbol', 'ancestors')
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3131
        ('symbol', '4'))))
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3132
  * optimized:
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3133
  (func
21893
e967c3b08705 revset: replace _missingancestors optimization with only revset
Siddharth Agarwal <sid0@fb.com>
parents: 21870
diff changeset
  3134
    ('symbol', 'only')
20499
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3135
    (list
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3136
      ('symbol', '6')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  3137
      ('symbol', '4'))
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  3138
    define)
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3139
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3140
  <baseset+ [3, 5, 6]>
20499
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3141
  3
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3142
  5
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3143
  6
2efd608473fb revset: optimize missing ancestor expressions
Siddharth Agarwal <sid0@fb.com>
parents: 20393
diff changeset
  3144
25995
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  3145
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
  3146
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  3147
  $ 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
  3148
  (and
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  3149
    (dagrangepre
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  3150
      ('symbol', '1'))
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  3151
    (group
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  3152
      None))
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  3153
  * optimized:
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  3154
  (and
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  3155
    None
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  3156
    (func
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  3157
      ('symbol', 'ancestors')
29932
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  3158
      ('symbol', '1')
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  3159
      define)
09a84e747c88 revset: pass around ordering flags to operations
Yuya Nishihara <yuya@tcha.org>
parents: 29929
diff changeset
  3160
    define)
25995
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  3161
  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
  3162
  [255]
4f703dcc626f revset: prevent crash caused by empty group expression while optimizing "and"
Yuya Nishihara <yuya@tcha.org>
parents: 25819
diff changeset
  3163
32913
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3164
optimization to only() works only if ancestors() takes only one argument
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3165
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3166
  $ hg debugrevspec -p optimized 'ancestors(6) - ancestors(4, 1)'
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3167
  * optimized:
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3168
  (difference
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3169
    (func
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3170
      ('symbol', 'ancestors')
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3171
      ('symbol', '6')
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3172
      define)
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3173
    (func
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3174
      ('symbol', 'ancestors')
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3175
      (list
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3176
        ('symbol', '4')
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3177
        ('symbol', '1'))
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3178
      any)
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3179
    define)
33002
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  3180
  0
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  3181
  1
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  3182
  3
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  3183
  5
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  3184
  6
32913
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3185
  $ hg debugrevspec -p optimized 'ancestors(6, 1) - ancestors(4)'
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3186
  * optimized:
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3187
  (difference
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3188
    (func
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3189
      ('symbol', 'ancestors')
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3190
      (list
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3191
        ('symbol', '6')
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3192
        ('symbol', '1'))
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3193
      define)
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3194
    (func
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3195
      ('symbol', 'ancestors')
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3196
      ('symbol', '4')
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3197
      any)
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3198
    define)
33002
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  3199
  5
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  3200
  6
32913
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3201
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3202
optimization disabled if keyword arguments passed (because we're too lazy
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3203
to support it)
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3204
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3205
  $ hg debugrevspec -p optimized 'ancestors(set=6) - ancestors(set=4)'
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3206
  * optimized:
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3207
  (difference
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3208
    (func
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3209
      ('symbol', 'ancestors')
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3210
      (keyvalue
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3211
        ('symbol', 'set')
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3212
        ('symbol', '6'))
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3213
      define)
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3214
    (func
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3215
      ('symbol', 'ancestors')
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3216
      (keyvalue
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3217
        ('symbol', 'set')
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3218
        ('symbol', '4'))
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3219
      any)
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3220
    define)
32914
577759ef2ed2 revset: add support of keyword arguments to ancestors() and descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 32913
diff changeset
  3221
  3
577759ef2ed2 revset: add support of keyword arguments to ancestors() and descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 32913
diff changeset
  3222
  5
577759ef2ed2 revset: add support of keyword arguments to ancestors() and descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 32913
diff changeset
  3223
  6
32913
3292c0df64f7 revsetlang: check arguments passed to ancestors() before optimizing to only()
Yuya Nishihara <yuya@tcha.org>
parents: 32885
diff changeset
  3224
29441
9e8d258708bb revset: check invalid function syntax "func-name"() explicitly
Yuya Nishihara <yuya@tcha.org>
parents: 29408
diff changeset
  3225
invalid function call should not be optimized to only()
9e8d258708bb revset: check invalid function syntax "func-name"() explicitly
Yuya Nishihara <yuya@tcha.org>
parents: 29408
diff changeset
  3226
9e8d258708bb revset: check invalid function syntax "func-name"() explicitly
Yuya Nishihara <yuya@tcha.org>
parents: 29408
diff changeset
  3227
  $ log '"ancestors"(6) and not ancestors(4)'
9e8d258708bb revset: check invalid function syntax "func-name"() explicitly
Yuya Nishihara <yuya@tcha.org>
parents: 29408
diff changeset
  3228
  hg: parse error: not a symbol
9e8d258708bb revset: check invalid function syntax "func-name"() explicitly
Yuya Nishihara <yuya@tcha.org>
parents: 29408
diff changeset
  3229
  [255]
9e8d258708bb revset: check invalid function syntax "func-name"() explicitly
Yuya Nishihara <yuya@tcha.org>
parents: 29408
diff changeset
  3230
9e8d258708bb revset: check invalid function syntax "func-name"() explicitly
Yuya Nishihara <yuya@tcha.org>
parents: 29408
diff changeset
  3231
  $ log 'ancestors(6) and not "ancestors"(4)'
9e8d258708bb revset: check invalid function syntax "func-name"() explicitly
Yuya Nishihara <yuya@tcha.org>
parents: 29408
diff changeset
  3232
  hg: parse error: not a symbol
9e8d258708bb revset: check invalid function syntax "func-name"() explicitly
Yuya Nishihara <yuya@tcha.org>
parents: 29408
diff changeset
  3233
  [255]
9e8d258708bb revset: check invalid function syntax "func-name"() explicitly
Yuya Nishihara <yuya@tcha.org>
parents: 29408
diff changeset
  3234
16820
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
  3235
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
  3236
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
  3237
  $ 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
  3238
  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
  3239
  [255]
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
  3240
  $ log 'tag("re:1..*")'
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
  3241
  6
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
  3242
  $ 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
  3243
  6
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
  3244
  $ log 'tag("literal:1.0")'
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
  3245
  6
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
  3246
  $ log 'tag("re:0..*")'
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
  3247
13925
c315ffc13a25 tests: add tests for non-existant branch/tag/bookmark
Idan Kamara <idankk86@gmail.com>
parents: 13665
diff changeset
  3248
  $ 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
  3249
  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
  3250
  [255]
23978
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23956
diff changeset
  3251
  $ 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
  3252
  $ 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
  3253
  $ 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
  3254
  $ log 'branch(unknown)'
c315ffc13a25 tests: add tests for non-existant branch/tag/bookmark
Idan Kamara <idankk86@gmail.com>
parents: 13665
diff changeset
  3255
  abort: unknown revision 'unknown'!
c315ffc13a25 tests: add tests for non-existant branch/tag/bookmark
Idan Kamara <idankk86@gmail.com>
parents: 13665
diff changeset
  3256
  [255]
26537
832feae7c986 revset: do not fall through to revspec for literal: branch (issue4838)
Yuya Nishihara <yuya@tcha.org>
parents: 26232
diff changeset
  3257
  $ 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
  3258
  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
  3259
  [255]
23978
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23956
diff changeset
  3260
  $ 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
  3261
  $ 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
  3262
  $ 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
  3263
  $ 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
  3264
  2
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
  3265
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3266
  $ 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
  3267
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3268
  8
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3269
  $ 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
  3270
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3271
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3272
  6
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3273
  7
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3274
  8
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
  3275
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3276
  $ 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
  3277
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3278
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3279
  5
11456
88abbb046e66 revset: deal with empty sets in range endpoints
Matt Mackall <mpm@selenic.com>
parents: 11419
diff changeset
  3280
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3281
  $ 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
  3282
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3283
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3284
  $ 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
  3285
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3286
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3287
  $ 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
  3288
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3289
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3290
  $ 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
  3291
  $ 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
  3292
  $ 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
  3293
  $ 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
  3294
  9
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3295
  7
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3296
  6
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3297
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3298
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3299
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3300
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3301
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  3302
  0
12616
e797fdf91df4 revset: lower precedence of minus infix (issue2361)
Matt Mackall <mpm@selenic.com>
parents: 12408
diff changeset
  3303
  $ log '4::8 - 8'
e797fdf91df4 revset: lower precedence of minus infix (issue2361)
Matt Mackall <mpm@selenic.com>
parents: 12408
diff changeset
  3304
  4
29321
de4a80a2b45c test-revset: fix test vector for ordering issue of matching()
Yuya Nishihara <yuya@tcha.org>
parents: 29264
diff changeset
  3305
de4a80a2b45c test-revset: fix test vector for ordering issue of matching()
Yuya Nishihara <yuya@tcha.org>
parents: 29264
diff changeset
  3306
matching() should preserve the order of the input set:
de4a80a2b45c test-revset: fix test vector for ordering issue of matching()
Yuya Nishihara <yuya@tcha.org>
parents: 29264
diff changeset
  3307
de4a80a2b45c test-revset: fix test vector for ordering issue of matching()
Yuya Nishihara <yuya@tcha.org>
parents: 29264
diff changeset
  3308
  $ log '(2 or 3 or 1) and matching(1 or 2 or 3)'
16640
592e0beee8b0 revset: make matching() preserve input revision order
Patrick Mezard <patrick@mezard.eu>
parents: 16521
diff changeset
  3309
  2
592e0beee8b0 revset: make matching() preserve input revision order
Patrick Mezard <patrick@mezard.eu>
parents: 16521
diff changeset
  3310
  3
592e0beee8b0 revset: make matching() preserve input revision order
Patrick Mezard <patrick@mezard.eu>
parents: 16521
diff changeset
  3311
  1
12786
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  3312
23978
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23956
diff changeset
  3313
  $ 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
  3314
  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
  3315
  [255]
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23956
diff changeset
  3316
  $ 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
  3317
  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
  3318
  [255]
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23956
diff changeset
  3319
  $ 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
  3320
  $ 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
  3321
24008
873eb5db89c8 revset: get revision number of each node from target namespaces
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  3322
  $ log 'tag()'
873eb5db89c8 revset: get revision number of each node from target namespaces
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  3323
  6
873eb5db89c8 revset: get revision number of each node from target namespaces
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  3324
  $ 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
  3325
  6
873eb5db89c8 revset: get revision number of each node from target namespaces
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  3326
12786
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  3327
issue2437
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  3328
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  3329
  $ log '3 and p1(5)'
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  3330
  3
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  3331
  $ log '4 and p2(6)'
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  3332
  4
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  3333
  $ log '1 and parents(:2)'
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  3334
  1
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  3335
  $ log '2 and children(1:)'
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  3336
  2
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  3337
  $ 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
  3338
  0
16394
f3df7d34791e revset: do not ignore input revisions in roots()
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3339
  $ 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
  3340
  0
12786
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  3341
  $ 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
  3342
  9
9aae04f4fcf6 revset: disable subset optimization for parents() and children() (issue2437)
Wagner Bruna <wbruna@yahoo.com>
parents: 12736
diff changeset
  3343
  $ 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
  3344
  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
  3345
e798e430c5e5 revset: report a parse error if a revset is not parsed completely (issue2654)
Bernhard Leiner <bleiner@gmail.com>
parents: 12942
diff changeset
  3346
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
  3347
e798e430c5e5 revset: report a parse error if a revset is not parsed completely (issue2654)
Bernhard Leiner <bleiner@gmail.com>
parents: 12942
diff changeset
  3348
  $ 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
  3349
  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
  3350
  [255]
e798e430c5e5 revset: report a parse error if a revset is not parsed completely (issue2654)
Bernhard Leiner <bleiner@gmail.com>
parents: 12942
diff changeset
  3351
13932
34f577007ffe revsets: preserve ordering with the or operator
Augie Fackler <durin42@gmail.com>
parents: 13925
diff changeset
  3352
or operator should preserve ordering:
34f577007ffe revsets: preserve ordering with the or operator
Augie Fackler <durin42@gmail.com>
parents: 13925
diff changeset
  3353
  $ log 'reverse(2::4) or tip'
34f577007ffe revsets: preserve ordering with the or operator
Augie Fackler <durin42@gmail.com>
parents: 13925
diff changeset
  3354
  4
34f577007ffe revsets: preserve ordering with the or operator
Augie Fackler <durin42@gmail.com>
parents: 13925
diff changeset
  3355
  2
34f577007ffe revsets: preserve ordering with the or operator
Augie Fackler <durin42@gmail.com>
parents: 13925
diff changeset
  3356
  9
14070
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3357
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3358
parentrevspec
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3359
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3360
  $ log 'merge()^0'
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3361
  6
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3362
  $ log 'merge()^'
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3363
  5
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3364
  $ log 'merge()^1'
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3365
  5
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3366
  $ log 'merge()^2'
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3367
  4
30179
cdef35b38026 revset: for x^2, do not take null as a valid p2 revision
Yuya Nishihara <yuya@tcha.org>
parents: 30044
diff changeset
  3368
  $ log '(not merge())^2'
14080
debe5083a84e revset: add tests for multiple and mixed ^ and ~ operators
Kevin Gessner <kevin@kevingessner.com>
parents: 14070
diff changeset
  3369
  $ log 'merge()^^'
debe5083a84e revset: add tests for multiple and mixed ^ and ~ operators
Kevin Gessner <kevin@kevingessner.com>
parents: 14070
diff changeset
  3370
  3
debe5083a84e revset: add tests for multiple and mixed ^ and ~ operators
Kevin Gessner <kevin@kevingessner.com>
parents: 14070
diff changeset
  3371
  $ log 'merge()^1^'
debe5083a84e revset: add tests for multiple and mixed ^ and ~ operators
Kevin Gessner <kevin@kevingessner.com>
parents: 14070
diff changeset
  3372
  3
debe5083a84e revset: add tests for multiple and mixed ^ and ~ operators
Kevin Gessner <kevin@kevingessner.com>
parents: 14070
diff changeset
  3373
  $ log 'merge()^^^'
debe5083a84e revset: add tests for multiple and mixed ^ and ~ operators
Kevin Gessner <kevin@kevingessner.com>
parents: 14070
diff changeset
  3374
  1
14070
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3375
32885
8e02829bec61 revset: fix negative ancestor spec to not return changectx objects
Yuya Nishihara <yuya@tcha.org>
parents: 32821
diff changeset
  3376
  $ hg debugrevspec -s '(merge() | 0)~-1'
8e02829bec61 revset: fix negative ancestor spec to not return changectx objects
Yuya Nishihara <yuya@tcha.org>
parents: 32821
diff changeset
  3377
  * set:
8e02829bec61 revset: fix negative ancestor spec to not return changectx objects
Yuya Nishihara <yuya@tcha.org>
parents: 32821
diff changeset
  3378
  <baseset+ [1, 7]>
8e02829bec61 revset: fix negative ancestor spec to not return changectx objects
Yuya Nishihara <yuya@tcha.org>
parents: 32821
diff changeset
  3379
  1
32699
f75d0aa5dc83 revset: lookup descendents for negative arguments to ancestor operator
David Soria Parra <davidsp@fb.com>
parents: 32684
diff changeset
  3380
  7
f75d0aa5dc83 revset: lookup descendents for negative arguments to ancestor operator
David Soria Parra <davidsp@fb.com>
parents: 32684
diff changeset
  3381
  $ log 'merge()~-1'
f75d0aa5dc83 revset: lookup descendents for negative arguments to ancestor operator
David Soria Parra <davidsp@fb.com>
parents: 32684
diff changeset
  3382
  7
f75d0aa5dc83 revset: lookup descendents for negative arguments to ancestor operator
David Soria Parra <davidsp@fb.com>
parents: 32684
diff changeset
  3383
  $ log 'tip~-1'
f75d0aa5dc83 revset: lookup descendents for negative arguments to ancestor operator
David Soria Parra <davidsp@fb.com>
parents: 32684
diff changeset
  3384
  $ log '(tip | merge())~-1'
f75d0aa5dc83 revset: lookup descendents for negative arguments to ancestor operator
David Soria Parra <davidsp@fb.com>
parents: 32684
diff changeset
  3385
  7
14070
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3386
  $ log 'merge()~0'
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3387
  6
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3388
  $ log 'merge()~1'
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3389
  5
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3390
  $ log 'merge()~2'
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3391
  3
14080
debe5083a84e revset: add tests for multiple and mixed ^ and ~ operators
Kevin Gessner <kevin@kevingessner.com>
parents: 14070
diff changeset
  3392
  $ log 'merge()~2^1'
debe5083a84e revset: add tests for multiple and mixed ^ and ~ operators
Kevin Gessner <kevin@kevingessner.com>
parents: 14070
diff changeset
  3393
  1
14070
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3394
  $ log 'merge()~3'
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3395
  1
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3396
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3397
  $ log '(-3:tip)^'
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3398
  4
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3399
  6
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3400
  8
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3401
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3402
  $ log 'tip^foo'
305c97670d7a revset: add ^ and ~ operators from parentrevspec extension
Kevin Gessner <kevin@kevingessner.com>
parents: 13932
diff changeset
  3403
  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
  3404
  [255]
14098
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  3405
32699
f75d0aa5dc83 revset: lookup descendents for negative arguments to ancestor operator
David Soria Parra <davidsp@fb.com>
parents: 32684
diff changeset
  3406
  $ log 'branchpoint()~-1'
f75d0aa5dc83 revset: lookup descendents for negative arguments to ancestor operator
David Soria Parra <davidsp@fb.com>
parents: 32684
diff changeset
  3407
  abort: revision in set has more than one child!
f75d0aa5dc83 revset: lookup descendents for negative arguments to ancestor operator
David Soria Parra <davidsp@fb.com>
parents: 32684
diff changeset
  3408
  [255]
f75d0aa5dc83 revset: lookup descendents for negative arguments to ancestor operator
David Soria Parra <davidsp@fb.com>
parents: 32684
diff changeset
  3409
24220
fe195d41f7d2 test-revset: add tests for missing function output
Augie Fackler <augie@google.com>
parents: 24204
diff changeset
  3410
Bogus function gets suggestions
fe195d41f7d2 test-revset: add tests for missing function output
Augie Fackler <augie@google.com>
parents: 24204
diff changeset
  3411
  $ log 'add()'
24222
02d7b5cd373b dispatch: offer suggestions of similar-named commands
Augie Fackler <augie@google.com>
parents: 24221
diff changeset
  3412
  hg: parse error: unknown identifier: add
27623
b3376fba4ab9 dispatch: report similar names consistently
Bryan O'Sullivan <bos@serpentine.com>
parents: 27586
diff changeset
  3413
  (did you mean adds?)
24220
fe195d41f7d2 test-revset: add tests for missing function output
Augie Fackler <augie@google.com>
parents: 24204
diff changeset
  3414
  [255]
fe195d41f7d2 test-revset: add tests for missing function output
Augie Fackler <augie@google.com>
parents: 24204
diff changeset
  3415
  $ log 'added()'
24222
02d7b5cd373b dispatch: offer suggestions of similar-named commands
Augie Fackler <augie@google.com>
parents: 24221
diff changeset
  3416
  hg: parse error: unknown identifier: added
27623
b3376fba4ab9 dispatch: report similar names consistently
Bryan O'Sullivan <bos@serpentine.com>
parents: 27586
diff changeset
  3417
  (did you mean adds?)
24220
fe195d41f7d2 test-revset: add tests for missing function output
Augie Fackler <augie@google.com>
parents: 24204
diff changeset
  3418
  [255]
fe195d41f7d2 test-revset: add tests for missing function output
Augie Fackler <augie@google.com>
parents: 24204
diff changeset
  3419
  $ log 'remo()'
24222
02d7b5cd373b dispatch: offer suggestions of similar-named commands
Augie Fackler <augie@google.com>
parents: 24221
diff changeset
  3420
  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
  3421
  (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
  3422
  [255]
fe195d41f7d2 test-revset: add tests for missing function output
Augie Fackler <augie@google.com>
parents: 24204
diff changeset
  3423
  $ log 'babar()'
24222
02d7b5cd373b dispatch: offer suggestions of similar-named commands
Augie Fackler <augie@google.com>
parents: 24221
diff changeset
  3424
  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
  3425
  [255]
fe195d41f7d2 test-revset: add tests for missing function output
Augie Fackler <augie@google.com>
parents: 24204
diff changeset
  3426
25632
015c0d1087a3 revset: don't suggest private or undocumented queries
Matt Harbison <matt_harbison@yahoo.com>
parents: 25385
diff changeset
  3427
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
  3428
  $ log 'matches()'
015c0d1087a3 revset: don't suggest private or undocumented queries
Matt Harbison <matt_harbison@yahoo.com>
parents: 25385
diff changeset
  3429
  hg: parse error: unknown identifier: matches
27623
b3376fba4ab9 dispatch: report similar names consistently
Bryan O'Sullivan <bos@serpentine.com>
parents: 27586
diff changeset
  3430
  (did you mean matching?)
25632
015c0d1087a3 revset: don't suggest private or undocumented queries
Matt Harbison <matt_harbison@yahoo.com>
parents: 25385
diff changeset
  3431
  [255]
015c0d1087a3 revset: don't suggest private or undocumented queries
Matt Harbison <matt_harbison@yahoo.com>
parents: 25385
diff changeset
  3432
015c0d1087a3 revset: don't suggest private or undocumented queries
Matt Harbison <matt_harbison@yahoo.com>
parents: 25385
diff changeset
  3433
Undocumented functions aren't suggested as similar either
30701
8b1d87243710 revset: document wdir() as an experimental function
Yuya Nishihara <yuya@tcha.org>
parents: 30699
diff changeset
  3434
  $ log 'tagged2()'
8b1d87243710 revset: document wdir() as an experimental function
Yuya Nishihara <yuya@tcha.org>
parents: 30699
diff changeset
  3435
  hg: parse error: unknown identifier: tagged2
25632
015c0d1087a3 revset: don't suggest private or undocumented queries
Matt Harbison <matt_harbison@yahoo.com>
parents: 25385
diff changeset
  3436
  [255]
015c0d1087a3 revset: don't suggest private or undocumented queries
Matt Harbison <matt_harbison@yahoo.com>
parents: 25385
diff changeset
  3437
20798
170d6d591a7d scmutil: fix revrange when multiple revs are specified
Durham Goode <durham@fb.com>
parents: 20781
diff changeset
  3438
multiple revspecs
170d6d591a7d scmutil: fix revrange when multiple revs are specified
Durham Goode <durham@fb.com>
parents: 20781
diff changeset
  3439
170d6d591a7d scmutil: fix revrange when multiple revs are specified
Durham Goode <durham@fb.com>
parents: 20781
diff changeset
  3440
  $ 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
  3441
  8
170d6d591a7d scmutil: fix revrange when multiple revs are specified
Durham Goode <durham@fb.com>
parents: 20781
diff changeset
  3442
  9
170d6d591a7d scmutil: fix revrange when multiple revs are specified
Durham Goode <durham@fb.com>
parents: 20781
diff changeset
  3443
  4
170d6d591a7d scmutil: fix revrange when multiple revs are specified
Durham Goode <durham@fb.com>
parents: 20781
diff changeset
  3444
  5
170d6d591a7d scmutil: fix revrange when multiple revs are specified
Durham Goode <durham@fb.com>
parents: 20781
diff changeset
  3445
  6
170d6d591a7d scmutil: fix revrange when multiple revs are specified
Durham Goode <durham@fb.com>
parents: 20781
diff changeset
  3446
  7
170d6d591a7d scmutil: fix revrange when multiple revs are specified
Durham Goode <durham@fb.com>
parents: 20781
diff changeset
  3447
20862
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3448
test usage in revpair (with "+")
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3449
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3450
(real pair)
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3451
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3452
  $ hg diff -r 'tip^^' -r 'tip'
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3453
  diff -r 2326846efdab -r 24286f4ae135 .hgtags
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3454
  --- /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
  3455
  +++ 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
  3456
  @@ -0,0 +1,1 @@
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3457
  +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3458
  $ hg diff -r 'tip^^::tip'
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3459
  diff -r 2326846efdab -r 24286f4ae135 .hgtags
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3460
  --- /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
  3461
  +++ 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
  3462
  @@ -0,0 +1,1 @@
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3463
  +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3464
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3465
(single rev)
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3466
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3467
  $ 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
  3468
  $ hg diff -r 'tip^:tip^'
20862
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3469
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3470
(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
  3471
26020
cc3a30ff9490 revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents: 25998
diff changeset
  3472
  $ 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
  3473
  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
  3474
  --- /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
  3475
  +++ 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
  3476
  @@ -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
  3477
  +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
20862
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3478
  $ hg diff -r 'tip^ or tip^'
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3479
  diff -r d5d0dcbdc4d9 .hgtags
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3480
  --- /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
  3481
  +++ b/.hgtags	* (glob)
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3482
  @@ -0,0 +1,1 @@
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3483
  +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3484
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3485
(no rev)
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3486
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3487
  $ hg diff -r 'author("babar") or author("celeste")'
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3488
  abort: empty revision range
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3489
  [255]
97b2f26dfc43 revpair: smartset compatibility
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20798
diff changeset
  3490
14098
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  3491
aliases:
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  3492
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  3493
  $ echo '[revsetalias]' >> .hg/hgrc
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  3494
  $ echo 'm = merge()' >> .hg/hgrc
24883
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3495
(revset aliases can override builtin revsets)
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3496
  $ echo 'p2($1) = p1($1)' >> .hg/hgrc
16096
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3497
  $ echo 'sincem = descendants(m)' >> .hg/hgrc
14098
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  3498
  $ echo 'd($1) = reverse(sort($1, date))' >> .hg/hgrc
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  3499
  $ 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
  3500
  $ 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
  3501
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  3502
  $ try m
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  3503
  ('symbol', 'm')
28629
d6f8a1535224 debugrevspec: show expanded/concatenated states before printing trees
Yuya Nishihara <yuya@tcha.org>
parents: 28427
diff changeset
  3504
  * expanded:
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3505
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3506
    ('symbol', 'merge')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3507
    None)
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3508
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3509
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  3510
    <fullreposet+ 0:10>,
28424
534f968d33e5 revset: add inspection data to all filter() calls
Yuya Nishihara <yuya@tcha.org>
parents: 28423
diff changeset
  3511
    <merge>>
14098
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  3512
  6
16096
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3513
24892
8cc6036bca53 tests: make tests with temporary environment setting portable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24883
diff changeset
  3514
  $ HGPLAIN=1
8cc6036bca53 tests: make tests with temporary environment setting portable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24883
diff changeset
  3515
  $ export HGPLAIN
8cc6036bca53 tests: make tests with temporary environment setting portable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24883
diff changeset
  3516
  $ try m
24883
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3517
  ('symbol', 'm')
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3518
  abort: unknown revision 'm'!
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3519
  [255]
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3520
24892
8cc6036bca53 tests: make tests with temporary environment setting portable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24883
diff changeset
  3521
  $ HGPLAINEXCEPT=revsetalias
8cc6036bca53 tests: make tests with temporary environment setting portable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24883
diff changeset
  3522
  $ export HGPLAINEXCEPT
8cc6036bca53 tests: make tests with temporary environment setting portable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24883
diff changeset
  3523
  $ try m
24883
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3524
  ('symbol', 'm')
28629
d6f8a1535224 debugrevspec: show expanded/concatenated states before printing trees
Yuya Nishihara <yuya@tcha.org>
parents: 28427
diff changeset
  3525
  * expanded:
24883
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3526
  (func
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3527
    ('symbol', 'merge')
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3528
    None)
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3529
  * set:
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3530
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  3531
    <fullreposet+ 0:10>,
28424
534f968d33e5 revset: add inspection data to all filter() calls
Yuya Nishihara <yuya@tcha.org>
parents: 28423
diff changeset
  3532
    <merge>>
24883
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3533
  6
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3534
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3535
  $ unset HGPLAIN
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3536
  $ unset HGPLAINEXCEPT
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3537
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3538
  $ try 'p2(.)'
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3539
  (func
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3540
    ('symbol', 'p2')
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3541
    ('symbol', '.'))
28629
d6f8a1535224 debugrevspec: show expanded/concatenated states before printing trees
Yuya Nishihara <yuya@tcha.org>
parents: 28427
diff changeset
  3542
  * expanded:
24883
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3543
  (func
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3544
    ('symbol', 'p1')
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3545
    ('symbol', '.'))
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3546
  * set:
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3547
  <baseset+ [8]>
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3548
  8
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3549
24892
8cc6036bca53 tests: make tests with temporary environment setting portable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24883
diff changeset
  3550
  $ HGPLAIN=1
8cc6036bca53 tests: make tests with temporary environment setting portable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24883
diff changeset
  3551
  $ export HGPLAIN
8cc6036bca53 tests: make tests with temporary environment setting portable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24883
diff changeset
  3552
  $ try 'p2(.)'
24883
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3553
  (func
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3554
    ('symbol', 'p2')
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3555
    ('symbol', '.'))
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3556
  * set:
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3557
  <baseset+ []>
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3558
24892
8cc6036bca53 tests: make tests with temporary environment setting portable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24883
diff changeset
  3559
  $ HGPLAINEXCEPT=revsetalias
8cc6036bca53 tests: make tests with temporary environment setting portable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24883
diff changeset
  3560
  $ export HGPLAINEXCEPT
8cc6036bca53 tests: make tests with temporary environment setting portable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 24883
diff changeset
  3561
  $ try 'p2(.)'
24883
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3562
  (func
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3563
    ('symbol', 'p2')
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3564
    ('symbol', '.'))
28629
d6f8a1535224 debugrevspec: show expanded/concatenated states before printing trees
Yuya Nishihara <yuya@tcha.org>
parents: 28427
diff changeset
  3565
  * expanded:
24883
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3566
  (func
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3567
    ('symbol', 'p1')
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3568
    ('symbol', '.'))
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3569
  * set:
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3570
  <baseset+ [8]>
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3571
  8
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3572
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3573
  $ unset HGPLAIN
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3574
  $ unset HGPLAINEXCEPT
09049042ab99 ui: disable revsetaliases in plain mode (BC)
Siddharth Agarwal <sid0@fb.com>
parents: 24708
diff changeset
  3575
16096
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3576
test alias recursion
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3577
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3578
  $ try sincem
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3579
  ('symbol', 'sincem')
28629
d6f8a1535224 debugrevspec: show expanded/concatenated states before printing trees
Yuya Nishihara <yuya@tcha.org>
parents: 28427
diff changeset
  3580
  * expanded:
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3581
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3582
    ('symbol', 'descendants')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3583
    (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3584
      ('symbol', 'merge')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3585
      None))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3586
  * set:
33075
d83b189aef83 dagop: change revdescendants() to include all root revisions
Yuya Nishihara <yuya@tcha.org>
parents: 33074
diff changeset
  3587
  <generatorset+>
14098
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  3588
  6
16096
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3589
  7
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3590
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3591
test infinite recursion
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3592
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3593
  $ echo 'recurse1 = recurse2' >> .hg/hgrc
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3594
  $ echo 'recurse2 = recurse1' >> .hg/hgrc
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3595
  $ try recurse1
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3596
  ('symbol', 'recurse1')
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3597
  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
  3598
  [255]
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3599
16772
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  3600
  $ 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
  3601
  $ 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
  3602
  $ try "level2(level1(1, 2), 3)"
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  3603
  (func
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  3604
    ('symbol', 'level2')
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  3605
    (list
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  3606
      (func
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  3607
        ('symbol', 'level1')
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  3608
        (list
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  3609
          ('symbol', '1')
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  3610
          ('symbol', '2')))
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  3611
      ('symbol', '3')))
28629
d6f8a1535224 debugrevspec: show expanded/concatenated states before printing trees
Yuya Nishihara <yuya@tcha.org>
parents: 28427
diff changeset
  3612
  * expanded:
16772
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  3613
  (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3614
    (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3615
      ('symbol', '3')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3616
      (or
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3617
        (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3618
          ('symbol', '1')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3619
          ('symbol', '2')))))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3620
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3621
  <addset
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3622
    <baseset [3]>,
25343
7fbef7932af9 revset: optimize 'or' operation of trivial revisions to a list
Yuya Nishihara <yuya@tcha.org>
parents: 25309
diff changeset
  3623
    <baseset [1, 2]>>
16772
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  3624
  3
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  3625
  1
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  3626
  2
30e46d7138de revset: fix infinite alias expansion detection
Patrick Mezard <patrick@mezard.eu>
parents: 16771
diff changeset
  3627
16096
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3628
test nesting and variable passing
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3629
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3630
  $ echo 'nested($1) = nested2($1)' >> .hg/hgrc
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3631
  $ echo 'nested2($1) = nested3($1)' >> .hg/hgrc
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3632
  $ echo 'nested3($1) = max($1)' >> .hg/hgrc
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3633
  $ try 'nested(2:5)'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3634
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3635
    ('symbol', 'nested')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3636
    (range
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3637
      ('symbol', '2')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3638
      ('symbol', '5')))
28629
d6f8a1535224 debugrevspec: show expanded/concatenated states before printing trees
Yuya Nishihara <yuya@tcha.org>
parents: 28427
diff changeset
  3639
  * expanded:
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3640
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3641
    ('symbol', 'max')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3642
    (range
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3643
      ('symbol', '2')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3644
      ('symbol', '5')))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3645
  * set:
28427
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3646
  <baseset
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3647
    <max
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  3648
      <fullreposet+ 0:10>,
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  3649
      <spanset+ 2:6>>>
16096
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3650
  5
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3651
25309
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3652
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
  3653
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3654
  $ 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
  3655
  $ 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
  3656
  (func
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3657
    ('symbol', 'chainedorops')
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3658
    (list
27987
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  3659
      (range
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  3660
        ('symbol', '0')
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  3661
        ('symbol', '1'))
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  3662
      (range
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  3663
        ('symbol', '1')
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  3664
        ('symbol', '2'))
25309
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3665
      (range
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3666
        ('symbol', '2')
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3667
        ('symbol', '3'))))
28629
d6f8a1535224 debugrevspec: show expanded/concatenated states before printing trees
Yuya Nishihara <yuya@tcha.org>
parents: 28427
diff changeset
  3668
  * expanded:
25309
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3669
  (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3670
    (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3671
      (range
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3672
        ('symbol', '0')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3673
        ('symbol', '1'))
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3674
      (range
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3675
        ('symbol', '1')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3676
        ('symbol', '2'))
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3677
      (range
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3678
        ('symbol', '2')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3679
        ('symbol', '3'))))
25309
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3680
  * set:
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3681
  <addset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  3682
    <spanset+ 0:2>,
25309
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3683
    <addset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  3684
      <spanset+ 1:3>,
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  3685
      <spanset+ 2:4>>>
25309
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3686
  0
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3687
  1
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3688
  2
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3689
  3
b333ca94403d revset: reduce nesting of chained 'or' operations (issue4624)
Yuya Nishihara <yuya@tcha.org>
parents: 25295
diff changeset
  3690
16096
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3691
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
  3692
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
  3693
far away.
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3694
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3695
  $ echo 'injectparamasstring = max("$1")' >> .hg/hgrc
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3696
  $ echo 'callinjection($1) = descendants(injectparamasstring)' >> .hg/hgrc
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3697
  $ try 'callinjection(2:5)'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3698
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3699
    ('symbol', 'callinjection')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3700
    (range
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3701
      ('symbol', '2')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3702
      ('symbol', '5')))
28629
d6f8a1535224 debugrevspec: show expanded/concatenated states before printing trees
Yuya Nishihara <yuya@tcha.org>
parents: 28427
diff changeset
  3703
  * expanded:
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3704
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3705
    ('symbol', 'descendants')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3706
    (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3707
      ('symbol', 'max')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3708
      ('string', '$1')))
16096
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3709
  abort: unknown revision '$1'!
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3710
  [255]
b8be450638f6 revset: fix alias substitution recursion (issue3240)
Patrick Mezard <patrick@mezard.eu>
parents: 16008
diff changeset
  3711
28688
3e0d03c3c594 revset: add test that should fail if '_aliasarg' tag is removed
Yuya Nishihara <yuya@tcha.org>
parents: 28629
diff changeset
  3712
test scope of alias expansion: 'universe' is expanded prior to 'shadowall(0)',
30332
318a24b52eeb spelling: fixes of non-dictionary words
Mads Kiilerich <madski@unity3d.com>
parents: 30179
diff changeset
  3713
but 'all()' should never be substituted to '0()'.
28688
3e0d03c3c594 revset: add test that should fail if '_aliasarg' tag is removed
Yuya Nishihara <yuya@tcha.org>
parents: 28629
diff changeset
  3714
3e0d03c3c594 revset: add test that should fail if '_aliasarg' tag is removed
Yuya Nishihara <yuya@tcha.org>
parents: 28629
diff changeset
  3715
  $ echo 'universe = all()' >> .hg/hgrc
3e0d03c3c594 revset: add test that should fail if '_aliasarg' tag is removed
Yuya Nishihara <yuya@tcha.org>
parents: 28629
diff changeset
  3716
  $ echo 'shadowall(all) = all and universe' >> .hg/hgrc
3e0d03c3c594 revset: add test that should fail if '_aliasarg' tag is removed
Yuya Nishihara <yuya@tcha.org>
parents: 28629
diff changeset
  3717
  $ try 'shadowall(0)'
3e0d03c3c594 revset: add test that should fail if '_aliasarg' tag is removed
Yuya Nishihara <yuya@tcha.org>
parents: 28629
diff changeset
  3718
  (func
3e0d03c3c594 revset: add test that should fail if '_aliasarg' tag is removed
Yuya Nishihara <yuya@tcha.org>
parents: 28629
diff changeset
  3719
    ('symbol', 'shadowall')
3e0d03c3c594 revset: add test that should fail if '_aliasarg' tag is removed
Yuya Nishihara <yuya@tcha.org>
parents: 28629
diff changeset
  3720
    ('symbol', '0'))
3e0d03c3c594 revset: add test that should fail if '_aliasarg' tag is removed
Yuya Nishihara <yuya@tcha.org>
parents: 28629
diff changeset
  3721
  * expanded:
3e0d03c3c594 revset: add test that should fail if '_aliasarg' tag is removed
Yuya Nishihara <yuya@tcha.org>
parents: 28629
diff changeset
  3722
  (and
3e0d03c3c594 revset: add test that should fail if '_aliasarg' tag is removed
Yuya Nishihara <yuya@tcha.org>
parents: 28629
diff changeset
  3723
    ('symbol', '0')
3e0d03c3c594 revset: add test that should fail if '_aliasarg' tag is removed
Yuya Nishihara <yuya@tcha.org>
parents: 28629
diff changeset
  3724
    (func
3e0d03c3c594 revset: add test that should fail if '_aliasarg' tag is removed
Yuya Nishihara <yuya@tcha.org>
parents: 28629
diff changeset
  3725
      ('symbol', 'all')
3e0d03c3c594 revset: add test that should fail if '_aliasarg' tag is removed
Yuya Nishihara <yuya@tcha.org>
parents: 28629
diff changeset
  3726
      None))
3e0d03c3c594 revset: add test that should fail if '_aliasarg' tag is removed
Yuya Nishihara <yuya@tcha.org>
parents: 28629
diff changeset
  3727
  * set:
3e0d03c3c594 revset: add test that should fail if '_aliasarg' tag is removed
Yuya Nishihara <yuya@tcha.org>
parents: 28629
diff changeset
  3728
  <filteredset
3e0d03c3c594 revset: add test that should fail if '_aliasarg' tag is removed
Yuya Nishihara <yuya@tcha.org>
parents: 28629
diff changeset
  3729
    <baseset [0]>,
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  3730
    <spanset+ 0:10>>
28688
3e0d03c3c594 revset: add test that should fail if '_aliasarg' tag is removed
Yuya Nishihara <yuya@tcha.org>
parents: 28629
diff changeset
  3731
  0
3e0d03c3c594 revset: add test that should fail if '_aliasarg' tag is removed
Yuya Nishihara <yuya@tcha.org>
parents: 28629
diff changeset
  3732
28690
b56bf98c8afb revset: drop redundant check for unknown alias arguments
Yuya Nishihara <yuya@tcha.org>
parents: 28689
diff changeset
  3733
test unknown reference:
b56bf98c8afb revset: drop redundant check for unknown alias arguments
Yuya Nishihara <yuya@tcha.org>
parents: 28689
diff changeset
  3734
b56bf98c8afb revset: drop redundant check for unknown alias arguments
Yuya Nishihara <yuya@tcha.org>
parents: 28689
diff changeset
  3735
  $ try "unknownref(0)" --config 'revsetalias.unknownref($1)=$1:$2'
b56bf98c8afb revset: drop redundant check for unknown alias arguments
Yuya Nishihara <yuya@tcha.org>
parents: 28689
diff changeset
  3736
  (func
b56bf98c8afb revset: drop redundant check for unknown alias arguments
Yuya Nishihara <yuya@tcha.org>
parents: 28689
diff changeset
  3737
    ('symbol', 'unknownref')
b56bf98c8afb revset: drop redundant check for unknown alias arguments
Yuya Nishihara <yuya@tcha.org>
parents: 28689
diff changeset
  3738
    ('symbol', '0'))
29059
8eba4cdcfd81 parser: shorten prefix of alias parsing errors
Yuya Nishihara <yuya@tcha.org>
parents: 29058
diff changeset
  3739
  abort: bad definition of revset alias "unknownref": invalid symbol '$2'
28690
b56bf98c8afb revset: drop redundant check for unknown alias arguments
Yuya Nishihara <yuya@tcha.org>
parents: 28689
diff changeset
  3740
  [255]
b56bf98c8afb revset: drop redundant check for unknown alias arguments
Yuya Nishihara <yuya@tcha.org>
parents: 28689
diff changeset
  3741
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
  3742
  $ 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
  3743
  ('symbol', 'tip')
29059
8eba4cdcfd81 parser: shorten prefix of alias parsing errors
Yuya Nishihara <yuya@tcha.org>
parents: 29058
diff changeset
  3744
  warning: bad definition of revset alias "anotherbadone": at 7: not a prefix: end
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3745
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3746
  <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
  3747
  9
16771
2f3317d53d51 revset: explicitely tag alias arguments for expansion
Patrick Mezard <patrick@mezard.eu>
parents: 16640
diff changeset
  3748
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
  3749
  $ 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
  3750
  ('symbol', 'tip')
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3751
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3752
  <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
  3753
  9
23846
aac4a1a7920e revset: parse alias declaration strictly by _parsealiasdecl
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23844
diff changeset
  3754
aac4a1a7920e revset: parse alias declaration strictly by _parsealiasdecl
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23844
diff changeset
  3755
  $ 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
  3756
  ('symbol', 'tip')
29059
8eba4cdcfd81 parser: shorten prefix of alias parsing errors
Yuya Nishihara <yuya@tcha.org>
parents: 29058
diff changeset
  3757
  warning: bad 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
  3758
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3759
  <baseset [9]>
23846
aac4a1a7920e revset: parse alias declaration strictly by _parsealiasdecl
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23844
diff changeset
  3760
  9
23994
8a2156780839 revset: replace parsing alias definition by _parsealiasdefn to parse strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  3761
  $ 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
  3762
  $ 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
  3763
  (func
8a2156780839 revset: replace parsing alias definition by _parsealiasdefn to parse strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  3764
    ('symbol', 'strictreplacing')
8a2156780839 revset: replace parsing alias definition by _parsealiasdefn to parse strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  3765
    (list
8a2156780839 revset: replace parsing alias definition by _parsealiasdefn to parse strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  3766
      ('string', 'foo')
8a2156780839 revset: replace parsing alias definition by _parsealiasdefn to parse strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  3767
      ('symbol', 'tip')))
28629
d6f8a1535224 debugrevspec: show expanded/concatenated states before printing trees
Yuya Nishihara <yuya@tcha.org>
parents: 28427
diff changeset
  3768
  * expanded:
23994
8a2156780839 revset: replace parsing alias definition by _parsealiasdefn to parse strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  3769
  (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3770
    (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3771
      ('symbol', 'tip')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3772
      (func
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3773
        ('symbol', 'desc')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3774
        ('string', '$1'))))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3775
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3776
  <addset
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3777
    <baseset [9]>,
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3778
    <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  3779
      <fullreposet+ 0:10>,
28424
534f968d33e5 revset: add inspection data to all filter() calls
Yuya Nishihara <yuya@tcha.org>
parents: 28423
diff changeset
  3780
      <desc '$1'>>>
23994
8a2156780839 revset: replace parsing alias definition by _parsealiasdefn to parse strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23978
diff changeset
  3781
  9
23846
aac4a1a7920e revset: parse alias declaration strictly by _parsealiasdecl
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23844
diff changeset
  3782
14098
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  3783
  $ try 'd(2:5)'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3784
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3785
    ('symbol', 'd')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3786
    (range
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3787
      ('symbol', '2')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3788
      ('symbol', '5')))
28629
d6f8a1535224 debugrevspec: show expanded/concatenated states before printing trees
Yuya Nishihara <yuya@tcha.org>
parents: 28427
diff changeset
  3789
  * expanded:
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3790
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3791
    ('symbol', 'reverse')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3792
    (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3793
      ('symbol', 'sort')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3794
      (list
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3795
        (range
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3796
          ('symbol', '2')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3797
          ('symbol', '5'))
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3798
        ('symbol', 'date'))))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3799
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3800
  <baseset [4, 5, 3, 2]>
14098
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  3801
  4
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  3802
  5
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  3803
  3
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  3804
  2
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  3805
  $ try 'rs(2 or 3, date)'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3806
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3807
    ('symbol', 'rs')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3808
    (list
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3809
      (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3810
        (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3811
          ('symbol', '2')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3812
          ('symbol', '3')))
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3813
      ('symbol', 'date')))
28629
d6f8a1535224 debugrevspec: show expanded/concatenated states before printing trees
Yuya Nishihara <yuya@tcha.org>
parents: 28427
diff changeset
  3814
  * expanded:
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3815
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3816
    ('symbol', 'reverse')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3817
    (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3818
      ('symbol', 'sort')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3819
      (list
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3820
        (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3821
          (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3822
            ('symbol', '2')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3823
            ('symbol', '3')))
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3824
        ('symbol', 'date'))))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3825
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3826
  <baseset [3, 2]>
14098
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  3827
  3
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
  3828
  2
14723
b9faf94ee196 revset: fix aliases with 0 or more than 2 parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 14650
diff changeset
  3829
  $ try 'rs()'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3830
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3831
    ('symbol', 'rs')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3832
    None)
14723
b9faf94ee196 revset: fix aliases with 0 or more than 2 parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 14650
diff changeset
  3833
  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
  3834
  [255]
b9faf94ee196 revset: fix aliases with 0 or more than 2 parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 14650
diff changeset
  3835
  $ try 'rs(2)'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3836
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3837
    ('symbol', 'rs')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3838
    ('symbol', '2'))
14723
b9faf94ee196 revset: fix aliases with 0 or more than 2 parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 14650
diff changeset
  3839
  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
  3840
  [255]
b9faf94ee196 revset: fix aliases with 0 or more than 2 parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 14650
diff changeset
  3841
  $ try 'rs(2, data, 7)'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3842
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3843
    ('symbol', 'rs')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3844
    (list
27987
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  3845
      ('symbol', '2')
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  3846
      ('symbol', 'data')
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3847
      ('symbol', '7')))
14723
b9faf94ee196 revset: fix aliases with 0 or more than 2 parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 14650
diff changeset
  3848
  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
  3849
  [255]
b9faf94ee196 revset: fix aliases with 0 or more than 2 parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 14650
diff changeset
  3850
  $ try 'rs4(2 or 3, x, x, date)'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3851
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3852
    ('symbol', 'rs4')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3853
    (list
27987
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  3854
      (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3855
        (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3856
          ('symbol', '2')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3857
          ('symbol', '3')))
27987
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  3858
      ('symbol', 'x')
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  3859
      ('symbol', 'x')
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3860
      ('symbol', 'date')))
28629
d6f8a1535224 debugrevspec: show expanded/concatenated states before printing trees
Yuya Nishihara <yuya@tcha.org>
parents: 28427
diff changeset
  3861
  * expanded:
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3862
  (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3863
    ('symbol', 'reverse')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3864
    (func
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3865
      ('symbol', 'sort')
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3866
      (list
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3867
        (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3868
          (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3869
            ('symbol', '2')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3870
            ('symbol', '3')))
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  3871
        ('symbol', 'date'))))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3872
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  3873
  <baseset [3, 2]>
14723
b9faf94ee196 revset: fix aliases with 0 or more than 2 parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 14650
diff changeset
  3874
  3
b9faf94ee196 revset: fix aliases with 0 or more than 2 parameters
Mads Kiilerich <mads@kiilerich.com>
parents: 14650
diff changeset
  3875
  2
14153
f8047a059ca0 revset: avoid over-aggresive optimizations of non-filtering functions (issue2549)
Mads Kiilerich <mads@kiilerich.com>
parents: 14098
diff changeset
  3876
24175
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3877
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
  3878
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3879
  $ 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
  3880
  6:e0cc66ef77e8
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3881
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3882
  $ 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
  3883
  0:2785f51eece5
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3884
  1:d75937da8da0
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3885
  2:5ed5505e9f1c
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3886
  3:8528aa5637f2
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3887
  4:2326846efdab
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3888
  5:904fa392b941
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3889
  6:e0cc66ef77e8
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3890
  7:013af1973af4
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3891
  8:d5d0dcbdc4d9
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3892
  9:24286f4ae135
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3893
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3894
  $ 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
  3895
  0:2785f51eece5
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3896
  1:d75937da8da0
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3897
  2:5ed5505e9f1c
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3898
  3:8528aa5637f2
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3899
  4:2326846efdab
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3900
  5:904fa392b941
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3901
  6:e0cc66ef77e8
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3902
  7:013af1973af4
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3903
  8:d5d0dcbdc4d9
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3904
  9:24286f4ae135
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3905
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3906
  $ 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
  3907
  0:2785f51eece5
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3908
  1:d75937da8da0
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3909
  2:5ed5505e9f1c
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3910
  3:8528aa5637f2
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3911
  4:2326846efdab
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3912
  5:904fa392b941
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3913
  6:e0cc66ef77e8
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3914
  7:013af1973af4
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3915
  8:d5d0dcbdc4d9
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3916
  9:24286f4ae135
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3917
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3918
  $ 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
  3919
  6:e0cc66ef77e8
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3920
  7:013af1973af4
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3921
  8:d5d0dcbdc4d9
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3922
  9:24286f4ae135
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3923
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3924
  $ 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
  3925
  0:2785f51eece5
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3926
  1:d75937da8da0
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3927
  2:5ed5505e9f1c
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3928
  3:8528aa5637f2
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3929
  4:2326846efdab
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3930
  5:904fa392b941
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3931
  6:e0cc66ef77e8
c4e3e7b031b7 revrange: don't parse revset aliases as hash prefixes (issue4553)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24163
diff changeset
  3932
14153
f8047a059ca0 revset: avoid over-aggresive optimizations of non-filtering functions (issue2549)
Mads Kiilerich <mads@kiilerich.com>
parents: 14098
diff changeset
  3933
issue2549 - correct optimizations
f8047a059ca0 revset: avoid over-aggresive optimizations of non-filtering functions (issue2549)
Mads Kiilerich <mads@kiilerich.com>
parents: 14098
diff changeset
  3934
28426
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  3935
  $ try 'limit(1 or 2 or 3, 2) and not 2'
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  3936
  (and
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  3937
    (func
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  3938
      ('symbol', 'limit')
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  3939
      (list
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  3940
        (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3941
          (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3942
            ('symbol', '1')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3943
            ('symbol', '2')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3944
            ('symbol', '3')))
28426
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  3945
        ('symbol', '2')))
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  3946
    (not
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  3947
      ('symbol', '2')))
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  3948
  * set:
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  3949
  <filteredset
32820
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  3950
    <baseset [1, 2]>,
28426
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  3951
    <not
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  3952
      <baseset [2]>>>
14153
f8047a059ca0 revset: avoid over-aggresive optimizations of non-filtering functions (issue2549)
Mads Kiilerich <mads@kiilerich.com>
parents: 14098
diff changeset
  3953
  1
28427
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3954
  $ try 'max(1 or 2) and not 2'
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3955
  (and
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3956
    (func
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3957
      ('symbol', 'max')
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3958
      (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3959
        (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3960
          ('symbol', '1')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3961
          ('symbol', '2'))))
28427
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3962
    (not
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3963
      ('symbol', '2')))
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3964
  * set:
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3965
  <filteredset
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3966
    <baseset
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3967
      <max
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  3968
        <fullreposet+ 0:10>,
28427
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3969
        <baseset [1, 2]>>>,
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3970
    <not
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3971
      <baseset [2]>>>
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3972
  $ try 'min(1 or 2) and not 1'
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3973
  (and
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3974
    (func
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3975
      ('symbol', 'min')
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3976
      (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3977
        (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3978
          ('symbol', '1')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3979
          ('symbol', '2'))))
28427
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3980
    (not
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3981
      ('symbol', '1')))
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3982
  * set:
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3983
  <filteredset
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3984
    <baseset
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3985
      <min
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  3986
        <fullreposet+ 0:10>,
28427
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3987
        <baseset [1, 2]>>>,
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3988
    <not
969a4615c4c4 revset: add inspection data to max() and min() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28426
diff changeset
  3989
      <baseset [1]>>>
28426
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  3990
  $ try 'last(1 or 2, 1) and not 2'
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  3991
  (and
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  3992
    (func
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  3993
      ('symbol', 'last')
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  3994
      (list
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  3995
        (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3996
          (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3997
            ('symbol', '1')
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  3998
            ('symbol', '2')))
28426
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  3999
        ('symbol', '1')))
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  4000
    (not
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  4001
      ('symbol', '2')))
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  4002
  * set:
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  4003
  <filteredset
32820
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  4004
    <baseset [2]>,
28426
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  4005
    <not
3d39ac06af9a revset: add inspection data to limit() and last() functions
Yuya Nishihara <yuya@tcha.org>
parents: 28424
diff changeset
  4006
      <baseset [2]>>>
15726
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4007
21870
dd716807fd23 revset: maintain ordering when subtracting from a baseset (issue4289)
Matt Mackall <mpm@selenic.com>
parents: 21024
diff changeset
  4008
issue4289 - ordering of built-ins
dd716807fd23 revset: maintain ordering when subtracting from a baseset (issue4289)
Matt Mackall <mpm@selenic.com>
parents: 21024
diff changeset
  4009
  $ 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
  4010
  3:8528aa5637f2
dd716807fd23 revset: maintain ordering when subtracting from a baseset (issue4289)
Matt Mackall <mpm@selenic.com>
parents: 21024
diff changeset
  4011
  2:5ed5505e9f1c
dd716807fd23 revset: maintain ordering when subtracting from a baseset (issue4289)
Matt Mackall <mpm@selenic.com>
parents: 21024
diff changeset
  4012
17858
acd4577a568d test: add test for the issue introduced by e410be860393 (issue3669)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17753
diff changeset
  4013
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
  4014
acd4577a568d test: add test for the issue introduced by e410be860393 (issue3669)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17753
diff changeset
  4015
  $ 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
  4016
  $ 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
  4017
  9
acd4577a568d test: add test for the issue introduced by e410be860393 (issue3669)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17753
diff changeset
  4018
  $ 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
  4019
  8
acd4577a568d test: add test for the issue introduced by e410be860393 (issue3669)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17753
diff changeset
  4020
18473
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4021
test or-ed indirect predicates (issue3775)
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4022
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4023
  $ log '6 or 6^1' | sort
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4024
  5
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4025
  6
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4026
  $ log '6^1 or 6' | sort
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4027
  5
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4028
  6
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4029
  $ log '4 or 4~1' | sort
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4030
  2
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4031
  4
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4032
  $ log '4~1 or 4' | sort
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4033
  2
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4034
  4
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4035
  $ 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
  4036
  0
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4037
  1
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4038
  2
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4039
  3
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4040
  4
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4041
  5
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4042
  6
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4043
  $ 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
  4044
  0
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4045
  1
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4046
  2
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4047
  3
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4048
  4
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4049
  5
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4050
  6
692cbda1eb50 revset: evaluate sub expressions correctly (issue3775)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17858
diff changeset
  4051
16008
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  4052
tests for 'remote()' predicate:
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  4053
#.  (csets in remote) (id)            (remote)
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  4054
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
  4055
2.  same with local   specified       "default"
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  4056
3.  more than local   specified       specified
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  4057
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  4058
  $ hg clone --quiet -U . ../remote3
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  4059
  $ cd ../remote3
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  4060
  $ hg update -q 7
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  4061
  $ echo r > r
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  4062
  $ hg ci -Aqm 10
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  4063
  $ log 'remote()'
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  4064
  7
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  4065
  $ log 'remote("a-b-c-")'
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  4066
  2
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  4067
  $ cd ../repo
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  4068
  $ log 'remote(".a.b.c.", "../remote3")'
02a497a17257 revset: add tests for 'remote()' predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15726
diff changeset
  4069
23742
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4070
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
  4071
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4072
  $ 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
  4073
  (_concat
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4074
    (_concat
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4075
      (_concat
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4076
        ('symbol', '278')
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4077
        ('string', '5f5'))
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4078
      ('symbol', '1ee'))
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4079
    ('string', 'ce5'))
28629
d6f8a1535224 debugrevspec: show expanded/concatenated states before printing trees
Yuya Nishihara <yuya@tcha.org>
parents: 28427
diff changeset
  4080
  * concatenated:
23742
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4081
  ('string', '2785f51eece5')
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  4082
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  4083
  <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
  4084
  0
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4085
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4086
  $ 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
  4087
  $ 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
  4088
  (func
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4089
    ('symbol', 'cat4')
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4090
    (list
27987
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  4091
      ('symbol', '278')
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  4092
      ('string', '5f5')
b19d8d5d6b51 revset: flatten chained 'list' operations (aka function args) (issue5072)
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
  4093
      ('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
  4094
      ('string', 'ce5')))
28629
d6f8a1535224 debugrevspec: show expanded/concatenated states before printing trees
Yuya Nishihara <yuya@tcha.org>
parents: 28427
diff changeset
  4095
  * expanded:
23742
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4096
  (_concat
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4097
    (_concat
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4098
      (_concat
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4099
        ('symbol', '278')
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4100
        ('string', '5f5'))
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4101
      ('symbol', '1ee'))
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4102
    ('string', 'ce5'))
28629
d6f8a1535224 debugrevspec: show expanded/concatenated states before printing trees
Yuya Nishihara <yuya@tcha.org>
parents: 28427
diff changeset
  4103
  * concatenated:
23742
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4104
  ('string', '2785f51eece5')
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  4105
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  4106
  <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
  4107
  0
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4108
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4109
(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
  4110
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4111
  $ 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
  4112
  $ 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
  4113
  $ 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
  4114
  0
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4115
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4116
(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
  4117
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4118
  $ 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
  4119
  $ 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
  4120
  0
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4121
  4
3a4d8a6ce432 revset: introduce new operator "##" to concatenate strings/symbols at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23725
diff changeset
  4122
15726
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4123
  $ cd ..
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4124
25265
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4125
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
  4126
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4127
  $ hg init namedbranch
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4128
  $ cd namedbranch
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4129
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4130
  $ echo default0 >> a
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4131
  $ hg ci -Aqm0
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4132
  $ echo default1 >> a
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4133
  $ hg ci -m1
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4134
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4135
  $ hg branch -q stable
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4136
  $ echo stable2 >> a
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4137
  $ hg ci -m2
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4138
  $ echo stable3 >> a
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4139
  $ hg ci -m3
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4140
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4141
  $ hg update -q null
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4142
  $ echo default4 >> a
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4143
  $ hg ci -Aqm4
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4144
  $ echo default5 >> a
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4145
  $ hg ci -m5
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4146
25266
38117278f295 revbranchcache: return uncached branchinfo for nullrev (issue4683)
Yuya Nishihara <yuya@tcha.org>
parents: 25265
diff changeset
  4147
"null" revision belongs to "default" branch (issue4683)
38117278f295 revbranchcache: return uncached branchinfo for nullrev (issue4683)
Yuya Nishihara <yuya@tcha.org>
parents: 25265
diff changeset
  4148
38117278f295 revbranchcache: return uncached branchinfo for nullrev (issue4683)
Yuya Nishihara <yuya@tcha.org>
parents: 25265
diff changeset
  4149
  $ log 'branch(null)'
38117278f295 revbranchcache: return uncached branchinfo for nullrev (issue4683)
Yuya Nishihara <yuya@tcha.org>
parents: 25265
diff changeset
  4150
  0
38117278f295 revbranchcache: return uncached branchinfo for nullrev (issue4683)
Yuya Nishihara <yuya@tcha.org>
parents: 25265
diff changeset
  4151
  1
38117278f295 revbranchcache: return uncached branchinfo for nullrev (issue4683)
Yuya Nishihara <yuya@tcha.org>
parents: 25265
diff changeset
  4152
  4
38117278f295 revbranchcache: return uncached branchinfo for nullrev (issue4683)
Yuya Nishihara <yuya@tcha.org>
parents: 25265
diff changeset
  4153
  5
38117278f295 revbranchcache: return uncached branchinfo for nullrev (issue4683)
Yuya Nishihara <yuya@tcha.org>
parents: 25265
diff changeset
  4154
25265
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4155
"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
  4156
unless explicitly specified (issue4682)
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4157
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4158
  $ log 'children(branch(default))'
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4159
  1
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4160
  2
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4161
  5
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4162
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4163
  $ cd ..
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  4164
15726
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4165
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
  4166
# unicode: cp932:
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4167
# 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
  4168
# 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
  4169
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4170
  $ 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
  4171
  $ cd problematicencoding
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4172
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4173
  $ 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
  4174
  > print u'''
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4175
  > 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
  4176
  > 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
  4177
  > 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
  4178
  > 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
  4179
  > 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
  4180
  > 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
  4181
  > 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
  4182
  > 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
  4183
  > 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
  4184
  > '''.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
  4185
  > EOF
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4186
  $ 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
  4187
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4188
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
  4189
  $ 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
  4190
  > print u'''
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4191
  > 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
  4192
  > echo ====
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4193
  > 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
  4194
  > echo ====
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4195
  > 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
  4196
  > echo ====
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4197
  > 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
  4198
  > echo ====
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4199
  > 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
  4200
  > echo ====
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4201
  > 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
  4202
  > '''.encode('cp932')
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4203
  > EOF
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4204
  $ 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
  4205
  0
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4206
  ====
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4207
  1
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4208
  ====
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4209
  2
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4210
  ====
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4211
  3
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4212
  ====
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4213
  0
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4214
  2
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4215
  ====
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4216
  1
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4217
  3
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4218
24707
57f58f96f850 revsets: show current revset abort behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 24459
diff changeset
  4219
test error message of bad revset
57f58f96f850 revsets: show current revset abort behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 24459
diff changeset
  4220
  $ hg log -r 'foo\\'
24708
fb47816e1a9c revsets: more informative syntax error message
Ryan McElroy <rmcelroy@fb.com>
parents: 24707
diff changeset
  4221
  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
  4222
  [255]
57f58f96f850 revsets: show current revset abort behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 24459
diff changeset
  4223
15726
9b822edecb4c i18n: use "encoding.lower()" to normalize specified string for revset
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 15623
diff changeset
  4224
  $ cd ..
27586
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  4225
28394
dcb4209bd30d revset: replace extpredicate by revsetpredicate of registrar
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28217
diff changeset
  4226
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
  4227
loading it
27586
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  4228
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  4229
  $ cd repo
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  4230
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  4231
  $ 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
  4232
  > 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
  4233
  > 
28394
dcb4209bd30d revset: replace extpredicate by revsetpredicate of registrar
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28217
diff changeset
  4234
  > 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
  4235
  > 
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  4236
  > @revsetpredicate('custom1()')
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  4237
  > 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
  4238
  >     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
  4239
  > 
28394
dcb4209bd30d revset: replace extpredicate by revsetpredicate of registrar
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28217
diff changeset
  4240
  > 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
  4241
  > EOF
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  4242
  $ 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
  4243
  > [extensions]
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  4244
  > 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
  4245
  > EOF
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  4246
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  4247
  $ hg debugrevspec "custom1()"
28394
dcb4209bd30d revset: replace extpredicate by revsetpredicate of registrar
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28217
diff changeset
  4248
  *** 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
  4249
  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
  4250
  [255]
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  4251
42910f9fffeb revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27517
diff changeset
  4252
  $ cd ..