##// END OF EJS Templates
show: fix corrupt json output with no bookmarks
show: fix corrupt json output with no bookmarks

File last commit:

r31800:c63cb2d1 default
r31859:8e282aa3 default
Show More
test-revset.t
3720 lines | 64.7 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])
>
> mercurial.revset.symbols['r3232'] = r3232
> EOF
$ cat >> $HGRCPATH << EOF
> [extensions]
> 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 (
> cmdutil,
> node as nodemod,
> revset,
Yuya Nishihara
revset: split language services to revsetlang module (API)...
r31024 > revsetlang,
Yuya Nishihara
smartset: move set classes and related functions from revset module (API)...
r30881 > smartset,
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 > )
> cmdtable = {}
> command = cmdutil.command(cmdtable)
> @command('debugrevlistspec',
> [('', 'optimize', None, 'print parsed tree after optimizing'),
> ('', 'bin', None, 'unhexlify arguments')])
> 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:
Yuya Nishihara
revset: split language services to revsetlang module (API)...
r31024 > tree = revsetlang.parse(expr, lookup=repo.__contains__)
> ui.note(revsetlang.prettyformat(tree), "\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))
> ui.note("* optimized:\n", revsetlang.prettyformat(opttree),
> "\n")
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 > func = revset.match(ui, expr, repo)
> revs = func(repo)
> if ui.verbose:
Yuya Nishihara
smartset: move set classes and related functions from revset module (API)...
r30881 > ui.note("* set:\n", smartset.prettyformat(revs), "\n")
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 > for c in revs:
> ui.write("%s\n" % c)
> 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
('symbol', '0')
('symbol', '1'))
* set:
Yuya Nishihara
revset: optimize "x & fullreposet" case...
r24459 <spanset+ 0:1>
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
None
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 define)
Yuya Nishihara
revset: parse nullary ":" operator as "0:tip"...
r25819 * set:
<spanset+ 0:9>
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
('symbol', '3')
('symbol', '6'))
* 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
('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
('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
('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_
('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
('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.
('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
('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
revset: port parsing rule of old-style ranges from scmutil.revrange()...
r25902 ('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+'
('symbol', '+a+b+c+')
* set:
<baseset [3]>
3
$ try '+a+b+c+:'
(rangepost
('symbol', '+a+b+c+'))
* set:
<spanset+ 3:9>
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
('symbol', '+a+b+c+'))
* set:
<spanset+ 0:3>
0
1
2
3
$ try -- '-a-b-c-:+a+b+c+'
(range
('symbol', '-a-b-c-')
('symbol', '+a+b+c+'))
* set:
<spanset- 3:4>
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
('symbol', 'a'))
('symbol', 'b'))
('symbol', 'c'))
(negate
('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 é
('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
('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
('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
('symbol', '1')
(and
('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
('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
('symbol', '1')
(group
(or
(list
('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
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
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Yuya Nishihara
revset: handle error of string unescaping
r26232 $ log 'date("\xy")'
hg: parse error: invalid \x escape
[255]
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'date(tip)'
abort: 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)'
hg: parse error: extra takes at most 2 arguments
[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
('symbol', 'foo')
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
('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
('symbol', 'foo')
(group
(not
(func
('symbol', 'public')
None))))
* optimized:
(keyvalue
('symbol', 'foo')
(func
('symbol', '_notpublic')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 None
any))
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
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
('symbol', '0')
('symbol', '1'))))
Yuya Nishihara
debugrevspec: add option to print parsed tree at given stages...
r29913 ('symbol', '1'))
* analyzed:
(and
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
('symbol', '0')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '1'))
define)
Yuya Nishihara
debugrevspec: add option to print parsed tree at given stages...
r29913 (not
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '1')
follow)
define)
Yuya Nishihara
debugrevspec: add option to print parsed tree at given stages...
r29913 * optimized:
(difference
(func
('symbol', '_list')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('string', '0\x001')
define)
('symbol', '1')
define)
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
('symbol', 'r3232')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 None
define)
('symbol', '2')
define)
Yuya Nishihara
debugrevspec: add option to verify optimized result...
r29924 * optimized:
(and
('symbol', '2')
(func
('symbol', 'r3232')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 None
define)
define)
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
None
Yuya Nishihara
revset: do not rewrite ':y' to '0:y' (issue5385)...
r30044 define)
* set:
<spanset+ 0:9>
0
1
2
3
4
5
6
7
8
9
$ try -p analyzed ':1'
* analyzed:
(rangepre
('symbol', '1')
define)
* set:
<spanset+ 0:1>
0
1
$ try -p analyzed ':(1|2)'
* analyzed:
(rangepre
(or
(list
('symbol', '1')
('symbol', '2'))
define)
define)
* set:
<spanset+ 0:2>
0
1
2
$ try -p analyzed ':(1&2)'
* analyzed:
(rangepre
(and
('symbol', '1')
('symbol', '2')
define)
define)
* set:
<baseset []>
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 infix/suffix resolution of ^ operator (issue2884):
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
('symbol', '1'))
('symbol', '2'))
* set:
<spanset+ 0:2>
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
('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
('symbol', '9')))
* set:
<spanset+ 8:9>
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
('symbol', '1')
(group
(rangepre
('symbol', '2'))))
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
('symbol', 'sort')
(range
(parentpost
('symbol', '1'))
('symbol', '2')))
* set:
<spanset+ 0:2>
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
('symbol', '3'))
('symbol', '4'))))
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 ('symbol', '2'))
* set:
<spanset+ 0:2>
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
('symbol', '3'))
('symbol', '4'))))
Yuya Nishihara
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 ('symbol', '2'))
* set:
<baseset+ [0, 1, 2]>
0
1
2
Yuya Nishihara
revset: also parse x^: as (x^):...
r29770 $ try '(9^:)^:'
(rangepost
(parentpost
(group
(rangepost
(parentpost
('symbol', '9'))))))
* set:
<spanset+ 4:9>
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
revset: add test for resolution of infix/suffix ambiguity of x^:y...
r29768 ('symbol', 'A')
* expanded:
(range
(parentpost
('symbol', '1'))
('symbol', '2'))
* set:
<spanset+ 0:2>
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
('symbol', 'A')
('symbol', '2'))
* expanded:
(range
(parentpost
('symbol', '1'))
('symbol', '2'))
* set:
<spanset+ 0:2>
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
('symbol', '1')
('symbol', 'A'))
* expanded:
(parent
('symbol', '1')
(rangepre
('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
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
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
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
('symbol', 'grep')
('string', '('))
Martin Geisler
merge with stable
r12321 hg: parse error: invalid match pattern: unbalanced parenthesis
[255]
Brodie Rao
revset: support raw string literals...
r12408 $ try 'grep("\bissue\d+")'
Patrick Mezard
debugrevspec: pretty print output...
r16218 (func
('symbol', 'grep')
('string', '\x08issue\\d+'))
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<filteredset
Yuya Nishihara
revset: add inspection data to all filter() calls...
r28424 <fullreposet+ 0:9>,
<grep '\x08issue\\d+'>>
Brodie Rao
revset: support raw string literals...
r12408 $ try 'grep(r"\bissue\d+")'
Patrick Mezard
debugrevspec: pretty print output...
r16218 (func
('symbol', 'grep')
('string', '\\bissue\\d+'))
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<filteredset
Yuya Nishihara
revset: add inspection data to all filter() calls...
r28424 <fullreposet+ 0:9>,
<grep '\\bissue\\d+'>>
Brodie Rao
revset: support raw string literals...
r12408 6
$ try 'grep(r"\")'
hg: parse error at 7: unterminated string
[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
$ log 'heads(6::)'
7
$ log 'keyword(issue)'
6
Alexander Plavin
revset: fix wrong keyword() behaviour for strings with spaces...
r19706 $ log 'keyword("test a")'
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]
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
('symbol', '8')
('symbol', '9'))
('symbol', '8')))
* optimized:
(func
('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
('symbol', '8')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '9')
define)
('symbol', '8')
define)
define)
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
('symbol', '9'))
(group
('symbol', '5')))
* optimized:
(func
('symbol', 'only')
(list
('symbol', '9')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '5'))
define)
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)'
abort: 00changelog.i@2: ambiguous identifier!
[255]
$ 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: drop magic of fullreposet membership test (issue4682)...
r25265 BROKEN: should be '-1'
Yuya Nishihara
revset: extend fullreposet to make "null" revision magically appears in set...
r24204 $ log 'first(null:)'
Yuya Nishihara
revset: drop magic of fullreposet membership test (issue4682)...
r25265 BROKEN: should be '-1'
Yuya Nishihara
revset: extend fullreposet to make "null" revision magically appears in set...
r24204 $ log 'min(null:)'
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
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
$ log '(all() + wdir()) & first(wdir() + .)'
2147483647
$ log '(all() + wdir()) & last(. + wdir())'
2147483647
Yuya Nishihara
revset: add wdir() function to specify workingctx revision by command...
r24419
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
('symbol', '3')
('symbol', '0')
define)
(range
('symbol', '0')
('symbol', '3')
follow)
define)
(range
('symbol', '2')
('symbol', '1')
any)
define)
* set:
<filteredset
<filteredset
<spanset- 0:3>,
<spanset+ 0:3>>,
<not
<spanset+ 1:2>>>
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
('symbol', '2')
('symbol', '0'))
(group
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
('symbol', '0')
('symbol', '1')
('symbol', '2')))))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * optimized:
(and
(range
('symbol', '2')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '0')
define)
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
('symbol', '_list')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('string', '0\x001\x002')
follow)
define)
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
<spanset- 0:2>,
<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
('symbol', '2')
('symbol', '0'))
(group
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
(range
('symbol', '0')
('symbol', '1'))
('symbol', '2')))))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * optimized:
(and
(range
('symbol', '2')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '0')
define)
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
revsetlang: enable optimization of 'x + y' expression...
r31800 ('symbol', '2')
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (range
('symbol', '0')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '1')
Yuya Nishihara
revsetlang: enable optimization of 'x + y' expression...
r31800 follow))
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 follow)
define)
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
<spanset- 0:2>,
<addset
Yuya Nishihara
revsetlang: enable optimization of 'x + y' expression...
r31800 <baseset [2]>,
<spanset+ 0:1>>>
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
('symbol', '2')
('symbol', '0'))
(func
('symbol', '_intlist')
('string', '0\x001\x002')))
* optimized:
(and
(func
('symbol', '_intlist')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('string', '0\x001\x002')
follow)
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (range
('symbol', '2')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '0')
define)
define)
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * set:
<filteredset
<spanset- 0:2>,
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
('symbol', '_intlist')
('string', '0\x002\x001'))
(range
('symbol', '2')
('symbol', '0')))
* optimized:
(and
(func
('symbol', '_intlist')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('string', '0\x002\x001')
define)
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (range
('symbol', '2')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '0')
follow)
define)
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]>,
<spanset- 0:2>>
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
('symbol', '2')
('symbol', '0'))
(func
('symbol', '_hexlist')
('string', '*'))) (glob)
* optimized:
(and
(range
('symbol', '2')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '0')
define)
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
('symbol', '_hexlist')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('string', '*') (glob)
follow)
define)
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
<spanset- 0:2>,
<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
('symbol', '_hexlist')
('string', '*')) (glob)
(range
('symbol', '2')
('symbol', '0')))
* optimized:
(and
(range
('symbol', '2')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '0')
follow)
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
('symbol', '_hexlist')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('string', '*') (glob)
define)
define)
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
('symbol', '2')
('symbol', '0')
define)
(func
('symbol', '_list')
('string', '0\x001')
any)
define)
* set:
<filteredset
<spanset- 0:2>,
<not
<baseset [0, 1]>>>
2
$ try -p optimized '2:0 & not (0:2 & (0 + 1))'
* optimized:
(difference
(range
('symbol', '2')
('symbol', '0')
define)
(and
(range
('symbol', '0')
('symbol', '2')
any)
(func
('symbol', '_list')
('string', '0\x001')
any)
any)
define)
* set:
<filteredset
<spanset- 0:2>,
<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
('symbol', 'present')
(func
('symbol', '_list')
('string', '2\x000\x001')
define)
define)
* 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
('symbol', '2')
('symbol', '0'))
(func
('symbol', 'present')
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
('symbol', '0')
('symbol', '1')
('symbol', '2')))))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * optimized:
(and
(range
('symbol', '2')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '0')
define)
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
('symbol', 'present')
(func
('symbol', '_list')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('string', '0\x001\x002')
Yuya Nishihara
revset: forward ordering requirement to argument of present()...
r29943 follow)
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 follow)
define)
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
<spanset- 0:2>,
<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
('symbol', '0')
('symbol', '2'))
(func
('symbol', 'reverse')
(func
('symbol', 'all')
None)))
* optimized:
(and
(range
('symbol', '0')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '2')
define)
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
('symbol', 'reverse')
(func
('symbol', 'all')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 None
define)
follow)
define)
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * set:
<filteredset
Yuya Nishihara
revset: make reverse() noop depending on ordering requirement (BC)...
r29945 <spanset+ 0:2>,
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 <spanset+ 0:9>>
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
('symbol', '0')
('symbol', '2'))
(func
('symbol', 'sort')
(list
(func
('symbol', 'all')
None)
(negate
('symbol', 'rev')))))
* optimized:
(and
(range
('symbol', '0')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '2')
define)
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
('symbol', 'sort')
(list
(func
('symbol', 'all')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 None
define)
('string', '-rev'))
follow)
define)
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * set:
<filteredset
Yuya Nishihara
revset: make sort() noop depending on ordering requirement (BC)...
r29946 <spanset+ 0:2>,
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 <spanset+ 0:9>>
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
('symbol', '2')
('symbol', '0'))
(func
('symbol', 'first')
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
('symbol', '1')
('symbol', '0')
('symbol', '2')))))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * optimized:
(and
(range
('symbol', '2')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '0')
define)
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
('symbol', 'first')
(func
('symbol', '_list')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('string', '1\x000\x002')
define)
follow)
define)
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * set:
<baseset
<limit n=1, offset=0,
<spanset- 0:2>,
<baseset [1, 0, 2]>>>
1
$ try --optimize '2:0 & not last(0 + 2 + 1)'
(and
(range
('symbol', '2')
('symbol', '0'))
(not
(func
('symbol', 'last')
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
('symbol', '0')
('symbol', '2')
('symbol', '1'))))))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * optimized:
(difference
(range
('symbol', '2')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '0')
define)
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
('symbol', 'last')
(func
('symbol', '_list')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('string', '0\x002\x001')
define)
any)
define)
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * set:
<filteredset
<spanset- 0:2>,
<not
<baseset
<last n=1,
<fullreposet+ 0:9>,
<baseset [1, 2, 0]>>>>>
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
('symbol', '2')
('symbol', '0'))
(range
(group
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
('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
('symbol', '0')
('symbol', '2')
('symbol', '1'))))))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * optimized:
(and
(range
('symbol', '2')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '0')
define)
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (range
(func
('symbol', '_list')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('string', '1\x000\x002')
define)
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
('symbol', '_list')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('string', '0\x002\x001')
define)
follow)
define)
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 <spanset- 0:2>,
<baseset [1]>>
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 'A & B' can be rewritten as 'B & A' by weight, but that's fine as long as
the ordering rule is determined before the rewrite; in this example,
'B' follows the order of the initial set, which is the same order as 'A'
since 'A' also follows the order:
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390
$ try --optimize 'contains("glob:*") & (2 + 0 + 1)'
(and
(func
('symbol', 'contains')
('string', 'glob:*'))
(group
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
('symbol', '2')
('symbol', '0')
('symbol', '1')))))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * optimized:
(and
(func
('symbol', '_list')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('string', '2\x000\x001')
follow)
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
('symbol', 'contains')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('string', 'glob:*')
define)
define)
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
('symbol', 'reverse')
(func
('symbol', 'contains')
('string', 'glob:*')))
(group
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
('symbol', '0')
('symbol', '2')
('symbol', '1')))))
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 * optimized:
(and
(func
('symbol', '_list')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('string', '0\x002\x001')
follow)
Yuya Nishihara
test-revset: show how inconsistent the ordering of compound expressions is...
r29390 (func
('symbol', 'reverse')
(func
('symbol', 'contains')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('string', 'glob:*')
define)
define)
define)
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
Yuya Nishihara
revsetlang: enable optimization of 'x + y' expression...
r31800 'A + B' can be rewritten to 'B + A' by weight only when the order doesn't
matter (e.g. 'X & (A + B)' can be 'X & (B + A)', but '(A + B) & X' can't):
$ try -p optimized '0:2 & (reverse(contains("a")) + 2)'
* optimized:
(and
(range
('symbol', '0')
('symbol', '2')
define)
(or
(list
('symbol', '2')
(func
('symbol', 'reverse')
(func
('symbol', 'contains')
('string', 'a')
define)
follow))
follow)
define)
* set:
<filteredset
<spanset+ 0:2>,
<addset
<baseset [2]>,
<filteredset
<fullreposet+ 0:9>,
<contains 'a'>>>>
0
1
2
$ try -p optimized '(reverse(contains("a")) + 2) & 0:2'
* optimized:
(and
(range
('symbol', '0')
('symbol', '2')
follow)
(or
(list
(func
('symbol', 'reverse')
(func
('symbol', 'contains')
('string', 'a')
define)
define)
('symbol', '2'))
define)
define)
* set:
<addset
<filteredset
<spanset- 0:2>,
<contains 'a'>>,
<baseset [2]>>
1
0
2
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
Mads Kiilerich
spelling: fixes from spell checker
r21024 test subtracting something from an addset
Lucas Moscovicz
revset: extend sorting tests
r20736
$ log '(outgoing() or removes(a)) - removes(a)'
8
9
test intersecting something with an addset
$ log 'parents(outgoing() or removes(a))'
1
4
5
Pierre-Yves David
revert: bring back usage of `subset & ps` in `parents`...
r22712 8
Lucas Moscovicz
revset: extend sorting tests
r20736
Pierre-Yves David
revset: restore order of `or` operation as in Mercurial 2.9...
r22861 test that `or` operation combines elements in the right order:
$ log '3:4 or 2:5'
3
4
2
5
$ log '3:4 or 5:2'
3
4
5
2
$ log 'sort(3:4 or 2:5)'
2
3
4
5
$ log 'sort(3:4 or 5:2)'
2
3
4
5
Yuya Nishihara
revrange: drop unnecessary deduplication of revisions...
r25383 test that more than one `-r`s are combined in the right order and deduplicated:
$ hg log -T '{rev}\n' -r 3 -r 3 -r 4 -r 5:2 -r 'ancestors(4)'
3
4
5
2
0
1
Yuya Nishihara
revset: test current behavior of addset class...
r25024 test that `or` operation skips duplicated revisions from right-hand side
$ try 'reverse(1::5) or ancestors(4)'
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
(func
('symbol', 'reverse')
(dagrange
('symbol', '1')
('symbol', '5')))
(func
('symbol', 'ancestors')
('symbol', '4'))))
Yuya Nishihara
revset: test current behavior of addset class...
r25024 * set:
<addset
Pierre-Yves David
reachableroots: use baseset lazy sorting...
r26061 <baseset- [1, 3, 5]>,
Yuya Nishihara
revset: drop redundant filteredset from right-hand side set of "or" operation...
r25129 <generatorset+>>
Yuya Nishihara
revset: test current behavior of addset class...
r25024 5
3
1
0
2
4
$ try 'sort(ancestors(4) or reverse(1::5))'
(func
('symbol', 'sort')
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
(func
('symbol', 'ancestors')
('symbol', '4'))
(func
('symbol', 'reverse')
(dagrange
('symbol', '1')
('symbol', '5'))))))
Yuya Nishihara
revset: test current behavior of addset class...
r25024 * set:
<addset+
<generatorset+>,
Pierre-Yves David
reachableroots: use baseset lazy sorting...
r26061 <baseset- [1, 3, 5]>>
Yuya Nishihara
revset: test current behavior of addset class...
r25024 0
1
2
3
4
5
Yuya Nishihara
revset: optimize 'or' operation of trivial revisions to a list...
r25343 test optimization of trivial `or` operation
$ try --optimize '0|(1)|"2"|-2|tip|null'
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
('symbol', '0')
(group
('symbol', '1'))
('string', '2')
(negate
('symbol', '2'))
('symbol', 'tip')
('symbol', 'null')))
Yuya Nishihara
revset: optimize 'or' operation of trivial revisions to a list...
r25343 * optimized:
(func
('symbol', '_list')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('string', '0\x001\x002\x00-2\x00tip\x00null')
define)
Yuya Nishihara
revset: optimize 'or' operation of trivial revisions to a list...
r25343 * set:
<baseset [0, 1, 2, 8, 9, -1]>
0
1
2
8
9
-1
$ try --optimize '0|1|2:3'
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
('symbol', '0')
('symbol', '1')
(range
('symbol', '2')
('symbol', '3'))))
Yuya Nishihara
revset: optimize 'or' operation of trivial revisions to a list...
r25343 * optimized:
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
(func
('symbol', '_list')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('string', '0\x001')
define)
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (range
('symbol', '2')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '3')
define))
define)
Yuya Nishihara
revset: optimize 'or' operation of trivial revisions to a list...
r25343 * set:
<addset
<baseset [0, 1]>,
<spanset+ 2:3>>
0
1
2
3
$ try --optimize '0:1|2|3:4|5|6'
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
(range
('symbol', '0')
('symbol', '1'))
('symbol', '2')
(range
('symbol', '3')
('symbol', '4'))
('symbol', '5')
('symbol', '6')))
Yuya Nishihara
revset: optimize 'or' operation of trivial revisions to a list...
r25343 * optimized:
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
(range
('symbol', '0')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '1')
define)
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 ('symbol', '2')
(range
('symbol', '3')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '4')
define)
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (func
('symbol', '_list')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('string', '5\x006')
define))
define)
Yuya Nishihara
revset: optimize 'or' operation of trivial revisions to a list...
r25343 * set:
<addset
<addset
<spanset+ 0:1>,
<baseset [2]>>,
<addset
<spanset+ 3:4>,
<baseset [5, 6]>>>
0
1
2
3
4
5
6
Yuya Nishihara
debugrevspec: add option to skip optimize() and evaluate unoptimized tree...
r29923 unoptimized `or` looks like this
$ try --no-optimized -p analyzed '0|1|2|3|4'
* analyzed:
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
('symbol', '0')
('symbol', '1')
('symbol', '2')
('symbol', '3')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '4'))
define)
Yuya Nishihara
debugrevspec: add option to skip optimize() and evaluate unoptimized tree...
r29923 * set:
<addset
<addset
<baseset [0]>,
<baseset [1]>>,
<addset
<baseset [2]>,
<addset
<baseset [3]>,
<baseset [4]>>>>
0
1
2
3
4
Yuya Nishihara
revset: optimize 'or' operation of trivial revisions to a list...
r25343 test that `_list` should be narrowed by provided `subset`
$ log '0:2 and (null|1|2|3)'
1
2
test that `_list` should remove duplicates
$ log '0|1|2|1|2|-1|tip'
0
1
2
9
test unknown revision in `_list`
$ log '0|unknown'
abort: unknown revision 'unknown'!
[255]
Yuya Nishihara
revset: add fast path for _list() of integer revisions...
r25344 test integer range in `_list`
$ log '-1|-10'
9
0
$ log '-10|-11'
abort: unknown revision '-11'!
[255]
$ log '9|10'
abort: unknown revision '10'!
[255]
test '0000' != '0' in `_list`
$ log '0|0000'
0
-1
timeless
revset: add hint for list error to use or
r27517 test ',' in `_list`
$ log '0,1'
hg: parse error: can't use a list in this context
(see hg help "revsets.x or y")
[255]
Yuya Nishihara
revset: flatten chained 'list' operations (aka function args) (issue5072)...
r27987 $ try '0,1,2'
(list
('symbol', '0')
('symbol', '1')
('symbol', '2'))
hg: parse error: can't use a list in this context
(see hg help "revsets.x or y")
[255]
timeless
revset: add hint for list error to use or
r27517
Yuya Nishihara
revset: reduce nesting of chained 'or' operations (issue4624)...
r25309 test that chained `or` operations make balanced addsets
$ try '0:1|1:2|2:3|3:4|4:5'
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
(range
('symbol', '0')
('symbol', '1'))
(range
('symbol', '1')
('symbol', '2'))
(range
('symbol', '2')
('symbol', '3'))
(range
('symbol', '3')
('symbol', '4'))
(range
('symbol', '4')
('symbol', '5'))))
Yuya Nishihara
revset: reduce nesting of chained 'or' operations (issue4624)...
r25309 * set:
<addset
<addset
<spanset+ 0:1>,
<spanset+ 1:2>>,
<addset
<spanset+ 2:3>,
<addset
<spanset+ 3:4>,
<spanset+ 4:5>>>>
0
1
2
3
4
5
Yuya Nishihara
revset: prevent crash caused by empty group expression while optimizing "or"...
r25996 no crash by empty group "()" while optimizing `or` operations
$ try --optimize '0|()'
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
('symbol', '0')
(group
None)))
Yuya Nishihara
revset: prevent crash caused by empty group expression while optimizing "or"...
r25996 * optimized:
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
('symbol', '0')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 None)
define)
Yuya Nishihara
revset: prevent crash caused by empty group expression while optimizing "or"...
r25996 hg: parse error: missing argument
[255]
Yuya Nishihara
revset: reduce nesting of chained 'or' operations (issue4624)...
r25309 test that chained `or` operations never eat up stack (issue4624)
(uses `0:1` instead of `0` to avoid future optimization of trivial revisions)
FUJIWARA Katsunori
tests: avoid nested quoting on command line for portability...
r27991 $ hg log -T '{rev}\n' -r `python -c "print '+'.join(['0:1'] * 500)"`
Yuya Nishihara
revset: reduce nesting of chained 'or' operations (issue4624)...
r25309 0
1
Yuya Nishihara
revrange: build balanced tree of addsets from revisions (issue4565)...
r25385 test that repeated `-r` options never eat up stack (issue4565)
(uses `-r 0::1` to avoid possible optimization at old-style parser)
$ hg log -T '{rev}\n' `python -c "for i in xrange(500): print '-r 0::1 ',"`
0
1
Siddharth Agarwal
revset: replace _missingancestors optimization with only revset...
r21893 check that conversion to only works
Siddharth Agarwal
revset: optimize missing ancestor expressions...
r20499 $ try --optimize '::3 - ::1'
(minus
(dagrangepre
('symbol', '3'))
(dagrangepre
('symbol', '1')))
* optimized:
(func
Siddharth Agarwal
revset: replace _missingancestors optimization with only revset...
r21893 ('symbol', 'only')
Siddharth Agarwal
revset: optimize missing ancestor expressions...
r20499 (list
('symbol', '3')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '1'))
define)
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<baseset+ [3]>
Siddharth Agarwal
revset: optimize missing ancestor expressions...
r20499 3
$ try --optimize 'ancestors(1) - ancestors(3)'
(minus
(func
('symbol', 'ancestors')
('symbol', '1'))
(func
('symbol', 'ancestors')
('symbol', '3')))
* optimized:
(func
Siddharth Agarwal
revset: replace _missingancestors optimization with only revset...
r21893 ('symbol', 'only')
Siddharth Agarwal
revset: optimize missing ancestor expressions...
r20499 (list
('symbol', '1')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '3'))
define)
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<baseset+ []>
Siddharth Agarwal
revset: optimize missing ancestor expressions...
r20499 $ try --optimize 'not ::2 and ::6'
(and
(not
(dagrangepre
('symbol', '2')))
(dagrangepre
('symbol', '6')))
* optimized:
(func
Siddharth Agarwal
revset: replace _missingancestors optimization with only revset...
r21893 ('symbol', 'only')
Siddharth Agarwal
revset: optimize missing ancestor expressions...
r20499 (list
('symbol', '6')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '2'))
define)
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<baseset+ [3, 4, 5, 6]>
Siddharth Agarwal
revset: optimize missing ancestor expressions...
r20499 3
4
5
6
$ try --optimize 'ancestors(6) and not ancestors(4)'
(and
(func
('symbol', 'ancestors')
('symbol', '6'))
(not
(func
('symbol', 'ancestors')
('symbol', '4'))))
* optimized:
(func
Siddharth Agarwal
revset: replace _missingancestors optimization with only revset...
r21893 ('symbol', 'only')
Siddharth Agarwal
revset: optimize missing ancestor expressions...
r20499 (list
('symbol', '6')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '4'))
define)
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<baseset+ [3, 5, 6]>
Siddharth Agarwal
revset: optimize missing ancestor expressions...
r20499 3
5
6
Yuya Nishihara
revset: prevent crash caused by empty group expression while optimizing "and"...
r25995 no crash by empty group "()" while optimizing to "only()"
$ try --optimize '::1 and ()'
(and
(dagrangepre
('symbol', '1'))
(group
None))
* optimized:
(and
None
(func
('symbol', 'ancestors')
Yuya Nishihara
revset: pass around ordering flags to operations...
r29932 ('symbol', '1')
define)
define)
Yuya Nishihara
revset: prevent crash caused by empty group expression while optimizing "and"...
r25995 hg: parse error: missing argument
[255]
Yuya Nishihara
revset: check invalid function syntax "func-name"() explicitly...
r29441 invalid function call should not be optimized to only()
$ log '"ancestors"(6) and not ancestors(4)'
hg: parse error: not a symbol
[255]
$ log 'ancestors(6) and not "ancestors"(4)'
hg: parse error: not a symbol
[255]
Simon King
revset: add pattern matching to 'tag' revset expression...
r16820 we can use patterns when searching for tags
$ log 'tag("1..*")'
FUJIWARA Katsunori
revset: raise RepoLookupError to make present() predicate continue the query...
r23978 abort: tag '1..*' does not exist!
Simon King
revset: add pattern matching to 'tag' revset expression...
r16820 [255]
$ log 'tag("re:1..*")'
6
$ log 'tag("re:[0-9].[0-9]")'
6
$ log 'tag("literal:1.0")'
6
$ log 'tag("re:0..*")'
Idan Kamara
tests: add tests for non-existant branch/tag/bookmark
r13925 $ log 'tag(unknown)'
FUJIWARA Katsunori
revset: raise RepoLookupError to make present() predicate continue the query...
r23978 abort: tag 'unknown' does not exist!
Idan Kamara
tests: add tests for non-existant branch/tag/bookmark
r13925 [255]
FUJIWARA Katsunori
revset: raise RepoLookupError to make present() predicate continue the query...
r23978 $ log 'tag("re:unknown")'
$ log 'present(tag("unknown"))'
$ log 'present(tag("re:unknown"))'
Idan Kamara
tests: add tests for non-existant branch/tag/bookmark
r13925 $ log 'branch(unknown)'
abort: unknown revision 'unknown'!
[255]
Yuya Nishihara
revset: do not fall through to revspec for literal: branch (issue4838)...
r26537 $ log 'branch("literal:unknown")'
abort: branch 'unknown' does not exist!
[255]
FUJIWARA Katsunori
revset: raise RepoLookupError to make present() predicate continue the query...
r23978 $ log 'branch("re:unknown")'
$ log 'present(branch("unknown"))'
$ log 'present(branch("re:unknown"))'
Nicolas Dumazet
util: get rid of extra trailing whitespace in parsedate abort message
r12105 $ log 'user(bob)'
2
$ log '4::8'
4
8
$ log '4:8'
4
5
6
7
8
$ log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")'
4
2
5
$ log 'not 0 and 0:2'
1
2
$ log 'not 1 and 0:2'
0
2
$ log 'not 2 and 0:2'
0
1
$ log '(1 and 2)::'
$ log '(1 and 2):'
$ log '(1 and 2):3'
$ log 'sort(head(), -rev)'
9
7
6
5
4
3
2
1
0
Matt Mackall
revset: lower precedence of minus infix (issue2361)
r12616 $ log '4::8 - 8'
4
Yuya Nishihara
test-revset: fix test vector for ordering issue of matching()...
r29321
matching() should preserve the order of the input set:
$ log '(2 or 3 or 1) and matching(1 or 2 or 3)'
Patrick Mezard
revset: make matching() preserve input revision order
r16640 2
3
1
Wagner Bruna
revset: disable subset optimization for parents() and children() (issue2437)...
r12786
FUJIWARA Katsunori
revset: raise RepoLookupError to make present() predicate continue the query...
r23978 $ log 'named("unknown")'
abort: namespace 'unknown' does not exist!
[255]
$ log 'named("re:unknown")'
abort: no namespace exists that match 'unknown'!
[255]
$ log 'present(named("unknown"))'
$ log 'present(named("re:unknown"))'
FUJIWARA Katsunori
revset: get revision number of each node from target namespaces...
r24008 $ log 'tag()'
6
$ log 'named("tags")'
6
Wagner Bruna
revset: disable subset optimization for parents() and children() (issue2437)...
r12786 issue2437
$ log '3 and p1(5)'
3
$ log '4 and p2(6)'
4
$ log '1 and parents(:2)'
1
$ log '2 and children(1:)'
2
$ log 'roots(all()) or roots(all())'
0
Patrick Mezard
revset: do not ignore input revisions in roots()...
r16394 $ hg debugrevspec 'roots(all()) or roots(all())'
0
Wagner Bruna
revset: disable subset optimization for parents() and children() (issue2437)...
r12786 $ log 'heads(branch(é)) or heads(branch(é))'
9
$ log 'ancestors(8) and (heads(branch("-a-b-c-")) or heads(branch(é)))'
4
Bernhard Leiner
revset: report a parse error if a revset is not parsed completely (issue2654)
r13665
issue2654: report a parse error if the revset was not completely parsed
$ log '1 OR 2'
hg: parse error at 2: invalid token
[255]
Augie Fackler
revsets: preserve ordering with the or operator...
r13932 or operator should preserve ordering:
$ log 'reverse(2::4) or tip'
4
2
9
Kevin Gessner
revset: add ^ and ~ operators from parentrevspec extension...
r14070
parentrevspec
$ log 'merge()^0'
6
$ log 'merge()^'
5
$ log 'merge()^1'
5
$ log 'merge()^2'
4
Yuya Nishihara
revset: for x^2, do not take null as a valid p2 revision...
r30179 $ log '(not merge())^2'
Kevin Gessner
revset: add tests for multiple and mixed ^ and ~ operators
r14080 $ log 'merge()^^'
3
$ log 'merge()^1^'
3
$ log 'merge()^^^'
1
Kevin Gessner
revset: add ^ and ~ operators from parentrevspec extension...
r14070
$ log 'merge()~0'
6
$ log 'merge()~1'
5
$ log 'merge()~2'
3
Kevin Gessner
revset: add tests for multiple and mixed ^ and ~ operators
r14080 $ log 'merge()~2^1'
1
Kevin Gessner
revset: add ^ and ~ operators from parentrevspec extension...
r14070 $ log 'merge()~3'
1
$ log '(-3:tip)^'
4
6
8
$ log 'tip^foo'
hg: parse error: ^ expects a number 0, 1, or 2
[255]
Alexander Solovyov
revset aliases
r14098
Augie Fackler
test-revset: add tests for missing function output...
r24220 Bogus function gets suggestions
$ log 'add()'
Augie Fackler
dispatch: offer suggestions of similar-named commands...
r24222 hg: parse error: unknown identifier: add
Bryan O'Sullivan
dispatch: report similar names consistently
r27623 (did you mean adds?)
Augie Fackler
test-revset: add tests for missing function output...
r24220 [255]
$ log 'added()'
Augie Fackler
dispatch: offer suggestions of similar-named commands...
r24222 hg: parse error: unknown identifier: added
Bryan O'Sullivan
dispatch: report similar names consistently
r27623 (did you mean adds?)
Augie Fackler
test-revset: add tests for missing function output...
r24220 [255]
$ log 'remo()'
Augie Fackler
dispatch: offer suggestions of similar-named commands...
r24222 hg: parse error: unknown identifier: remo
Augie Fackler
dispatch: offer near-edit-distance suggestions for {file,rev}set functions...
r24221 (did you mean one of remote, removes?)
Augie Fackler
test-revset: add tests for missing function output...
r24220 [255]
$ log 'babar()'
Augie Fackler
dispatch: offer suggestions of similar-named commands...
r24222 hg: parse error: unknown identifier: babar
Augie Fackler
test-revset: add tests for missing function output...
r24220 [255]
Matt Harbison
revset: don't suggest private or undocumented queries...
r25632 Bogus function with a similar internal name doesn't suggest the internal name
$ log 'matches()'
hg: parse error: unknown identifier: matches
Bryan O'Sullivan
dispatch: report similar names consistently
r27623 (did you mean matching?)
Matt Harbison
revset: don't suggest private or undocumented queries...
r25632 [255]
Undocumented functions aren't suggested as similar either
Yuya Nishihara
revset: document wdir() as an experimental function...
r30701 $ log 'tagged2()'
hg: parse error: unknown identifier: tagged2
Matt Harbison
revset: don't suggest private or undocumented queries...
r25632 [255]
Durham Goode
scmutil: fix revrange when multiple revs are specified...
r20798 multiple revspecs
$ hg log -r 'tip~1:tip' -r 'tip~2:tip~1' --template '{rev}\n'
8
9
4
5
6
7
Pierre-Yves David
revpair: smartset compatibility...
r20862 test usage in revpair (with "+")
(real pair)
$ hg diff -r 'tip^^' -r 'tip'
diff -r 2326846efdab -r 24286f4ae135 .hgtags
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
@@ -0,0 +1,1 @@
+e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
$ hg diff -r 'tip^^::tip'
diff -r 2326846efdab -r 24286f4ae135 .hgtags
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
@@ -0,0 +1,1 @@
+e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
(single rev)
$ hg diff -r 'tip^' -r 'tip^'
Yuya Nishihara
revpair: restrict odd-range handling to top-level x:y expression (issue4774)...
r26020 $ hg diff -r 'tip^:tip^'
Pierre-Yves David
revpair: smartset compatibility...
r20862
(single rev that does not looks like a range)
Yuya Nishihara
revpair: restrict odd-range handling to top-level x:y expression (issue4774)...
r26020 $ hg diff -r 'tip^::tip^ or tip^'
diff -r d5d0dcbdc4d9 .hgtags
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgtags * (glob)
@@ -0,0 +1,1 @@
+e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
Pierre-Yves David
revpair: smartset compatibility...
r20862 $ hg diff -r 'tip^ or tip^'
diff -r d5d0dcbdc4d9 .hgtags
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgtags * (glob)
@@ -0,0 +1,1 @@
+e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0
(no rev)
$ hg diff -r 'author("babar") or author("celeste")'
abort: empty revision range
[255]
Alexander Solovyov
revset aliases
r14098 aliases:
$ echo '[revsetalias]' >> .hg/hgrc
$ echo 'm = merge()' >> .hg/hgrc
Siddharth Agarwal
ui: disable revsetaliases in plain mode (BC)...
r24883 (revset aliases can override builtin revsets)
$ echo 'p2($1) = p1($1)' >> .hg/hgrc
Patrick Mezard
revset: fix alias substitution recursion (issue3240)...
r16096 $ echo 'sincem = descendants(m)' >> .hg/hgrc
Alexander Solovyov
revset aliases
r14098 $ echo 'd($1) = reverse(sort($1, date))' >> .hg/hgrc
$ echo 'rs(ARG1, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc
Mads Kiilerich
revset: fix aliases with 0 or more than 2 parameters...
r14723 $ echo 'rs4(ARG1, ARGA, ARGB, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc
Alexander Solovyov
revset aliases
r14098
$ try m
('symbol', 'm')
Yuya Nishihara
debugrevspec: show expanded/concatenated states before printing trees...
r28629 * expanded:
Patrick Mezard
debugrevspec: pretty print output...
r16218 (func
('symbol', 'merge')
None)
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<filteredset
Yuya Nishihara
revset: add inspection data to all filter() calls...
r28424 <fullreposet+ 0:9>,
<merge>>
Alexander Solovyov
revset aliases
r14098 6
Patrick Mezard
revset: fix alias substitution recursion (issue3240)...
r16096
FUJIWARA Katsunori
tests: make tests with temporary environment setting portable...
r24892 $ HGPLAIN=1
$ export HGPLAIN
$ try m
Siddharth Agarwal
ui: disable revsetaliases in plain mode (BC)...
r24883 ('symbol', 'm')
abort: unknown revision 'm'!
[255]
FUJIWARA Katsunori
tests: make tests with temporary environment setting portable...
r24892 $ HGPLAINEXCEPT=revsetalias
$ export HGPLAINEXCEPT
$ try m
Siddharth Agarwal
ui: disable revsetaliases in plain mode (BC)...
r24883 ('symbol', 'm')
Yuya Nishihara
debugrevspec: show expanded/concatenated states before printing trees...
r28629 * expanded:
Siddharth Agarwal
ui: disable revsetaliases in plain mode (BC)...
r24883 (func
('symbol', 'merge')
None)
* set:
<filteredset
Yuya Nishihara
revset: add inspection data to all filter() calls...
r28424 <fullreposet+ 0:9>,
<merge>>
Siddharth Agarwal
ui: disable revsetaliases in plain mode (BC)...
r24883 6
$ unset HGPLAIN
$ unset HGPLAINEXCEPT
$ try 'p2(.)'
(func
('symbol', 'p2')
('symbol', '.'))
Yuya Nishihara
debugrevspec: show expanded/concatenated states before printing trees...
r28629 * expanded:
Siddharth Agarwal
ui: disable revsetaliases in plain mode (BC)...
r24883 (func
('symbol', 'p1')
('symbol', '.'))
* set:
<baseset+ [8]>
8
FUJIWARA Katsunori
tests: make tests with temporary environment setting portable...
r24892 $ HGPLAIN=1
$ export HGPLAIN
$ try 'p2(.)'
Siddharth Agarwal
ui: disable revsetaliases in plain mode (BC)...
r24883 (func
('symbol', 'p2')
('symbol', '.'))
* set:
<baseset+ []>
FUJIWARA Katsunori
tests: make tests with temporary environment setting portable...
r24892 $ HGPLAINEXCEPT=revsetalias
$ export HGPLAINEXCEPT
$ try 'p2(.)'
Siddharth Agarwal
ui: disable revsetaliases in plain mode (BC)...
r24883 (func
('symbol', 'p2')
('symbol', '.'))
Yuya Nishihara
debugrevspec: show expanded/concatenated states before printing trees...
r28629 * expanded:
Siddharth Agarwal
ui: disable revsetaliases in plain mode (BC)...
r24883 (func
('symbol', 'p1')
('symbol', '.'))
* set:
<baseset+ [8]>
8
$ unset HGPLAIN
$ unset HGPLAINEXCEPT
Patrick Mezard
revset: fix alias substitution recursion (issue3240)...
r16096 test alias recursion
$ try sincem
('symbol', 'sincem')
Yuya Nishihara
debugrevspec: show expanded/concatenated states before printing trees...
r28629 * expanded:
Patrick Mezard
debugrevspec: pretty print output...
r16218 (func
('symbol', 'descendants')
(func
('symbol', 'merge')
None))
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<addset+
<filteredset
Yuya Nishihara
revset: add inspection data to all filter() calls...
r28424 <fullreposet+ 0:9>,
<merge>>,
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 <generatorset+>>
Alexander Solovyov
revset aliases
r14098 6
Patrick Mezard
revset: fix alias substitution recursion (issue3240)...
r16096 7
test infinite recursion
$ echo 'recurse1 = recurse2' >> .hg/hgrc
$ echo 'recurse2 = recurse1' >> .hg/hgrc
$ try recurse1
('symbol', 'recurse1')
hg: parse error: infinite expansion of revset alias "recurse1" detected
[255]
Patrick Mezard
revset: fix infinite alias expansion detection...
r16772 $ echo 'level1($1, $2) = $1 or $2' >> .hg/hgrc
$ echo 'level2($1, $2) = level1($2, $1)' >> .hg/hgrc
$ try "level2(level1(1, 2), 3)"
(func
('symbol', 'level2')
(list
(func
('symbol', 'level1')
(list
('symbol', '1')
('symbol', '2')))
('symbol', '3')))
Yuya Nishihara
debugrevspec: show expanded/concatenated states before printing trees...
r28629 * expanded:
Patrick Mezard
revset: fix infinite alias expansion detection...
r16772 (or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
('symbol', '3')
(or
(list
('symbol', '1')
('symbol', '2')))))
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<addset
<baseset [3]>,
Yuya Nishihara
revset: optimize 'or' operation of trivial revisions to a list...
r25343 <baseset [1, 2]>>
Patrick Mezard
revset: fix infinite alias expansion detection...
r16772 3
1
2
Patrick Mezard
revset: fix alias substitution recursion (issue3240)...
r16096 test nesting and variable passing
$ echo 'nested($1) = nested2($1)' >> .hg/hgrc
$ echo 'nested2($1) = nested3($1)' >> .hg/hgrc
$ echo 'nested3($1) = max($1)' >> .hg/hgrc
$ try 'nested(2:5)'
Patrick Mezard
debugrevspec: pretty print output...
r16218 (func
('symbol', 'nested')
(range
('symbol', '2')
('symbol', '5')))
Yuya Nishihara
debugrevspec: show expanded/concatenated states before printing trees...
r28629 * expanded:
Patrick Mezard
debugrevspec: pretty print output...
r16218 (func
('symbol', 'max')
(range
('symbol', '2')
('symbol', '5')))
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
Yuya Nishihara
revset: add inspection data to max() and min() functions...
r28427 <baseset
<max
<fullreposet+ 0:9>,
<spanset+ 2:5>>>
Patrick Mezard
revset: fix alias substitution recursion (issue3240)...
r16096 5
Yuya Nishihara
revset: reduce nesting of chained 'or' operations (issue4624)...
r25309 test chained `or` operations are flattened at parsing phase
$ echo 'chainedorops($1, $2, $3) = $1|$2|$3' >> .hg/hgrc
$ try 'chainedorops(0:1, 1:2, 2:3)'
(func
('symbol', 'chainedorops')
(list
Yuya Nishihara
revset: flatten chained 'list' operations (aka function args) (issue5072)...
r27987 (range
('symbol', '0')
('symbol', '1'))
(range
('symbol', '1')
('symbol', '2'))
Yuya Nishihara
revset: reduce nesting of chained 'or' operations (issue4624)...
r25309 (range
('symbol', '2')
('symbol', '3'))))
Yuya Nishihara
debugrevspec: show expanded/concatenated states before printing trees...
r28629 * expanded:
Yuya Nishihara
revset: reduce nesting of chained 'or' operations (issue4624)...
r25309 (or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
(range
('symbol', '0')
('symbol', '1'))
(range
('symbol', '1')
('symbol', '2'))
(range
('symbol', '2')
('symbol', '3'))))
Yuya Nishihara
revset: reduce nesting of chained 'or' operations (issue4624)...
r25309 * set:
<addset
<spanset+ 0:1>,
<addset
<spanset+ 1:2>,
<spanset+ 2:3>>>
0
1
2
3
Patrick Mezard
revset: fix alias substitution recursion (issue3240)...
r16096 test variable isolation, variable placeholders are rewritten as string
then parsed and matched again as string. Check they do not leak too
far away.
$ echo 'injectparamasstring = max("$1")' >> .hg/hgrc
$ echo 'callinjection($1) = descendants(injectparamasstring)' >> .hg/hgrc
$ try 'callinjection(2:5)'
Patrick Mezard
debugrevspec: pretty print output...
r16218 (func
('symbol', 'callinjection')
(range
('symbol', '2')
('symbol', '5')))
Yuya Nishihara
debugrevspec: show expanded/concatenated states before printing trees...
r28629 * expanded:
Patrick Mezard
debugrevspec: pretty print output...
r16218 (func
('symbol', 'descendants')
(func
('symbol', 'max')
('string', '$1')))
Patrick Mezard
revset: fix alias substitution recursion (issue3240)...
r16096 abort: unknown revision '$1'!
[255]
Yuya Nishihara
revset: add test that should fail if '_aliasarg' tag is removed...
r28688 test scope of alias expansion: 'universe' is expanded prior to 'shadowall(0)',
Mads Kiilerich
spelling: fixes of non-dictionary words
r30332 but 'all()' should never be substituted to '0()'.
Yuya Nishihara
revset: add test that should fail if '_aliasarg' tag is removed...
r28688
$ echo 'universe = all()' >> .hg/hgrc
$ echo 'shadowall(all) = all and universe' >> .hg/hgrc
$ try 'shadowall(0)'
(func
('symbol', 'shadowall')
('symbol', '0'))
* expanded:
(and
('symbol', '0')
(func
('symbol', 'all')
None))
* set:
<filteredset
<baseset [0]>,
<spanset+ 0:9>>
0
Yuya Nishihara
revset: drop redundant check for unknown alias arguments...
r28690 test unknown reference:
$ try "unknownref(0)" --config 'revsetalias.unknownref($1)=$1:$2'
(func
('symbol', 'unknownref')
('symbol', '0'))
Yuya Nishihara
parser: shorten prefix of alias parsing errors...
r29059 abort: bad definition of revset alias "unknownref": invalid symbol '$2'
Yuya Nishihara
revset: drop redundant check for unknown alias arguments...
r28690 [255]
FUJIWARA Katsunori
revset: delay showing parse error for the revset alias until it is referred...
r23725 $ hg debugrevspec --debug --config revsetalias.anotherbadone='branch(' "tip"
('symbol', 'tip')
Yuya Nishihara
parser: shorten prefix of alias parsing errors...
r29059 warning: bad definition of revset alias "anotherbadone": at 7: not a prefix: end
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<baseset [9]>
FUJIWARA Katsunori
revset: delay showing parse error for the revset alias until it is referred...
r23725 9
Patrick Mezard
revset: explicitely tag alias arguments for expansion...
r16771
FUJIWARA Katsunori
revset: delay showing parse error for the revset alias until it is referred...
r23725 $ try 'tip'
('symbol', 'tip')
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<baseset [9]>
FUJIWARA Katsunori
revset: delay showing parse error for the revset alias until it is referred...
r23725 9
FUJIWARA Katsunori
revset: parse alias declaration strictly by _parsealiasdecl...
r23846
$ hg debugrevspec --debug --config revsetalias.'bad name'='tip' "tip"
('symbol', 'tip')
Yuya Nishihara
parser: shorten prefix of alias parsing errors...
r29059 warning: bad declaration of revset alias "bad name": at 4: invalid token
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<baseset [9]>
FUJIWARA Katsunori
revset: parse alias declaration strictly by _parsealiasdecl...
r23846 9
FUJIWARA Katsunori
revset: replace parsing alias definition by _parsealiasdefn to parse strictly...
r23994 $ echo 'strictreplacing($1, $10) = $10 or desc("$1")' >> .hg/hgrc
$ try 'strictreplacing("foo", tip)'
(func
('symbol', 'strictreplacing')
(list
('string', 'foo')
('symbol', 'tip')))
Yuya Nishihara
debugrevspec: show expanded/concatenated states before printing trees...
r28629 * expanded:
FUJIWARA Katsunori
revset: replace parsing alias definition by _parsealiasdefn to parse strictly...
r23994 (or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
('symbol', 'tip')
(func
('symbol', 'desc')
('string', '$1'))))
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<addset
<baseset [9]>,
<filteredset
Yuya Nishihara
revset: add inspection data to all filter() calls...
r28424 <fullreposet+ 0:9>,
<desc '$1'>>>
FUJIWARA Katsunori
revset: replace parsing alias definition by _parsealiasdefn to parse strictly...
r23994 9
FUJIWARA Katsunori
revset: parse alias declaration strictly by _parsealiasdecl...
r23846
Alexander Solovyov
revset aliases
r14098 $ try 'd(2:5)'
Patrick Mezard
debugrevspec: pretty print output...
r16218 (func
('symbol', 'd')
(range
('symbol', '2')
('symbol', '5')))
Yuya Nishihara
debugrevspec: show expanded/concatenated states before printing trees...
r28629 * expanded:
Patrick Mezard
debugrevspec: pretty print output...
r16218 (func
('symbol', 'reverse')
(func
('symbol', 'sort')
(list
(range
('symbol', '2')
('symbol', '5'))
('symbol', 'date'))))
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<baseset [4, 5, 3, 2]>
Alexander Solovyov
revset aliases
r14098 4
5
3
2
$ try 'rs(2 or 3, date)'
Patrick Mezard
debugrevspec: pretty print output...
r16218 (func
('symbol', 'rs')
(list
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
('symbol', '2')
('symbol', '3')))
Patrick Mezard
debugrevspec: pretty print output...
r16218 ('symbol', 'date')))
Yuya Nishihara
debugrevspec: show expanded/concatenated states before printing trees...
r28629 * expanded:
Patrick Mezard
debugrevspec: pretty print output...
r16218 (func
('symbol', 'reverse')
(func
('symbol', 'sort')
(list
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
('symbol', '2')
('symbol', '3')))
Patrick Mezard
debugrevspec: pretty print output...
r16218 ('symbol', 'date'))))
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<baseset [3, 2]>
Alexander Solovyov
revset aliases
r14098 3
2
Mads Kiilerich
revset: fix aliases with 0 or more than 2 parameters...
r14723 $ try 'rs()'
Patrick Mezard
debugrevspec: pretty print output...
r16218 (func
('symbol', 'rs')
None)
Mads Kiilerich
revset: fix aliases with 0 or more than 2 parameters...
r14723 hg: parse error: invalid number of arguments: 0
[255]
$ try 'rs(2)'
Patrick Mezard
debugrevspec: pretty print output...
r16218 (func
('symbol', 'rs')
('symbol', '2'))
Mads Kiilerich
revset: fix aliases with 0 or more than 2 parameters...
r14723 hg: parse error: invalid number of arguments: 1
[255]
$ try 'rs(2, data, 7)'
Patrick Mezard
debugrevspec: pretty print output...
r16218 (func
('symbol', 'rs')
(list
Yuya Nishihara
revset: flatten chained 'list' operations (aka function args) (issue5072)...
r27987 ('symbol', '2')
('symbol', 'data')
Patrick Mezard
debugrevspec: pretty print output...
r16218 ('symbol', '7')))
Mads Kiilerich
revset: fix aliases with 0 or more than 2 parameters...
r14723 hg: parse error: invalid number of arguments: 3
[255]
$ try 'rs4(2 or 3, x, x, date)'
Patrick Mezard
debugrevspec: pretty print output...
r16218 (func
('symbol', 'rs4')
(list
Yuya Nishihara
revset: flatten chained 'list' operations (aka function args) (issue5072)...
r27987 (or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
('symbol', '2')
('symbol', '3')))
Yuya Nishihara
revset: flatten chained 'list' operations (aka function args) (issue5072)...
r27987 ('symbol', 'x')
('symbol', 'x')
Patrick Mezard
debugrevspec: pretty print output...
r16218 ('symbol', 'date')))
Yuya Nishihara
debugrevspec: show expanded/concatenated states before printing trees...
r28629 * expanded:
Patrick Mezard
debugrevspec: pretty print output...
r16218 (func
('symbol', 'reverse')
(func
('symbol', 'sort')
(list
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
('symbol', '2')
('symbol', '3')))
Patrick Mezard
debugrevspec: pretty print output...
r16218 ('symbol', 'date'))))
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<baseset [3, 2]>
Mads Kiilerich
revset: fix aliases with 0 or more than 2 parameters...
r14723 3
2
Mads Kiilerich
revset: avoid over-aggresive optimizations of non-filtering functions (issue2549)...
r14153
Jordi Gutiérrez Hermoso
revrange: don't parse revset aliases as hash prefixes (issue4553)...
r24175 issue4553: check that revset aliases override existing hash prefix
$ hg log -qr e
6:e0cc66ef77e8
$ hg log -qr e --config revsetalias.e="all()"
0:2785f51eece5
1:d75937da8da0
2:5ed5505e9f1c
3:8528aa5637f2
4:2326846efdab
5:904fa392b941
6:e0cc66ef77e8
7:013af1973af4
8:d5d0dcbdc4d9
9:24286f4ae135
$ hg log -qr e: --config revsetalias.e="0"
0:2785f51eece5
1:d75937da8da0
2:5ed5505e9f1c
3:8528aa5637f2
4:2326846efdab
5:904fa392b941
6:e0cc66ef77e8
7:013af1973af4
8:d5d0dcbdc4d9
9:24286f4ae135
$ hg log -qr :e --config revsetalias.e="9"
0:2785f51eece5
1:d75937da8da0
2:5ed5505e9f1c
3:8528aa5637f2
4:2326846efdab
5:904fa392b941
6:e0cc66ef77e8
7:013af1973af4
8:d5d0dcbdc4d9
9:24286f4ae135
$ hg log -qr e:
6:e0cc66ef77e8
7:013af1973af4
8:d5d0dcbdc4d9
9:24286f4ae135
$ hg log -qr :e
0:2785f51eece5
1:d75937da8da0
2:5ed5505e9f1c
3:8528aa5637f2
4:2326846efdab
5:904fa392b941
6:e0cc66ef77e8
Mads Kiilerich
revset: avoid over-aggresive optimizations of non-filtering functions (issue2549)...
r14153 issue2549 - correct optimizations
Yuya Nishihara
revset: add inspection data to limit() and last() functions...
r28426 $ try 'limit(1 or 2 or 3, 2) and not 2'
(and
(func
('symbol', 'limit')
(list
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
('symbol', '1')
('symbol', '2')
('symbol', '3')))
Yuya Nishihara
revset: add inspection data to limit() and last() functions...
r28426 ('symbol', '2')))
(not
('symbol', '2')))
* set:
<filteredset
<baseset
<limit n=2, offset=0,
<fullreposet+ 0:9>,
<baseset [1, 2, 3]>>>,
<not
<baseset [2]>>>
Mads Kiilerich
revset: avoid over-aggresive optimizations of non-filtering functions (issue2549)...
r14153 1
Yuya Nishihara
revset: add inspection data to max() and min() functions...
r28427 $ try 'max(1 or 2) and not 2'
(and
(func
('symbol', 'max')
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
('symbol', '1')
('symbol', '2'))))
Yuya Nishihara
revset: add inspection data to max() and min() functions...
r28427 (not
('symbol', '2')))
* set:
<filteredset
<baseset
<max
<fullreposet+ 0:9>,
<baseset [1, 2]>>>,
<not
<baseset [2]>>>
$ try 'min(1 or 2) and not 1'
(and
(func
('symbol', 'min')
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
('symbol', '1')
('symbol', '2'))))
Yuya Nishihara
revset: add inspection data to max() and min() functions...
r28427 (not
('symbol', '1')))
* set:
<filteredset
<baseset
<min
<fullreposet+ 0:9>,
<baseset [1, 2]>>>,
<not
<baseset [1]>>>
Yuya Nishihara
revset: add inspection data to limit() and last() functions...
r28426 $ try 'last(1 or 2, 1) and not 2'
(and
(func
('symbol', 'last')
(list
(or
Yuya Nishihara
revset: wrap arguments of 'or' by 'list' node...
r29929 (list
('symbol', '1')
('symbol', '2')))
Yuya Nishihara
revset: add inspection data to limit() and last() functions...
r28426 ('symbol', '1')))
(not
('symbol', '2')))
* set:
<filteredset
<baseset
<last n=1,
<fullreposet+ 0:9>,
<baseset [2, 1]>>>,
<not
<baseset [2]>>>
FUJIWARA Katsunori
i18n: use "encoding.lower()" to normalize specified string for revset...
r15726
Matt Mackall
revset: maintain ordering when subtracting from a baseset (issue4289)
r21870 issue4289 - ordering of built-ins
$ hg log -M -q -r 3:2
3:8528aa5637f2
2:5ed5505e9f1c
FUJIWARA Katsunori
test: add test for the issue introduced by e410be860393 (issue3669)...
r17858 test revsets started with 40-chars hash (issue3669)
$ ISSUE3669_TIP=`hg tip --template '{node}'`
$ hg log -r "${ISSUE3669_TIP}" --template '{rev}\n'
9
$ hg log -r "${ISSUE3669_TIP}^" --template '{rev}\n'
8
FUJIWARA Katsunori
revset: evaluate sub expressions correctly (issue3775)...
r18473 test or-ed indirect predicates (issue3775)
$ log '6 or 6^1' | sort
5
6
$ log '6^1 or 6' | sort
5
6
$ log '4 or 4~1' | sort
2
4
$ log '4~1 or 4' | sort
2
4
$ log '(0 or 2):(4 or 6) or 0 or 6' | sort
0
1
2
3
4
5
6
$ log '0 or 6 or (0 or 2):(4 or 6)' | sort
0
1
2
3
4
5
6
FUJIWARA Katsunori
revset: add tests for 'remote()' predicate
r16008 tests for 'remote()' predicate:
#. (csets in remote) (id) (remote)
1. less than local current branch "default"
2. same with local specified "default"
3. more than local specified specified
$ hg clone --quiet -U . ../remote3
$ cd ../remote3
$ hg update -q 7
$ echo r > r
$ hg ci -Aqm 10
$ log 'remote()'
7
$ log 'remote("a-b-c-")'
2
$ cd ../repo
$ log 'remote(".a.b.c.", "../remote3")'
FUJIWARA Katsunori
revset: introduce new operator "##" to concatenate strings/symbols at runtime...
r23742 tests for concatenation of strings/symbols by "##"
$ try "278 ## '5f5' ## 1ee ## 'ce5'"
(_concat
(_concat
(_concat
('symbol', '278')
('string', '5f5'))
('symbol', '1ee'))
('string', 'ce5'))
Yuya Nishihara
debugrevspec: show expanded/concatenated states before printing trees...
r28629 * concatenated:
FUJIWARA Katsunori
revset: introduce new operator "##" to concatenate strings/symbols at runtime...
r23742 ('string', '2785f51eece5')
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<baseset [0]>
FUJIWARA Katsunori
revset: introduce new operator "##" to concatenate strings/symbols at runtime...
r23742 0
$ echo 'cat4($1, $2, $3, $4) = $1 ## $2 ## $3 ## $4' >> .hg/hgrc
$ try "cat4(278, '5f5', 1ee, 'ce5')"
(func
('symbol', 'cat4')
(list
Yuya Nishihara
revset: flatten chained 'list' operations (aka function args) (issue5072)...
r27987 ('symbol', '278')
('string', '5f5')
('symbol', '1ee')
FUJIWARA Katsunori
revset: introduce new operator "##" to concatenate strings/symbols at runtime...
r23742 ('string', 'ce5')))
Yuya Nishihara
debugrevspec: show expanded/concatenated states before printing trees...
r28629 * expanded:
FUJIWARA Katsunori
revset: introduce new operator "##" to concatenate strings/symbols at runtime...
r23742 (_concat
(_concat
(_concat
('symbol', '278')
('string', '5f5'))
('symbol', '1ee'))
('string', 'ce5'))
Yuya Nishihara
debugrevspec: show expanded/concatenated states before printing trees...
r28629 * concatenated:
FUJIWARA Katsunori
revset: introduce new operator "##" to concatenate strings/symbols at runtime...
r23742 ('string', '2785f51eece5')
Yuya Nishihara
debugrevspec: show nesting structure of smartsets if verbose...
r24458 * set:
<baseset [0]>
FUJIWARA Katsunori
revset: introduce new operator "##" to concatenate strings/symbols at runtime...
r23742 0
(check concatenation in alias nesting)
$ echo 'cat2($1, $2) = $1 ## $2' >> .hg/hgrc
$ echo 'cat2x2($1, $2, $3, $4) = cat2($1 ## $2, $3 ## $4)' >> .hg/hgrc
$ log "cat2x2(278, '5f5', 1ee, 'ce5')"
0
(check operator priority)
$ echo 'cat2n2($1, $2, $3, $4) = $1 ## $2 or $3 ## $4~2' >> .hg/hgrc
$ log "cat2n2(2785f5, 1eece5, 24286f, 4ae135)"
0
4
FUJIWARA Katsunori
i18n: use "encoding.lower()" to normalize specified string for revset...
r15726 $ cd ..
Yuya Nishihara
revset: drop magic of fullreposet membership test (issue4682)...
r25265 prepare repository that has "default" branches of multiple roots
$ hg init namedbranch
$ cd namedbranch
$ echo default0 >> a
$ hg ci -Aqm0
$ echo default1 >> a
$ hg ci -m1
$ hg branch -q stable
$ echo stable2 >> a
$ hg ci -m2
$ echo stable3 >> a
$ hg ci -m3
$ hg update -q null
$ echo default4 >> a
$ hg ci -Aqm4
$ echo default5 >> a
$ hg ci -m5
Yuya Nishihara
revbranchcache: return uncached branchinfo for nullrev (issue4683)...
r25266 "null" revision belongs to "default" branch (issue4683)
$ log 'branch(null)'
0
1
4
5
Yuya Nishihara
revset: drop magic of fullreposet membership test (issue4682)...
r25265 "null" revision belongs to "default" branch, but it shouldn't appear in set
unless explicitly specified (issue4682)
$ log 'children(branch(default))'
1
2
5
$ cd ..
FUJIWARA Katsunori
i18n: use "encoding.lower()" to normalize specified string for revset...
r15726 test author/desc/keyword in problematic encoding
# unicode: cp932:
# u30A2 0x83 0x41(= 'A')
# u30C2 0x83 0x61(= 'a')
$ hg init problematicencoding
$ cd problematicencoding
$ python > setup.sh <<EOF
> print u'''
> echo a > text
> hg add text
> hg --encoding utf-8 commit -u '\u30A2' -m none
> echo b > text
> hg --encoding utf-8 commit -u '\u30C2' -m none
> echo c > text
> hg --encoding utf-8 commit -u none -m '\u30A2'
> echo d > text
> hg --encoding utf-8 commit -u none -m '\u30C2'
> '''.encode('utf-8')
> EOF
$ sh < setup.sh
test in problematic encoding
$ python > test.sh <<EOF
> print u'''
> hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30A2)'
> echo ====
> hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30C2)'
> echo ====
> hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30A2)'
> echo ====
> hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30C2)'
> echo ====
> hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30A2)'
> echo ====
> hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30C2)'
> '''.encode('cp932')
> EOF
$ sh < test.sh
0
====
1
====
2
====
3
====
0
2
====
1
3
Ryan McElroy
revsets: show current revset abort behavior
r24707 test error message of bad revset
$ hg log -r 'foo\\'
Ryan McElroy
revsets: more informative syntax error message...
r24708 hg: parse error at 3: syntax error in revset 'foo\\'
Ryan McElroy
revsets: show current revset abort behavior
r24707 [255]
FUJIWARA Katsunori
i18n: use "encoding.lower()" to normalize specified string for revset...
r15726 $ cd ..
FUJIWARA Katsunori
revset: use delayregistrar to register predicate in extension easily...
r27586
FUJIWARA Katsunori
revset: replace extpredicate by revsetpredicate of registrar...
r28394 Test that revset predicate of extension isn't loaded at failure of
loading it
FUJIWARA Katsunori
revset: use delayregistrar to register predicate in extension easily...
r27586
$ cd repo
$ cat <<EOF > $TESTTMP/custompredicate.py
FUJIWARA Katsunori
revset: replace extpredicate by revsetpredicate of registrar...
r28394 > from mercurial import error, registrar, revset
FUJIWARA Katsunori
revset: use delayregistrar to register predicate in extension easily...
r27586 >
FUJIWARA Katsunori
revset: replace extpredicate by revsetpredicate of registrar...
r28394 > revsetpredicate = registrar.revsetpredicate()
FUJIWARA Katsunori
revset: use delayregistrar to register predicate in extension easily...
r27586 >
> @revsetpredicate('custom1()')
> def custom1(repo, subset, x):
> return revset.baseset([1])
>
FUJIWARA Katsunori
revset: replace extpredicate by revsetpredicate of registrar...
r28394 > raise error.Abort('intentional failure of loading extension')
FUJIWARA Katsunori
revset: use delayregistrar to register predicate in extension easily...
r27586 > EOF
$ cat <<EOF > .hg/hgrc
> [extensions]
> custompredicate = $TESTTMP/custompredicate.py
> EOF
$ hg debugrevspec "custom1()"
FUJIWARA Katsunori
revset: replace extpredicate by revsetpredicate of registrar...
r28394 *** failed to import extension custompredicate from $TESTTMP/custompredicate.py: intentional failure of loading extension
FUJIWARA Katsunori
revset: use delayregistrar to register predicate in extension easily...
r27586 hg: parse error: unknown identifier: custom1
[255]
$ cd ..