tests/test-revset.t
author Yuya Nishihara <yuya@tcha.org>
Wed, 27 Jun 2018 23:39:41 +0900
changeset 38479 72621094505f
parent 38478 b2d5ad03f31a
child 38522 54d7aaa243cc
permissions -rw-r--r--
revset: fix heads() order to always follow the input set (BC) An argument expression should never affect the order of the result set. That's the rule of the revset predicates.
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
  > 
36379
28551d4c5ee8 py3: add b'' prefixes in test-revset.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35542
diff changeset
    19
  > mercurial.revset.symbols[b'r3232'] = r3232
24940
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]
33377
5d63e5f40bea revset: define successors revset
Jun Wu <quark@fb.com>
parents: 33336
diff changeset
    23
  > drawdag=$TESTDIR/drawdag.py
24940
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
    24
  > testrevset=$TESTTMP/testrevset.py
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
    25
  > EOF
11409
7a6ac83a15b0 revset: add some tests
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    26
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    27
  $ try() {
14098
9f5a0acb0056 revset aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 14080
diff changeset
    28
  >   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
    29
  > }
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    30
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    31
  $ log() {
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    32
  >   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
    33
  > }
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
    34
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    35
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
    36
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
    37
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    38
  $ 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
    39
  > 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
    40
  > from mercurial import (
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    41
  >     node as nodemod,
32337
46ba2cdda476 registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 31920
diff changeset
    42
  >     registrar,
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    43
  >     revset,
31024
0b8356705de6 revset: split language services to revsetlang module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 30881
diff changeset
    44
  >     revsetlang,
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    45
  > )
38261
f3033692ccef stringutil: promote smartset.prettyformat() to utility function
Yuya Nishihara <yuya@tcha.org>
parents: 37867
diff changeset
    46
  > from mercurial.utils import stringutil
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    47
  > cmdtable = {}
32337
46ba2cdda476 registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 31920
diff changeset
    48
  > command = registrar.command(cmdtable)
33097
fce4ed2912bb py3: make sure commands name are bytes in tests
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33080
diff changeset
    49
  > @command(b'debugrevlistspec',
36379
28551d4c5ee8 py3: add b'' prefixes in test-revset.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35542
diff changeset
    50
  >     [(b'', b'optimize', None, b'print parsed tree after optimizing'),
28551d4c5ee8 py3: add b'' prefixes in test-revset.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35542
diff changeset
    51
  >      (b'', b'bin', None, b'unhexlify arguments')])
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    52
  > 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
    53
  >     if opts['bin']:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    54
  >         args = map(nodemod.bin, args)
31024
0b8356705de6 revset: split language services to revsetlang module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 30881
diff changeset
    55
  >     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
    56
  >     if ui.verbose:
37350
e32dfff71529 revset: use revsymbol() for checking if a symbol is valid
Martin von Zweigbergk <martinvonz@google.com>
parents: 36685
diff changeset
    57
  >         tree = revsetlang.parse(expr, lookup=revset.lookupfn(repo))
36582
27911e0fb50e tests: add missing b prefixes and fix a %s to %d in test-revset.t
Augie Fackler <augie@google.com>
parents: 36379
diff changeset
    58
  >         ui.note(revsetlang.prettyformat(tree), b"\n")
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    59
  >         if opts["optimize"]:
31024
0b8356705de6 revset: split language services to revsetlang module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 30881
diff changeset
    60
  >             opttree = revsetlang.optimize(revsetlang.analyze(tree))
36379
28551d4c5ee8 py3: add b'' prefixes in test-revset.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35542
diff changeset
    61
  >             ui.note(b"* optimized:\n", revsetlang.prettyformat(opttree),
28551d4c5ee8 py3: add b'' prefixes in test-revset.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35542
diff changeset
    62
  >                     b"\n")
37674
f83cb91b052e revset: pass in lookup function instead of repo (API)
Yuya Nishihara <yuya@tcha.org>
parents: 37350
diff changeset
    63
  >     func = revset.match(ui, expr, lookup=revset.lookupfn(repo))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    64
  >     revs = func(repo)
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    65
  >     if ui.verbose:
38261
f3033692ccef stringutil: promote smartset.prettyformat() to utility function
Yuya Nishihara <yuya@tcha.org>
parents: 37867
diff changeset
    66
  >         ui.note(b"* set:\n", stringutil.prettyrepr(revs), b"\n")
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    67
  >     for c in revs:
36582
27911e0fb50e tests: add missing b prefixes and fix a %s to %d in test-revset.t
Augie Fackler <augie@google.com>
parents: 36379
diff changeset
    68
  >         ui.write(b"%d\n" % c)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    69
  > EOF
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    70
  $ cat <<EOF >> $HGRCPATH
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    71
  > [extensions]
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    72
  > 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
    73
  > EOF
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    74
  $ trylist() {
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    75
  >   hg debugrevlistspec --debug "$@"
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    76
  > }
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    77
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    78
  $ 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
    79
  $ cd repo
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
    80
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    81
  $ 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
    82
  $ 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
    83
  marked working directory as branch a
