tests/test-revset.t
author Martin von Zweigbergk <martinvonz@google.com>
Mon, 07 May 2018 14:32:43 -0700
changeset 37866 37e7ae332e90
parent 37760 29eb4cafeeb8
child 37867 0a79fb64118e
permissions -rw-r--r--
revset: make id() an empty set for ambiguous nodeid (BC) As Yuya pointed out in the review of D3311, id() (and rev()) does not raise an error when the input is an unknown identifier, so it doesn't make sense for it to do that when the input is ambiguous with a filtered node. However, it turned out that it already does raise an error when the input is ambiguous among the visible nodes. So let's start by fixing that. Differential Revision: https://phab.mercurial-scm.org/D3462
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,
30881
1be65deb3d54 smartset: move set classes and related functions from revset module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 30803
diff changeset
    45
  >     smartset,
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
    46
  > )
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:
36379
28551d4c5ee8 py3: add b'' prefixes in test-revset.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35542
diff changeset
    66
  >         ui.note(b"* set:\n", smartset.prettyformat(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
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1360
  $ 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
  1361
  7
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1362
  $ 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
  1363
  6
19706
26ddce1a2a55 revset: fix wrong keyword() behaviour for strings with spaces
Alexander Plavin <alexander@plav.in>
parents: 18955
diff changeset
  1364
  $ 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
  1365
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1366
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
  1367
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1368
  $ log '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
  1369
  0
26638
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
  1370
  $ 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
  1371
  5
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
  1372
  6
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
  1373
  7
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
  1374
  $ 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
  1375
  6
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
  1376
  $ 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
  1377
  $ log 'limit(all(), 1, -1)'
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
  1378
  hg: parse error: negative offset
7afaf2566e25 revset: add optional offset argument to limit() predicate
Yuya Nishihara <yuya@tcha.org>
parents: 26537
diff changeset
  1379
  [255]
32799
b36ec65ea583 revset: reject negative number to select first/last n members
Yuya Nishihara <yuya@tcha.org>
parents: 32798
diff changeset
  1380
  $ log 'limit(all(), -1)'
b36ec65ea583 revset: reject negative number to select first/last n members
Yuya Nishihara <yuya@tcha.org>
parents: 32798
diff changeset
  1381
  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
  1382
  [255]
b36ec65ea583 revset: reject negative number to select first/last n members
Yuya Nishihara <yuya@tcha.org>
parents: 32798
diff changeset
  1383
  $ log 'limit(all(), 0)'
b36ec65ea583 revset: reject negative number to select first/last n members
Yuya Nishihara <yuya@tcha.org>
parents: 32798
diff changeset
  1384
b36ec65ea583 revset: reject negative number to select first/last n members
Yuya Nishihara <yuya@tcha.org>
parents: 32798
diff changeset
  1385
  $ log 'last(all(), -1)'
b36ec65ea583 revset: reject negative number to select first/last n members
Yuya Nishihara <yuya@tcha.org>
parents: 32798
diff changeset
  1386
  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
  1387
  [255]
32798
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1388
  $ 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
  1389
  $ 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
  1390
  9
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1391
  $ 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
  1392
  8
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1393
  9
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1394
32819
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1395
Test smartset.slice() by first/last()
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1396
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1397
 (using unoptimized set, filteredset as example)
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1398
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1399
  $ 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
  1400
  * set:
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1401
  <filteredset
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1402
    <spanset+ 0:8>,
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1403
    <branch 're:'>>
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1404
  $ log 'limit(0:7 & branch("re:"), 3, 4)'
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1405
  4
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1406
  5
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1407
  6
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1408
  $ log 'limit(7:0 & branch("re:"), 3, 4)'
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1409
  3
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1410
  2
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1411
  1
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1412
  $ log 'last(0:7 & branch("re:"), 2)'
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1413
  6
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1414
  7
4710cc4dac99 smartset: extract method to slice abstractsmartset
Yuya Nishihara <yuya@tcha.org>
parents: 32817
diff changeset
  1415
32820
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1416
 (using baseset)
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1417
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1418
  $ 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
  1419
  * set:
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1420
  <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
  1421
  $ 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
  1422
  * set:
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1423
  <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
  1424
  $ 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
  1425
  4
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1426
  5
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1427
  6
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1428
  $ 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
  1429
  4
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1430
  5
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1431
  6
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1432
  $ 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
  1433
  3
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1434
  2
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1435
  1
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1436
  $ 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
  1437
  6
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1438
  7
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1439
  $ 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
  1440
  * set:
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1441
  <baseset+ [6, 7]>
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1442
  6
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1443
  7
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1444
  $ 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
  1445
  * set:
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1446
  <baseset+ []>
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1447
  $ 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
  1448
  * set:
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1449
  <baseset- [0, 1]>
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1450
  1
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1451
  0
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1452
  $ 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
  1453
  * set:
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1454
  <baseset- []>
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1455
  $ 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
  1456
  * set:
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1457
  <baseset+ []>
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  1458
32821
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1459
 (using spanset)
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1460
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1461
  $ 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
  1462
  * set:
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1463
  <spanset+ 0:8>
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1464
  $ 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
  1465
  4
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1466
  5
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1467
  6
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1468
  $ 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
  1469
  3
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1470
  2
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1471
  1
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1472
  $ 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
  1473
  6
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1474
  7
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1475
  $ 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
  1476
  1
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1477
  0
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1478
  $ log 'last(0:7, 2)'
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1479
  6
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1480
  7
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1481
  $ 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
  1482
  * set:
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1483
  <spanset+ 6:8>
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1484
  6
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1485
  7
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1486
  $ 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
  1487
  * set:
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1488
  <spanset+ 8:8>
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1489
  $ 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
  1490
  * set:
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1491
  <spanset- 0:2>
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1492
  1
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1493
  0
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1494
  $ 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
  1495
  * set:
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1496
  <spanset- 0:0>
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1497
  $ 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
  1498
  * set:
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1499
  <spanset+ 0:0>
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1500
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1501
Test order of first/last revisions
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1502
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1503
  $ 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
  1504
  * set:
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1505
  <filteredset
32821
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1506
    <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
  1507
    <spanset+ 3:10>>
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1508
  4
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1509
  3
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1510
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1511
  $ 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
  1512
  * set:
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1513
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  1514
    <spanset+ 3:10>,
32821
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1515
    <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
  1516
  3
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1517
  4
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1518
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1519
  $ 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
  1520
  * set:
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1521
  <filteredset
32821
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1522
    <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
  1523
    <spanset+ 0:2>>
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1524
  1
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1525
  0
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1526
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1527
  $ 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
  1528
  * set:
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1529
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  1530
    <spanset+ 0:2>,
32821
9b7d615108d7 smartset: micro optimize spanset.slice() to narrow range accordingly
Yuya Nishihara <yuya@tcha.org>
parents: 32820
diff changeset
  1531
    <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
  1532
  0
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1533
  1
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1534
33109
247bae545061 smartset: fix generatorset.last() to not return the first element (issue5609)
Yuya Nishihara <yuya@tcha.org>
parents: 33097
diff changeset
  1535
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
  1536
247bae545061 smartset: fix generatorset.last() to not return the first element (issue5609)
Yuya Nishihara <yuya@tcha.org>
parents: 33097
diff changeset
  1537
  $ 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
  1538
  * set:
247bae545061 smartset: fix generatorset.last() to not return the first element (issue5609)
Yuya Nishihara <yuya@tcha.org>
parents: 33097
diff changeset
  1539
  <baseset slice=0:1
35501
12a46ad67a3c smartset: split generatorset classes to avoid cycle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34866
diff changeset
  1540
    <generatorsetasc->>
33109
247bae545061 smartset: fix generatorset.last() to not return the first element (issue5609)
Yuya Nishihara <yuya@tcha.org>
parents: 33097
diff changeset
  1541
  9
247bae545061 smartset: fix generatorset.last() to not return the first element (issue5609)
Yuya Nishihara <yuya@tcha.org>
parents: 33097
diff changeset
  1542
  $ 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
  1543
  9
247bae545061 smartset: fix generatorset.last() to not return the first element (issue5609)
Yuya Nishihara <yuya@tcha.org>
parents: 33097
diff changeset
  1544
32798
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1545
Test matching
573b792872c1 revset: fix order of last() n members where n > 1 (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 32699
diff changeset
  1546
16447
60c379da12aa tests: add tests for matching keyword
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 16415
diff changeset
  1547
  $ log 'matching(6)'
60c379da12aa tests: add tests for matching keyword
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 16415
diff changeset
  1548
  6
60c379da12aa tests: add tests for matching keyword
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 16415
diff changeset
  1549
  $ 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
  1550
  6
60c379da12aa tests: add tests for matching keyword
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 16415
diff changeset
  1551
  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
  1552
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1553
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
  1554
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1555
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
  1556
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1557
  $ 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
  1558
  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
  1559
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1560
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
  1561
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1562
  $ 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
  1563
  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
  1564
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1565
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
  1566
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1567
  $ 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
  1568
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1569
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
  1570
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1571
  $ 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
  1572
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1573
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
  1574
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1575
  $ 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
  1576
  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
  1577
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1578
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
  1579
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1580
  $ 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
  1581
  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
  1582
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1583
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
  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
  $ 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
  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
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
  1588
876c17336b4e revset: raise ValueError when calling min or max on empty smartset
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20862
diff changeset
  1589
  $ 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
  1590
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
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1592
  $ log 'merge()'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1593
  6
17753
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1594
  $ log 'branchpoint()'
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1595
  1
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1596
  4
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1597
  $ 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
  1598
  4
16521
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
  1599
  $ log 'modifies("path:b")'
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
  1600
  4
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
  1601
  $ log 'modifies("*")'
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
  1602
  4
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
  1603
  6
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
  1604
  $ log 'modifies("set:modified()")'
592701c8eac6 revset: fix adds/modifies/removes and patterns (issue3403)
Patrick Mezard <patrick@mezard.eu>
parents: 16447
diff changeset
  1605
  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
  1606
  $ 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
  1607
  2
20613
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1608
  $ log 'only(9)'
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1609
  8
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1610
  9
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1611
  $ log 'only(8)'
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1612
  8
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1613
  $ log 'only(9, 5)'
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1614
  2
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1615
  4
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1616
  8
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1617
  9
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1618
  $ log 'only(7 + 9, 5 + 2)'
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1619
  4
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1620
  6
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1621
  7
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1622
  8
10433163bf57 revset: add 'only' revset
Durham Goode <durham@fb.com>
parents: 20499
diff changeset
  1623
  9
21925
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
  1624
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
  1625
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
  1626
  $ 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
  1627
  $ 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
  1628
  0
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
  1629
  1
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
  1630
  2
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
  1631
  4
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
  1632
  8
7142e04b438e revset: avoid a ValueError when 'only()' is given an empty set
Matt Harbison <matt_harbison@yahoo.com>
parents: 21893
diff changeset
  1633
  9
23062
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
  1634
23765
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1635
Test '%' operator
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1636
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1637
  $ log '9%'
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1638
  8
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1639
  9
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1640
  $ log '9%5'
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1641
  2
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1642
  4
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1643
  8
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1644
  9
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1645
  $ log '(7 + 9)%(5 + 2)'
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1646
  4
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1647
  6
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1648
  7
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1649
  8
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1650
  9
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1651
30332
318a24b52eeb spelling: fixes of non-dictionary words
Mads Kiilerich <madski@unity3d.com>
parents: 30179
diff changeset
  1652
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
  1653
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1654
  $ 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
  1655
  (onlypost
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1656
    (minus
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1657
      (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1658
        (symbol '8')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1659
        (symbol '9'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1660
      (symbol '8')))
25094
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1661
  * optimized:
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1662
  (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1663
    (symbol 'only')
28217
d2ac8b57a75d revset: use smartset minus operator
Durham Goode <durham@fb.com>
parents: 28015
diff changeset
  1664
    (difference
25094
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1665
      (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1666
        (symbol '8')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1667
        (symbol '9'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1668
      (symbol '8')))
25094
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1669
  * set:
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1670
  <baseset+ [8, 9]>
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1671
  8
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1672
  9
25105
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1673
  $ try --optimize '(9)%(5)'
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1674
  (only
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1675
    (group
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1676
      (symbol '9'))
25105
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1677
    (group
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1678
      (symbol '5')))
25105
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1679
  * optimized:
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1680
  (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1681
    (symbol 'only')
25105
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1682
    (list
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1683
      (symbol '9')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  1684
      (symbol '5')))
25105
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1685
  * set:
28785
87b89dca669d revset: stabilize repr of baseset initialized with a set
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 28690
diff changeset
  1686
  <baseset+ [2, 4, 8, 9]>
25105
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1687
  2
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1688
  4
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1689
  8
2f34746c27df revset: remove unused 'only' from methods table
Yuya Nishihara <yuya@tcha.org>
parents: 25102
diff changeset
  1690
  9
25094
8b99e9a8db05 revset: map postfix '%' to only() to optimize operand recursively (issue4670)
Yuya Nishihara <yuya@tcha.org>
parents: 24904
diff changeset
  1691
23765
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1692
Test the order of operations
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1693
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1694
  $ log '7 + 9%5 + 2'
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1695
  7
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1696
  2
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1697
  4
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1698
  8
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1699
  9
537a2669a113 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com>
parents: 23742
diff changeset
  1700
23062
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
  1701
Test explicit numeric revision
23954
310222feb9a8 revset: allow rev(-1) to indicate null revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 23846
diff changeset
  1702
  $ 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
  1703
  $ log 'rev(-1)'
23954
310222feb9a8 revset: allow rev(-1) to indicate null revision (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 23846
diff changeset
  1704
  -1
23062
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
  1705
  $ 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
  1706
  0
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
  1707
  $ 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
  1708
  9
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
  1709
  $ 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
  1710
  $ 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
  1711
  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
  1712
  [255]
ba89f7b542c9 revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)
Yuya Nishihara <yuya@tcha.org>
parents: 22861
diff changeset
  1713
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
  1714
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
  1715
  $ 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
  1716
  $ 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
  1717
  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
  1718
  $ 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
  1719
  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
  1720
  $ 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
  1721
  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
  1722
  $ 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
  1723
  $ 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
  1724
  $ 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
  1725
  $ 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
  1726
  $ 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
  1727
  $ 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
  1728
23956
b1e026c25552 revset: fix ancestors(null) to include null revision (issue4512)
Yuya Nishihara <yuya@tcha.org>
parents: 23954
diff changeset
  1729
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
  1730
  $ log '(null)'
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1731
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1732
  $ log '(null:0)'
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1733
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1734
  0
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1735
  $ log '(0:null)'
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1736
  0
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1737
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1738
  $ log 'null::0'
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1739
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1740
  0
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1741
  $ 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
  1742
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1743
  $ 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
  1744
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1745
  $ 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
  1746
  -1
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1747
  0
23956
b1e026c25552 revset: fix ancestors(null) to include null revision (issue4512)
Yuya Nishihara <yuya@tcha.org>
parents: 23954
diff changeset
  1748
  $ log 'ancestors(null)'
b1e026c25552 revset: fix ancestors(null) to include null revision (issue4512)
Yuya Nishihara <yuya@tcha.org>
parents: 23954
diff changeset
  1749
  -1
24204
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1750
  $ 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
  1751
  0
d2de20e1451f revset: extend fullreposet to make "null" revision magically appears in set
Yuya Nishihara <yuya@tcha.org>
parents: 24202
diff changeset
  1752
  -1
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1753
  $ log 'first(null:)'
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1754
  -1
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1755
  $ log 'min(null:)'
25265
e16456831516 revset: drop magic of fullreposet membership test (issue4682)
Yuya Nishihara <yuya@tcha.org>
parents: 25094
diff changeset
  1756
BROKEN: should be '-1'
24202
2de9ee016425 revset: have all() filter out null revision
Yuya Nishihara <yuya@tcha.org>
parents: 24175
diff changeset
  1757
  $ log 'tip:null and all()' | tail -2
2de9ee016425 revset: have all() filter out null revision
Yuya Nishihara <yuya@tcha.org>
parents: 24175
diff changeset
  1758
  1
2de9ee016425 revset: have all() filter out null revision
Yuya Nishihara <yuya@tcha.org>
parents: 24175
diff changeset
  1759
  0
23956
b1e026c25552 revset: fix ancestors(null) to include null revision (issue4512)
Yuya Nishihara <yuya@tcha.org>
parents: 23954
diff changeset
  1760
24419
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 24222
diff changeset
  1761
Test working-directory revision
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 24222
diff changeset
  1762
  $ hg debugrevspec 'wdir()'
25765
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
  1763
  2147483647
32404
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1764
  $ hg debugrevspec 'wdir()^'
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1765
  9
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1766
  $ hg up 7
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1767
  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
  1768
  $ hg debugrevspec 'wdir()^'
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1769
  7
32437
f03dcb3f95a5 tests: add tests for predicates and operators which works with wdir()
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32436
diff changeset
  1770
  $ 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
  1771
  2147483647
32441
018f638ad88e revset: add support for using ~ operator on wdir() predicate
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32440
diff changeset
  1772
  $ hg debugrevspec 'wdir()~3'
018f638ad88e revset: add support for using ~ operator on wdir() predicate
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32440
diff changeset
  1773
  5
32442
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1774
  $ hg debugrevspec 'ancestors(wdir())'
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1775
  0
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1776
  1
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1777
  2
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1778
  3
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1779
  4
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1780
  5
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1781
  6
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1782
  7
4dd292cec3ad revset: add support for ancestors(wdir())
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32441
diff changeset
  1783
  2147483647
32437
f03dcb3f95a5 tests: add tests for predicates and operators which works with wdir()
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32436
diff changeset
  1784
  $ 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
  1785
  2147483647
f03dcb3f95a5 tests: add tests for predicates and operators which works with wdir()
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32436
diff changeset
  1786
  $ 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
  1787
  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
  1788
  $ 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
  1789
  $ 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
  1790
  7
32436
f064e2f72c49 revset: add support for "wdir()^n"
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32404
diff changeset
  1791
  $ hg debugrevspec 'wdir()^1'
f064e2f72c49 revset: add support for "wdir()^n"
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32404
diff changeset
  1792
  7
f064e2f72c49 revset: add support for "wdir()^n"
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32404
diff changeset
  1793
  $ hg debugrevspec 'wdir()^2'
f064e2f72c49 revset: add support for "wdir()^n"
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32404
diff changeset
  1794
  $ hg debugrevspec 'wdir()^3'
f064e2f72c49 revset: add support for "wdir()^n"
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32404
diff changeset
  1795
  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
  1796
  [255]
32404
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1797
For tests consistency
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1798
  $ hg up 9
e8c043375b53 revset: make `hg log -r 'wdir()^'` work (issue4905)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
  1799
  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
  1800
  $ 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
  1801
  9
25765
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
  1802
  2147483647
24419
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 24222
diff changeset
  1803
  $ 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
  1804
  $ 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
  1805
  8
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
  1806
  9
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
  1807
  2147483647
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
  1808
  $ 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
  1809
  2147483647
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
  1810
  9
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
  1811
  8
d51dac68ec98 revset: work around x:y range where x or y is wdir()
Yuya Nishihara <yuya@tcha.org>
parents: 25765
diff changeset
  1812
  $ 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
  1813
  2147483647
25765
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
  1814
  $ log '(all() + wdir()) & min(. + wdir())'
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
  1815
  9
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
  1816
  $ log '(all() + wdir()) & max(. + wdir())'
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
  1817
  2147483647
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1818
  $ log 'first(wdir() + .)'
25765
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
  1819
  2147483647
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  1820
  $ log 'last(. + wdir())'
25765
5e1b0739611c revset: use integer representation of wdir() in revset
Yuya Nishihara <yuya@tcha.org>
parents: 25706
diff changeset
  1821
  2147483647
24419
0e41f110e69e revset: add wdir() function to specify workingctx revision by command
Yuya Nishihara <yuya@tcha.org>
parents: 24222
diff changeset
  1822
32661
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1823
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
  1824
(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
  1825
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1826
  $ hg debugrevspec '0:wdir() & 2147483647'
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1827
  2147483647
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1828
  $ 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
  1829
  2147483647
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1830
  $ hg debugrevspec '0:wdir() & ffffffffffffffffffffffffffffffffffffffff'
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1831
  2147483647
32684
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1832
  $ 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
  1833
  2147483647
32661
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1834
  $ 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
  1835
  2147483647
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1836
  $ 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
  1837
  2147483647
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1838
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1839
  $ cd ..
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1840
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1841
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
  1842
(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
  1843
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1844
  $ hg init wdir-hashcollision
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1845
  $ cd wdir-hashcollision
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1846
  $ cat <<EOF >> .hg/hgrc
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1847
  > [experimental]
34866
1644623ab096 config: use 'experimental.evolution.create-markers'
Boris Feld <boris.feld@octobus.net>
parents: 34126
diff changeset
  1848
  > evolution.createmarkers=True
32684
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1849
  > EOF
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1850
  $ echo 0 > a
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1851
  $ hg ci -qAm 0
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1852
  $ 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
  1853
  >   hg up -q 0
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1854
  >   echo $i > a
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1855
  >   hg ci -qm $i
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1856
  > done
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1857
  $ hg up -q null
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1858
  $ 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
  1859
  0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a b4e
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1860
  1:fffbae3886c8fbb2114296380d276fd37715d571 fffba
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1861
  2:fffb6093b00943f91034b9bdad069402c834e572 fffb6
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1862
  3:fff48a9b9de34a4d64120c29548214c67980ade3 fff4
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1863
  4:ffff85cff0ff78504fcdc3c0bc10de0c65379249 ffff8
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1864
  2147483647:ffffffffffffffffffffffffffffffffffffffff fffff
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1865
  $ hg debugobsolete fffbae3886c8fbb2114296380d276fd37715d571
33542
b11e8c67fb0f debugobsolete: also report the number of obsoleted changesets
Boris Feld <boris.feld@octobus.net>
parents: 33417
diff changeset
  1866
  obsoleted 1 changesets
32684
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1867
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1868
  $ 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
  1869
  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
  1870
  [255]
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1871
  $ 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
  1872
  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
  1873
  [255]
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1874
  $ 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
  1875
  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
  1876
  [255]
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1877
BROKEN should be '2' (node lookup uses unfiltered repo since dc25ed84bee8)
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1878
  $ hg debugrevspec '0:wdir() & id(fffb)'
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1879
  2
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1880
  $ 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
  1881
  4
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1882
  $ 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
  1883
  2147483647
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1884
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1885
  $ cd ..
32661
a3064fe3e495 revset: add support for integer and hex wdir identifiers
Yuya Nishihara <yuya@tcha.org>
parents: 32462
diff changeset
  1886
32683
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1887
Test branch() with wdir()
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1888
32684
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1889
  $ cd repo
af854b1b36f8 revlog: add support for partial matching of wdir node id
Yuya Nishihara <yuya@tcha.org>
parents: 32683
diff changeset
  1890
32683
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1891
  $ log '0:wdir() & branch("literal:é")'
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1892
  8
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1893
  9
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1894
  2147483647
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1895
  $ log '0:wdir() & branch("re:é")'
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1896
  8
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1897
  9
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1898
  2147483647
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1899
  $ 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
  1900
  0
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1901
  2
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1902
  $ log '0:wdir() & branch(8)'
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1903
  8
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1904
  9
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1905
  2147483647
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1906
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1907
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
  1908
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
  1909
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1910
  $ log 'branch(wdir())'
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1911
  8
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1912
  9
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1913
  $ log '0:wdir() & branch(wdir())'
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1914
  8
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1915
  9
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1916
  2147483647
9f840d99054c revset: add support for branch(wdir()) and wdir() & branch()
Yuya Nishihara <yuya@tcha.org>
parents: 32661
diff changeset
  1917
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1918
  $ log 'outgoing()'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1919
  8
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1920
  9
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1921
  $ 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
  1922
  8
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1923
  9
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1924
  $ 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
  1925
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1926
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1927
  6
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1928
  7
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1929
  9
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1930
  $ 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
  1931
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1932
  $ 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
  1933
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1934
  $ 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
  1935
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1936
  5
17753
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1937
  $ log 'p1(branchpoint())'
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1938
  0
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1939
  2
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1940
  $ log 'p2(branchpoint())'
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1941
  $ log 'parents(branchpoint())'
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1942
  0
69d5078d760d revsets: add branchpoint() function
Ivan Andrus <darthandrus@gmail.com>
parents: 17100
diff changeset
  1943
  2
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1944
  $ 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
  1945
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1946
  6
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1947
  $ 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
  1948
  0
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1949
  $ 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
  1950
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1951
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1952
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1953
  2
17100
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1954
  $ log 'reverse(all())'
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1955
  9
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1956
  8
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1957
  7
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1958
  6
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1959
  5
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1960
  4
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1961
  3
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1962
  2
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1963
  1
ee2370d866fc revset: ensure we are reversing a list (issue3530)
Bryan O'Sullivan <bryano@fb.com>
parents: 16851
diff changeset
  1964
  0
23826
c90d195320c5 revset: fix spanset.isascending() to honor sort() or reverse() request
Yuya Nishihara <yuya@tcha.org>
parents: 23062
diff changeset
  1965
  $ 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
  1966
  4
c90d195320c5 revset: fix spanset.isascending() to honor sort() or reverse() request
Yuya Nishihara <yuya@tcha.org>
parents: 23062
diff changeset
  1967
  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
  1968
  $ 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
  1969
  5
12105
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1970
  $ 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
  1971
  7
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1972
  8
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1973
  9
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1974
  $ 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
  1975
  2
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1976
  3
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1977
  5
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1978
  4
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1979
  $ log 'tagged()'
6f58430dfdd0 util: get rid of extra trailing whitespace in parsedate abort message
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12103
diff changeset
  1980
  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
  1981
  $ 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
  1982
  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
  1983
  $ 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
  1984
  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
  1985
  $ 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
  1986
  9
16820
20f55613fb2a revset: add pattern matching to 'tag' revset expression
Simon King <simon@simonking.org.uk>
parents: 16778
diff changeset
  1987
29139
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  1988
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
  1989
----------------------------------------------
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  1990
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  1991
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
  1992
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
  1993
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
  1994
29139
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  1995
 '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
  1996
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  1997
  $ log '2:0 & 0::2'
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  1998
  2
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  1999
  1
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  2000
  0
64c1955a0461 revset: make dagrange preserve order of input set
Yuya Nishihara <yuya@tcha.org>
parents: 29059
diff changeset
  2001
29408
785cadec2091 revset: make head() honor order of subset
Martin von Zweigbergk <martinvonz@google.com>
parents: 29390
diff changeset
  2002
 '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
  2003
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2004
  $ log '2:0 & head()'
29408
785cadec2091 revset: make head() honor order of subset
Martin von Zweigbergk <martinvonz@google.com>
parents: 29390
diff changeset
  2005
  2
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2006
  1
29408
785cadec2091 revset: make head() honor order of subset
Martin von Zweigbergk <martinvonz@google.com>
parents: 29390
diff changeset
  2007
  0
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2008
29944
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2009
 '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
  2010
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2011
  $ 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
  2012
  * optimized:
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2013
  (difference
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2014
    (and
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2015
      (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2016
        (symbol '3')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2017
        (symbol '0'))
29944
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2018
      (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2019
        (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2020
        (symbol '3')))
29944
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2021
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2022
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2023
      (symbol '1')))
29944
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2024
  * set:
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2025
  <filteredset
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2026
    <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2027
      <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
  2028
      <spanset+ 0:4>>,
29944
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2029
    <not
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2030
      <spanset+ 1:3>>>
29944
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2031
  3
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2032
  0
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2033
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2034
 '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
  2035
 the left expression:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2036
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2037
  $ 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
  2038
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2039
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2040
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2041
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2042
    (group
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2043
      (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2044
        (list
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2045
          (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2046
          (symbol '1')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2047
          (symbol '2')))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2048
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2049
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
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 '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2052
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2053
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2054
      (symbol '_list')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2055
      (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
  2056
  * set:
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2057
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2058
    <spanset- 0:3>,
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2059
    <baseset [0, 1, 2]>>
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2060
  2
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2061
  1
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2062
  0
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2063
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2064
 '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
  2065
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2066
  $ 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
  2067
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2068
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2069
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2070
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2071
    (group
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2072
      (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2073
        (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2074
          (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2075
            (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2076
            (symbol '1'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2077
          (symbol '2')))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2078
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2079
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2080
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2081
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2082
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2083
    (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2084
      (list
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2085
        (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2086
          (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2087
          (symbol '1'))
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2088
        (symbol '2'))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2089
  * set:
29934
2c6a05b938d8 revset: fix order of nested 'or' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29932
diff changeset
  2090
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2091
    <spanset- 0:3>,
29934
2c6a05b938d8 revset: fix order of nested 'or' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29932
diff changeset
  2092
    <addset
34010
72b5f4d53c58 revset: drop optimization about reordering "or" set elements
Jun Wu <quark@fb.com>
parents: 33868
diff changeset
  2093
      <spanset+ 0:2>,
72b5f4d53c58 revset: drop optimization about reordering "or" set elements
Jun Wu <quark@fb.com>
parents: 33868
diff changeset
  2094
      <baseset [2]>>>
29934
2c6a05b938d8 revset: fix order of nested 'or' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29932
diff changeset
  2095
  2
2c6a05b938d8 revset: fix order of nested 'or' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29932
diff changeset
  2096
  1
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2097
  0
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2098
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2099
 '_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
  2100
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2101
  $ 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
  2102
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2103
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2104
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2105
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2106
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2107
      (symbol '_intlist')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2108
      (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
  2109
  * optimized:
34020
37b82485097f revset: do not flip "and" arguments when optimizing
Jun Wu <quark@fb.com>
parents: 34011
diff changeset
  2110
  (andsmally
37b82485097f revset: do not flip "and" arguments when optimizing
Jun Wu <quark@fb.com>
parents: 34011
diff changeset
  2111
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2112
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2113
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2114
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2115
      (symbol '_intlist')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2116
      (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
  2117
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2118
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2119
    <spanset- 0:3>,
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2120
    <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
  2121
  2
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2122
  1
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2123
  0
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2124
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2125
  $ 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
  2126
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2127
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2128
      (symbol '_intlist')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2129
      (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
  2130
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2131
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2132
      (symbol '0')))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2133
  * optimized:
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
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2136
      (symbol '_intlist')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2137
      (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
  2138
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2139
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2140
      (symbol '0')))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2141
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2142
  <filteredset
29944
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2143
    <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
  2144
    <spanset- 0:3>>
29944
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2145
  0
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2146
  2
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2147
  1
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2148
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2149
 '_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
  2150
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2151
  $ 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
  2152
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2153
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2154
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2155
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2156
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2157
      (symbol '_hexlist')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2158
      (string '*'))) (glob)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2159
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2160
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2161
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2162
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2163
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2164
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2165
      (symbol '_hexlist')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2166
      (string '*'))) (glob)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2167
  * set:
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2168
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2169
    <spanset- 0:3>,
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2170
    <baseset [0, 1, 2]>>
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2171
  2
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2172
  1
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2173
  0
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2174
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2175
  $ 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
  2176
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2177
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2178
      (symbol '_hexlist')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2179
      (string '*')) (glob)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2180
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2181
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2182
      (symbol '0')))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2183
  * optimized:
34020
37b82485097f revset: do not flip "and" arguments when optimizing
Jun Wu <quark@fb.com>
parents: 34011
diff changeset
  2184
  (andsmally
37b82485097f revset: do not flip "and" arguments when optimizing
Jun Wu <quark@fb.com>
parents: 34011
diff changeset
  2185
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2186
      (symbol '_hexlist')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2187
      (string '*')) (glob)
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2188
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2189
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2190
      (symbol '0')))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2191
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2192
  <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
  2193
  0
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2194
  2
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2195
  1
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2196
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2197
 '_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
  2198
 matter:
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2199
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2200
  $ 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
  2201
  * optimized:
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2202
  (difference
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2203
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2204
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2205
      (symbol '0'))
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2206
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2207
      (symbol '_list')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2208
      (string '0\x001')))
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2209
  * set:
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2210
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2211
    <spanset- 0:3>,
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2212
    <not
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2213
      <baseset [0, 1]>>>
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2214
  2
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2215
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2216
  $ 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
  2217
  * optimized:
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2218
  (difference
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2219
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2220
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2221
      (symbol '0'))
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2222
    (and
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2223
      (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2224
        (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2225
        (symbol '2'))
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2226
      (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2227
        (symbol '_list')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2228
        (string '0\x001'))))
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2229
  * set:
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2230
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2231
    <spanset- 0:3>,
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2232
    <not
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2233
      <baseset [0, 1]>>>
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2234
  2
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2235
29943
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2236
 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
  2237
 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
  2238
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2239
  $ 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
  2240
  * optimized:
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2241
  (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2242
    (symbol 'present')
29943
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2243
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2244
      (symbol '_list')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2245
      (string '2\x000\x001')))
29943
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2246
  * set:
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2247
  <baseset [2, 0, 1]>
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2248
  2
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2249
  0
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2250
  1
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2251
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2252
  $ 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
  2253
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2254
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2255
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2256
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2257
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2258
      (symbol 'present')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2259
      (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2260
        (list
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2261
          (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2262
          (symbol '1')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2263
          (symbol '2')))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2264
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2265
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2266
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2267
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2268
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2269
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2270
      (symbol 'present')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2271
      (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2272
        (symbol '_list')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2273
        (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
  2274
  * set:
29943
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2275
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2276
    <spanset- 0:3>,
29943
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2277
    <baseset [0, 1, 2]>>
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2278
  2
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2279
  1
29943
80c86b9bb40b revset: forward ordering requirement to argument of present()
Yuya Nishihara <yuya@tcha.org>
parents: 29935
diff changeset
  2280
  0
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2281
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2282
 '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
  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 '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
  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 '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2288
      (symbol '2'))
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 'reverse')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2291
      (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2292
        (symbol 'all')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2293
        None)))
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2294
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2295
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2296
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2297
      (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2298
      (symbol '2'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2299
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2300
      (symbol 'reverse')
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 'all')
34011
1b28525e6698 revset: remove order information from tree (API)
Jun Wu <quark@fb.com>
parents: 34010
diff changeset
  2303
        None)))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2304
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2305
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2306
    <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
  2307
    <spanset+ 0:10>>
29945
89dbae952ec1 revset: make reverse() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29944
diff changeset
  2308
  0
89dbae952ec1 revset: make reverse() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29944
diff changeset
  2309
  1
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2310
  2
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2311
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2312
 '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
  2313
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2314
  $ 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
  2315
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2316
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2317
      (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2318
      (symbol '2'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2319
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2320
      (symbol 'sort')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2321
      (list
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2322
        (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2323
          (symbol 'all')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2324
          None)
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2325
        (negate
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2326
          (symbol 'rev')))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2327
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2328
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2329
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2330
      (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2331
      (symbol '2'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2332
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2333
      (symbol 'sort')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2334
      (list
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2335
        (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2336
          (symbol 'all')
34011
1b28525e6698 revset: remove order information from tree (API)
Jun Wu <quark@fb.com>
parents: 34010
diff changeset
  2337
          None)
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2338
        (string '-rev'))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2339
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2340
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2341
    <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
  2342
    <spanset+ 0:10>>
29946
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2343
  0
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2344
  1
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2345
  2
29946
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2346
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2347
 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
  2348
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2349
  $ log '0:2 & sort()'
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2350
  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
  2351
  [255]
285a8c3e53f2 revset: make sort() noop depending on ordering requirement (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29945
diff changeset
  2352
  $ 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
  2353
  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
  2354
  [255]
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2355
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2356
 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
  2357
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2358
  $ 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
  2359
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2360
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2361
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2362
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2363
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2364
      (symbol 'first')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2365
      (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2366
        (list
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2367
          (symbol '1')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2368
          (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2369
          (symbol '2')))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2370
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2371
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2372
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2373
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2374
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2375
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2376
      (symbol 'first')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2377
      (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2378
        (symbol '_list')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2379
        (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
  2380
  * set:
32800
3e6f9bff7e3f revset: filter first/last members by __and__ operation
Yuya Nishihara <yuya@tcha.org>
parents: 32799
diff changeset
  2381
  <filteredset
32820
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  2382
    <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
  2383
    <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
  2384
  1
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2385
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2386
  $ 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
  2387
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2388
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2389
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2390
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2391
    (not
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2392
      (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2393
        (symbol 'last')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2394
        (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2395
          (list
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2396
            (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2397
            (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2398
            (symbol '1'))))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2399
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2400
  (difference
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2401
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2402
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2403
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2404
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2405
      (symbol 'last')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2406
      (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2407
        (symbol '_list')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2408
        (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
  2409
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2410
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2411
    <spanset- 0:3>,
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2412
    <not
32820
653d60455dbe smartset: micro optimize baseset.slice() to use slice of list
Yuya Nishihara <yuya@tcha.org>
parents: 32819
diff changeset
  2413
      <baseset [1]>>>
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2414
  2
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2415
  0
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2416
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2417
 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
  2418
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2419
  $ 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
  2420
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2421
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2422
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2423
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2424
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2425
      (group
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 '1')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2429
            (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2430
            (symbol '2'))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2431
      (group
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2432
        (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2433
          (list
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2434
            (symbol '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2435
            (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2436
            (symbol '1'))))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2437
  * optimized:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2438
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2439
    (range
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2440
      (symbol '2')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2441
      (symbol '0'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2442
    (range
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2443
      (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2444
        (symbol '_list')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2445
        (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
  2446
      (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2447
        (symbol '_list')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2448
        (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
  2449
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2450
  <filteredset
32817
e962c70c0aad smartset: change repr of spanset to show revisions as half-open range
Yuya Nishihara <yuya@tcha.org>
parents: 32801
diff changeset
  2451
    <spanset- 0:3>,
29944
5f56a3b9675e revset: fix order of nested 'range' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29943
diff changeset
  2452
    <baseset [1]>>
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2453
  1
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2454
34011
1b28525e6698 revset: remove order information from tree (API)
Jun Wu <quark@fb.com>
parents: 34010
diff changeset
  2455
 '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
  2456
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2457
  $ 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
  2458
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2459
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2460
      (symbol 'contains')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2461
      (string 'glob:*'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2462
    (group
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2463
      (or
29929
b3845cab4ddc revset: wrap arguments of 'or' by 'list' node
Yuya Nishihara <yuya@tcha.org>
parents: 29924
diff changeset
  2464
        (list
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2465
          (symbol '2')
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 '1')))))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2468
  * optimized:
34020
37b82485097f revset: do not flip "and" arguments when optimizing
Jun Wu <quark@fb.com>
parents: 34011
diff changeset
  2469
  (andsmally
37b82485097f revset: do not flip "and" arguments when optimizing
Jun Wu <quark@fb.com>
parents: 34011
diff changeset
  2470
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2471
      (symbol 'contains')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2472
      (string 'glob:*'))
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2473
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2474
      (symbol '_list')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2475
      (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
  2476
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2477
  <filteredset
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2478
    <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
  2479
    <contains 'glob:*'>>
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2480
  0
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2481
  1
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2482
  2
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2483
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2484
 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
  2485
 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
  2486
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2487
  $ 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
  2488
  (and
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2489
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2490
      (symbol 'reverse')
29390
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 '0')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2498
          (symbol '2')
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
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
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 'reverse')
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2504
      (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2505
        (symbol 'contains')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2506
        (string 'glob:*')))
34020
37b82485097f revset: do not flip "and" arguments when optimizing
Jun Wu <quark@fb.com>
parents: 34011
diff changeset
  2507
    (func
34073
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2508
      (symbol '_list')
7bbc4e113e5f parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org>
parents: 34065
diff changeset
  2509
      (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
  2510
  * set:
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2511
  <filteredset
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2512
    <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
  2513
    <contains 'glob:*'>>
29935
e34cd85dc5b1 revset: fix order of nested '_(|int|hex)list' expression (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 29934
diff changeset
  2514
  2
29390
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2515
  1
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2516
  0
9349b4073c11 test-revset: show how inconsistent the ordering of compound expressions is
Yuya Nishihara <yuya@tcha.org>
parents: 29362
diff changeset
  2517
20717
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2518
test sort revset
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2519
--------------------------------------------
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2520
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2521
test when adding two unordered revsets
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2522
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2523
  $ log 'sort(keyword(issue) or modifies(b))'
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2524
  4
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2525
  6
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2526
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2527
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
  2528
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2529
  $ log 'sort(reverse(all()), -rev)'
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2530
  9
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2531
  8
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2532
  7
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2533
  6
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2534
  5
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2535
  4
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2536
  3
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2537
  2
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2538
  1
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2539
  0
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2540
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2541
test when sorting a reversed collection
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2542
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2543
  $ log 'sort(reverse(all()), rev)'
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2544
  0
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2545
  1
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2546
  2
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2547
  3
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2548
  4
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2549
  5
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2550
  6
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2551
  7
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2552
  8
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2553
  9
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
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2556
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
  2557
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2558
  $ 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
  2559
  2
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2560
  6
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2561
  8
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
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2564
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
  2565
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2566
  $ 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
  2567
  9
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2568
  8
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2569
  6
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2570
  2
da3124178fbb tests: added tests to test sort revset
Lucas Moscovicz <lmoscovicz@fb.com>
parents: 20613
diff changeset
  2571
29362
ec75d77df9d7 revset: fix crash on empty sort key
Yuya Nishihara <yuya@tcha.org>
parents: 29348
diff changeset
  2572
test empty sort key which is noop
ec75d77df9d7 revset: fix crash on empty sort key
Yuya Nishihara <yuya@tcha.org>
parents: 29348
diff changeset
  2573
ec75d77df9d7 revset: fix crash on empty sort key
Yuya Nishihara <yuya@tcha.org>
parents: 29348
diff changeset
  2574
  $ log 'sort(0 + 2 + 1, "")'
ec75d77df9d7 revset: fix crash on empty sort key
Yuya Nishihara <yuya@tcha.org>
parents: 29348
diff changeset
  2575
  0
ec75d77df9d7 revset: fix crash on empty sort key
Yuya Nishihara <yuya@tcha.org>
parents: 29348
diff changeset
  2576
  2
ec75d77df9d7 revset: fix crash on empty sort key
Yuya Nishihara <yuya@tcha.org>
parents: 29348
diff changeset
  2577
  1
ec75d77df9d7 revset: fix crash on empty sort key
Yuya Nishihara <yuya@tcha.org>
parents: 29348
diff changeset
  2578
29264
22625884b15c revset: factor out reverse flag of sort() key
Yuya Nishihara <yuya@tcha.org>
parents: 29139
diff changeset
  2579
test invalid sort keys
22625884b15c revset: factor out reverse flag of sort() key
Yuya Nishihara <yuya@tcha.org>
parents: 29139
diff changeset
  2580
22625884b15c revset: factor out reverse flag of sort() key
Yuya Nishihara <yuya@tcha.org>
parents: 29139
diff changeset
  2581
  $ log 'sort(all(), -invalid)'
22625884b15c revset: factor out reverse flag of sort() key
Yuya Nishihara <yuya@tcha.org>
parents: 29139
diff changeset
  2582
  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
  2583
  [255]
22625884b15c revset: factor out reverse flag of sort() key
Yuya Nishihara <yuya@tcha.org>
parents: 29139
diff changeset
  2584
29001
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2585
  $ cd ..
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2586
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2587
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
  2588
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2589
  $ 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
  2590
  $ cd sorting
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2591
  $ 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
  2592
  > [ui]
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2593
  > 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
  2594
  > [templatealias]
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2595
  > 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
  2596
  > EOF
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2597
  $ 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
  2598
  $ 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
  2599
  $ 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
  2600
  $ 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
  2601
  $ 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
  2602
  $ 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
  2603
  $ 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
  2604
  $ 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
  2605
  $ 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
  2606
  $ 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
  2607
  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
  2608
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2609
 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
  2610
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2611
  $ 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
  2612
  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
  2613
  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
  2614
  2 b111 m11  u12  111 3600
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2615
  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
  2616
  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
  2617
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2618
  $ 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
  2619
  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
  2620
  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
  2621
  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
  2622
  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
  2623
  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
  2624
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2625
 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
  2626
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2627
  $ 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
  2628
  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
  2629
  2 b111 m11  u12  111 3600
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2630
  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
  2631
  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
  2632
  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
  2633
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2634
  $ hg log -r 'sort(all(), -branch)'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2635
  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
  2636
  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
  2637
  2 b111 m11  u12  111 3600
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2638
  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
  2639
  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
  2640
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2641
  $ hg log -r 'sort(all(), desc)'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2642
  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
  2643
  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
  2644
  3 b112 m111 u11  120 0
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2645
  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
  2646
  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
  2647
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2648
  $ hg log -r 'sort(all(), -desc)'
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2649
  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
  2650
  4 b111 m112 u111 110 14400
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2651
  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
  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
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2655
  $ 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
  2656
  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
  2657
  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
  2658
  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
  2659
  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
  2660
  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
  2661
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2662
  $ 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
  2663
  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
  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
  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
  2666
  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
  2667
  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
  2668
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2669
 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
  2670
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2671
  $ 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
  2672
  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
  2673
  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
  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
  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
  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
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2678
  $ 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
  2679
  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
  2680
  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
  2681
  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
  2682
  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
  2683
  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
  2684
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2685
 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
  2686
 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
  2687
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2688
  $ 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
  2689
  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
  2690
  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
  2691
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2692
  $ 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
  2693
  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
  2694
  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
  2695
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2696
  $ 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
  2697
  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
  2698
  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
  2699
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2700
 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
  2701
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2702
  $ 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
  2703
  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
  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
  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
  2706
  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
  2707
  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
  2708
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2709
  $ 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
  2710
  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
  2711
  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
  2712
  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
  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
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2716
  $ 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
  2717
  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
  2718
  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
  2719
  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
  2720
  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
  2721
  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
  2722
29348
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2723
 toposort prioritises graph branches
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2724
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2725
  $ hg up 2
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2726
  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
  2727
  $ touch a
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2728
  $ hg addremove
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2729
  adding a
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2730
  $ hg ci -m 't1' -u 'tu' -d '130 0'
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2731
  created new head
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2732
  $ echo 'a' >> a
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2733
  $ hg ci -m 't2' -u 'tu' -d '130 0'
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2734
  $ hg book book1
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2735
  $ hg up 4
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2736
  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
  2737
  (leaving bookmark book1)
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2738
  $ touch a
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2739
  $ hg addremove
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2740
  adding a
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2741
  $ hg ci -m 't3' -u 'tu' -d '130 0'
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2742
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2743
  $ hg log -r 'sort(all(), topo)'
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2744
  7 b111 t3   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2745
  4 b111 m112 u111 110 14400
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2746
  3 b112 m111 u11  120 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2747
  6 b111 t2   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2748
  5 b111 t1   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2749
  2 b111 m11  u12  111 3600
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2750
  1 b11  m12  u111 112 7200
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2751
  0 b12  m111 u112 111 10800
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2752
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2753
  $ hg log -r 'sort(all(), -topo)'
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2754
  0 b12  m111 u112 111 10800
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2755
  1 b11  m12  u111 112 7200
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2756
  2 b111 m11  u12  111 3600
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2757
  5 b111 t1   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2758
  6 b111 t2   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2759
  3 b112 m111 u11  120 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2760
  4 b111 m112 u111 110 14400
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2761
  7 b111 t3   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2762
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2763
  $ hg log -r 'sort(all(), topo, topo.firstbranch=book1)'
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2764
  6 b111 t2   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2765
  5 b111 t1   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2766
  7 b111 t3   tu   130 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2767
  4 b111 m112 u111 110 14400
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2768
  3 b112 m111 u11  120 0
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2769
  2 b111 m11  u12  111 3600
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2770
  1 b11  m12  u111 112 7200
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2771
  0 b12  m111 u112 111 10800
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2772
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2773
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
  2774
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
  2775
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2776
  $ hg log -r 'sort(all(), "topo user")'
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2777
  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
  2778
  [255]
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2779
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2780
  $ hg log -r 'sort(all(), user, topo.firstbranch=book1)'
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2781
  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
  2782
  [255]
2188f170f5b6 revset: add new topographical sort
Martijn Pieters <mjpieters@fb.com>
parents: 29321
diff changeset
  2783
29766
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
  2784
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
  2785
5004ef47f437 revset: fix keyword arguments to go through optimization process
Yuya Nishihara <yuya@tcha.org>
parents: 29441
diff changeset
  2786
  $ 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
  2787
  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
  2788
29001
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2789
  $ cd ..
923fa9e06ea0 revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)
Yuya Nishihara <yuya@tcha.org>
parents: 28785
diff changeset
  2790
  $ cd repo
36685
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
  2791
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
  2792
test multiline revset with errors
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
  2793
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
  2794
  $ echo > multiline-revset
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
  2795
  $ echo '. +' >> multiline-revset
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
  2796
  $ echo '.^ +' >> multiline-revset
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
  2797
  $ 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
  2798
  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
  2799
  ( . + .^ +
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
  2800
            ^ here)
2a258985ffeb revsetlang: add a hint for more useful parse errors
Ryan McElroy <rmcelroy@fb.com>
parents: 36583
diff changeset
  2801
  [255]
37760
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2802
  $ 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
  2803
  * parsed:
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2804
  (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2805
    (symbol 'revset')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2806
    (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2807
      (symbol 'first')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2808
      (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2809
        (symbol 'rev')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2810
        (symbol '0'))))
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2811
  * expanded:
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2812
  (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2813
    (symbol 'revset')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2814
    (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2815
      (symbol 'first')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2816
      (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2817
        (symbol 'rev')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2818
        (symbol '0'))))
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2819
  * concatenated:
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2820
  (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2821
    (symbol 'revset')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2822
    (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2823
      (symbol 'first')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2824
      (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2825
        (symbol 'rev')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2826
        (symbol '0'))))
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2827
  * analyzed:
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2828
  (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2829
    (symbol 'first')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2830
    (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2831
      (symbol 'rev')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2832
      (symbol '0')))
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2833
  * optimized:
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2834
  (func
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2835
    (symbol 'first')
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 'rev')
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2838
      (symbol '0')))
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2839
  * set:
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2840
  <baseset+ [0]>
29eb4cafeeb8 revset: skip legacy lookup for revspec wrapped in 'revset(...)'
Boris Feld <boris.feld@octobus.net>
parents: 37674
diff changeset
  2841
  0