##// END OF EJS Templates
revset: add partial support for ancestor(wdir())...
revset: add partial support for ancestor(wdir()) It's easy, so let's make it happen. I'm not certain if 'wdir() &' should be required. ancestors(wdir()) works without it, but ancestor(wdir()) doesn't as of now. That's the issue of fullreposet.__contains__() vs __and__().

File last commit:

r38541:54d7aaa2 default
r38541:54d7aaa2 default
Show More
test-revset.t
2883 lines | 49.2 KiB | text/troff | Tads3Lexer
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ HGENCODING=utf-8
$ export HGENCODING
Pierre-Yves David
revset: avoid returning duplicates when returning ancestors...
r24940 $ cat > testrevset.py << EOF
> import mercurial.revset
>
> baseset = mercurial.revset.baseset
>
> def r3232(repo, subset, x):
> """"simple revset that return [3,2,3,2]
>
> revisions duplicated on purpose.
> """
> if 3 not in subset:
> if 2 in subset:
> return baseset([2,2])
> return baseset()
> return baseset([3,3,2,2])
>
Pulkit Goyal
py3: add b'' prefixes in test-revset.t...
r36397 > mercurial.revset.symbols[b'r3232'] = r3232
Pierre-Yves David
revset: avoid returning duplicates when returning ancestors...
r24940 > EOF
$ cat >> $HGRCPATH << EOF
> [extensions]
Jun Wu
revset: define successors revset...
r33377 > drawdag=$TESTDIR/drawdag.py
Pierre-Yves David
revset: avoid returning duplicates when returning ancestors...
r24940 > testrevset=$TESTTMP/testrevset.py
> EOF
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105
$ try() {
Alexander Solovyov
revset aliases
r14098 > hg debugrevspec --debug "$@"
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 > }
$ log() {
> hg log --template '{rev}\n' -r "$1"
> }
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 extension to build '_intlist()' and '_hexlist()', which is necessary because
these predicates use '\0' as a separator:
$ cat <<EOF > debugrevlistspec.py
> from __future__ import absolute_import
> from mercurial import (
> node as nodemod,
Yuya Nishihara
registrar: move cmdutil.command to registrar module (API)...
r32337 > registrar,
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 > revset,
Yuya Nishihara
revset: split language services to revsetlang module (API)...
r31024 > revsetlang,
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 > )
Yuya Nishihara
stringutil: promote smartset.prettyformat() to utility function...
r38280 > from mercurial.utils import stringutil
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 > cmdtable = {}
Yuya Nishihara
registrar: move cmdutil.command to registrar module (API)...
r32337 > command = registrar.command(cmdtable)
Pulkit Goyal
py3: make sure commands name are bytes in tests
r33097 > @command(b'debugrevlistspec',
Pulkit Goyal
py3: add b'' prefixes in test-revset.t...
r36397 > [(b'', b'optimize', None, b'print parsed tree after optimizing'),
> (b'', b'bin', None, b'unhexlify arguments')])
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 > def debugrevlistspec(ui, repo, fmt, *args, **opts):
> if opts['bin']:
> args = map(nodemod.bin, args)
Yuya Nishihara
revset: split language services to revsetlang module (API)...
r31024 > expr = revsetlang.formatspec(fmt, list(args))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 > if ui.verbose:
Martin von Zweigbergk
revset: use revsymbol() for checking if a symbol is valid...
r37368 > tree = revsetlang.parse(expr, lookup=revset.lookupfn(repo))
Augie Fackler
tests: add missing b prefixes and fix a %s to %d in test-revset.t...
r36600 > ui.note(revsetlang.prettyformat(tree), b"\n")
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 > if opts["optimize"]:
Yuya Nishihara
revset: split language services to revsetlang module (API)...
r31024 > opttree = revsetlang.optimize(revsetlang.analyze(tree))
Pulkit Goyal
py3: add b'' prefixes in test-revset.t...
r36397 > ui.note(b"* optimized:\n", revsetlang.prettyformat(opttree),
> b"\n")
Yuya Nishihara
revset: pass in lookup function instead of repo (API)...
r37692 > func = revset.match(ui, expr, lookup=revset.lookupfn(repo))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 > revs = func(repo)
> if ui.verbose:
Yuya Nishihara
stringutil: promote smartset.prettyformat() to utility function...
r38280 > ui.note(b"* set:\n", stringutil.prettyrepr(revs), b"\n")
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 > for c in revs:
Augie Fackler
tests: add missing b prefixes and fix a %s to %d in test-revset.t...
r36600 > ui.write(b"%d\n" % c)
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 > EOF
$ cat <<EOF >> $HGRCPATH
> [extensions]
> debugrevlistspec = $TESTTMP/debugrevlistspec.py
> EOF
$ trylist() {
> hg debugrevlistspec --debug "$@"
> }
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ hg init repo
$ cd repo
$ echo a > a
$ hg branch a
marked working directory as branch a
Matt Mackall
branch: warn on branching
r15615 (branches are permanent and global, did you want a bookmark?)
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ hg ci -Aqm0
$ echo b > b
$ hg branch b
marked working directory as branch b
$ hg ci -Aqm1
$ rm a
$ hg branch a-b-c-
marked working directory as branch a-b-c-
$ hg ci -Aqm2 -u Bob
Henrik Stuart
revset: add function for matching extra data (issue2767)
r16661 $ hg log -r "extra('branch', 'a-b-c-')" --template '{rev}\n'
2
$ hg log -r "extra('branch')" --template '{rev}\n'
0
1
2
Simon King
revset: add pattern matching to 'extra' revset expression
r16824 $ hg log -r "extra('branch', 're:a')" --template '{rev} {branch}\n'
0 a
2 a-b-c-
Henrik Stuart
revset: add function for matching extra data (issue2767)
r16661
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ hg co 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg branch +a+b+c+
marked working directory as branch +a+b+c+
$ hg ci -Aqm3
$ hg co 2 # interleave
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ echo bb > b
$ hg branch -- -a-b-c-
marked working directory as branch -a-b-c-
$ hg ci -Aqm4 -d "May 12 2005"
$ hg co 3
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
Adrian Buehlmann
test-revset: enable for Windows...
r16851 $ hg branch !a/b/c/
marked working directory as branch !a/b/c/
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ hg ci -Aqm"5 bug"
$ hg merge 4
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg branch _a_b_c_
marked working directory as branch _a_b_c_
$ hg ci -Aqm"6 issue619"
$ hg branch .a.b.c.
marked working directory as branch .a.b.c.
$ hg ci -Aqm7
$ hg branch all
marked working directory as branch all
$ hg co 4
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg branch é
Mads Kiilerich
tests: use (esc) for all non-ASCII test output
r12942 marked working directory as branch \xc3\xa9 (esc)
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ hg ci -Aqm9
$ hg tag -r6 1.0
Alexander Drozdov
revset: id() called with 40-byte strings should give the same results as for short strings...
r24904 $ hg bookmark -r6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105
$ hg clone --quiet -U -r 7 . ../remote1
$ hg clone --quiet -U -r 8 . ../remote2
$ echo "[paths]" >> .hg/hgrc
$ echo "default = ../remote1" >> .hg/hgrc
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 trivial
$ try 0:1
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '0')
(symbol '1'))
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset+ 0:2>
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 0
1
Yuya Nishihara
revset: parse nullary ":" operator as "0:tip"...
r25819 $ try --optimize :
(rangeall
None)
* optimized:
Yuya Nishihara
revset: do not transform range* operators in parsed tree...
r30803 (rangeall
Jun Wu
revset: remove order information from tree (API)...
r34013 None)
Yuya Nishihara
revset: parse nullary ":" operator as "0:tip"...
r25819 * set:
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset+ 0:10>
Yuya Nishihara
revset: parse nullary ":" operator as "0:tip"...
r25819 0
1
2
3
4
5
6
7
8
9
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 $ try 3::6
(dagrange
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '3')
(symbol '6'))
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
Pierre-Yves David
reachableroots: use baseset lazy sorting...
r26061 <baseset+ [3, 5, 6]>
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 3
5
6
$ try '0|1|2'
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '0')
(symbol '1')
(symbol '2')))
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
Yuya Nishihara
revset: optimize 'or' operation of trivial revisions to a list...
r25343 <baseset [0, 1, 2]>
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 0
1
2
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 names that should work without quoting
$ try a
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'a')
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<baseset [0]>
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 0
$ try b-a
Patrick Mezard
debugrevspec: pretty print output...
r16218 (minus
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'b')
(symbol 'a'))
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<filteredset
Yuya Nishihara
revset: add extra data to filteredset for better inspection...
r28423 <baseset [1]>,
<not
<baseset [0]>>>
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 1
$ try _a_b_c_
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '_a_b_c_')
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<baseset [6]>
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 6
$ try _a_b_c_-a
Patrick Mezard
debugrevspec: pretty print output...
r16218 (minus
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '_a_b_c_')
(symbol 'a'))
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<filteredset
Yuya Nishihara
revset: add extra data to filteredset for better inspection...
r28423 <baseset [6]>,
<not
<baseset [0]>>>
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 6
$ try .a.b.c.
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '.a.b.c.')
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<baseset [7]>
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 7
$ try .a.b.c.-a
Patrick Mezard
debugrevspec: pretty print output...
r16218 (minus
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '.a.b.c.')
(symbol 'a'))
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<filteredset
Yuya Nishihara
revset: add extra data to filteredset for better inspection...
r28423 <baseset [7]>,
<not
<baseset [0]>>>
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 7
Yuya Nishihara
debugrevspec: pass lookup function to visualize fallback mechanism...
r25901
names that should be caught by fallback mechanism
$ try -- '-a-b-c-'
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '-a-b-c-')
Yuya Nishihara
debugrevspec: pass lookup function to visualize fallback mechanism...
r25901 * set:
<baseset [4]>
4
$ log -a-b-c-
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 4
Yuya Nishihara
revset: port parsing rule of old-style ranges from scmutil.revrange()...
r25902 $ try '+a+b+c+'
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '+a+b+c+')
Yuya Nishihara
revset: port parsing rule of old-style ranges from scmutil.revrange()...
r25902 * set:
<baseset [3]>
3
$ try '+a+b+c+:'
(rangepost
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '+a+b+c+'))
Yuya Nishihara
revset: port parsing rule of old-style ranges from scmutil.revrange()...
r25902 * set:
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset+ 3:10>
Yuya Nishihara
revset: port parsing rule of old-style ranges from scmutil.revrange()...
r25902 3
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 4
Yuya Nishihara
revset: port parsing rule of old-style ranges from scmutil.revrange()...
r25902 5
6
7
8
9
$ try ':+a+b+c+'
(rangepre
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '+a+b+c+'))
Yuya Nishihara
revset: port parsing rule of old-style ranges from scmutil.revrange()...
r25902 * set:
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset+ 0:4>
Yuya Nishihara
revset: port parsing rule of old-style ranges from scmutil.revrange()...
r25902 0
1
2
3
$ try -- '-a-b-c-:+a+b+c+'
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '-a-b-c-')
(symbol '+a+b+c+'))
Yuya Nishihara
revset: port parsing rule of old-style ranges from scmutil.revrange()...
r25902 * set:
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset- 3:5>
Yuya Nishihara
revset: port parsing rule of old-style ranges from scmutil.revrange()...
r25902 4
3
$ log '-a-b-c-:+a+b+c+'
4
3
Matt Mackall
revrange: pass repo to revset parser...
r20781
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ try -- -a-b-c--a # complains
Patrick Mezard
debugrevspec: pretty print output...
r16218 (minus
(minus
(minus
(negate
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'a'))
(symbol 'b'))
(symbol 'c'))
Patrick Mezard
debugrevspec: pretty print output...
r16218 (negate
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'a')))
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 abort: unknown revision '-a'!
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ try é
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '\xc3\xa9')
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<baseset [9]>
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 9
Matt Mackall
revrange: pass repo to revset parser...
r20781 no quoting needed
$ log ::a-b-c-
0
1
2
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 quoting needed
$ try '"-a-b-c-"-a'
Patrick Mezard
debugrevspec: pretty print output...
r16218 (minus
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (string '-a-b-c-')
(symbol 'a'))
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<filteredset
Yuya Nishihara
revset: add extra data to filteredset for better inspection...
r28423 <baseset [4]>,
<not
<baseset [0]>>>
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 4
$ log '1 or 2'
1
2
$ log '1|2'
1
2
$ log '1 and 2'
$ log '1&2'
$ try '1&2|3' # precedence - and is higher
Patrick Mezard
debugrevspec: pretty print output...
r16218 (or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
(and
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '1')
(symbol '2'))
(symbol '3')))
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<addset
<baseset []>,
<baseset [3]>>
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 3
$ try '1|2&3'
Patrick Mezard
debugrevspec: pretty print output...
r16218 (or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '1')
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (and
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '3'))))
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<addset
<baseset [1]>,
<baseset []>>
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 1
$ try '1&2&3' # associativity
Patrick Mezard
debugrevspec: pretty print output...
r16218 (and
(and
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '1')
(symbol '2'))
(symbol '3'))
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<baseset []>
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ try '1|(2|3)'
Patrick Mezard
debugrevspec: pretty print output...
r16218 (or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '1')
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (group
(or
(list
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '3'))))))
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<addset
<baseset [1]>,
Yuya Nishihara
revset: optimize 'or' operation of trivial revisions to a list...
r25343 <baseset [2, 3]>>
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 1
2
3
$ log '1.0' # tag
6
$ log 'a' # branch
0
$ log '2785f51ee'
0
$ log 'date(2005)'
4
$ log 'date(this is a test)'
hg: parse error at 10: unexpected token: symbol
Ryan McElroy
revsetlang: add a hint for more useful parse errors...
r36703 (date(this is a test)
^ here)
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'date()'
Benoit Boissinot
revset: use 'requires' instead of 'wants' in error message
r12736 hg: parse error: date requires a string
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'date'
Jordi Gutiérrez Hermoso
revset: don't error out if tokens parse as existing symbols...
r24932 abort: unknown revision 'date'!
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'date('
hg: parse error at 5: not a prefix: end
Ryan McElroy
revsetlang: add a hint for more useful parse errors...
r36703 (date(
^ here)
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Yuya Nishihara
revset: handle error of string unescaping
r26232 $ log 'date("\xy")'
Augie Fackler
tests: add some re and globs for test-revset on python3...
r36601 hg: parse error: invalid \x escape* (glob)
Yuya Nishihara
revset: handle error of string unescaping
r26232 [255]
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'date(tip)'
Boris Feld
util: raise ParseError when parsing dates (BC)...
r32462 hg: parse error: invalid date: 'tip'
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Jordi Gutiérrez Hermoso
revset: don't error out if tokens parse as existing symbols...
r24932 $ log '0:date'
abort: unknown revision 'date'!
[255]
$ log '::"date"'
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 abort: unknown revision 'date'!
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Jordi Gutiérrez Hermoso
revset: don't error out if tokens parse as existing symbols...
r24932 $ hg book date -r 4
$ log '0:date'
0
1
2
3
4
$ log '::date'
0
1
2
4
$ log '::"date"'
0
1
2
4
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'date(2005) and 1::'
4
Jordi Gutiérrez Hermoso
revset: don't error out if tokens parse as existing symbols...
r24932 $ hg book -d date
Yuya Nishihara
revset: check invalid function syntax "func-name"() explicitly...
r29441 function name should be a symbol
$ log '"date"(2005)'
hg: parse error: not a symbol
[255]
Yuya Nishihara
revset: add parsing rule for key=value pair...
r25704 keyword arguments
Yuya Nishihara
revset: port extra() to support keyword arguments...
r25706 $ log 'extra(branch, value=a)'
0
$ log 'extra(branch, a, b)'
Yuya Nishihara
parser: verify excessive number of args excluding kwargs in buildargsdict()...
r31920 hg: parse error: extra takes at most 2 positional arguments
Yuya Nishihara
revset: port extra() to support keyword arguments...
r25706 [255]
$ log 'extra(a, label=b)'
hg: parse error: extra got multiple values for keyword argument 'label'
[255]
$ log 'extra(label=branch, default)'
hg: parse error: extra got an invalid argument
[255]
$ log 'extra(branch, foo+bar=baz)'
hg: parse error: extra got an invalid argument
[255]
$ log 'extra(unknown=branch)'
hg: parse error: extra got an unexpected keyword argument 'unknown'
[255]
Yuya Nishihara
revset: add parsing rule for key=value pair...
r25704 $ try 'foo=bar|baz'
(keyvalue
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'foo')
Yuya Nishihara
revset: add parsing rule for key=value pair...
r25704 (or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'bar')
(symbol 'baz'))))
Yuya Nishihara
revset: add parsing rule for key=value pair...
r25704 hg: parse error: can't use a key-value pair in this context
[255]
Yuya Nishihara
revset: fix keyword arguments to go through optimization process...
r29766 right-hand side should be optimized recursively
$ try --optimize 'foo=(not public())'
(keyvalue
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'foo')
Yuya Nishihara
revset: fix keyword arguments to go through optimization process...
r29766 (group
(not
(func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'public')
Yuya Nishihara
revset: fix keyword arguments to go through optimization process...
r29766 None))))
* optimized:
(keyvalue
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'foo')
Yuya Nishihara
revset: fix keyword arguments to go through optimization process...
r29766 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '_notpublic')
Jun Wu
revset: remove order information from tree (API)...
r34013 None))
Yuya Nishihara
revset: fix keyword arguments to go through optimization process...
r29766 hg: parse error: can't use a key-value pair in this context
[255]
Yuya Nishihara
revset: add experimental relation and subscript operators...
r33416 relation-subscript operator has the highest binding strength (as function call):
$ hg debugrevspec -p parsed 'tip:tip^#generations[-1]'
* parsed:
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'tip')
Yuya Nishihara
revset: add experimental relation and subscript operators...
r33416 (relsubscript
(parentpost
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'tip'))
(symbol 'generations')
Yuya Nishihara
revset: add experimental relation and subscript operators...
r33416 (negate
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '1'))))
Yuya Nishihara
revset: add experimental ancestors/descendants relation subscript...
r33417 9
8
7
6
5
4
Yuya Nishihara
revset: add experimental relation and subscript operators...
r33416
$ hg debugrevspec -p parsed --no-show-revs 'not public()#generations[0]'
* parsed:
(not
(relsubscript
(func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'public')
Yuya Nishihara
revset: add experimental relation and subscript operators...
r33416 None)
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'generations')
(symbol '0')))
Yuya Nishihara
revset: add experimental relation and subscript operators...
r33416
left-hand side of relation-subscript operator should be optimized recursively:
$ hg debugrevspec -p analyzed -p optimized --no-show-revs \
> '(not public())#generations[0]'
* analyzed:
(relsubscript
(not
(func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'public')
Jun Wu
revset: remove order information from tree (API)...
r34013 None))
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'generations')
(symbol '0'))
Yuya Nishihara
revset: add experimental relation and subscript operators...
r33416 * optimized:
(relsubscript
(func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '_notpublic')
Jun Wu
revset: remove order information from tree (API)...
r34013 None)
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'generations')
(symbol '0'))
Yuya Nishihara
revset: add experimental relation and subscript operators...
r33416
resolution of subscript and relation-subscript ternary operators:
$ hg debugrevspec -p analyzed 'tip[0]'
* analyzed:
(subscript
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'tip')
(symbol '0'))
Yuya Nishihara
revset: add experimental relation and subscript operators...
r33416 hg: parse error: can't use a subscript in this context
[255]
$ hg debugrevspec -p analyzed 'tip#rel[0]'
* analyzed:
(relsubscript
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'tip')
(symbol 'rel')
(symbol '0'))
Yuya Nishihara
revset: add experimental ancestors/descendants relation subscript...
r33417 hg: parse error: unknown identifier: rel
Yuya Nishihara
revset: add experimental relation and subscript operators...
r33416 [255]
$ hg debugrevspec -p analyzed '(tip#rel)[0]'
* analyzed:
(subscript
(relation
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'tip')
(symbol 'rel'))
(symbol '0'))
Yuya Nishihara
revset: add experimental relation and subscript operators...
r33416 hg: parse error: can't use a subscript in this context
[255]
$ hg debugrevspec -p analyzed 'tip#rel[0][1]'
* analyzed:
(subscript
(relsubscript
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'tip')
(symbol 'rel')
(symbol '0'))
(symbol '1'))
Yuya Nishihara
revset: add experimental relation and subscript operators...
r33416 hg: parse error: can't use a subscript in this context
[255]
$ hg debugrevspec -p analyzed 'tip#rel0#rel1[1]'
* analyzed:
(relsubscript
(relation
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'tip')
(symbol 'rel0'))
(symbol 'rel1')
(symbol '1'))
Yuya Nishihara
revset: add experimental ancestors/descendants relation subscript...
r33417 hg: parse error: unknown identifier: rel1
Yuya Nishihara
revset: add experimental relation and subscript operators...
r33416 [255]
$ hg debugrevspec -p analyzed 'tip#rel0[0]#rel1[1]'
* analyzed:
(relsubscript
(relsubscript
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'tip')
(symbol 'rel0')
(symbol '0'))
(symbol 'rel1')
(symbol '1'))
Yuya Nishihara
revset: add experimental ancestors/descendants relation subscript...
r33417 hg: parse error: unknown identifier: rel1
Yuya Nishihara
revset: add experimental relation and subscript operators...
r33416 [255]
parse errors of relation, subscript and relation-subscript operators:
$ hg debugrevspec '[0]'
hg: parse error at 0: not a prefix: [
Ryan McElroy
revsetlang: add a hint for more useful parse errors...
r36703 ([0]
^ here)
Yuya Nishihara
revset: add experimental relation and subscript operators...
r33416 [255]
$ hg debugrevspec '.#'
hg: parse error at 2: not a prefix: end
Ryan McElroy
revsetlang: add a hint for more useful parse errors...
r36703 (.#
^ here)
Yuya Nishihara
revset: add experimental relation and subscript operators...
r33416 [255]
$ hg debugrevspec '#rel'
hg: parse error at 0: not a prefix: #
Ryan McElroy
revsetlang: add a hint for more useful parse errors...
r36703 (#rel
^ here)
Yuya Nishihara
revset: add experimental relation and subscript operators...
r33416 [255]
$ hg debugrevspec '.#rel[0'
hg: parse error at 7: unexpected token: end
Ryan McElroy
revsetlang: add a hint for more useful parse errors...
r36703 (.#rel[0
^ here)
Yuya Nishihara
revset: add experimental relation and subscript operators...
r33416 [255]
$ hg debugrevspec '.]'
hg: parse error at 1: invalid token
Ryan McElroy
revsetlang: add a hint for more useful parse errors...
r36703 (.]
^ here)
Yuya Nishihara
revset: add experimental relation and subscript operators...
r33416 [255]
Yuya Nishihara
revset: add experimental ancestors/descendants relation subscript...
r33417 $ hg debugrevspec '.#generations[a]'
hg: parse error: relation subscript must be an integer
[255]
$ hg debugrevspec '.#generations[1-2]'
hg: parse error: relation subscript must be an integer
[255]
Yuya Nishihara
debugrevspec: add option to print parsed tree at given stages...
r29913 parsed tree at stages:
$ hg debugrevspec -p all '()'
* parsed:
(group
None)
* expanded:
(group
None)
* concatenated:
(group
None)
* analyzed:
None
* optimized:
None
hg: parse error: missing argument
[255]
Yuya Nishihara
debugrevspec: add option to skip optimize() and evaluate unoptimized tree...
r29923 $ hg debugrevspec --no-optimized -p all '()'
* parsed:
(group
None)
* expanded:
(group
None)
* concatenated:
(group
None)
* analyzed:
None
hg: parse error: missing argument
[255]
Yuya Nishihara
debugrevspec: add option to print parsed tree at given stages...
r29913 $ hg debugrevspec -p parsed -p analyzed -p optimized '(0|1)-1'
* parsed:
(minus
(group
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '0')
(symbol '1'))))
(symbol '1'))
Yuya Nishihara
debugrevspec: add option to print parsed tree at given stages...
r29913 * analyzed:
(and
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '0')
(symbol '1')))
Yuya Nishihara
debugrevspec: add option to print parsed tree at given stages...
r29913 (not
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '1')))
Yuya Nishihara
debugrevspec: add option to print parsed tree at given stages...
r29913 * optimized:
(difference
(func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '_list')
(string '0\x001'))
(symbol '1'))
Yuya Nishihara
debugrevspec: add option to print parsed tree at given stages...
r29913 0
$ hg debugrevspec -p unknown '0'
abort: invalid stage name: unknown
[255]
$ hg debugrevspec -p all --optimize '0'
abort: cannot use --optimize with --show-stage
[255]
Yuya Nishihara
debugrevspec: add option to verify optimized result...
r29924 verify optimized tree:
$ hg debugrevspec --verify '0|1'
$ hg debugrevspec --verify -v -p analyzed -p optimized 'r3232() & 2'
* analyzed:
(and
(func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'r3232')
Jun Wu
revset: remove order information from tree (API)...
r34013 None)
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2'))
Yuya Nishihara
debugrevspec: add option to verify optimized result...
r29924 * optimized:
Jun Wu
revset: do not flip "and" arguments when optimizing...
r34022 (andsmally
Yuya Nishihara
debugrevspec: add option to verify optimized result...
r29924 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'r3232')
Jun Wu
revset: do not flip "and" arguments when optimizing...
r34022 None)
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2'))
Yuya Nishihara
debugrevspec: add option to verify optimized result...
r29924 * analyzed set:
<baseset [2]>
* optimized set:
<baseset [2, 2]>
--- analyzed
+++ optimized
2
+2
[1]
$ hg debugrevspec --no-optimized --verify-optimized '0'
abort: cannot use --verify-optimized with --no-optimized
[255]
Jordi Gutiérrez Hermoso
revset: don't error out if tokens parse as existing symbols...
r24932 Test that symbols only get parsed as functions if there's an opening
parenthesis.
$ hg book only -r 9
$ log 'only(only)' # Outer "only" is a function, inner "only" is the bookmark
8
9
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105
Yuya Nishihara
revset: do not rewrite ':y' to '0:y' (issue5385)...
r30044 ':y' behaves like '0:y', but can't be rewritten as such since the revision '0'
may be hidden (issue5385)
$ try -p parsed -p analyzed ':'
* parsed:
(rangeall
None)
* analyzed:
Yuya Nishihara
revset: do not transform range* operators in parsed tree...
r30803 (rangeall
Jun Wu
revset: remove order information from tree (API)...
r34013 None)
Yuya Nishihara
revset: do not rewrite ':y' to '0:y' (issue5385)...
r30044 * set:
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset+ 0:10>
Yuya Nishihara
revset: do not rewrite ':y' to '0:y' (issue5385)...
r30044 0
1
2
3
4
5
6
7
8
9
$ try -p analyzed ':1'
* analyzed:
(rangepre
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '1'))
Yuya Nishihara
revset: do not rewrite ':y' to '0:y' (issue5385)...
r30044 * set:
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset+ 0:2>
Yuya Nishihara
revset: do not rewrite ':y' to '0:y' (issue5385)...
r30044 0
1
$ try -p analyzed ':(1|2)'
* analyzed:
(rangepre
(or
(list
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '1')
(symbol '2'))))
Yuya Nishihara
revset: do not rewrite ':y' to '0:y' (issue5385)...
r30044 * set:
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset+ 0:3>
Yuya Nishihara
revset: do not rewrite ':y' to '0:y' (issue5385)...
r30044 0
1
2
$ try -p analyzed ':(1&2)'
* analyzed:
(rangepre
(and
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '1')
(symbol '2')))
Yuya Nishihara
revset: do not rewrite ':y' to '0:y' (issue5385)...
r30044 * set:
<baseset []>
Yuya Nishihara
revset: parse x^:: as (x^):: (issue5764)...
r35556 infix/suffix resolution of ^ operator (issue2884, issue5764):
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768
x^:y means (x^):y
Yuya Nishihara
revset: resolve ambiguity of x^:y before alias expansion...
r29769 $ try '1^:2'
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 (range
(parentpost
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '1'))
(symbol '2'))
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 * set:
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset+ 0:3>
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 0
1
2
Yuya Nishihara
revset: resolve ambiguity of x^:y before alias expansion...
r29769 $ try '1^::2'
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 (dagrange
(parentpost
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '1'))
(symbol '2'))
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 * set:
<baseset+ [0, 1, 2]>
0
1
2
Yuya Nishihara
revset: parse x^:: as (x^):: (issue5764)...
r35556 $ try '1^..2'
(dagrange
(parentpost
(symbol '1'))
(symbol '2'))
* set:
<baseset+ [0, 1, 2]>
0
1
2
Yuya Nishihara
revset: also parse x^: as (x^):...
r29770 $ try '9^:'
(rangepost
(parentpost
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '9')))
Yuya Nishihara
revset: also parse x^: as (x^):...
r29770 * set:
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset+ 8:10>
Yuya Nishihara
revset: also parse x^: as (x^):...
r29770 8
9
Yuya Nishihara
revset: parse x^:: as (x^):: (issue5764)...
r35556 $ try '9^::'
(dagrangepost
(parentpost
(symbol '9')))
* set:
<generatorsetasc+>
8
9
$ try '9^..'
(dagrangepost
(parentpost
(symbol '9')))
* set:
<generatorsetasc+>
8
9
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 x^:y should be resolved before omitting group operators
Yuya Nishihara
revset: resolve ambiguity of x^:y before alias expansion...
r29769 $ try '1^(:2)'
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 (parent
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '1')
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 (group
(rangepre
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2'))))
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 hg: parse error: ^ expects a number 0, 1, or 2
[255]
x^:y should be resolved recursively
Yuya Nishihara
revset: resolve ambiguity of x^:y before alias expansion...
r29769 $ try 'sort(1^:2)'
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'sort')
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 (range
(parentpost
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '1'))
(symbol '2')))
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 * set:
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset+ 0:3>
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 0
1
2
Yuya Nishihara
revset: resolve ambiguity of x^:y before alias expansion...
r29769 $ try '(3^:4)^:2'
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 (range
(parentpost
Yuya Nishihara
revset: resolve ambiguity of x^:y before alias expansion...
r29769 (group
(range
(parentpost
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '3'))
(symbol '4'))))
(symbol '2'))
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 * set:
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset+ 0:3>
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 0
1
2
Yuya Nishihara
revset: resolve ambiguity of x^:y before alias expansion...
r29769 $ try '(3^::4)^::2'
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 (dagrange
(parentpost
Yuya Nishihara
revset: resolve ambiguity of x^:y before alias expansion...
r29769 (group
(dagrange
(parentpost
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '3'))
(symbol '4'))))
(symbol '2'))
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 * set:
<baseset+ [0, 1, 2]>
0
1
2
Yuya Nishihara
revset: also parse x^: as (x^):...
r29770 $ try '(9^:)^:'
(rangepost
(parentpost
(group
(rangepost
(parentpost
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '9'))))))
Yuya Nishihara
revset: also parse x^: as (x^):...
r29770 * set:
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset+ 4:10>
Yuya Nishihara
revset: also parse x^: as (x^):...
r29770 4
5
6
7
8
9
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 x^ in alias should also be resolved
Yuya Nishihara
revset: resolve ambiguity of x^:y before alias expansion...
r29769 $ try 'A' --config 'revsetalias.A=1^:2'
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'A')
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 * expanded:
(range
(parentpost
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '1'))
(symbol '2'))
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 * set:
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset+ 0:3>
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 0
1
2
Yuya Nishihara
revset: resolve ambiguity of x^:y before alias expansion...
r29769 $ try 'A:2' --config 'revsetalias.A=1^'
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 (range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'A')
(symbol '2'))
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 * expanded:
(range
(parentpost
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '1'))
(symbol '2'))
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 * set:
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset+ 0:3>
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 0
1
2
but not beyond the boundary of alias expansion, because the resolution should
be made at the parsing stage
Yuya Nishihara
revset: resolve ambiguity of x^:y before alias expansion...
r29769 $ try '1^A' --config 'revsetalias.A=:2'
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 (parent
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '1')
(symbol 'A'))
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 * expanded:
(parent
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '1')
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 (rangepre
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')))
Yuya Nishihara
revset: resolve ambiguity of x^:y before alias expansion...
r29769 hg: parse error: ^ expects a number 0, 1, or 2
[255]
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768
Yuya Nishihara
revset: parse x^:: as (x^):: (issue5764)...
r35556 '::' itself isn't a valid expression
$ try '::'
(dagrangeall
None)
hg: parse error: can't use '::' in this context
[255]
Paul Cavallaro
revset: change ancestor to accept 0 or more arguments (issue3750)...
r18536 ancestor can accept 0 or more arguments
$ log 'ancestor()'
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'ancestor(1)'
Paul Cavallaro
revset: change ancestor to accept 0 or more arguments (issue3750)...
r18536 1
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'ancestor(4,5)'
1
$ log 'ancestor(4,5) and 4'
Paul Cavallaro
revset: change ancestor to accept 0 or more arguments (issue3750)...
r18536 $ log 'ancestor(0,0,1,3)'
0
$ log 'ancestor(3,1,5,3,5,1)'
1
$ log 'ancestor(0,1,3,5)'
0
$ log 'ancestor(1,2,3,4,5)'
1
Pierre-Yves David
revset: avoid returning duplicates when returning ancestors...
r24940
test ancestors
Yuya Nishihara
revset: add depth limit to ancestors()...
r33002 $ hg log -G -T '{rev}\n' --config experimental.graphshorten=True
@ 9
o 8
| o 7
| o 6
|/|
| o 5
o | 4
| o 3
o | 2
|/
o 1
o 0
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'ancestors(5)'
0
1
3
5
Paul Cavallaro
revset: change ancestor to accept 0 or more arguments (issue3750)...
r18536 $ log 'ancestor(ancestors(5))'
0
Pierre-Yves David
revset: avoid returning duplicates when returning ancestors...
r24940 $ log '::r3232()'
0
1
2
3
Yuya Nishihara
revset: add depth limit to ancestors()...
r33002 test ancestors with depth limit
(depth=0 selects the node itself)
$ log 'reverse(ancestors(9, depth=0))'
9
(interleaved: '4' would be missing if heap queue were higher depth first)
$ log 'reverse(ancestors(8:9, depth=1))'
9
8
4
(interleaved: '2' would be missing if heap queue were higher depth first)
$ log 'reverse(ancestors(7+8, depth=2))'
8
7
6
5
4
2
(walk example above by separate queries)
$ log 'reverse(ancestors(8, depth=2)) + reverse(ancestors(7, depth=2))'
8
4
2
7
6
5
Yuya Nishihara
revset: add startdepth limit to ancestors() as internal option...
r33003 (walk 2nd and 3rd ancestors)
$ log 'reverse(ancestors(7, depth=3, startdepth=2))'
5
4
3
2
(interleaved: '4' would be missing if higher-depth ancestors weren't scanned)
$ log 'reverse(ancestors(7+8, depth=2, startdepth=2))'
5
4
2
(note that 'ancestors(x, depth=y, startdepth=z)' does not identical to
'ancestors(x, depth=y) - ancestors(x, depth=z-1)' because a node may have
multiple depths)
$ log 'reverse(ancestors(7+8, depth=2) - ancestors(7+8, depth=1))'
5
2
Yuya Nishihara
revset: add depth limit to ancestors()...
r33002 test bad arguments passed to ancestors()
$ log 'ancestors(., depth=-1)'
hg: parse error: negative depth
[255]
$ log 'ancestors(., depth=foo)'
hg: parse error: ancestors expects an integer depth
[255]
Yuya Nishihara
test-revset: add a few more tests of descendants()...
r33074 test descendants
$ hg log -G -T '{rev}\n' --config experimental.graphshorten=True
@ 9
o 8
| o 7
| o 6
|/|
| o 5
o | 4
| o 3
o | 2
|/
o 1
o 0
(null is ultimate root and has optimized path)
$ log 'null:4 & descendants(null)'
-1
0
1
2
3
4
(including merge)
$ log ':8 & descendants(2)'
2
4
6
7
8
(multiple roots)
$ log ':8 & descendants(2+5)'
2
4
5
6
7
8
Yuya Nishihara
revset: add depth limit to descendants() (issue5374)...
r33080 test descendants with depth limit
(depth=0 selects the node itself)
$ log 'descendants(0, depth=0)'
0
$ log 'null: & descendants(null, depth=0)'
-1
(p2 = null should be ignored)
$ log 'null: & descendants(null, depth=2)'
-1
0
1
(multiple paths: depth(6) = (2, 3))
$ log 'descendants(1+3, depth=2)'
1
2
3
4
5
6
(multiple paths: depth(5) = (1, 2), depth(6) = (2, 3))
$ log 'descendants(3+1, depth=2, startdepth=2)'
4
5
6
(multiple depths: depth(6) = (0, 2, 4), search for depth=2)
$ log 'descendants(0+3+6, depth=3, startdepth=1)'
1
2
3
4
5
6
7
(multiple depths: depth(6) = (0, 4), no match)
$ log 'descendants(0+6, depth=3, startdepth=1)'
1
2
3
4
5
7
Yuya Nishihara
revset: add experimental ancestors/descendants relation subscript...
r33417 test ancestors/descendants relation subscript:
$ log 'tip#generations[0]'
9
$ log '.#generations[-1]'
8
$ log '.#g[(-1)]'
8
$ hg debugrevspec -p parsed 'roots(:)#g[2]'
* parsed:
(relsubscript
(func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'roots')
Yuya Nishihara
revset: add experimental ancestors/descendants relation subscript...
r33417 (rangeall
None))
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'g')
(symbol '2'))
Yuya Nishihara
revset: add experimental ancestors/descendants relation subscript...
r33417 2
3
Yuya Nishihara
revset: add depth limit to ancestors()...
r33002 test author
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'author(bob)'
2
Simon King
revset: add pattern matching to the 'user' revset expression
r16823 $ log 'author("re:bob|test")'
0
1
2
3
4
5
6
7
8
9
Matt Harbison
revset: stop lowercasing the regex pattern for 'author'...
r30782 $ log 'author(r"re:\S")'
0
1
2
3
4
5
6
7
8
9
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'branch(é)'
8
9
Simon King
revset: add pattern matching to 'branch' revset expression
r16821 $ log 'branch(a)'
0
$ hg log -r 'branch("re:a")' --template '{rev} {branch}\n'
0 a
2 a-b-c-
3 +a+b+c+
4 -a-b-c-
Adrian Buehlmann
test-revset: enable for Windows...
r16851 5 !a/b/c/
Simon King
revset: add pattern matching to 'branch' revset expression
r16821 6 _a_b_c_
7 .a.b.c.
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'children(ancestor(4,5))'
2
3
Yuya Nishihara
revset: make children() not look at p2 if null (issue5439)...
r30699
$ log 'children(4)'
6
8
$ log 'children(null)'
0
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'closed()'
$ log 'contains(a)'
0
1
3
5
FUJIWARA Katsunori
revset: make default kind of pattern for "contains()" rooted at cwd...
r20286 $ log 'contains("../repo/a")'
0
1
3
5
Thomas Arendsen Hein
revset: add desc(string) to search in commit messages...
r14650 $ log 'desc(B)'
5
Matt Harbison
revset: add regular expression support to 'desc'...
r30783 $ hg log -r 'desc(r"re:S?u")' --template "{rev} {desc|firstline}\n"
5 5 bug
6 6 issue619
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'descendants(2 or 3)'
2
3
4
5
6
7
8
9
Patrick Mezard
graphlog: correctly handle calls in subdirectories
r16411 $ log 'file("b*")'
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 1
4
FUJIWARA Katsunori
revset: use "canonpath()" for "filelog()" pattern without explicit kind...
r20288 $ log 'filelog("b")'
1
4
$ log 'filelog("../repo/b")'
1
4
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'follow()'
0
1
2
4
8
9
$ log 'grep("issue\d+")'
6
Martin Geisler
merge with stable
r12321 $ try 'grep("(")' # invalid regular expression
Patrick Mezard
debugrevspec: pretty print output...
r16218 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'grep')
(string '('))
Augie Fackler
tests: add some re and globs for test-revset on python3...
r36601 hg: parse error: invalid match pattern: (unbalanced parenthesis|missing \),.*) (re)
Martin Geisler
merge with stable
r12321 [255]
Brodie Rao
revset: support raw string literals...
r12408 $ try 'grep("\bissue\d+")'
Patrick Mezard
debugrevspec: pretty print output...
r16218 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'grep')
(string '\x08issue\\d+'))
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<filteredset
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <fullreposet+ 0:10>,
Yuya Nishihara
revset: add inspection data to all filter() calls...
r28424 <grep '\x08issue\\d+'>>
Brodie Rao
revset: support raw string literals...
r12408 $ try 'grep(r"\bissue\d+")'
Patrick Mezard
debugrevspec: pretty print output...
r16218 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'grep')
(string '\\bissue\\d+'))
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<filteredset
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <fullreposet+ 0:10>,
Yuya Nishihara
revset: add inspection data to all filter() calls...
r28424 <grep '\\bissue\\d+'>>
Brodie Rao
revset: support raw string literals...
r12408 6
$ try 'grep(r"\")'
hg: parse error at 7: unterminated string
Ryan McElroy
revsetlang: add a hint for more useful parse errors...
r36703 (grep(r"\")
^ here)
Brodie Rao
revset: support raw string literals...
r12408 [255]
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'head()'
0
1
2
3
4
5
6
7
9
Yuya Nishihara
test-revset: show that order of heads() can be wrong
r38497
Test heads
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'heads(6::)'
7
Yuya Nishihara
test-revset: show that order of heads() can be wrong
r38497
heads() can be computed in subset '9:'
$ hg debugrevspec -s '9: & heads(all())'
* set:
<filteredset
<filteredset
<baseset [9]>,
<spanset+ 0:10>>,
<not
<filteredset
<baseset [9]>, set([0, 1, 2, 3, 4, 5, 6, 8])>>>
9
Yuya Nishihara
revset: fix heads() order to always follow the input set (BC)...
r38498 but should follow the order of the subset
Yuya Nishihara
test-revset: show that order of heads() can be wrong
r38497
$ log 'heads(all())'
7
9
$ log 'heads(tip:0)'
Yuya Nishihara
revset: fix heads() order to always follow the input set (BC)...
r38498 7
Yuya Nishihara
test-revset: show that order of heads() can be wrong
r38497 9
$ log 'tip:0 & heads(all())'
9
7
$ log 'tip:0 & heads(0:tip)'
Yuya Nishihara
revset: fix heads() order to always follow the input set (BC)...
r38498 9
Yuya Nishihara
test-revset: show that order of heads() can be wrong
r38497 7
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'keyword(issue)'
6
Alexander Plavin
revset: fix wrong keyword() behaviour for strings with spaces...
r19706 $ log 'keyword("test a")'
Yuya Nishihara
revset: fix order of last() n members where n > 1 (BC)...
r32797
Test first (=limit) and last
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'limit(head(), 1)'
0
Yuya Nishihara
revset: add optional offset argument to limit() predicate...
r26638 $ log 'limit(author("re:bob|test"), 3, 5)'
5
6
7
$ log 'limit(author("re:bob|test"), offset=6)'
6
$ log 'limit(author("re:bob|test"), offset=10)'
$ log 'limit(all(), 1, -1)'
hg: parse error: negative offset
[255]
Yuya Nishihara
revset: reject negative number to select first/last n members...
r32798 $ log 'limit(all(), -1)'
hg: parse error: negative number to select
[255]
$ log 'limit(all(), 0)'
$ log 'last(all(), -1)'
hg: parse error: negative number to select
[255]
Yuya Nishihara
revset: fix order of last() n members where n > 1 (BC)...
r32797 $ log 'last(all(), 0)'
$ log 'last(all(), 1)'
9
$ log 'last(all(), 2)'
8
9
Yuya Nishihara
smartset: extract method to slice abstractsmartset...
r32819 Test smartset.slice() by first/last()
(using unoptimized set, filteredset as example)
$ hg debugrevspec --no-show-revs -s '0:7 & branch("re:")'
* set:
<filteredset
<spanset+ 0:8>,
<branch 're:'>>
$ log 'limit(0:7 & branch("re:"), 3, 4)'
4
5
6
$ log 'limit(7:0 & branch("re:"), 3, 4)'
3
2
1
$ log 'last(0:7 & branch("re:"), 2)'
6
7
Yuya Nishihara
smartset: micro optimize baseset.slice() to use slice of list...
r32820 (using baseset)
$ hg debugrevspec --no-show-revs -s 0+1+2+3+4+5+6+7
* set:
<baseset [0, 1, 2, 3, 4, 5, 6, 7]>
$ hg debugrevspec --no-show-revs -s 0::7
* set:
<baseset+ [0, 1, 2, 3, 4, 5, 6, 7]>
$ log 'limit(0+1+2+3+4+5+6+7, 3, 4)'
4
5
6
$ log 'limit(sort(0::7, rev), 3, 4)'
4
5
6
$ log 'limit(sort(0::7, -rev), 3, 4)'
3
2
1
$ log 'last(sort(0::7, rev), 2)'
6
7
$ hg debugrevspec -s 'limit(sort(0::7, rev), 3, 6)'
* set:
<baseset+ [6, 7]>
6
7
$ hg debugrevspec -s 'limit(sort(0::7, rev), 3, 9)'
* set:
<baseset+ []>
$ hg debugrevspec -s 'limit(sort(0::7, -rev), 3, 6)'
* set:
<baseset- [0, 1]>
1
0
$ hg debugrevspec -s 'limit(sort(0::7, -rev), 3, 9)'
* set:
<baseset- []>
$ hg debugrevspec -s 'limit(0::7, 0)'
* set:
<baseset+ []>
Yuya Nishihara
smartset: micro optimize spanset.slice() to narrow range accordingly...
r32821 (using spanset)
$ hg debugrevspec --no-show-revs -s 0:7
* set:
<spanset+ 0:8>
$ log 'limit(0:7, 3, 4)'
4
5
6
$ log 'limit(7:0, 3, 4)'
3
2
1
$ log 'limit(0:7, 3, 6)'
6
7
$ log 'limit(7:0, 3, 6)'
1
0
$ log 'last(0:7, 2)'
6
7
$ hg debugrevspec -s 'limit(0:7, 3, 6)'
* set:
<spanset+ 6:8>
6
7
$ hg debugrevspec -s 'limit(0:7, 3, 9)'
* set:
<spanset+ 8:8>
$ hg debugrevspec -s 'limit(7:0, 3, 6)'
* set:
<spanset- 0:2>
1
0
$ hg debugrevspec -s 'limit(7:0, 3, 9)'
* set:
<spanset- 0:0>
$ hg debugrevspec -s 'limit(0:7, 0)'
* set:
<spanset+ 0:0>
Yuya Nishihara
revset: filter first/last members by __and__ operation...
r32799 Test order of first/last revisions
$ hg debugrevspec -s 'first(4:0, 3) & 3:'
* set:
<filteredset
Yuya Nishihara
smartset: micro optimize spanset.slice() to narrow range accordingly...
r32821 <spanset- 2:5>,
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset+ 3:10>>
Yuya Nishihara
revset: filter first/last members by __and__ operation...
r32799 4
3
$ hg debugrevspec -s '3: & first(4:0, 3)'
* set:
<filteredset
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset+ 3:10>,
Yuya Nishihara
smartset: micro optimize spanset.slice() to narrow range accordingly...
r32821 <spanset- 2:5>>
Yuya Nishihara
revset: fix order of first/last members in compound expression (BC)...
r32800 3
Yuya Nishihara
revset: filter first/last members by __and__ operation...
r32799 4
$ hg debugrevspec -s 'last(4:0, 3) & :1'
* set:
<filteredset
Yuya Nishihara
smartset: micro optimize spanset.slice() to narrow range accordingly...
r32821 <spanset- 0:3>,
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset+ 0:2>>
Yuya Nishihara
revset: filter first/last members by __and__ operation...
r32799 1
0
$ hg debugrevspec -s ':1 & last(4:0, 3)'
* set:
<filteredset
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset+ 0:2>,
Yuya Nishihara
smartset: micro optimize spanset.slice() to narrow range accordingly...
r32821 <spanset+ 0:3>>
Yuya Nishihara
revset: fix order of first/last members in compound expression (BC)...
r32800 0
Yuya Nishihara
revset: filter first/last members by __and__ operation...
r32799 1
Yuya Nishihara
smartset: fix generatorset.last() to not return the first element (issue5609)
r33109 Test scmutil.revsingle() should return the last revision
$ hg debugrevspec -s 'last(0::)'
* set:
<baseset slice=0:1
Gregory Szorc
smartset: split generatorset classes to avoid cycle...
r35517 <generatorsetasc->>
Yuya Nishihara
smartset: fix generatorset.last() to not return the first element (issue5609)
r33109 9
$ hg identify -r '0::' --num
9
Yuya Nishihara
revset: fix order of last() n members where n > 1 (BC)...
r32797 Test matching
Angel Ezquerra
tests: add tests for matching keyword...
r16447 $ log 'matching(6)'
6
$ log 'matching(6:7, "phase parents user date branch summary files description substate")'
6
7
Pierre-Yves David
revset: raise ValueError when calling min or max on empty smartset...
r20863
Testing min and max
max: simple
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'max(contains(a))'
5
Pierre-Yves David
revset: raise ValueError when calling min or max on empty smartset...
r20863
max: simple on unordered set)
$ log 'max((4+0+2+5+7) and contains(a))'
5
max: no result
$ log 'max(contains(stringthatdoesnotappearanywhere))'
max: no result on unordered set
$ log 'max((4+0+2+5+7) and contains(stringthatdoesnotappearanywhere))'
min: simple
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'min(contains(a))'
0
Pierre-Yves David
revset: raise ValueError when calling min or max on empty smartset...
r20863
min: simple on unordered set
$ log 'min((4+0+2+5+7) and contains(a))'
0
min: empty
$ log 'min(contains(stringthatdoesnotappearanywhere))'
min: empty on unordered set
$ log 'min((4+0+2+5+7) and contains(stringthatdoesnotappearanywhere))'
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'merge()'
6
Ivan Andrus
revsets: add branchpoint() function...
r17753 $ log 'branchpoint()'
1
4
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'modifies(b)'
4
Patrick Mezard
revset: fix adds/modifies/removes and patterns (issue3403)...
r16521 $ log 'modifies("path:b")'
4
$ log 'modifies("*")'
4
6
$ log 'modifies("set:modified()")'
4
Augie Fackler
revset: add id() and rev() to allow explicitly referring to changes by hash or rev
r12716 $ log 'id(5)'
2
Durham Goode
revset: add 'only' revset...
r20613 $ log 'only(9)'
8
9
$ log 'only(8)'
8
$ log 'only(9, 5)'
2
4
8
9
$ log 'only(7 + 9, 5 + 2)'
4
6
7
8
9
Matt Harbison
revset: avoid a ValueError when 'only()' is given an empty set...
r21925
Test empty set input
$ log 'only(p2())'
$ log 'only(p1(), p2())'
0
1
2
4
8
9
Yuya Nishihara
revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)...
r23062
Sean Farley
revset: use '%' as an operator for 'only'...
r23765 Test '%' operator
$ log '9%'
8
9
$ log '9%5'
2
4
8
9
$ log '(7 + 9)%(5 + 2)'
4
6
7
8
9
Mads Kiilerich
spelling: fixes of non-dictionary words
r30332 Test operand of '%' is optimized recursively (issue4670)
Yuya Nishihara
revset: map postfix '%' to only() to optimize operand recursively (issue4670)...
r25094
$ try --optimize '8:9-8%'
(onlypost
(minus
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '8')
(symbol '9'))
(symbol '8')))
Yuya Nishihara
revset: map postfix '%' to only() to optimize operand recursively (issue4670)...
r25094 * optimized:
(func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'only')
Durham Goode
revset: use smartset minus operator...
r28217 (difference
Yuya Nishihara
revset: map postfix '%' to only() to optimize operand recursively (issue4670)...
r25094 (range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '8')
(symbol '9'))
(symbol '8')))
Yuya Nishihara
revset: map postfix '%' to only() to optimize operand recursively (issue4670)...
r25094 * set:
<baseset+ [8, 9]>
8
9
Yuya Nishihara
revset: remove unused 'only' from methods table...
r25105 $ try --optimize '(9)%(5)'
(only
(group
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '9'))
Yuya Nishihara
revset: remove unused 'only' from methods table...
r25105 (group
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '5')))
Yuya Nishihara
revset: remove unused 'only' from methods table...
r25105 * optimized:
(func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'only')
Yuya Nishihara
revset: remove unused 'only' from methods table...
r25105 (list
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '9')
(symbol '5')))
Yuya Nishihara
revset: remove unused 'only' from methods table...
r25105 * set:
Pierre-Yves David
revset: stabilize repr of baseset initialized with a set...
r28785 <baseset+ [2, 4, 8, 9]>
Yuya Nishihara
revset: remove unused 'only' from methods table...
r25105 2
4
8
9
Yuya Nishihara
revset: map postfix '%' to only() to optimize operand recursively (issue4670)...
r25094
Sean Farley
revset: use '%' as an operator for 'only'...
r23765 Test the order of operations
$ log '7 + 9%5 + 2'
7
2
4
8
9
Yuya Nishihara
revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)...
r23062 Test explicit numeric revision
Yuya Nishihara
revset: allow rev(-1) to indicate null revision (BC)...
r23954 $ log 'rev(-2)'
Yuya Nishihara
revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)...
r23062 $ log 'rev(-1)'
Yuya Nishihara
revset: allow rev(-1) to indicate null revision (BC)...
r23954 -1
Yuya Nishihara
revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)...
r23062 $ log 'rev(0)'
0
$ log 'rev(9)'
9
$ log 'rev(10)'
$ log 'rev(tip)'
hg: parse error: rev expects a number
[255]
Alexander Drozdov
revset: id() called with 40-byte strings should give the same results as for short strings...
r24904 Test hexadecimal revision
$ log 'id(2)'
$ log 'id(23268)'
4
$ log 'id(2785f51eece)'
0
$ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532c)'
8
$ log 'id(d5d0dcbdc4a)'
$ log 'id(d5d0dcbdc4w)'
$ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532d)'
$ log 'id(d5d0dcbdc4d9ff5dbb2d336f32f0bb561c1a532q)'
$ log 'id(1.0)'
$ log 'id(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)'
Yuya Nishihara
revset: fix ancestors(null) to include null revision (issue4512)...
r23956 Test null revision
Yuya Nishihara
revset: extend fullreposet to make "null" revision magically appears in set...
r24204 $ log '(null)'
-1
$ log '(null:0)'
-1
0
$ log '(0:null)'
0
-1
$ log 'null::0'
-1
0
$ log 'null:tip - 0:'
-1
$ log 'null: and null::' | head -1
-1
$ log 'null: or 0:' | head -2
-1
0
Yuya Nishihara
revset: fix ancestors(null) to include null revision (issue4512)...
r23956 $ log 'ancestors(null)'
-1
Yuya Nishihara
revset: extend fullreposet to make "null" revision magically appears in set...
r24204 $ log 'reverse(null:)' | tail -2
0
-1
Yuya Nishihara
revset: filter first/last members by __and__ operation...
r32799 $ log 'first(null:)'
-1
$ log 'min(null:)'
Yuya Nishihara
revset: drop magic of fullreposet membership test (issue4682)...
r25265 BROKEN: should be '-1'
Yuya Nishihara
revset: have all() filter out null revision...
r24202 $ log 'tip:null and all()' | tail -2
1
0
Yuya Nishihara
revset: fix ancestors(null) to include null revision (issue4512)...
r23956
Yuya Nishihara
revset: add wdir() function to specify workingctx revision by command...
r24419 Test working-directory revision
$ hg debugrevspec 'wdir()'
Yuya Nishihara
revset: use integer representation of wdir() in revset...
r25765 2147483647
Pulkit Goyal
revset: make `hg log -r 'wdir()^'` work (issue4905)...
r32403 $ hg debugrevspec 'wdir()^'
9
$ hg up 7
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg debugrevspec 'wdir()^'
7
Pulkit Goyal
tests: add tests for predicates and operators which works with wdir()...
r32437 $ hg debugrevspec 'wdir()^0'
2147483647
Pulkit Goyal
revset: add support for using ~ operator on wdir() predicate...
r32441 $ hg debugrevspec 'wdir()~3'
5
Pulkit Goyal
revset: add support for ancestors(wdir())...
r32442 $ hg debugrevspec 'ancestors(wdir())'
0
1
2
3
4
5
6
7
2147483647
Yuya Nishihara
revset: add partial support for ancestor(wdir())...
r38541 $ hg debugrevspec '0:wdir() & ancestor(wdir())'
2147483647
$ hg debugrevspec '0:wdir() & ancestor(.:wdir())'
4
$ hg debugrevspec '0:wdir() & ancestor(wdir(), wdir())'
2147483647
$ hg debugrevspec '0:wdir() & ancestor(wdir(), tip)'
4
$ hg debugrevspec 'null:wdir() & ancestor(wdir(), null)'
-1
Pulkit Goyal
tests: add tests for predicates and operators which works with wdir()...
r32437 $ hg debugrevspec 'wdir()~0'
2147483647
$ hg debugrevspec 'p1(wdir())'
7
Pulkit Goyal
revset: add support for p2(wdir()) to get second parent of working directory...
r32440 $ hg debugrevspec 'p2(wdir())'
Pulkit Goyal
tests: add tests for predicates and operators which works with wdir()...
r32437 $ hg debugrevspec 'parents(wdir())'
7
Pulkit Goyal
revset: add support for "wdir()^n"...
r32436 $ hg debugrevspec 'wdir()^1'
7
$ hg debugrevspec 'wdir()^2'
$ hg debugrevspec 'wdir()^3'
hg: parse error: ^ expects a number 0, 1, or 2
[255]
Pulkit Goyal
revset: make `hg log -r 'wdir()^'` work (issue4905)...
r32403 For tests consistency
$ hg up 9
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
Yuya Nishihara
revset: add wdir() function to specify workingctx revision by command...
r24419 $ hg debugrevspec 'tip or wdir()'
9
Yuya Nishihara
revset: use integer representation of wdir() in revset...
r25765 2147483647
Yuya Nishihara
revset: add wdir() function to specify workingctx revision by command...
r24419 $ hg debugrevspec '0:tip and wdir()'
Yuya Nishihara
revset: work around x:y range where x or y is wdir()...
r25766 $ log '0:wdir()' | tail -3
8
9
2147483647
$ log 'wdir():0' | head -3
2147483647
9
8
$ log 'wdir():wdir()'
2147483647
Yuya Nishihara
revset: use integer representation of wdir() in revset...
r25765 $ log '(all() + wdir()) & min(. + wdir())'
9
$ log '(all() + wdir()) & max(. + wdir())'
2147483647
Yuya Nishihara
revset: filter first/last members by __and__ operation...
r32799 $ log 'first(wdir() + .)'
Yuya Nishihara
revset: use integer representation of wdir() in revset...
r25765 2147483647
Yuya Nishihara
revset: filter first/last members by __and__ operation...
r32799 $ log 'last(. + wdir())'
Yuya Nishihara
revset: use integer representation of wdir() in revset...
r25765 2147483647
Yuya Nishihara
revset: add wdir() function to specify workingctx revision by command...
r24419
Yuya Nishihara
revset: add support for integer and hex wdir identifiers...
r32659 Test working-directory integer revision and node id
(BUG: '0:wdir()' is still needed to populate wdir revision)
$ hg debugrevspec '0:wdir() & 2147483647'
2147483647
$ hg debugrevspec '0:wdir() & rev(2147483647)'
2147483647
$ hg debugrevspec '0:wdir() & ffffffffffffffffffffffffffffffffffffffff'
2147483647
Yuya Nishihara
revlog: add support for partial matching of wdir node id...
r32684 $ hg debugrevspec '0:wdir() & ffffffffffff'
2147483647
Yuya Nishihara
revset: add support for integer and hex wdir identifiers...
r32659 $ hg debugrevspec '0:wdir() & id(ffffffffffffffffffffffffffffffffffffffff)'
2147483647
$ hg debugrevspec '0:wdir() & id(ffffffffffff)'
Yuya Nishihara
revlog: add support for partial matching of wdir node id...
r32684 2147483647
$ cd ..
Test short 'ff...' hash collision
(BUG: '0:wdir()' is still needed to populate wdir revision)
$ hg init wdir-hashcollision
$ cd wdir-hashcollision
$ cat <<EOF >> .hg/hgrc
> [experimental]
Boris Feld
config: use 'experimental.evolution.create-markers'...
r34867 > evolution.createmarkers=True
Yuya Nishihara
revlog: add support for partial matching of wdir node id...
r32684 > EOF
$ echo 0 > a
$ hg ci -qAm 0
$ for i in 2463 2961 6726 78127; do
> hg up -q 0
> echo $i > a
> hg ci -qm $i
> done
$ hg up -q null
$ hg log -r '0:wdir()' -T '{rev}:{node} {shortest(node, 3)}\n'
0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a b4e
1:fffbae3886c8fbb2114296380d276fd37715d571 fffba
2:fffb6093b00943f91034b9bdad069402c834e572 fffb6
3:fff48a9b9de34a4d64120c29548214c67980ade3 fff4
4:ffff85cff0ff78504fcdc3c0bc10de0c65379249 ffff8
2147483647:ffffffffffffffffffffffffffffffffffffffff fffff
$ hg debugobsolete fffbae3886c8fbb2114296380d276fd37715d571
Boris Feld
debugobsolete: also report the number of obsoleted changesets...
r33542 obsoleted 1 changesets
Yuya Nishihara
revlog: add support for partial matching of wdir node id...
r32684
$ hg debugrevspec '0:wdir() & fff'
abort: 00changelog.i@fff: ambiguous identifier!
[255]
$ hg debugrevspec '0:wdir() & ffff'
abort: 00changelog.i@ffff: ambiguous identifier!
[255]
$ hg debugrevspec '0:wdir() & fffb'
abort: 00changelog.i@fffb: ambiguous identifier!
[255]
Martin von Zweigbergk
revset: use resolvehexnodeidprefix() in id() predicate (BC)...
r37884 BROKEN should be '2' (node lookup uses unfiltered repo)
Yuya Nishihara
revlog: add support for partial matching of wdir node id...
r32684 $ hg debugrevspec '0:wdir() & id(fffb)'
Martin von Zweigbergk
revset: use resolvehexnodeidprefix() in id() predicate (BC)...
r37884 BROKEN should be '2' (node lookup uses unfiltered repo)
Yuya Nishihara
revlog: add support for partial matching of wdir node id...
r32684 $ hg debugrevspec '0:wdir() & ffff8'
4
$ hg debugrevspec '0:wdir() & fffff'
2147483647
$ cd ..
Yuya Nishihara
revset: add support for integer and hex wdir identifiers...
r32659
Yuya Nishihara
revset: add support for branch(wdir()) and wdir() & branch()
r32683 Test branch() with wdir()
Yuya Nishihara
revlog: add support for partial matching of wdir node id...
r32684 $ cd repo
Yuya Nishihara
revset: add support for branch(wdir()) and wdir() & branch()
r32683 $ log '0:wdir() & branch("literal:é")'
8
9
2147483647
$ log '0:wdir() & branch("re:é")'
8
9
2147483647
$ log '0:wdir() & branch("re:^a")'
0
2
$ log '0:wdir() & branch(8)'
8
9
2147483647
branch(wdir()) returns all revisions belonging to the working branch. The wdir
itself isn't returned unless it is explicitly populated.
$ log 'branch(wdir())'
8
9
$ log '0:wdir() & branch(wdir())'
8
9
2147483647
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'outgoing()'
8
9
$ log 'outgoing("../remote1")'
8
9
$ log 'outgoing("../remote2")'
3
5
6
7
9
$ log 'p1(merge())'
5
$ log 'p2(merge())'
4
$ log 'parents(merge())'
4
5
Ivan Andrus
revsets: add branchpoint() function...
r17753 $ log 'p1(branchpoint())'
0
2
$ log 'p2(branchpoint())'
$ log 'parents(branchpoint())'
0
2
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'removes(a)'
2
6
$ log 'roots(all())'
0
$ log 'reverse(2 or 3 or 4 or 5)'
5
4
3
2
Bryan O'Sullivan
revset: ensure we are reversing a list (issue3530)
r17100 $ log 'reverse(all())'
9
8
7
6
5
4
3
2
1
0
Yuya Nishihara
revset: fix spanset.isascending() to honor sort() or reverse() request...
r23826 $ log 'reverse(all()) & filelog(b)'
4
1
Augie Fackler
revset: add id() and rev() to allow explicitly referring to changes by hash or rev
r12716 $ log 'rev(5)'
5
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'sort(limit(reverse(all()), 3))'
7
8
9
$ log 'sort(2 or 3 or 4 or 5, date)'
2
3
5
4
$ log 'tagged()'
6
Augie Fackler
revset: rename tagged() to tag() and allow it to take an optional tag name
r12715 $ log 'tag()'
6
$ log 'tag(1.0)'
6
$ log 'tag(tip)'
9
Simon King
revset: add pattern matching to 'tag' revset expression...
r16820
Yuya Nishihara
revset: make dagrange preserve order of input set...
r29139 Test order of revisions in compound expression
----------------------------------------------
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 The general rule is that only the outermost (= leftmost) predicate can
enforce its ordering requirement. The other predicates should take the
ordering defined by it.
Yuya Nishihara
revset: make dagrange preserve order of input set...
r29139 'A & B' should follow the order of 'A':
$ log '2:0 & 0::2'
2
1
0
Martin von Zweigbergk
revset: make head() honor order of subset...
r29408 'head()' combines sets in right order:
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390
$ log '2:0 & head()'
Martin von Zweigbergk
revset: make head() honor order of subset...
r29408 2
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 1
Martin von Zweigbergk
revset: make head() honor order of subset...
r29408 0
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390
Yuya Nishihara
revset: fix order of nested 'range' expression (BC)...
r29944 'x:y' takes ordering parameter into account:
$ try -p optimized '3:0 & 0:3 & not 2:1'
* optimized:
(difference
(and
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '3')
(symbol '0'))
Yuya Nishihara
revset: fix order of nested 'range' expression (BC)...
r29944 (range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '0')
(symbol '3')))
Yuya Nishihara
revset: fix order of nested 'range' expression (BC)...
r29944 (range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '1')))
Yuya Nishihara
revset: fix order of nested 'range' expression (BC)...
r29944 * set:
<filteredset
<filteredset
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset- 0:4>,
<spanset+ 0:4>>,
Yuya Nishihara
revset: fix order of nested 'range' expression (BC)...
r29944 <not
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset+ 1:3>>>
Yuya Nishihara
revset: fix order of nested 'range' expression (BC)...
r29944 3
0
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 'a + b', which is optimized to '_list(a b)', should take the ordering of
the left expression:
$ try --optimize '2:0 & (0 + 1 + 2)'
(and
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '0'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (group
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '0')
(symbol '1')
(symbol '2')))))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * optimized:
(and
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '0'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '_list')
(string '0\x001\x002')))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * set:
Yuya Nishihara
revset: fix order of nested '_(|int|hex)list' expression (BC)...
r29935 <filteredset
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset- 0:3>,
Yuya Nishihara
revset: fix order of nested '_(|int|hex)list' expression (BC)...
r29935 <baseset [0, 1, 2]>>
2
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 1
Yuya Nishihara
revset: fix order of nested '_(|int|hex)list' expression (BC)...
r29935 0
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390
'A + B' should take the ordering of the left expression:
$ try --optimize '2:0 & (0:1 + 2)'
(and
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '0'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (group
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '0')
(symbol '1'))
(symbol '2')))))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * optimized:
(and
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '0'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '0')
(symbol '1'))
(symbol '2'))))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * set:
Yuya Nishihara
revset: fix order of nested 'or' expression (BC)...
r29934 <filteredset
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset- 0:3>,
Yuya Nishihara
revset: fix order of nested 'or' expression (BC)...
r29934 <addset
Jun Wu
revset: drop optimization about reordering "or" set elements...
r34012 <spanset+ 0:2>,
<baseset [2]>>>
Yuya Nishihara
revset: fix order of nested 'or' expression (BC)...
r29934 2
1
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 0
'_intlist(a b)' should behave like 'a + b':
$ trylist --optimize '2:0 & %ld' 0 1 2
(and
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '0'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '_intlist')
(string '0\x001\x002')))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * optimized:
Jun Wu
revset: do not flip "and" arguments when optimizing...
r34022 (andsmally
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '0'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '_intlist')
(string '0\x001\x002')))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * set:
<filteredset
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset- 0:3>,
Yuya Nishihara
revset: fix order of nested '_(|int|hex)list' expression (BC)...
r29935 <baseset+ [0, 1, 2]>>
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 2
1
0
$ trylist --optimize '%ld & 2:0' 0 2 1
(and
(func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '_intlist')
(string '0\x002\x001'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '0')))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * optimized:
(and
(func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '_intlist')
(string '0\x002\x001'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '0')))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * set:
<filteredset
Yuya Nishihara
revset: fix order of nested 'range' expression (BC)...
r29944 <baseset [0, 2, 1]>,
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset- 0:3>>
Yuya Nishihara
revset: fix order of nested 'range' expression (BC)...
r29944 0
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 2
1
'_hexlist(a b)' should behave like 'a + b':
$ trylist --optimize --bin '2:0 & %ln' `hg log -T '{node} ' -r0:2`
(and
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '0'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '_hexlist')
(string '*'))) (glob)
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * optimized:
(and
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '0'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '_hexlist')
(string '*'))) (glob)
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * set:
Yuya Nishihara
revset: fix order of nested '_(|int|hex)list' expression (BC)...
r29935 <filteredset
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset- 0:3>,
Yuya Nishihara
revset: fix order of nested '_(|int|hex)list' expression (BC)...
r29935 <baseset [0, 1, 2]>>
2
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 1
Yuya Nishihara
revset: fix order of nested '_(|int|hex)list' expression (BC)...
r29935 0
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390
$ trylist --optimize --bin '%ln & 2:0' `hg log -T '{node} ' -r0+2+1`
(and
(func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '_hexlist')
(string '*')) (glob)
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '0')))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * optimized:
Jun Wu
revset: do not flip "and" arguments when optimizing...
r34022 (andsmally
(func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '_hexlist')
(string '*')) (glob)
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '0')))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * set:
<baseset [0, 2, 1]>
0
2
1
Yuya Nishihara
revset: fix order of nested '_(|int|hex)list' expression (BC)...
r29935 '_list' should not go through the slow follow-order path if order doesn't
matter:
$ try -p optimized '2:0 & not (0 + 1)'
* optimized:
(difference
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '0'))
Yuya Nishihara
revset: fix order of nested '_(|int|hex)list' expression (BC)...
r29935 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '_list')
(string '0\x001')))
Yuya Nishihara
revset: fix order of nested '_(|int|hex)list' expression (BC)...
r29935 * set:
<filteredset
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset- 0:3>,
Yuya Nishihara
revset: fix order of nested '_(|int|hex)list' expression (BC)...
r29935 <not
<baseset [0, 1]>>>
2
$ try -p optimized '2:0 & not (0:2 & (0 + 1))'
* optimized:
(difference
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '0'))
Yuya Nishihara
revset: fix order of nested '_(|int|hex)list' expression (BC)...
r29935 (and
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '0')
(symbol '2'))
Yuya Nishihara
revset: fix order of nested '_(|int|hex)list' expression (BC)...
r29935 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '_list')
(string '0\x001'))))
Yuya Nishihara
revset: fix order of nested '_(|int|hex)list' expression (BC)...
r29935 * set:
<filteredset
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset- 0:3>,
Yuya Nishihara
revset: fix order of nested '_(|int|hex)list' expression (BC)...
r29935 <not
<baseset [0, 1]>>>
2
Yuya Nishihara
revset: forward ordering requirement to argument of present()...
r29943 because 'present()' does nothing other than suppressing an error, the
ordering requirement should be forwarded to the nested expression
$ try -p optimized 'present(2 + 0 + 1)'
* optimized:
(func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'present')
Yuya Nishihara
revset: forward ordering requirement to argument of present()...
r29943 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '_list')
(string '2\x000\x001')))
Yuya Nishihara
revset: forward ordering requirement to argument of present()...
r29943 * set:
<baseset [2, 0, 1]>
2
0
1
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390
$ try --optimize '2:0 & present(0 + 1 + 2)'
(and
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '0'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'present')
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '0')
(symbol '1')
(symbol '2')))))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * optimized:
(and
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '0'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'present')
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '_list')
(string '0\x001\x002'))))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * set:
Yuya Nishihara
revset: forward ordering requirement to argument of present()...
r29943 <filteredset
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset- 0:3>,
Yuya Nishihara
revset: forward ordering requirement to argument of present()...
r29943 <baseset [0, 1, 2]>>
2
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 1
Yuya Nishihara
revset: forward ordering requirement to argument of present()...
r29943 0
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390
'reverse()' should take effect only if it is the outermost expression:
$ try --optimize '0:2 & reverse(all())'
(and
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '0')
(symbol '2'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'reverse')
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'all')
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 None)))
* optimized:
(and
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '0')
(symbol '2'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'reverse')
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'all')
Jun Wu
revset: remove order information from tree (API)...
r34013 None)))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * set:
<filteredset
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset+ 0:3>,
<spanset+ 0:10>>
Yuya Nishihara
revset: make reverse() noop depending on ordering requirement (BC)...
r29945 0
1
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 2
'sort()' should take effect only if it is the outermost expression:
$ try --optimize '0:2 & sort(all(), -rev)'
(and
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '0')
(symbol '2'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'sort')
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (list
(func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'all')
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 None)
(negate
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'rev')))))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * optimized:
(and
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '0')
(symbol '2'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'sort')
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (list
(func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'all')
Jun Wu
revset: remove order information from tree (API)...
r34013 None)
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (string '-rev'))))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * set:
<filteredset
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset+ 0:3>,
<spanset+ 0:10>>
Yuya Nishihara
revset: make sort() noop depending on ordering requirement (BC)...
r29946 0
1
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 2
Yuya Nishihara
revset: make sort() noop depending on ordering requirement (BC)...
r29946
invalid argument passed to noop sort():
$ log '0:2 & sort()'
hg: parse error: sort requires one or two arguments
[255]
$ log '0:2 & sort(all(), -invalid)'
hg: parse error: unknown sort key '-invalid'
[255]
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390
for 'A & f(B)', 'B' should not be affected by the order of 'A':
$ try --optimize '2:0 & first(1 + 0 + 2)'
(and
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '0'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'first')
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '1')
(symbol '0')
(symbol '2')))))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * optimized:
(and
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '0'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'first')
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '_list')
(string '1\x000\x002'))))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * set:
Yuya Nishihara
revset: filter first/last members by __and__ operation...
r32799 <filteredset
Yuya Nishihara
smartset: micro optimize baseset.slice() to use slice of list...
r32820 <baseset [1]>,
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset- 0:3>>
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 1
$ try --optimize '2:0 & not last(0 + 2 + 1)'
(and
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '0'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (not
(func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'last')
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '0')
(symbol '2')
(symbol '1'))))))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * optimized:
(difference
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '0'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'last')
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '_list')
(string '0\x002\x001'))))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * set:
<filteredset
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset- 0:3>,
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 <not
Yuya Nishihara
smartset: micro optimize baseset.slice() to use slice of list...
r32820 <baseset [1]>>>
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 2
0
for 'A & (op)(B)', 'B' should not be affected by the order of 'A':
$ try --optimize '2:0 & (1 + 0 + 2):(0 + 2 + 1)'
(and
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '0'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (range
(group
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '1')
(symbol '0')
(symbol '2'))))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (group
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '0')
(symbol '2')
(symbol '1'))))))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * optimized:
(and
(range
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '0'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (range
(func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '_list')
(string '1\x000\x002'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '_list')
(string '0\x002\x001'))))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * set:
<filteredset
Yuya Nishihara
smartset: change repr of spanset to show revisions as half-open range...
r32817 <spanset- 0:3>,
Yuya Nishihara
revset: fix order of nested 'range' expression (BC)...
r29944 <baseset [1]>>
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 1
Jun Wu
revset: remove order information from tree (API)...
r34013 'A & B' can be rewritten as 'flipand(B, A)' by weight.
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390
$ try --optimize 'contains("glob:*") & (2 + 0 + 1)'
(and
(func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'contains')
(string 'glob:*'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (group
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '2')
(symbol '0')
(symbol '1')))))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * optimized:
Jun Wu
revset: do not flip "and" arguments when optimizing...
r34022 (andsmally
(func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'contains')
(string 'glob:*'))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '_list')
(string '2\x000\x001')))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * set:
<filteredset
Yuya Nishihara
revset: fix order of nested '_(|int|hex)list' expression (BC)...
r29935 <baseset+ [0, 1, 2]>,
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 <contains 'glob:*'>>
0
1
Yuya Nishihara
revset: fix order of nested '_(|int|hex)list' expression (BC)...
r29935 2
and in this example, 'A & B' is rewritten as 'B & A', but 'A' overrides
the order appropriately:
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390
$ try --optimize 'reverse(contains("glob:*")) & (0 + 2 + 1)'
(and
(func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'reverse')
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'contains')
(string 'glob:*')))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (group
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '0')
(symbol '2')
(symbol '1')))))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * optimized:
Jun Wu
revset: do not flip "and" arguments when optimizing...
r34022 (andsmally
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'reverse')
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol 'contains')
(string 'glob:*')))
Jun Wu
revset: do not flip "and" arguments when optimizing...
r34022 (func
Yuya Nishihara
parser: stabilize output of prettyformat() by using byte-safe repr()...
r34075 (symbol '_list')
(string '0\x002\x001')))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * set:
<filteredset
Yuya Nishihara
revset: fix order of nested '_(|int|hex)list' expression (BC)...
r29935 <baseset- [0, 1, 2]>,
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 <contains 'glob:*'>>
Yuya Nishihara
revset: fix order of nested '_(|int|hex)list' expression (BC)...
r29935 2
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 1
0
Lucas Moscovicz
tests: added tests to test sort revset...
r20717 test sort revset
--------------------------------------------
test when adding two unordered revsets
$ log 'sort(keyword(issue) or modifies(b))'
4
6
test when sorting a reversed collection in the same way it is
$ log 'sort(reverse(all()), -rev)'
9
8
7
6
5
4
3
2
1
0
test when sorting a reversed collection
$ log 'sort(reverse(all()), rev)'
0
1
2
3
4
5
6
7
8
9
test sorting two sorted collections in different orders
$ log 'sort(outgoing() or reverse(removes(a)), rev)'
2
6
8
9
test sorting two sorted collections in different orders backwards
$ log 'sort(outgoing() or reverse(removes(a)), -rev)'
9
8
6
2
Yuya Nishihara
revset: fix crash on empty sort key...
r29362 test empty sort key which is noop
$ log 'sort(0 + 2 + 1, "")'
0
2
1
Yuya Nishihara
revset: factor out reverse flag of sort() key...
r29264 test invalid sort keys
$ log 'sort(all(), -invalid)'
hg: parse error: unknown sort key '-invalid'
[255]
Yuya Nishihara
revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)...
r29001 $ cd ..
test sorting by multiple keys including variable-length strings
$ hg init sorting
$ cd sorting
$ cat <<EOF >> .hg/hgrc
> [ui]
> logtemplate = '{rev} {branch|p5}{desc|p5}{author|p5}{date|hgdate}\n'
> [templatealias]
> p5(s) = pad(s, 5)
> EOF
$ hg branch -qf b12
$ hg ci -m m111 -u u112 -d '111 10800'
$ hg branch -qf b11
$ hg ci -m m12 -u u111 -d '112 7200'
$ hg branch -qf b111
$ hg ci -m m11 -u u12 -d '111 3600'
$ hg branch -qf b112
$ hg ci -m m111 -u u11 -d '120 0'
$ hg branch -qf b111
$ hg ci -m m112 -u u111 -d '110 14400'
created new head
compare revisions (has fast path):
$ hg log -r 'sort(all(), rev)'
0 b12 m111 u112 111 10800
1 b11 m12 u111 112 7200
2 b111 m11 u12 111 3600
3 b112 m111 u11 120 0
4 b111 m112 u111 110 14400
$ hg log -r 'sort(all(), -rev)'
4 b111 m112 u111 110 14400
3 b112 m111 u11 120 0
2 b111 m11 u12 111 3600
1 b11 m12 u111 112 7200
0 b12 m111 u112 111 10800
compare variable-length strings (issue5218):
$ hg log -r 'sort(all(), branch)'
1 b11 m12 u111 112 7200
2 b111 m11 u12 111 3600
4 b111 m112 u111 110 14400
3 b112 m111 u11 120 0
0 b12 m111 u112 111 10800
$ hg log -r 'sort(all(), -branch)'
0 b12 m111 u112 111 10800
3 b112 m111 u11 120 0
2 b111 m11 u12 111 3600
4 b111 m112 u111 110 14400
1 b11 m12 u111 112 7200
$ hg log -r 'sort(all(), desc)'
2 b111 m11 u12 111 3600
0 b12 m111 u112 111 10800
3 b112 m111 u11 120 0
4 b111 m112 u111 110 14400
1 b11 m12 u111 112 7200
$ hg log -r 'sort(all(), -desc)'
1 b11 m12 u111 112 7200
4 b111 m112 u111 110 14400
0 b12 m111 u112 111 10800
3 b112 m111 u11 120 0
2 b111 m11 u12 111 3600
$ hg log -r 'sort(all(), user)'
3 b112 m111 u11 120 0
1 b11 m12 u111 112 7200
4 b111 m112 u111 110 14400
0 b12 m111 u112 111 10800
2 b111 m11 u12 111 3600
$ hg log -r 'sort(all(), -user)'
2 b111 m11 u12 111 3600
0 b12 m111 u112 111 10800
1 b11 m12 u111 112 7200
4 b111 m112 u111 110 14400
3 b112 m111 u11 120 0
compare dates (tz offset should have no effect):
$ hg log -r 'sort(all(), date)'
4 b111 m112 u111 110 14400
0 b12 m111 u112 111 10800
2 b111 m11 u12 111 3600
1 b11 m12 u111 112 7200
3 b112 m111 u11 120 0
$ hg log -r 'sort(all(), -date)'
3 b112 m111 u11 120 0
1 b11 m12 u111 112 7200
0 b12 m111 u112 111 10800
2 b111 m11 u12 111 3600
4 b111 m112 u111 110 14400
be aware that 'sort(x, -k)' is not exactly the same as 'reverse(sort(x, k))'
because '-k' reverses the comparison, not the list itself:
$ hg log -r 'sort(0 + 2, date)'
0 b12 m111 u112 111 10800
2 b111 m11 u12 111 3600
$ hg log -r 'sort(0 + 2, -date)'
0 b12 m111 u112 111 10800
2 b111 m11 u12 111 3600
$ hg log -r 'reverse(sort(0 + 2, date))'
2 b111 m11 u12 111 3600
0 b12 m111 u112 111 10800
sort by multiple keys:
$ hg log -r 'sort(all(), "branch -rev")'
1 b11 m12 u111 112 7200
4 b111 m112 u111 110 14400
2 b111 m11 u12 111 3600
3 b112 m111 u11 120 0
0 b12 m111 u112 111 10800
$ hg log -r 'sort(all(), "-desc -date")'
1 b11 m12 u111 112 7200
4 b111 m112 u111 110 14400
3 b112 m111 u11 120 0
0 b12 m111 u112 111 10800
2 b111 m11 u12 111 3600
$ hg log -r 'sort(all(), "user -branch date rev")'
3 b112 m111 u11 120 0
4 b111 m112 u111 110 14400
1 b11 m12 u111 112 7200
0 b12 m111 u112 111 10800
2 b111 m11 u12 111 3600
Martijn Pieters
revset: add new topographical sort...
r29348 toposort prioritises graph branches
$ hg up 2
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ touch a
$ hg addremove
adding a
$ hg ci -m 't1' -u 'tu' -d '130 0'
created new head
$ echo 'a' >> a
$ hg ci -m 't2' -u 'tu' -d '130 0'
$ hg book book1
$ hg up 4
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
(leaving bookmark book1)
$ touch a
$ hg addremove
adding a
$ hg ci -m 't3' -u 'tu' -d '130 0'
$ hg log -r 'sort(all(), topo)'
7 b111 t3 tu 130 0
4 b111 m112 u111 110 14400
3 b112 m111 u11 120 0
6 b111 t2 tu 130 0
5 b111 t1 tu 130 0
2 b111 m11 u12 111 3600
1 b11 m12 u111 112 7200
0 b12 m111 u112 111 10800
$ hg log -r 'sort(all(), -topo)'
0 b12 m111 u112 111 10800
1 b11 m12 u111 112 7200
2 b111 m11 u12 111 3600
5 b111 t1 tu 130 0
6 b111 t2 tu 130 0
3 b112 m111 u11 120 0
4 b111 m112 u111 110 14400
7 b111 t3 tu 130 0
$ hg log -r 'sort(all(), topo, topo.firstbranch=book1)'
6 b111 t2 tu 130 0
5 b111 t1 tu 130 0
7 b111 t3 tu 130 0
4 b111 m112 u111 110 14400
3 b112 m111 u11 120 0
2 b111 m11 u12 111 3600
1 b11 m12 u111 112 7200
0 b12 m111 u112 111 10800
topographical sorting can't be combined with other sort keys, and you can't
use the topo.firstbranch option when topo sort is not active:
$ hg log -r 'sort(all(), "topo user")'
hg: parse error: topo sort order cannot be combined with other sort keys
[255]
$ hg log -r 'sort(all(), user, topo.firstbranch=book1)'
hg: parse error: topo.firstbranch can only be used when using the topo sort key
[255]
Yuya Nishihara
revset: fix keyword arguments to go through optimization process...
r29766 topo.firstbranch should accept any kind of expressions:
$ hg log -r 'sort(0, topo, topo.firstbranch=(book1))'
0 b12 m111 u112 111 10800
Yuya Nishihara
revset: make sort() do dumb multi-pass sorting for multiple keys (issue5218)...
r29001 $ cd ..
$ cd repo
Ryan McElroy
revsetlang: add a hint for more useful parse errors...
r36703
test multiline revset with errors
$ echo > multiline-revset
$ echo '. +' >> multiline-revset
$ echo '.^ +' >> multiline-revset
$ hg log -r "`cat multiline-revset`"
hg: parse error at 9: not a prefix: end
( . + .^ +
^ here)
[255]
Boris Feld
revset: skip legacy lookup for revspec wrapped in 'revset(...)'...
r37778 $ hg debugrevspec -v 'revset(first(rev(0)))' -p all
* parsed:
(func
(symbol 'revset')
(func
(symbol 'first')
(func
(symbol 'rev')
(symbol '0'))))
* expanded:
(func
(symbol 'revset')
(func
(symbol 'first')
(func
(symbol 'rev')
(symbol '0'))))
* concatenated:
(func
(symbol 'revset')
(func
(symbol 'first')
(func
(symbol 'rev')
(symbol '0'))))
* analyzed:
(func
(symbol 'first')
(func
(symbol 'rev')
(symbol '0')))
* optimized:
(func
(symbol 'first')
(func
(symbol 'rev')
(symbol '0')))
* set:
<baseset+ [0]>
0