15615
41885892796e branch: warn on branching
Matt Mackall <mpm@selenic.com>
parents: 14723
diff changeset
    84
  (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
    85
  $ 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
    86
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    87
  $ 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
    88
  $ 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
    89
  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
    90
  $ hg ci -Aqm1
11409
7a6ac83a15b0 revset: add some tests
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
diff changeset
    91
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    92
  $ rm a
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
    93
  $ hg branch 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
  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
    95
  $ hg ci -Aqm2 -u Bob
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
    96
16661
de4b42daf396 revset: add function for matching extra data (issue2767)
Henrik Stuart <hg@hstuart.dk>
parents: 16640
diff changeset
    97
  $ 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
    98
  2
de4b42daf396 revset: add function for matching extra data (issue2767)
Henrik Stuart <hg@hstuart.dk>
parents: 16640
diff changeset
    99
  $ 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
   100
  0
de4b42daf396 revset: add function for matching extra data (issue2767)
Henrik Stuart <hg@hstuart.dk>
parents: 16640
diff changeset
   101
  1
de4b42daf396 revset: add function for matching extra data (issue2767)
Henrik Stuart <hg@hstuart.dk>
parents: 16640
diff changeset
   102
  2
16824
f3b8c82a559c revset: add pattern matching to 'extra' revset expression
Simon King <simon@simonking.org.uk>
parents: 16823
diff changeset
   103
  $ 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
   104
  0 a
f3b8c82a559c revset: add pattern matching to 'extra' revset expression
Simon King <simon@simonking.org.uk>
parents: 16823
diff changeset
   105
  2 a-b-c-
16661
de4b42daf396 revset: add function for matching extra data (issue2767)
Henrik Stuart <hg@hstuart.dk>
parents: 16640
diff changeset
   106
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   107
  $ 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
   108
  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
   109
  $ 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
   110
  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
   111
  $ hg ci -Aqm3
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
   112
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   113
  $ 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
   114
  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
   115
  $ 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
   116
  $ 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
   117
  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
   118
  $ hg ci -Aqm4 -d "May 12 2005"
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
   119
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   120
  $ 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
   121
  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
   122
  $ hg branch !a/b/c/
c739227b5eea test-revset: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16824
diff changeset
   123
  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
   124
  $ 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
   125
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   126
  $ 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
   127
  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
   128
  (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
   129
  $ 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
   130
  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
   131
  $ hg ci -Aqm"6 issue619"
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
   132
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   133
  $ 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
   134
  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
   135
  $ 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
   136
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   137
  $ 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
   138
  marked working directory as branch all
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
   139
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   140
  $ 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
   141
  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
   142
  $ hg branch é
12942
05fffd665170 tests: use (esc) for all non-ASCII test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12786
diff changeset
   143
  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
   144
  $ hg ci -Aqm9
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
   145
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   146
  $ 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
   147
  $ hg bookmark -r6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
   148
12105
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 7 . ../remote1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   150
  $ 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
   151
  $ 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
   152
  $ 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
   153
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   154
trivial
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   155
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   156
  $ try 0:1
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   157
  (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   158
    (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   159
    (symbol '1'))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   160
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   161
  <spanset+ 0:2>
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   162
  0
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
   163
  1
25819
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   164
  $ try --optimize :
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   165
  (rangeall
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   166
    None)
be29d26e2949 revset: parse nullary ":" operator as "0:tip"
Yuya Nishihara <yuya@tcha.org>
parents: 25766
diff changeset
   167
  * optimized:
30803
d389f19f14aa revset: do not transform range* operators in parsed tree
Yuya Nishihara <yuya@tcha.org>
parents: 30783
diff changeset
   168
  (rangeall
34011
1b28525e6698 revset: remove order information from tree (API)
Jun Wu <quark@fb.com>
parents: 34010
diff changeset
   169
    None)
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
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   184
    (symbol '3')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   185
    (symbol '6'))
24458
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
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   194
      (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   195
      (symbol '1')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
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
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
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
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   212
    (symbol 'b')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
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_
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
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
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   227
    (symbol '_a_b_c_')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
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.
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
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
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   242
    (symbol '.a.b.c.')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
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-'
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
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+'
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   261
  (symbol '+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
   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
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   267
    (symbol '+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
   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
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   279
    (symbol '+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
   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
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   288
    (symbol '-a-b-c-')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   289
    (symbol '+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
   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
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   303
          (symbol 'a'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   304
        (symbol 'b'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   305
      (symbol 'c'))
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
   306
    (negate
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
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 é
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
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
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   327
    (string '-a-b-c-')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
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
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   348
        (symbol '1')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   349
        (symbol '2'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
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
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   359
      (symbol '1')
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   360
      (and
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   361
        (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
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
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   371
      (symbol '1')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   372
      (symbol '2'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
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
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   379
      (symbol '1')
29929
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
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   383
            (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
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
36685
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
   402
  (date(this is a test)
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
   403
             ^ here)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12105
diff changeset
   404
  [255]
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   405
  $ log 'date()'
12736
7e14e67e6622 revset: use 'requires' instead of 'wants' in error message
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 12716
diff changeset
   406
  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
   407
  [255]
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   408
  $ 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
   409
  abort: unknown revision 'date'!
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12105
diff changeset
   410
  [255]
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   411
  $ log 'date('
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   412
  hg: parse error at 5: not a prefix: end
36685
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
   413
  (date(
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
   414
        ^ here)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12105
diff changeset
   415
  [255]
26232
43f9976346e9 revset: handle error of string unescaping
Yuya Nishihara <yuya@tcha.org>
parents: 26061
diff changeset
   416
  $ log 'date("\xy")'
36583
edf736c3c064 tests: add some re and globs for test-revset on python3
Augie Fackler <augie@google.com>
parents: 36582
diff changeset
   417
  hg: parse error: invalid \x escape* (glob)
26232
43f9976346e9 revset: handle error of string unescaping
Yuya Nishihara <yuya@tcha.org>
parents: 26061
diff changeset
   418
  [255]
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   419
  $ log 'date(tip)'
32462
bb18728ea617 util: raise ParseError when parsing dates (BC)
Boris Feld <boris.feld@octobus.net>
parents: 32442
diff changeset
   420
  hg: parse error: invalid date: 'tip'
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12105
diff changeset
   421
  [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
   422
  $ 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
   423
  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
   424
  [255]
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 '::"date"'
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   426
  abort: unknown revision 'date'!
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12105
diff changeset
   427
  [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
   428
  $ 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
   429
  $ 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
   430
  0
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   431
  1
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   432
  2
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   433
  3
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   434
  4
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   435
  $ 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
   436
  0
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   437
  1
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   438
  2
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   439
  4
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   440
  $ 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
   441
  0
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   442
  1
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   443
  2
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   444
  4
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
   445
  $ 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
   446
  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
   447
  $ 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
   448
29441
9e8d258708bb revset: check invalid function syntax "func-name"() explicitly
Yuya Nishihara <yuya@tcha.org>
parents: 29408
diff changeset
   449
function name should be a symbol
9e8d258708bb revset: check invalid function syntax "func-name"() explicitly
Yuya Nishihara <yuya@tcha.org>
parents: 29408
diff changeset
   450
9e8d258708bb revset: check invalid function syntax "func-name"() explicitly
Yuya Nishihara <yuya@tcha.org>
parents: 29408
diff changeset
   451
  $ log '"date"(2005)'
9e8d258708bb revset: check invalid function syntax "func-name"() explicitly
Yuya Nishihara <yuya@tcha.org>
parents: 29408
diff changeset
   452
  hg: parse error: not a symbol
9e8d258708bb revset: check invalid function syntax "func-name"() explicitly
Yuya Nishihara <yuya@tcha.org>
parents: 29408
diff changeset
   453
  [255]
9e8d258708bb revset: check invalid function syntax "func-name"() explicitly
Yuya Nishihara <yuya@tcha.org>
parents: 29408
diff changeset
   454
25704
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   455
keyword arguments
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   456
25706
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   457
  $ log 'extra(branch, value=a)'
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   458
  0
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   459
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   460
  $ 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
   461
  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
   462
  [255]
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   463
  $ log 'extra(a, label=b)'
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   464
  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
   465
  [255]
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   466
  $ log 'extra(label=branch, default)'
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   467
  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
   468
  [255]
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   469
  $ log 'extra(branch, foo+bar=baz)'
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   470
  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
   471
  [255]
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   472
  $ log 'extra(unknown=branch)'
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   473
  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
   474
  [255]
b7f53c474e2c revset: port extra() to support keyword arguments
Yuya Nishihara <yuya@tcha.org>
parents: 25704
diff changeset
   475
25704
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   476
  $ try 'foo=bar|baz'
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   477
  (keyvalue
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   478
    (symbol 'foo')
25704
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   479
    (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   480
      (list
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   481
        (symbol 'bar')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   482
        (symbol 'baz'))))
25704
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   483
  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
   484
  [255]
70a2082f855a revset: add parsing rule for key=value pair
Yuya Nishihara <yuya@tcha.org>
parents: 25632
diff changeset
   485
29766
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   486
 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
   487
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   488
  $ try --optimize 'foo=(not public())'
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   489
  (keyvalue
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   490
    (symbol 'foo')
29766
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   491
    (group
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   492
      (not
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   493
        (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   494
          (symbol 'public')
29766
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   495
          None))))
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   496
  * optimized:
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   497
  (keyvalue
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   498
    (symbol 'foo')
29766
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   499
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   500
      (symbol '_notpublic')
34011
1b28525e6698 revset: remove order information from tree (API)
Jun Wu <quark@fb.com>
parents: 34010
diff changeset
   501
      None))
29766
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   502
  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
   503
  [255]
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   504
33416
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   505
relation-subscript operator has the highest binding strength (as function call):
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   506
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   507
  $ hg debugrevspec -p parsed 'tip:tip^#generations[-1]'
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   508
  * parsed:
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   509
  (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   510
    (symbol 'tip')
33416
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   511
    (relsubscript
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   512
      (parentpost
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   513
        (symbol 'tip'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   514
      (symbol 'generations')
33416
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   515
      (negate
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   516
        (symbol '1'))))
33417
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
   517
  9
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
   518
  8
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
   519
  7
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
   520
  6
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
   521
  5
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
   522
  4
33416
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   523
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   524
  $ hg debugrevspec -p parsed --no-show-revs 'not public()#generations[0]'
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   525
  * parsed:
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   526
  (not
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   527
    (relsubscript
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   528
      (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   529
        (symbol 'public')
33416
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   530
        None)
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   531
      (symbol 'generations')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   532
      (symbol '0')))
33416
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   533
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   534
left-hand side of relation-subscript operator should be optimized recursively:
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   535
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   536
  $ hg debugrevspec -p analyzed -p optimized --no-show-revs \
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   537
  > '(not public())#generations[0]'
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   538
  * analyzed:
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   539
  (relsubscript
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   540
    (not
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   541
      (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   542
        (symbol 'public')
34011
1b28525e6698 revset: remove order information from tree (API)
Jun Wu <quark@fb.com>
parents: 34010
diff changeset
   543
        None))
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   544
    (symbol 'generations')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   545
    (symbol '0'))
33416
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   546
  * optimized:
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   547
  (relsubscript
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   548
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   549
      (symbol '_notpublic')
34011
1b28525e6698 revset: remove order information from tree (API)
Jun Wu <quark@fb.com>
parents: 34010
diff changeset
   550
      None)
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   551
    (symbol 'generations')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   552
    (symbol '0'))
33416
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   553
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   554
resolution of subscript and relation-subscript ternary operators:
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   555
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   556
  $ hg debugrevspec -p analyzed 'tip[0]'
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   557
  * analyzed:
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   558
  (subscript
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   559
    (symbol 'tip')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   560
    (symbol '0'))
33416
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   561
  hg: parse error: can't use a subscript in this context
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   562
  [255]
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   563
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   564
  $ hg debugrevspec -p analyzed 'tip#rel[0]'
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   565
  * analyzed:
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   566
  (relsubscript
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   567
    (symbol 'tip')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   568
    (symbol 'rel')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   569
    (symbol '0'))
33417
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
   570
  hg: parse error: unknown identifier: rel
33416
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   571
  [255]
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   572
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   573
  $ hg debugrevspec -p analyzed '(tip#rel)[0]'
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   574
  * analyzed:
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   575
  (subscript
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   576
    (relation
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   577
      (symbol 'tip')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   578
      (symbol 'rel'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   579
    (symbol '0'))
33416
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   580
  hg: parse error: can't use a subscript in this context
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   581
  [255]
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   582
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   583
  $ hg debugrevspec -p analyzed 'tip#rel[0][1]'
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   584
  * analyzed:
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   585
  (subscript
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   586
    (relsubscript
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   587
      (symbol 'tip')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   588
      (symbol 'rel')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   589
      (symbol '0'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   590
    (symbol '1'))
33416
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   591
  hg: parse error: can't use a subscript in this context
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   592
  [255]
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   593
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   594
  $ hg debugrevspec -p analyzed 'tip#rel0#rel1[1]'
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   595
  * analyzed:
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   596
  (relsubscript
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   597
    (relation
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   598
      (symbol 'tip')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   599
      (symbol 'rel0'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   600
    (symbol 'rel1')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   601
    (symbol '1'))
33417
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
   602
  hg: parse error: unknown identifier: rel1
33416
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   603
  [255]
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   604
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   605
  $ hg debugrevspec -p analyzed 'tip#rel0[0]#rel1[1]'
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   606
  * analyzed:
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   607
  (relsubscript
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   608
    (relsubscript
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   609
      (symbol 'tip')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   610
      (symbol 'rel0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   611
      (symbol '0'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   612
    (symbol 'rel1')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   613
    (symbol '1'))
33417
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
   614
  hg: parse error: unknown identifier: rel1
33416
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   615
  [255]
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   616
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   617
parse errors of relation, subscript and relation-subscript operators:
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   618
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   619
  $ hg debugrevspec '[0]'
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   620
  hg: parse error at 0: not a prefix: [
36685
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
   621
  ([0]
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
   622
   ^ here)
33416
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   623
  [255]
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   624
  $ hg debugrevspec '.#'
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   625
  hg: parse error at 2: not a prefix: end
36685
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
   626
  (.#
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
   627
     ^ here)
33416
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   628
  [255]
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   629
  $ hg debugrevspec '#rel'
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   630
  hg: parse error at 0: not a prefix: #
36685
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
   631
  (#rel
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
   632
   ^ here)
33416
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   633
  [255]
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   634
  $ hg debugrevspec '.#rel[0'
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   635
  hg: parse error at 7: unexpected token: end
36685
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
   636
  (.#rel[0
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
   637
          ^ here)
33416
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   638
  [255]
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   639
  $ hg debugrevspec '.]'
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   640
  hg: parse error at 1: invalid token
36685
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
   641
  (.]
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
   642
    ^ here)
33416
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   643
  [255]
9467d5337292 revset: add experimental relation and subscript operators
Yuya Nishihara <yuya@tcha.org>
parents: 33377
diff changeset
   644
33417
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
   645
  $ hg debugrevspec '.#generations[a]'
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
   646
  hg: parse error: relation subscript must be an integer
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
   647
  [255]
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
   648
  $ hg debugrevspec '.#generations[1-2]'
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
   649
  hg: parse error: relation subscript must be an integer
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
   650
  [255]
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
   651
29913
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   652
parsed tree at stages:
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   653
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   654
  $ hg debugrevspec -p all '()'
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   655
  * parsed:
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   656
  (group
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   657
    None)
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   658
  * expanded:
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   659
  (group
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   660
    None)
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   661
  * concatenated:
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   662
  (group
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   663
    None)
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   664
  * analyzed:
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   665
  None
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   666
  * optimized:
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   667
  None
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   668
  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
   669
  [255]
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   670
29923
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   671
  $ 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
   672
  * parsed:
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   673
  (group
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   674
    None)
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   675
  * expanded:
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   676
  (group
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   677
    None)
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   678
  * concatenated:
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   679
  (group
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   680
    None)
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   681
  * analyzed:
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   682
  None
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   683
  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
   684
  [255]
429fd2747d9a debugrevspec: add option to skip optimize() and evaluate unoptimized tree
Yuya Nishihara <yuya@tcha.org>
parents: 29913
diff changeset
   685
29913
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   686
  $ 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
   687
  * parsed:
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   688
  (minus
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   689
    (group
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   690
      (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   691
        (list
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   692
          (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   693
          (symbol '1'))))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   694
    (symbol '1'))
29913
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   695
  * analyzed:
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   696
  (and
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   697
    (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
   698
      (list
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   699
        (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   700
        (symbol '1')))
29913
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   701
    (not
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   702
      (symbol '1')))
29913
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   703
  * optimized:
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   704
  (difference
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   705
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   706
      (symbol '_list')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   707
      (string '0\x001'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   708
    (symbol '1'))
29913
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   709
  0
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   710
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   711
  $ 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
   712
  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
   713
  [255]
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   714
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   715
  $ 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
   716
  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
   717
  [255]
9cb950276d27 debugrevspec: add option to print parsed tree at given stages
Yuya Nishihara <yuya@tcha.org>
parents: 29905
diff changeset
   718
29924
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   719
verify optimized tree:
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   720
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   721
  $ hg debugrevspec --verify '0|1'
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   722
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   723
  $ 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
   724
  * analyzed:
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   725
  (and
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   726
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   727
      (symbol 'r3232')
34011
1b28525e6698 revset: remove order information from tree (API)
Jun Wu <quark@fb.com>
parents: 34010
diff changeset
   728
      None)
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   729
    (symbol '2'))
29924
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   730
  * optimized:
34020
37b82485097f revset: do not flip "and" arguments when optimizing
Jun Wu <quark@fb.com>
parents: 34011
diff changeset
   731
  (andsmally
29924
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   732
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   733
      (symbol 'r3232')
34020
37b82485097f revset: do not flip "and" arguments when optimizing
Jun Wu <quark@fb.com>
parents: 34011
diff changeset
   734
      None)
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   735
    (symbol '2'))
29924
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   736
  * analyzed set:
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   737
  <baseset [2]>
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   738
  * optimized set:
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   739
  <baseset [2, 2]>
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   740
  --- analyzed
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   741
  +++ optimized
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   742
   2
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   743
  +2
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   744
  [1]
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   745
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   746
  $ hg debugrevspec --no-optimized --verify-optimized '0'
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   747
  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
   748
  [255]
45bf56a89197 debugrevspec: add option to verify optimized result
Yuya Nishihara <yuya@tcha.org>
parents: 29923
diff changeset
   749
24932
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   750
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
   751
parenthesis.
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   752
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   753
  $ 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
   754
  $ 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
   755
  8
022282152632 revset: don't error out if tokens parse as existing symbols
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 24904
diff changeset
   756
  9
11419
3cc2e34d7a7d tests: extend revset test
Matt Mackall <mpm@selenic.com>
parents: 11409
diff changeset
   757
30044
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   758
':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
   759
may be hidden (issue5385)
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   760
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   761
  $ try -p parsed -p analyzed ':'
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   762
  * parsed:
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   763
  (rangeall
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   764
    None)
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   765
  * analyzed:
30803
d389f19f14aa revset: do not transform range* operators in parsed tree
Yuya Nishihara <yuya@tcha.org>
parents: 30783
diff changeset
   766
  (rangeall
34011
1b28525e6698 revset: remove order information from tree (API)
Jun Wu <quark@fb.com>
parents: 34010
diff changeset
   767
    None)
30044
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   768
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   769
  <spanset+ 0:10>
30044
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   770
  0
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   771
  1
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   772
  2
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   773
  3
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   774
  4
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   775
  5
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   776
  6
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   777
  7
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   778
  8
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   779
  9
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   780
  $ try -p analyzed ':1'
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   781
  * analyzed:
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   782
  (rangepre
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   783
    (symbol '1'))
30044
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   784
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   785
  <spanset+ 0:2>
30044
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   786
  0
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   787
  1
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   788
  $ try -p analyzed ':(1|2)'
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   789
  * analyzed:
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   790
  (rangepre
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   791
    (or
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   792
      (list
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   793
        (symbol '1')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   794
        (symbol '2'))))
30044
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   795
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   796
  <spanset+ 0:3>
30044
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   797
  0
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   798
  1
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   799
  2
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   800
  $ try -p analyzed ':(1&2)'
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   801
  * analyzed:
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   802
  (rangepre
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   803
    (and
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   804
      (symbol '1')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   805
      (symbol '2')))
30044
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   806
  * set:
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   807
  <baseset []>
69b61d0bb008 revset: do not rewrite ':y' to '0:y' (issue5385)
Yuya Nishihara <yuya@tcha.org>
parents: 29946
diff changeset
   808
35542
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   809
infix/suffix resolution of ^ operator (issue2884, issue5764):
29768
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
 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
   812
29769
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   813
  $ 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
   814
  (range
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   815
    (parentpost
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   816
      (symbol '1'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   817
    (symbol '2'))
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   818
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   819
  <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
   820
  0
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   821
  1
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   822
  2
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   823
29769
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   824
  $ 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
   825
  (dagrange
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   826
    (parentpost
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   827
      (symbol '1'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   828
    (symbol '2'))
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   829
  * set:
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   830
  <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
   831
  0
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   832
  1
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   833
  2
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   834
35542
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   835
  $ try '1^..2'
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   836
  (dagrange
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   837
    (parentpost
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   838
      (symbol '1'))
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   839
    (symbol '2'))
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   840
  * set:
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   841
  <baseset+ [0, 1, 2]>
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   842
  0
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   843
  1
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   844
  2
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   845
29770
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   846
  $ try '9^:'
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   847
  (rangepost
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   848
    (parentpost
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   849
      (symbol '9')))
29770
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   850
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   851
  <spanset+ 8:10>
29770
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   852
  8
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   853
  9
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   854
35542
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   855
  $ try '9^::'
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   856
  (dagrangepost
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   857
    (parentpost
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   858
      (symbol '9')))
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   859
  * set:
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   860
  <generatorsetasc+>
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   861
  8
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   862
  9
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   863
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   864
  $ try '9^..'
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   865
  (dagrangepost
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   866
    (parentpost
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   867
      (symbol '9')))
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   868
  * set:
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   869
  <generatorsetasc+>
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   870
  8
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   871
  9
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   872
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   873
 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
   874
29769
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   875
  $ 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
   876
  (parent
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   877
    (symbol '1')
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   878
    (group
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   879
      (rangepre
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   880
        (symbol '2'))))
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   881
  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
   882
  [255]
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   883
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   884
 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
   885
29769
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   886
  $ 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
   887
  (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   888
    (symbol 'sort')
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   889
    (range
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   890
      (parentpost
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   891
        (symbol '1'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   892
      (symbol '2')))
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   893
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   894
  <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
   895
  0
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   896
  1
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   897
  2
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   898
29769
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   899
  $ 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
   900
  (range
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   901
    (parentpost
29769
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   902
      (group
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   903
        (range
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   904
          (parentpost
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   905
            (symbol '3'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   906
          (symbol '4'))))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   907
    (symbol '2'))
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   908
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   909
  <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
   910
  0
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   911
  1
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   912
  2
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   913
29769
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   914
  $ 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
   915
  (dagrange
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   916
    (parentpost
29769
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   917
      (group
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   918
        (dagrange
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   919
          (parentpost
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   920
            (symbol '3'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   921
          (symbol '4'))))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   922
    (symbol '2'))
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   923
  * set:
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   924
  <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
   925
  0
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   926
  1
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   927
  2
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   928
29770
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   929
  $ try '(9^:)^:'
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   930
  (rangepost
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   931
    (parentpost
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   932
      (group
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   933
        (rangepost
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   934
          (parentpost
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   935
            (symbol '9'))))))
29770
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   936
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   937
  <spanset+ 4:10>
29770
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   938
  4
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   939
  5
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   940
  6
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   941
  7
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   942
  8
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   943
  9
9c51a5de76db revset: also parse x^: as (x^):
Yuya Nishihara <yuya@tcha.org>
parents: 29769
diff changeset
   944
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   945
 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
   946
29769
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   947
  $ try 'A' --config 'revsetalias.A=1^:2'
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   948
  (symbol 'A')
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   949
  * expanded:
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   950
  (range
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   951
    (parentpost
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   952
      (symbol '1'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   953
    (symbol '2'))
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   954
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   955
  <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
   956
  0
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   957
  1
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   958
  2
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   959
29769
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   960
  $ 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
   961
  (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   962
    (symbol 'A')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   963
    (symbol '2'))
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   964
  * expanded:
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   965
  (range
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   966
    (parentpost
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   967
      (symbol '1'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   968
    (symbol '2'))
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   969
  * set:
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
   970
  <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
   971
  0
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   972
  1
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   973
  2
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   974
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   975
 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
   976
 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
   977
29769
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   978
  $ 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
   979
  (parent
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   980
    (symbol '1')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   981
    (symbol 'A'))
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   982
  * expanded:
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   983
  (parent
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   984
    (symbol '1')
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   985
    (rangepre
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
   986
      (symbol '2')))
29769
abe4eecc3253 revset: resolve ambiguity of x^:y before alias expansion
Yuya Nishihara <yuya@tcha.org>
parents: 29768
diff changeset
   987
  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
   988
  [255]
29768
8e4841944e68 revset: add test for resolution of infix/suffix ambiguity of x^:y
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
   989
35542
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   990
'::' itself isn't a valid expression
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   991
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   992
  $ try '::'
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   993
  (dagrangeall
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   994
    None)
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   995
  hg: parse error: can't use '::' in this context
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   996
  [255]
beb667c9880f revset: parse x^:: as (x^):: (issue5764)
Yuya Nishihara <yuya@tcha.org>
parents: 35501
diff changeset
   997
18536
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
   998
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
   999
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
  1000
  $ 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
  1001
  $ log 'ancestor(1)'
18536
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
  1002
  1
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1003
  $ 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
  1004
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1005
  $ 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
  1006
  $ 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
  1007
  0
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
  1008
  $ 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
  1009
  1
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
  1010
  $ 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
  1011
  0
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
  1012
  $ 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
  1013
  1
24940
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
  1014
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
  1015
test ancestors
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
  1016
33002
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1017
  $ 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
  1018
  @  9
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1019
  o  8
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1020
  | o  7
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1021
  | o  6
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1022
  |/|
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1023
  | o  5
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1024
  o |  4
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1025
  | o  3
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1026
  o |  2
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1027
  |/
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1028
  o  1
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1029
  o  0
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1030
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1031
  $ 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
  1032
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1033
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1034
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1035
  5
18536
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
  1036
  $ log 'ancestor(ancestors(5))'
ae645d4f084c revset: change ancestor to accept 0 or more arguments (issue3750)
Paul Cavallaro <ptc@fb.com>
parents: 18473
diff changeset
  1037
  0
24940
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
  1038
  $ log '::r3232()'
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
  1039
  0
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
  1040
  1
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
  1041
  2
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
  1042
  3
6b54f749659b revset: avoid returning duplicates when returning ancestors
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24932
diff changeset
  1043
33002
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1044
test ancestors with depth limit
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1045
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1046
 (depth=0 selects the node itself)
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1047
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1048
  $ log 'reverse(ancestors(9, depth=0))'
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1049
  9
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1050
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1051
 (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
  1052
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1053
  $ log 'reverse(ancestors(8:9, depth=1))'
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1054
  9
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1055
  8
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1056
  4
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1057
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1058
 (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
  1059
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1060
  $ log 'reverse(ancestors(7+8, depth=2))'
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1061
  8
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1062
  7
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1063
  6
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1064
  5
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1065
  4
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1066
  2
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1067
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1068
 (walk example above by separate queries)
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1069
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1070
  $ 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
  1071
  8
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1072
  4
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1073
  2
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1074
  7
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1075
  6
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1076
  5
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1077
33003
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
  1078
 (walk 2nd and 3rd ancestors)
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
  1079
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
  1080
  $ 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
  1081
  5
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
  1082
  4
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
  1083
  3
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
  1084
  2
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
  1085
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
  1086
 (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
  1087
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
  1088
  $ 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
  1089
  5
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
  1090
  4
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
  1091
  2
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
  1092
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
  1093
 (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
  1094
 '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
  1095
 multiple depths)
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
  1096
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
  1097
  $ 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
  1098
  5
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
  1099
  2
f63d111258da revset: add startdepth limit to ancestors() as internal option
Yuya Nishihara <yuya@tcha.org>
parents: 33002
diff changeset
  1100
33002
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1101
test bad arguments passed to ancestors()
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1102
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1103
  $ log 'ancestors(., depth=-1)'
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1104
  hg: parse error: negative depth
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1105
  [255]
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1106
  $ log 'ancestors(., depth=foo)'
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1107
  hg: parse error: ancestors expects an integer depth
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1108
  [255]
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1109
33074
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1110
test descendants
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1111
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1112
  $ 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
  1113
  @  9
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1114
  o  8
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1115
  | o  7
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1116
  | o  6
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1117
  |/|
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1118
  | o  5
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1119
  o |  4
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1120
  | o  3
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1121
  o |  2
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1122
  |/
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1123
  o  1
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1124
  o  0
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1125
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1126
 (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
  1127
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1128
  $ log 'null:4 & descendants(null)'
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1129
  -1
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1130
  0
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1131
  1
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1132
  2
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1133
  3
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1134
  4
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1135
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1136
 (including merge)
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1137
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1138
  $ log ':8 & descendants(2)'
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1139
  2
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1140
  4
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1141
  6
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1142
  7
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1143
  8
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1144
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1145
 (multiple roots)
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1146
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1147
  $ log ':8 & descendants(2+5)'
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1148
  2
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1149
  4
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1150
  5
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1151
  6
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1152
  7
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1153
  8
e999b59d6eb1 test-revset: add a few more tests of descendants()
Yuya Nishihara <yuya@tcha.org>
parents: 33003
diff changeset
  1154
33080
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1155
test descendants with depth limit
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1156
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1157
 (depth=0 selects the node itself)
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1158
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1159
  $ log 'descendants(0, depth=0)'
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1160
  0
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1161
  $ log 'null: & descendants(null, depth=0)'
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1162
  -1
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1163
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1164
 (p2 = null should be ignored)
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1165
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1166
  $ log 'null: & descendants(null, depth=2)'
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1167
  -1
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1168
  0
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1169
  1
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1170
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1171
 (multiple paths: depth(6) = (2, 3))
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1172
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1173
  $ log 'descendants(1+3, depth=2)'
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1174
  1
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1175
  2
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1176
  3
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1177
  4
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1178
  5
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1179
  6
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1180
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1181
 (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
  1182
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1183
  $ 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
  1184
  4
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1185
  5
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1186
  6
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1187
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1188
 (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
  1189
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1190
  $ 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
  1191
  1
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1192
  2
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1193
  3
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1194
  4
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1195
  5
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1196
  6
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1197
  7
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1198
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1199
 (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
  1200
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1201
  $ 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
  1202
  1
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1203
  2
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1204
  3
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1205
  4
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1206
  5
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1207
  7
a53bfc2845f2 revset: add depth limit to descendants() (issue5374)
Yuya Nishihara <yuya@tcha.org>
parents: 33075
diff changeset
  1208
33417
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
  1209
test ancestors/descendants relation subscript:
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
  1210
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
  1211
  $ log 'tip#generations[0]'
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
  1212
  9
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
  1213
  $ log '.#generations[-1]'
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
  1214
  8
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
  1215
  $ log '.#g[(-1)]'
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
  1216
  8
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
  1217
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
  1218
  $ hg debugrevspec -p parsed 'roots(:)#g[2]'
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
  1219
  * parsed:
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
  1220
  (relsubscript
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
  1221
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1222
      (symbol 'roots')
33417
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
  1223
      (rangeall
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
  1224
        None))
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1225
    (symbol 'g')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1226
    (symbol '2'))
33417
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
  1227
  2
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
  1228
  3
d1b13d4995ed revset: add experimental ancestors/descendants relation subscript
Yuya Nishihara <yuya@tcha.org>
parents: 33416
diff changeset
  1229
33002
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1230
test author
272a44cac57e revset: add depth limit to ancestors()
Yuya Nishihara <yuya@tcha.org>
parents: 32914
diff changeset
  1231
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1232
  $ 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
  1233
  2
16823
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
  1234
  $ 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
  1235
  0
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
  1236
  1
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
  1237
  2
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
  1238
  3
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
  1239
  4
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
  1240
  5
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
  1241
  6
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
  1242
  7
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
  1243
  8
b23bacb230c9 revset: add pattern matching to the 'user' revset expression
Simon King <simon@simonking.org.uk>
parents: 16821
diff changeset
  1244
  9
30782
db38cfc7c29d revset: stop lowercasing the regex pattern for 'author'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30701
diff changeset
  1245
  $ log 'author(r"re:\S")'
db38cfc7c29d revset: stop lowercasing the regex pattern for 'author'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30701
diff changeset
  1246
  0
db38cfc7c29d revset: stop lowercasing the regex pattern for 'author'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30701
diff changeset
  1247
  1
db38cfc7c29d revset: stop lowercasing the regex pattern for 'author'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30701
diff changeset
  1248
  2
db38cfc7c29d revset: stop lowercasing the regex pattern for 'author'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30701
diff changeset
  1249
  3
db38cfc7c29d revset: stop lowercasing the regex pattern for 'author'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30701
diff changeset
  1250
  4
db38cfc7c29d revset: stop lowercasing the regex pattern for 'author'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30701
diff changeset
  1251
  5
db38cfc7c29d revset: stop lowercasing the regex pattern for 'author'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30701
diff changeset
  1252
  6
db38cfc7c29d revset: stop lowercasing the regex pattern for 'author'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30701
diff changeset
  1253
  7
db38cfc7c29d revset: stop lowercasing the regex pattern for 'author'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30701
diff changeset
  1254
  8
db38cfc7c29d revset: stop lowercasing the regex pattern for 'author'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30701
diff changeset
  1255
  9
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1256
  $ log 'branch(é)'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1257
  8
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1258
  9
16821
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
  1259
  $ log 'branch(a)'
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
  1260
  0
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
  1261
  $ 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
  1262
  0 a
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
  1263
  2 a-b-c-
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
  1264
  3 +a+b+c+
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
  1265
  4 -a-b-c-
16851
c739227b5eea test-revset: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16824
diff changeset
  1266
  5 !a/b/c/
16821
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
  1267
  6 _a_b_c_
0946502fd3d5 revset: add pattern matching to 'branch' revset expression
Simon King <simon@simonking.org.uk>
parents: 16820
diff changeset
  1268
  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
  1269
  $ 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
  1270
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1271
  3
30699
5bda147c3139 revset: make children() not look at p2 if null (issue5439)
Yuya Nishihara <yuya@tcha.org>
parents: 30332
diff changeset
  1272
5bda147c3139 revset: make children() not look at p2 if null (issue5439)
Yuya Nishihara <yuya@tcha.org>
parents: 30332
diff changeset
  1273
  $ log 'children(4)'
5bda147c3139 revset: make children() not look at p2 if null (issue5439)
Yuya Nishihara <yuya@tcha.org>
parents: 30332
diff changeset
  1274
  6
5bda147c3139 revset: make children() not look at p2 if null (issue5439)
Yuya Nishihara <yuya@tcha.org>
parents: 30332
diff changeset
  1275
  8
5bda147c3139 revset: make children() not look at p2 if null (issue5439)
Yuya Nishihara <yuya@tcha.org>
parents: 30332
diff changeset
  1276
  $ log 'children(null)'
5bda147c3139 revset: make children() not look at p2 if null (issue5439)
Yuya Nishihara <yuya@tcha.org>
parents: 30332
diff changeset
  1277
  0
5bda147c3139 revset: make children() not look at p2 if null (issue5439)
Yuya Nishihara <yuya@tcha.org>
parents: 30332
diff changeset
  1278
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1279
  $ log 'closed()'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1280
  $ 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
  1281
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1282
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1283
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1284
  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
  1285
  $ 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
  1286
  0
760151697a4f revset: make default kind of pattern for "contains()" rooted at cwd
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19706
diff changeset
  1287
  1
760151697a4f revset: make default kind of pattern for "contains()" rooted at cwd
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19706
diff changeset
  1288
  3
760151697a4f revset: make default kind of pattern for "contains()" rooted at cwd
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19706
diff changeset
  1289
  5
14650
93731b3efd0d revset: add desc(string) to search in commit messages
Thomas Arendsen Hein <thomas@intevation.de>
parents: 14153
diff changeset
  1290
  $ log 'desc(B)'
93731b3efd0d revset: add desc(string) to search in commit messages
Thomas Arendsen Hein <thomas@intevation.de>
parents: 14153
diff changeset
  1291
  5
30783
931a60880df4 revset: add regular expression support to 'desc'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30782
diff changeset
  1292
  $ 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
  1293
  5 5 bug
931a60880df4 revset: add regular expression support to 'desc'
Matt Harbison <matt_harbison@yahoo.com>
parents: 30782
diff changeset
  1294
  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
  1295
  $ 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
  1296
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1297
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1298
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1299
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1300
  6
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1301
  7
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1302
  8
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1303
  9
16411
4c2edcd84175 graphlog: correctly handle calls in subdirectories
Patrick Mezard <patrick@mezard.eu>
parents: 16218
diff changeset
  1304
  $ 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
  1305
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1306
  4
20288
b61ad01c4e73 revset: use "canonpath()" for "filelog()" pattern without explicit kind
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20286
diff changeset
  1307
  $ log 'filelog("b")'
b61ad01c4e73 revset: use "canonpath()" for "filelog()" pattern without explicit kind
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20286
diff changeset
  1308
  1
b61ad01c4e73 revset: use "canonpath()" for "filelog()" pattern without explicit kind
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20286
diff changeset
  1309
  4
b61ad01c4e73 revset: use "canonpath()" for "filelog()" pattern without explicit kind
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20286
diff changeset
  1310
  $ 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
  1311
  1
b61ad01c4e73 revset: use "canonpath()" for "filelog()" pattern without explicit kind
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20286
diff changeset
  1312
  4
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1313
  $ log 'follow()'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1314
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1315
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1316
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1317
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1318
  8
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1319
  9
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1320
  $ 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
  1321
  6
12321
11db6fa2961e merge with stable
Martin Geisler <mg@aragost.com>
parents: 12320 12316
diff changeset
  1322
  $ try 'grep("(")' # invalid regular expression
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1323
  (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1324
    (symbol 'grep')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1325
    (string '('))
36583
edf736c3c064 tests: add some re and globs for test-revset on python3
Augie Fackler <augie@google.com>
parents: 36582
diff changeset
  1326
  hg: parse error: invalid match pattern: (unbalanced parenthesis|missing \),.*) (re)
12321
11db6fa2961e merge with stable
Martin Geisler <mg@aragost.com>
parents: 12320 12316
diff changeset
  1327
  [255]
12408
78a97859b90d revset: support raw string literals
Brodie Rao <brodie@bitheap.org>
parents: 12321
diff changeset
  1328
  $ try 'grep("\bissue\d+")'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1329
  (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1330
    (symbol 'grep')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1331
    (string '\x08issue\\d+'))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1332
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1333
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  1334
    <fullreposet+ 0:10>,
28424
534f968d33e5 revset: add inspection data to all filter() calls
Yuya Nishihara <yuya@tcha.org>
parents: 28423
diff changeset
  1335
    <grep '\x08issue\\d+'>>
12408
78a97859b90d revset: support raw string literals
Brodie Rao <brodie@bitheap.org>
parents: 12321
diff changeset
  1336
  $ try 'grep(r"\bissue\d+")'
16218
81a1a00f5738 debugrevspec: pretty print output
Patrick Mezard <patrick@mezard.eu>
parents: 16096
diff changeset
  1337
  (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1338
    (symbol 'grep')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1339
    (string '\\bissue\\d+'))
24458
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1340
  * set:
7d87f672d069 debugrevspec: show nesting structure of smartsets if verbose
Yuya Nishihara <yuya@tcha.org>
parents: 24419
diff changeset
  1341
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  1342
    <fullreposet+ 0:10>,
28424
534f968d33e5 revset: add inspection data to all filter() calls
Yuya Nishihara <yuya@tcha.org>
parents: 28423
diff changeset
  1343
    <grep '\\bissue\\d+'>>
12408
78a97859b90d revset: support raw string literals
Brodie Rao <brodie@bitheap.org>
parents: 12321
diff changeset
  1344
  6
78a97859b90d revset: support raw string literals
Brodie Rao <brodie@bitheap.org>
parents: 12321
diff changeset
  1345
  $ try 'grep(r"\")'
78a97859b90d revset: support raw string literals
Brodie Rao <brodie@bitheap.org>
parents: 12321
diff changeset
  1346
  hg: parse error at 7: unterminated string
36685
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
  1347
  (grep(r"\")
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
  1348
          ^ here)
12408
78a97859b90d revset: support raw string literals
Brodie Rao <brodie@bitheap.org>
parents: 12321
diff changeset
  1349
  [255]
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1350
  $ log 'head()'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1351
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1352
  1
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1353
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1354
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1355
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1356
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1357
  6
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1358
  7
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1359
  9
38478
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1360
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1361
Test heads
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1362
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1363
  $ 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
  1364
  7
38478
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1365
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1366
 heads() can be computed in subset '9:'
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1367
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1368
  $ hg debugrevspec -s '9: & heads(all())'
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1369
  * set:
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1370
  <filteredset
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1371
    <filteredset
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1372
      <baseset [9]>,
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1373
      <spanset+ 0:10>>,
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1374
    <not
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1375
      <filteredset
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1376
        <baseset [9]>, set([0, 1, 2, 3, 4, 5, 6, 8])>>>
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1377
  9
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1378
38479
72621094505f revset: fix heads() order to always follow the input set (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 38478
diff changeset
  1379
 but should follow the order of the subset
38478
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1380
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1381
  $ log 'heads(all())'
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1382
  7
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1383
  9
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1384
  $ log 'heads(tip:0)'
38479
72621094505f revset: fix heads() order to always follow the input set (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 38478
diff changeset
  1385
  7
38478
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1386
  9
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1387
  $ log 'tip:0 & heads(all())'
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1388
  9
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1389
  7
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1390
  $ log 'tip:0 & heads(0:tip)'
38479
72621094505f revset: fix heads() order to always follow the input set (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 38478
diff changeset
  1391
  9
38478
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1392
  7
b2d5ad03f31a test-revset: show that order of heads() can be wrong
Yuya Nishihara <yuya@tcha.org>
parents: 38261
diff changeset
  1393
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1394
  $ 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
  1395
  6
19706
26ddce1a2a55 revset: fix wrong keyword() behaviour for strings with spaces
Alexander Plavin <alexander@plav.in>
parents: 18955
diff changeset
  1396
  $ 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
  1397
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1398
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
  1399
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1400
  $ 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
  1401
  0
26638
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
  1402
  $ 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
  1403
  5
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
  1404
  6
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
  1405
  7
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
  1406
  $ 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
  1407
  6
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
  1408
  $ 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
  1409
  $ log 'limit(all(), 1, -1)'
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
  1410
  hg: parse error: negative offset
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
  1411
  [255]
32799
b36ec65ea583 revset: reject negative number to select first/last n members
Yuya Nishihara <yuya@tcha.org>
parents: 32798
diff changeset
  1412
  $ log 'limit(all(), -1)'
b36ec65ea583 revset: reject negative number to select first/last n members
Yuya Nishihara <yuya@tcha.org>
parents: 32798
diff changeset
  1413
  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
  1414
  [255]
b36ec65ea583 revset: reject negative number to select first/last n members
Yuya Nishihara <yuya@tcha.org>
parents: 32798
diff changeset
  1415
  $ log 'limit(all(), 0)'
b36ec65ea583 revset: reject negative number to select first/last n members
Yuya Nishihara <yuya@tcha.org>
parents: 32798
diff changeset
  1416
b36ec65ea583 revset: reject negative number to select first/last n members
Yuya Nishihara <yuya@tcha.org>
parents: 32798
diff changeset
  1417
  $ log 'last(all(), -1)'
b36ec65ea583 revset: reject negative number to select first/last n members
Yuya Nishihara <yuya@tcha.org>
parents: 32798
diff changeset
  1418
  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
  1419
  [255]
32798
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1420
  $ 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
  1421
  $ 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
  1422
  9
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1423
  $ 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
  1424
  8
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1425
  9
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1426
32819
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1427
Test smartset.slice() by first/last()
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1428
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1429
 (using unoptimized set, filteredset as example)
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1430
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1431
  $ 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
  1432
  * set:
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1433
  <filteredset
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1434
    <spanset+ 0:8>,
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1435
    <branch 're:'>>
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1436
  $ log 'limit(0:7 & branch("re:"), 3, 4)'
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1437
  4
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1438
  5
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1439
  6
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1440
  $ log 'limit(7:0 & branch("re:"), 3, 4)'
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1441
  3
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1442
  2
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1443
  1
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1444
  $ log 'last(0:7 & branch("re:"), 2)'
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1445
  6
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1446
  7
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1447
32820
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1448
 (using baseset)
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1449
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1450
  $ 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
  1451
  * set:
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1452
  <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
  1453
  $ 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
  1454
  * set:
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1455
  <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
  1456
  $ 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
  1457
  4
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1458
  5
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1459
  6
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1460
  $ 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
  1461
  4
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1462
  5
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1463
  6
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1464
  $ 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
  1465
  3
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1466
  2
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1467
  1
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1468
  $ 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
  1469
  6
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1470
  7
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1471
  $ 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
  1472
  * set:
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1473
  <baseset+ [6, 7]>
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1474
  6
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1475
  7
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1476
  $ 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
  1477
  * set:
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1478
  <baseset+ []>
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1479
  $ 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
  1480
  * set:
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1481
  <baseset- [0, 1]>
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1482
  1
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1483
  0
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1484
  $ 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
  1485
  * set:
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1486
  <baseset- []>
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1487
  $ 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
  1488
  * set:
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1489
  <baseset+ []>
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1490
32821
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1491
 (using spanset)
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1492
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1493
  $ 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
  1494
  * set:
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1495
  <spanset+ 0:8>
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1496
  $ 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
  1497
  4
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1498
  5
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1499
  6
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1500
  $ 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
  1501
  3
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1502
  2
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1503
  1
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1504
  $ 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
  1505
  6
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1506
  7
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1507
  $ 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
  1508
  1
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1509
  0
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1510
  $ log 'last(0:7, 2)'
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1511
  6
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1512
  7
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1513
  $ 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
  1514
  * set:
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1515
  <spanset+ 6:8>
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1516
  6
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1517
  7
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1518
  $ 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
  1519
  * set:
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1520
  <spanset+ 8:8>
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1521
  $ 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
  1522
  * set:
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1523
  <spanset- 0:2>
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1524
  1
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1525
  0
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1526
  $ 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
  1527
  * set:
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1528
  <spanset- 0:0>
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1529
  $ 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
  1530
  * set:
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1531
  <spanset+ 0:0>
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1532
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1533
Test order of first/last revisions
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1534
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1535
  $ 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
  1536
  * set:
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1537
  <filteredset
32821
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1538
    <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
  1539
    <spanset+ 3:10>>
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1540
  4
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1541
  3
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1542
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1543
  $ 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
  1544
  * set:
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1545
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  1546
    <spanset+ 3:10>,
32821
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1547
    <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
  1548
  3
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1549
  4
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1550
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1551
  $ 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
  1552
  * set:
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1553
  <filteredset
32821
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1554
    <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
  1555
    <spanset+ 0:2>>
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1556
  1
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1557
  0
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1558
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1559
  $ 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
  1560
  * set:
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1561
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  1562
    <spanset+ 0:2>,
32821
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1563
    <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
  1564
  0
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1565
  1
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1566
33109
247bae545061 smartset: fix generatorset.last() to not return the first element (issue5609)
Yuya Nishihara <yuya@tcha.org>
parents: 33097
diff changeset
  1567
Test scmutil.revsingle() should return the last revision
247bae545061 smartset: fix generatorset.last() to not return the first element (issue5609)
Yuya Nishihara <yuya@tcha.org>
parents: 33097
diff changeset
  1568
247bae545061 smartset: fix generatorset.last() to not return the first element (issue5609)
Yuya Nishihara <yuya@tcha.org>
parents: 33097
diff changeset
  1569
  $ hg debugrevspec -s 'last(0::)'
247bae545061 smartset: fix generatorset.last() to not return the first element (issue5609)
Yuya Nishihara <yuya@tcha.org>
parents: 33097
diff changeset
  1570
  * set:
247bae545061 smartset: fix generatorset.last() to not return the first element (issue5609)
Yuya Nishihara <yuya@tcha.org>
parents: 33097
diff changeset
  1571
  <baseset slice=0:1
35501
12a46ad67a3c smartset: split generatorset classes to avoid cycle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34866
diff changeset
  1572
    <generatorsetasc->>
33109
247bae545061 smartset: fix generatorset.last() to not return the first element (issue5609)
Yuya Nishihara <yuya@tcha.org>
parents: 33097
diff changeset
  1573
  9
247bae545061 smartset: fix generatorset.last() to not return the first element (issue5609)
Yuya Nishihara <yuya@tcha.org>
parents: 33097
diff changeset
  1574
  $ hg identify -r '0::' --num
247bae545061 smartset: fix generatorset.last() to not return the first element (issue5609)
Yuya Nishihara <yuya@tcha.org>
parents: 33097
diff changeset
  1575
  9
247bae545061 smartset: fix generatorset.last() to not return the first element (issue5609)
Yuya Nishihara <yuya@tcha.org>
parents: 33097
diff changeset
  1576
32798
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1577
Test matching
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1578
16447
60c379da12aa tests: add tests for matching keyword
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 16415
diff changeset
  1579
  $ log 'matching(6)'
60c379da12aa tests: add tests for matching keyword
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 16415
diff changeset
  1580
  6
60c379da12aa tests: add tests for matching keyword
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 16415
diff changeset
  1581
  $ 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
  1582
  6
60c379da12aa tests: add tests for matching keyword
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 16415
diff changeset
  1583
  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
  1584
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1585
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
  1586
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1587
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
  1588
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1589
  $ 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
  1590
  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
  1591
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1592
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
  1593
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1594
  $ 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
  1595
  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
  1596
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1597
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
  1598
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1599
  $ 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
  1600
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1601
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
  1602
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1603
  $ 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
  1604
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1605
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
  1606
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1607
  $ 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
  1608
  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
  1609
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1610
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
  1611
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1612
  $ 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
  1613
  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
  1614
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1615
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
  1616
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1617
  $ 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
  1618
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1619
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
  1620
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1621
  $ 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
  1622
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1623
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1624
  $ log 'merge()'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1625
  6
17753
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1626
  $ log 'branchpoint()'
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1627
  1
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1628
  4
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1629
  $ 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
  1630
  4
16521
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
  1631
  $ log 'modifies("path:b")'
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
  1632
  4
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
  1633
  $ log 'modifies("*")'
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
  1634
  4
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
  1635
  6
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
  1636
  $ log 'modifies("set:modified()")'
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
  1637
  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
  1638
  $ 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
  1639
  2
20613
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1640
  $ log 'only(9)'
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1641
  8
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1642
  9
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1643
  $ log 'only(8)'
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1644
  8
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1645
  $ log 'only(9, 5)'
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1646
  2
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1647
  4
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1648
  8
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1649
  9
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1650
  $ log 'only(7 + 9, 5 + 2)'
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1651
  4
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1652
  6
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1653
  7
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1654
  8
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1655
  9
21925
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
  1656
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
  1657
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
  1658
  $ 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
  1659
  $ 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
  1660
  0
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
  1661
  1
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
  1662
  2
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
  1663
  4
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
  1664
  8
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
  1665
  9
23062
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
  1666
23765
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1667
Test '%' operator
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1668
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1669
  $ log '9%'
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1670
  8
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1671
  9
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1672
  $ log '9%5'
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1673
  2
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1674
  4
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1675
  8
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1676
  9
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1677
  $ log '(7 + 9)%(5 + 2)'
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1678
  4
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1679
  6
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1680
  7
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1681
  8
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1682
  9
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1683
30332
318a24b52eeb spelling: fixes of non-dictionary words
Mads Kiilerich <madski@unity3d.com>
parents: 30179
diff changeset
  1684
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
  1685
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1686
  $ 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
  1687
  (onlypost
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1688
    (minus
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1689
      (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1690
        (symbol '8')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1691
        (symbol '9'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1692
      (symbol '8')))
25094
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1693
  * optimized:
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1694
  (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1695
    (symbol 'only')
28217
d2ac8b57a75d revset: use smartset minus operator
Durham Goode <durham@fb.com>
parents: 28015
diff changeset
  1696
    (difference
25094
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1697
      (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1698
        (symbol '8')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1699
        (symbol '9'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1700
      (symbol '8')))
25094
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1701
  * set:
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1702
  <baseset+ [8, 9]>
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1703
  8
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1704
  9
25105
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1705
  $ try --optimize '(9)%(5)'
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1706
  (only
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1707
    (group
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1708
      (symbol '9'))
25105
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1709
    (group
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1710
      (symbol '5')))
25105
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1711
  * optimized:
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1712
  (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1713
    (symbol 'only')
25105
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1714
    (list
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1715
      (symbol '9')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1716
      (symbol '5')))
25105
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1717
  * set:
28785
87b89dca669d revset: stabilize repr of baseset initialized with a set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 28690
diff changeset
  1718
  <baseset+ [2, 4, 8, 9]>
25105
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1719
  2
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1720
  4
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1721
  8
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1722
  9
25094
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1723
23765
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1724
Test the order of operations
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1725
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1726
  $ log '7 + 9%5 + 2'
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1727
  7
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1728
  2
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1729
  4
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1730
  8
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1731
  9
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1732
23062
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
  1733
Test explicit numeric revision
23954
310222feb9a8 revset: allow rev(-1) to indicate null revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 23846
diff changeset
  1734
  $ 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
  1735
  $ log 'rev(-1)'
23954
310222feb9a8 revset: allow rev(-1) to indicate null revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 23846
diff changeset
  1736
  -1
23062
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
  1737
  $ 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
  1738
  0
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
  1739
  $ 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
  1740
  9
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
  1741
  $ 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
  1742
  $ 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
  1743
  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
  1744
  [255]
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
  1745
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
  1746
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
  1747
  $ 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
  1748
  $ 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
  1749
  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
  1750
  $ 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
  1751
  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
  1752
  $ 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
  1753
  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
  1754
  $ 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
  1755
  $ 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
  1756
  $ 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
  1757
  $ 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
  1758
  $ 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
  1759
  $ 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
  1760
23956
b1e026c25552 revset: fix ancestors(null) to include null revision (issue4512)
Yuya Nishihara <yuya@tcha.org>
parents: 23954
diff changeset
  1761
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
  1762
  $ log '(null)'
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1763
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1764
  $ log '(null:0)'
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1765
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1766
  0
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1767
  $ log '(0:null)'
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1768
  0
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1769
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1770
  $ log 'null::0'
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1771
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1772
  0
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1773
  $ 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
  1774
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1775
  $ 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
  1776
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1777
  $ 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
  1778
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1779
  0
23956
b1e026c25552 revset: fix ancestors(null) to include null revision (issue4512)
Yuya Nishihara <yuya@tcha.org>
parents: 23954
diff changeset
  1780
  $ log 'ancestors(null)'
b1e026c25552 revset: fix ancestors(null) to include null revision (issue4512)
Yuya Nishihara <yuya@tcha.org>
parents: 23954
diff changeset
  1781
  -1
24204
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1782
  $ 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
  1783
  0
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1784
  -1
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1785
  $ log 'first(null:)'
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1786
  -1
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1787
  $ log 'min(null:)'
25265
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  1788
BROKEN: should be '-1'
24202
2de9ee016425 revset: have all() filter out null revision
Yuya Nishihara <yuya@tcha.org>
parents: 24175
diff changeset
  1789
  $ log 'tip:null and all()' | tail -2
2de9ee016425 revset: have all() filter out null revision
Yuya Nishihara <yuya@tcha.org>
parents: 24175
diff changeset
  1790
  1
2de9ee016425 revset: have all() filter out null revision
Yuya Nishihara <yuya@tcha.org>
parents: 24175
diff changeset
  1791
  0
23956
b1e026c25552 revset: fix ancestors(null) to include null revision (issue4512)
Yuya Nishihara <yuya@tcha.org>
parents: 23954
diff changeset
  1792
24419
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 24222
diff changeset
  1793
Test working-directory revision
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 24222
diff changeset
  1794
  $ hg debugrevspec 'wdir()'
25765
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
  1795
  2147483647
32404
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1796
  $ hg debugrevspec 'wdir()^'
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1797
  9
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1798
  $ hg up 7
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1799
  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
  1800
  $ hg debugrevspec 'wdir()^'
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1801
  7
32437
f03dcb3f95a5 tests: add tests for predicates and operators which works with wdir()
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32436
diff changeset
  1802
  $ 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
  1803
  2147483647
32441
018f638ad88e revset: add support for using ~ operator on wdir() predicate
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32440
diff changeset
  1804
  $ hg debugrevspec 'wdir()~3'
018f638ad88e revset: add support for using ~ operator on wdir() predicate
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32440
diff changeset
  1805
  5
32442
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1806
  $ hg debugrevspec 'ancestors(wdir())'
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1807
  0
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1808
  1
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1809
  2
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1810
  3
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1811
  4
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1812
  5
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1813
  6
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1814
  7
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1815
  2147483647
32437
f03dcb3f95a5 tests: add tests for predicates and operators which works with wdir()
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32436
diff changeset
  1816
  $ 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
  1817
  2147483647
f03dcb3f95a5 tests: add tests for predicates and operators which works with wdir()
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32436
diff changeset
  1818
  $ 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
  1819
  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
  1820
  $ 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
  1821
  $ 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
  1822
  7
32436
f064e2f72c49 revset: add support for "wdir()^n"
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32404
diff changeset
  1823
  $ hg debugrevspec 'wdir()^1'
f064e2f72c49 revset: add support for "wdir()^n"
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32404
diff changeset
  1824
  7
f064e2f72c49 revset: add support for "wdir()^n"
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32404
diff changeset
  1825
  $ hg debugrevspec 'wdir()^2'
f064e2f72c49 revset: add support for "wdir()^n"
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32404
diff changeset
  1826
  $ hg debugrevspec 'wdir()^3'
f064e2f72c49 revset: add support for "wdir()^n"
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32404
diff changeset
  1827
  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
  1828
  [255]
32404
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1829
For tests consistency
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1830
  $ hg up 9
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1831
  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
  1832
  $ 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
  1833
  9
25765
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
  1834
  2147483647
24419
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 24222
diff changeset
  1835
  $ 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
  1836
  $ 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
  1837
  8
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
  1838
  9
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
  1839
  2147483647
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
  1840
  $ 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
  1841
  2147483647
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
  1842
  9
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
  1843
  8
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
  1844
  $ 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
  1845
  2147483647
25765
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
  1846
  $ log '(all() + wdir()) & min(. + wdir())'
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
  1847
  9
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
  1848
  $ log '(all() + wdir()) & max(. + wdir())'
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
  1849
  2147483647
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1850
  $ log 'first(wdir() + .)'
25765
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
  1851
  2147483647
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1852
  $ log 'last(. + wdir())'
25765
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
  1853
  2147483647
24419
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 24222
diff changeset
  1854
32661
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1855
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
  1856
(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
  1857
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1858
  $ hg debugrevspec '0:wdir() & 2147483647'
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1859
  2147483647
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1860
  $ 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
  1861
  2147483647
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1862
  $ hg debugrevspec '0:wdir() & ffffffffffffffffffffffffffffffffffffffff'
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1863
  2147483647
32684
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1864
  $ 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
  1865
  2147483647
32661
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1866
  $ 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
  1867
  2147483647
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1868
  $ 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
  1869
  2147483647
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1870
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1871
  $ cd ..
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1872
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1873
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
  1874
(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
  1875
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1876
  $ hg init wdir-hashcollision
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1877
  $ cd wdir-hashcollision
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1878
  $ cat <<EOF >> .hg/hgrc
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1879
  > [experimental]
34866
1644623ab096 config: use 'experimental.evolution.create-markers'
Boris Feld <boris.feld@octobus.net>
parents: 34126
diff changeset
  1880
  > evolution.createmarkers=True
32684
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1881
  > EOF
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1882
  $ echo 0 > a
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1883
  $ hg ci -qAm 0
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1884
  $ 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
  1885
  >   hg up -q 0
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1886
  >   echo $i > a
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1887
  >   hg ci -qm $i
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1888
  > done
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1889
  $ hg up -q null
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1890
  $ 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
  1891
  0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a b4e
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1892
  1:fffbae3886c8fbb2114296380d276fd37715d571 fffba
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1893
  2:fffb6093b00943f91034b9bdad069402c834e572 fffb6
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1894
  3:fff48a9b9de34a4d64120c29548214c67980ade3 fff4
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1895
  4:ffff85cff0ff78504fcdc3c0bc10de0c65379249 ffff8
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1896
  2147483647:ffffffffffffffffffffffffffffffffffffffff fffff
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1897
  $ hg debugobsolete fffbae3886c8fbb2114296380d276fd37715d571
33542
b11e8c67fb0f debugobsolete: also report the number of obsoleted changesets
Boris Feld <boris.feld@octobus.net>
parents: 33417
diff changeset
  1898
  obsoleted 1 changesets
32684
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1899
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1900
  $ 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
  1901
  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
  1902
  [255]
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1903
  $ 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
  1904
  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
  1905
  [255]
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1906
  $ 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
  1907
  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
  1908
  [255]
37867
0a79fb64118e revset: use resolvehexnodeidprefix() in id() predicate (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 37866
diff changeset
  1909
BROKEN should be '2' (node lookup uses unfiltered repo)
32684
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1910
  $ hg debugrevspec '0:wdir() & id(fffb)'
37867
0a79fb64118e revset: use resolvehexnodeidprefix() in id() predicate (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 37866
diff changeset
  1911
BROKEN should be '2' (node lookup uses unfiltered repo)
32684
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1912
  $ 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
  1913
  4
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1914
  $ 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
  1915
  2147483647
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1916
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1917
  $ cd ..
32661
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1918
32683
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1919
Test branch() with wdir()
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1920
32684
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1921
  $ cd repo
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1922
32683
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1923
  $ log '0:wdir() & branch("literal:é")'
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1924
  8
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1925
  9
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1926
  2147483647
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1927
  $ log '0:wdir() & branch("re:é")'
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1928
  8
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1929
  9
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1930
  2147483647
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1931
  $ 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
  1932
  0
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1933
  2
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1934
  $ log '0:wdir() & branch(8)'
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1935
  8
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1936
  9
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1937
  2147483647
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1938
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1939
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
  1940
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
  1941
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1942
  $ log 'branch(wdir())'
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1943
  8
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1944
  9
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1945
  $ log '0:wdir() & branch(wdir())'
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1946
  8
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1947
  9
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1948
  2147483647
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1949
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1950
  $ log 'outgoing()'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1951
  8
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1952
  9
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1953
  $ 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
  1954
  8
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1955
  9
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1956
  $ 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
  1957
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1958
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1959
  6
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1960
  7
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1961
  9
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1962
  $ 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
  1963
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1964
  $ 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
  1965
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1966
  $ 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
  1967
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1968
  5
17753
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1969
  $ log 'p1(branchpoint())'
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1970
  0
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1971
  2
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1972
  $ log 'p2(branchpoint())'
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1973
  $ log 'parents(branchpoint())'
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1974
  0
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1975
  2
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1976
  $ 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
  1977
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1978
  6
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1979
  $ 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
  1980
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1981
  $ 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
  1982
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1983
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1984
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1985
  2
17100
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1986
  $ log 'reverse(all())'
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1987
  9
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1988
  8
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1989
  7
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1990
  6
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1991
  5
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1992
  4
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1993
  3
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1994
  2
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1995
  1
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1996
  0
23826
c90d195320c5 revset: fix spanset.isascending() to honor sort() or reverse() request
Yuya Nishihara <yuya@tcha.org>
parents: 23062
diff changeset
  1997
  $ 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
  1998
  4
c90d195320c5 revset: fix spanset.isascending() to honor sort() or reverse() request
Yuya Nishihara <yuya@tcha.org>
parents: 23062
diff changeset
  1999
  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
  2000
  $ 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
  2001
  5
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  2002
  $ 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
  2003
  7
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  2004
  8
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  2005
  9
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  2006
  $ 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
  2007
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  2008
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  2009
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  2010
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  2011
  $ log 'tagged()'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  2012
  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
  2013
  $ 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
  2014
  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
  2015
  $ 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
  2016
  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
  2017
  $ 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
  2018
  9
16820
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
  2019
29139
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  2020
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
  2021
----------------------------------------------
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  2022
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2023
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
  2024
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
  2025
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
  2026
29139
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  2027
 '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
  2028
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  2029
  $ log '2:0 & 0::2'
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  2030
  2
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  2031
  1
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  2032
  0
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  2033
29408
785cadec2091 revset: make head() honor order of subset
Martin von Zweigbergk <martinvonz@google.com>
parents: 29390
diff changeset
  2034
 '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
  2035
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2036
  $ log '2:0 & head()'
29408
785cadec2091 revset: make head() honor order of subset
Martin von Zweigbergk <martinvonz@google.com>
parents: 29390
diff changeset
  2037
  2
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2038
  1
29408
785cadec2091 revset: make head() honor order of subset
Martin von Zweigbergk <martinvonz@google.com>
parents: 29390
diff changeset
  2039
  0
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2040
29944
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2041
 '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
  2042
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2043
  $ 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
  2044
  * optimized:
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2045
  (difference
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2046
    (and
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2047
      (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2048
        (symbol '3')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2049
        (symbol '0'))
29944
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2050
      (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2051
        (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2052
        (symbol '3')))
29944
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2053
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2054
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2055
      (symbol '1')))
29944
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2056
  * set:
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2057
  <filteredset
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2058
    <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2059
      <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
  2060
      <spanset+ 0:4>>,
29944
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2061
    <not
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2062
      <spanset+ 1:3>>>
29944
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2063
  3
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2064
  0
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2065
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2066
 '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
  2067
 the left expression:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2068
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2069
  $ 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
  2070
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2071
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2072
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2073
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2074
    (group
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2075
      (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2076
        (list
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2077
          (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2078
          (symbol '1')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2079
          (symbol '2')))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2080
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2081
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2082
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2083
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2084
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2085
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2086
      (symbol '_list')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2087
      (string '0\x001\x002')))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2088
  * set:
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2089
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2090
    <spanset- 0:3>,
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2091
    <baseset [0, 1, 2]>>
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2092
  2
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2093
  1
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2094
  0
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2095
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2096
 '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
  2097
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2098
  $ 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
  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
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2101
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2102
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2103
    (group
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2104
      (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2105
        (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2106
          (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2107
            (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2108
            (symbol '1'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2109
          (symbol '2')))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2110
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2111
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2112
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2113
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2114
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2115
    (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2116
      (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2117
        (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2118
          (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2119
          (symbol '1'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2120
        (symbol '2'))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2121
  * set:
29934
2c6a05b938d8 revset: fix order of nested 'or' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29932
diff changeset
  2122
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2123
    <spanset- 0:3>,
29934
2c6a05b938d8 revset: fix order of nested 'or' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29932
diff changeset
  2124
    <addset
34010
72b5f4d53c58 revset: drop optimization about reordering "or" set elements
Jun Wu <quark@fb.com>
parents: 33868
diff changeset
  2125
      <spanset+ 0:2>,
72b5f4d53c58 revset: drop optimization about reordering "or" set elements
Jun Wu <quark@fb.com>
parents: 33868
diff changeset
  2126
      <baseset [2]>>>
29934
2c6a05b938d8 revset: fix order of nested 'or' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29932
diff changeset
  2127
  2
2c6a05b938d8 revset: fix order of nested 'or' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29932
diff changeset
  2128
  1
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2129
  0
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2130
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2131
 '_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
  2132
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2133
  $ 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
  2134
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2135
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2136
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2137
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2138
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2139
      (symbol '_intlist')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2140
      (string '0\x001\x002')))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2141
  * optimized:
34020
37b82485097f revset: do not flip "and" arguments when optimizing
Jun Wu <quark@fb.com>
parents: 34011
diff changeset
  2142
  (andsmally
37b82485097f revset: do not flip "and" arguments when optimizing
Jun Wu <quark@fb.com>
parents: 34011
diff changeset
  2143
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2144
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2145
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2146
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2147
      (symbol '_intlist')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2148
      (string '0\x001\x002')))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2149
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2150
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2151
    <spanset- 0:3>,
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2152
    <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
  2153
  2
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2154
  1
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2155
  0
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2156
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2157
  $ 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
  2158
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2159
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2160
      (symbol '_intlist')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2161
      (string '0\x002\x001'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2162
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2163
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2164
      (symbol '0')))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2165
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2166
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2167
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2168
      (symbol '_intlist')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2169
      (string '0\x002\x001'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2170
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2171
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2172
      (symbol '0')))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2173
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2174
  <filteredset
29944
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2175
    <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
  2176
    <spanset- 0:3>>
29944
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2177
  0
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2178
  2
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2179
  1
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2180
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2181
 '_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
  2182
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2183
  $ 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
  2184
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2185
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2186
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2187
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2188
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2189
      (symbol '_hexlist')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2190
      (string '*'))) (glob)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2191
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2192
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2193
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2194
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2195
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2196
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2197
      (symbol '_hexlist')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2198
      (string '*'))) (glob)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2199
  * set:
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2200
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2201
    <spanset- 0:3>,
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2202
    <baseset [0, 1, 2]>>
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2203
  2
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2204
  1
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2205
  0
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2206
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2207
  $ 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
  2208
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2209
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2210
      (symbol '_hexlist')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2211
      (string '*')) (glob)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2212
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2213
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2214
      (symbol '0')))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2215
  * optimized:
34020
37b82485097f revset: do not flip "and" arguments when optimizing
Jun Wu <quark@fb.com>
parents: 34011
diff changeset
  2216
  (andsmally
37b82485097f revset: do not flip "and" arguments when optimizing
Jun Wu <quark@fb.com>
parents: 34011
diff changeset
  2217
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2218
      (symbol '_hexlist')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2219
      (string '*')) (glob)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2220
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2221
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2222
      (symbol '0')))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2223
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2224
  <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
  2225
  0
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2226
  2
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2227
  1
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2228
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2229
 '_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
  2230
 matter:
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2231
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2232
  $ 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
  2233
  * optimized:
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2234
  (difference
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2235
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2236
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2237
      (symbol '0'))
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2238
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2239
      (symbol '_list')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2240
      (string '0\x001')))
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2241
  * set:
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2242
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2243
    <spanset- 0:3>,
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2244
    <not
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2245
      <baseset [0, 1]>>>
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2246
  2
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2247
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2248
  $ 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
  2249
  * optimized:
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2250
  (difference
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2251
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2252
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2253
      (symbol '0'))
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2254
    (and
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2255
      (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2256
        (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2257
        (symbol '2'))
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2258
      (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2259
        (symbol '_list')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2260
        (string '0\x001'))))
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2261
  * set:
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2262
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2263
    <spanset- 0:3>,
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2264
    <not
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2265
      <baseset [0, 1]>>>
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2266
  2
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2267
29943
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2268
 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
  2269
 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
  2270
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2271
  $ 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
  2272
  * optimized:
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2273
  (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2274
    (symbol 'present')
29943
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2275
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2276
      (symbol '_list')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2277
      (string '2\x000\x001')))
29943
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2278
  * set:
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2279
  <baseset [2, 0, 1]>
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2280
  2
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2281
  0
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2282
  1
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2283
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2284
  $ 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
  2285
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2286
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2287
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2288
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2289
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2290
      (symbol 'present')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2291
      (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2292
        (list
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2293
          (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2294
          (symbol '1')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2295
          (symbol '2')))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2296
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2297
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2298
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2299
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2300
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2301
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2302
      (symbol 'present')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2303
      (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2304
        (symbol '_list')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2305
        (string '0\x001\x002'))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2306
  * set:
29943
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2307
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2308
    <spanset- 0:3>,
29943
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2309
    <baseset [0, 1, 2]>>
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2310
  2
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2311
  1
29943
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2312
  0
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2313
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2314
 '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
  2315
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2316
  $ 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
  2317
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2318
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2319
      (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2320
      (symbol '2'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2321
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2322
      (symbol 'reverse')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2323
      (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2324
        (symbol 'all')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2325
        None)))
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2326
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2327
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2328
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2329
      (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2330
      (symbol '2'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2331
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2332
      (symbol 'reverse')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2333
      (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2334
        (symbol 'all')
34011
1b28525e6698 revset: remove order information from tree (API)
Jun Wu <quark@fb.com>
parents: 34010
diff changeset
  2335
        None)))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2336
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2337
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2338
    <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
  2339
    <spanset+ 0:10>>
29945
89dbae952ec1 revset: make reverse() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29944
diff changeset
  2340
  0
89dbae952ec1 revset: make reverse() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29944
diff changeset
  2341
  1
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2342
  2
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2343
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2344
 '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
  2345
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2346
  $ 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
  2347
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2348
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2349
      (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2350
      (symbol '2'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2351
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2352
      (symbol 'sort')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2353
      (list
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2354
        (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2355
          (symbol 'all')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2356
          None)
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2357
        (negate
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2358
          (symbol 'rev')))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2359
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2360
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2361
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2362
      (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2363
      (symbol '2'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2364
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2365
      (symbol 'sort')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2366
      (list
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2367
        (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2368
          (symbol 'all')
34011
1b28525e6698 revset: remove order information from tree (API)
Jun Wu <quark@fb.com>
parents: 34010
diff changeset
  2369
          None)
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2370
        (string '-rev'))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2371
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2372
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2373
    <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
  2374
    <spanset+ 0:10>>
29946
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2375
  0
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2376
  1
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2377
  2
29946
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2378
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2379
 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
  2380
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2381
  $ log '0:2 & sort()'
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2382
  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
  2383
  [255]
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2384
  $ 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
  2385
  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
  2386
  [255]
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2387
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2388
 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
  2389
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2390
  $ 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
  2391
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2392
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2393
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2394
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2395
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2396
      (symbol 'first')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2397
      (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2398
        (list
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2399
          (symbol '1')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2400
          (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2401
          (symbol '2')))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2402
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2403
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2404
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2405
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2406
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2407
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2408
      (symbol 'first')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2409
      (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2410
        (symbol '_list')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2411
        (string '1\x000\x002'))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2412
  * set:
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  2413
  <filteredset
32820
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  2414
    <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
  2415
    <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
  2416
  1
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2417
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2418
  $ 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
  2419
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2420
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2421
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2422
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2423
    (not
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2424
      (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2425
        (symbol 'last')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2426
        (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2427
          (list
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2428
            (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2429
            (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2430
            (symbol '1'))))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2431
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2432
  (difference
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2433
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2434
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2435
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2436
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2437
      (symbol 'last')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2438
      (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2439
        (symbol '_list')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2440
        (string '0\x002\x001'))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2441
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
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>,
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2444
    <not
32820
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  2445
      <baseset [1]>>>
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2446
  2
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2447
  0
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2448
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2449
 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
  2450
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2451
  $ 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
  2452
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2453
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2454
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2455
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2456
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2457
      (group
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2458
        (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2459
          (list
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2460
            (symbol '1')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2461
            (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2462
            (symbol '2'))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2463
      (group
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2464
        (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2465
          (list
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2466
            (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2467
            (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2468
            (symbol '1'))))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2469
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2470
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2471
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2472
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2473
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2474
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2475
      (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2476
        (symbol '_list')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2477
        (string '1\x000\x002'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2478
      (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2479
        (symbol '_list')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2480
        (string '0\x002\x001'))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2481
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2482
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2483
    <spanset- 0:3>,
29944
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2484
    <baseset [1]>>
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2485
  1
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2486
34011
1b28525e6698 revset: remove order information from tree (API)
Jun Wu <quark@fb.com>
parents: 34010
diff changeset
  2487
 'A & B' can be rewritten as 'flipand(B, A)' by weight.
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2488
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2489
  $ 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
  2490
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2491
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2492
      (symbol 'contains')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2493
      (string 'glob:*'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2494
    (group
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2495
      (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2496
        (list
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2497
          (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2498
          (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2499
          (symbol '1')))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2500
  * optimized:
34020
37b82485097f revset: do not flip "and" arguments when optimizing
Jun Wu <quark@fb.com>
parents: 34011
diff changeset
  2501
  (andsmally
37b82485097f revset: do not flip "and" arguments when optimizing
Jun Wu <quark@fb.com>
parents: 34011
diff changeset
  2502
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2503
      (symbol 'contains')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2504
      (string 'glob:*'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2505
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2506
      (symbol '_list')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2507
      (string '2\x000\x001')))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2508
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2509
  <filteredset
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2510
    <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
  2511
    <contains 'glob:*'>>
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2512
  0
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2513
  1
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2514
  2
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2515
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2516
 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
  2517
 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
  2518
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2519
  $ 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
  2520
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2521
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2522
      (symbol 'reverse')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2523
      (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2524
        (symbol 'contains')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2525
        (string 'glob:*')))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2526
    (group
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2527
      (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2528
        (list
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2529
          (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2530
          (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2531
          (symbol '1')))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2532
  * optimized:
34020
37b82485097f revset: do not flip "and" arguments when optimizing
Jun Wu <quark@fb.com>
parents: 34011
diff changeset
  2533
  (andsmally
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2534
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2535
      (symbol 'reverse')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2536
      (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2537
        (symbol 'contains')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2538
        (string 'glob:*')))
34020
37b82485097f revset: do not flip "and" arguments when optimizing
Jun Wu <quark@fb.com>
parents: 34011
diff changeset
  2539
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2540
      (symbol '_list')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2541
      (string '0\x002\x001')))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2542
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2543
  <filteredset
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2544
    <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
  2545
    <contains 'glob:*'>>
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2546
  2
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2547
  1
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2548
  0
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2549
20717
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2550
test sort revset
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2551
--------------------------------------------
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2552
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2553
test when adding two unordered revsets
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2554
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2555
  $ log 'sort(keyword(issue) or modifies(b))'
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2556
  4
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2557
  6
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2558
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2559
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
  2560
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2561
  $ log 'sort(reverse(all()), -rev)'
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2562
  9
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2563
  8
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2564
  7
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2565
  6
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2566
  5
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2567
  4
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2568
  3
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2569
  2
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2570
  1
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2571
  0
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2572
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2573
test when sorting a reversed collection
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2574
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2575
  $ log 'sort(reverse(all()), rev)'
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2576
  0
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2577
  1
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2578
  2
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2579
  3
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2580
  4
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2581
  5
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2582
  6
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2583
  7
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2584
  8
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2585
  9
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2586
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2587
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2588
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
  2589
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2590
  $ 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
  2591
  2
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2592
  6
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2593
  8
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2594
  9
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2595
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2596
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
  2597
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2598
  $ 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
  2599
  9
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2600
  8
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2601
  6
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2602
  2
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2603
29362
ec75d77df9d7 revset: fix crash on empty sort key
Yuya Nishihara <yuya@tcha.org>
parents: 29348
diff changeset
  2604
test empty sort key which is noop
ec75d77df9d7 revset: fix crash on empty sort key
Yuya Nishihara <yuya@tcha.org>
parents: 29348
diff changeset
  2605
ec75d77df9d7 revset: fix crash on empty sort key
Yuya Nishihara <yuya@tcha.org>
parents: 29348
diff changeset
  2606
  $ log 'sort(0 + 2 + 1, "")'
ec75d77df9d7 revset: fix crash on empty sort key
Yuya Nishihara <yuya@tcha.org>
parents: 29348
diff changeset
  2607
  0
ec75d77df9d7 revset: fix crash on empty sort key
Yuya Nishihara <yuya@tcha.org>
parents: 29348
diff changeset
  2608
  2
ec75d77df9d7 revset: fix crash on empty sort key
Yuya Nishihara <yuya@tcha.org>
parents: 29348
diff changeset
  2609
  1
ec75d77df9d7 revset: fix crash on empty sort key
Yuya Nishihara <yuya@tcha.org>
parents: 29348
diff changeset
  2610
29264
22625884b15c revset: factor out reverse flag of sort() key
Yuya Nishihara <yuya@tcha.org>
parents: 29139
diff changeset
  2611
test invalid sort keys
22625884b15c revset: factor out reverse flag of sort() key
Yuya Nishihara <yuya@tcha.org>
parents: 29139
diff changeset
  2612
22625884b15c revset: factor out reverse flag of sort() key
Yuya Nishihara <yuya@tcha.org>
parents: 29139
diff changeset
  2613
  $ log 'sort(all(), -invalid)'
22625884b15c revset: factor out reverse flag of sort() key
Yuya Nishihara <yuya@tcha.org>
parents: 29139
diff changeset
  2614
  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
  2615
  [255]
22625884b15c revset: factor out reverse flag of sort() key
Yuya Nishihara <yuya@tcha.org>
parents: 29139
diff changeset
  2616
29001
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2617
  $ cd ..
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2618
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2619
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
  2620
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2621
  $ 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
  2622
  $ cd sorting
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2623
  $ 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
  2624
  > [ui]
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2625
  > 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
  2626
  > [templatealias]
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2627
  > 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
  2628
  > EOF
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2629
  $ 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
  2630
  $ 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
  2631
  $ 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
  2632
  $ 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
  2633
  $ 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
  2634
  $ 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
  2635
  $ 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
  2636
  $ 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
  2637
  $ 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
  2638
  $ 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
  2639
  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
  2640
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2641
 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
  2642
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2643
  $ 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
  2644
  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
  2645
  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
  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
  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
  2648
  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
  2649
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2650
  $ 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
  2651
  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
  2652
  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
  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
  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
  2655
  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
  2656
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2657
 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
  2658
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2659
  $ 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
  2660
  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
  2661
  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
  2662
  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
  2663
  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
  2664
  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
  2665
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2666
  $ 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
  2667
  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
  2668
  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
  2669
  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
  2670
  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
  2671
  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
  2672
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2673
  $ 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
  2674
  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
  2675
  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
  2676
  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
  2677
  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
  2678
  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
  2679
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2680
  $ 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
  2681
  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
  2682
  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
  2683
  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
  2684
  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
  2685
  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
  2686
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2687
  $ 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
  2688
  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
  2689
  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
  2690
  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
  2691
  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
  2692
  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
  2693
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2694
  $ 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
  2695
  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
  2696
  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
  2697
  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
  2698
  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
  2699
  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
  2700
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2701
 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
  2702
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2703
  $ 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
  2704
  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
  2705
  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
  2706
  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
  2707
  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
  2708
  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
  2709
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2710
  $ 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
  2711
  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
  2712
  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
  2713
  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
  2714
  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
  2715
  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
  2716
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2717
 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
  2718
 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
  2719
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2720
  $ 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
  2721
  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
  2722
  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
  2723
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2724
  $ 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
  2725
  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
  2726
  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
  2727
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2728
  $ 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
  2729
  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
  2730
  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
  2731
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2732
 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
  2733
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2734
  $ 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
  2735
  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
  2736
  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
  2737
  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
  2738
  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
  2739
  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
  2740
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2741
  $ 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
  2742
  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
  2743
  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
  2744
  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
  2745
  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
  2746
  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
  2747
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2748
  $ 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
  2749
  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
  2750
  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
  2751
  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
  2752
  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
  2753
  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
  2754
29348
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2755
 toposort prioritises graph branches
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2756
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2757
  $ hg up 2
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2758
  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
  2759
  $ touch a
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2760
  $ hg addremove
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2761
  adding a
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2762
  $ hg ci -m 't1' -u 'tu' -d '130 0'
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2763
  created new head
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2764
  $ echo 'a' >> a
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2765
  $ hg ci -m 't2' -u 'tu' -d '130 0'
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2766
  $ hg book book1
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2767
  $ hg up 4
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2768
  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
  2769
  (leaving bookmark book1)
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2770
  $ touch a
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2771
  $ hg addremove
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2772
  adding a
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2773
  $ hg ci -m 't3' -u 'tu' -d '130 0'
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2774
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2775
  $ hg log -r 'sort(all(), topo)'
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2776
  7 b111 t3   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2777
  4 b111 m112 u111 110 14400
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2778
  3 b112 m111 u11  120 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2779
  6 b111 t2   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2780
  5 b111 t1   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2781
  2 b111 m11  u12  111 3600
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2782
  1 b11  m12  u111 112 7200
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2783
  0 b12  m111 u112 111 10800
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2784
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2785
  $ hg log -r 'sort(all(), -topo)'
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2786
  0 b12  m111 u112 111 10800
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2787
  1 b11  m12  u111 112 7200
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2788
  2 b111 m11  u12  111 3600
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2789
  5 b111 t1   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2790
  6 b111 t2   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2791
  3 b112 m111 u11  120 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2792
  4 b111 m112 u111 110 14400
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2793
  7 b111 t3   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2794
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2795
  $ hg log -r 'sort(all(), topo, topo.firstbranch=book1)'
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2796
  6 b111 t2   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2797
  5 b111 t1   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2798
  7 b111 t3   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2799
  4 b111 m112 u111 110 14400
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2800
  3 b112 m111 u11  120 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2801
  2 b111 m11  u12  111 3600
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2802
  1 b11  m12  u111 112 7200
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2803
  0 b12  m111 u112 111 10800
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2804
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2805
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
  2806
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
  2807
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2808
  $ hg log -r 'sort(all(), "topo user")'
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2809
  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
  2810
  [255]
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2811
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2812
  $ hg log -r 'sort(all(), user, topo.firstbranch=book1)'
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2813
  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
  2814
  [255]
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2815
29766
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
  2816
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
  2817
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
  2818
  $ 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
  2819
  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
  2820
29001
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2821
  $ cd ..
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2822
  $ cd repo
36685
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
  2823
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
  2824
test multiline revset with errors
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
  2825
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
  2826
  $ echo > multiline-revset
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
  2827
  $ echo '. +' >> multiline-revset
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
  2828
  $ echo '.^ +' >> multiline-revset
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
  2829
  $ hg log -r "`cat multiline-revset`"
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
  2830
  hg: parse error at 9: not a prefix: end
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
  2831
  ( . + .^ +
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
  2832
            ^ here)
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
  2833
  [255]
37760
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2834
  $ hg debugrevspec -v 'revset(first(rev(0)))' -p all
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2835
  * parsed:
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2836
  (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2837
    (symbol 'revset')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2838
    (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2839
      (symbol 'first')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2840
      (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2841
        (symbol 'rev')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2842
        (symbol '0'))))
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2843
  * expanded:
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2844
  (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2845
    (symbol 'revset')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2846
    (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2847
      (symbol 'first')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2848
      (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2849
        (symbol 'rev')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2850
        (symbol '0'))))
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2851
  * concatenated:
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2852
  (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2853
    (symbol 'revset')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2854
    (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2855
      (symbol 'first')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2856
      (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2857
        (symbol 'rev')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2858
        (symbol '0'))))
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2859
  * analyzed:
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2860
  (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2861
    (symbol 'first')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2862
    (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2863
      (symbol 'rev')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2864
      (symbol '0')))
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2865
  * optimized:
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2866
  (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2867
    (symbol 'first')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2868
    (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2869
      (symbol 'rev')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2870
      (symbol '0')))
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2871
  * set:
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2872
  <baseset+ [0]>
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2873
  0