# HG changeset patch # User Martin von Zweigbergk # Date 2020-11-17 00:00:50 # Node ID fc4fb2f17dd4e85eb1660caf9842506576e6f98d # Parent 9dc1351d0b5f304caa282af27f40021f4bcf6981 errors: use exit code 10 for parse errors Now that `ParseError`s raised while reading the config file has been converted into `ConfigError`s, the remaining parse errors should all be "input errors" (i.e. exit code 10), according to https://www.mercurial-scm.org/wiki/ErrorCategoriesPlan. Differential Revision: https://phab.mercurial-scm.org/D9332 diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -222,7 +222,7 @@ def callcatch(ui, func): except error.WdirUnsupported: ui.error(_(b"abort: working directory revision cannot be specified\n")) except error.Abort as inst: - if isinstance(inst, error.InputError): + if isinstance(inst, (error.InputError, error.ParseError)): detailed_exit_code = 10 elif isinstance(inst, error.StateError): detailed_exit_code = 20 diff --git a/tests/test-annotate.t b/tests/test-annotate.t --- a/tests/test-annotate.t +++ b/tests/test-annotate.t @@ -930,34 +930,34 @@ check error cases $ hg up 24 --quiet $ hg log -r 'followlines()' hg: parse error: followlines takes at least 1 positional arguments - [255] + [10] $ hg log -r 'followlines(baz)' hg: parse error: followlines requires a line range - [255] + [10] $ hg log -r 'followlines(baz, x)' hg: parse error: followlines expects a line number or a range - [255] + [10] $ hg log -r 'followlines(baz, 1:2, startrev=desc("b"))' hg: parse error: followlines expects exactly one revision - [255] + [10] $ hg log -r 'followlines("glob:*", 1:2)' hg: parse error: followlines expects exactly one file - [255] + [10] $ hg log -r 'followlines(baz, 1:)' hg: parse error: line range bounds must be integers - [255] + [10] $ hg log -r 'followlines(baz, :1)' hg: parse error: line range bounds must be integers - [255] + [10] $ hg log -r 'followlines(baz, x:4)' hg: parse error: line range bounds must be integers - [255] + [10] $ hg log -r 'followlines(baz, 5:4)' hg: parse error: line range must be positive - [255] + [10] $ hg log -r 'followlines(baz, 0:4)' hg: parse error: fromline must be strictly positive - [255] + [10] $ hg log -r 'followlines(baz, 2:40)' abort: line range exceeds file size [10] @@ -965,10 +965,10 @@ check error cases hg: parse error at 43: not a prefix: [ (followlines(baz, 2:4, startrev=20, descend=[1]) ^ here) - [255] + [10] $ hg log -r 'followlines(baz, 2:4, startrev=20, descend=a)' hg: parse error: descend argument must be a boolean - [255] + [10] Test empty annotate output diff --git a/tests/test-commit.t b/tests/test-commit.t --- a/tests/test-commit.t +++ b/tests/test-commit.t @@ -16,20 +16,20 @@ commit date test $ echo foo >> foo $ hg commit -d '1 4444444' -m commit-3 hg: parse error: impossible time zone offset: 4444444 - [255] + [10] $ hg commit -d '1 15.1' -m commit-4 hg: parse error: invalid date: '1\t15.1' - [255] + [10] $ hg commit -d 'foo bar' -m commit-5 hg: parse error: invalid date: 'foo bar' - [255] + [10] $ hg commit -d ' 1 4444' -m commit-6 $ hg commit -d '111111111111 0' -m commit-7 hg: parse error: date exceeds 32 bits: 111111111111 - [255] + [10] $ hg commit -d '-111111111111 0' -m commit-7 hg: parse error: date exceeds 32 bits: -111111111111 - [255] + [10] $ echo foo >> foo $ hg commit -d '1901-12-13 20:45:52 +0000' -m commit-7-2 $ echo foo >> foo @@ -39,10 +39,10 @@ commit date test 2 1901-12-13 20:45:52 +0000 $ hg commit -d '1901-12-13 20:45:51 +0000' -m commit-7 hg: parse error: date exceeds 32 bits: -2147483649 - [255] + [10] $ hg commit -d '-2147483649 0' -m commit-7 hg: parse error: date exceeds 32 bits: -2147483649 - [255] + [10] commit added file that has been deleted diff --git a/tests/test-default-push.t b/tests/test-default-push.t --- a/tests/test-default-push.t +++ b/tests/test-default-push.t @@ -137,13 +137,13 @@ Invalid :pushrev raises appropriately $ hg --config 'paths.default:pushrev=notdefined()' push pushing to file:/*/$TESTTMP/pushurlsource/../pushurldest (glob) hg: parse error: unknown identifier: notdefined - [255] + [10] $ hg --config 'paths.default:pushrev=(' push pushing to file:/*/$TESTTMP/pushurlsource/../pushurldest (glob) hg: parse error at 1: not a prefix: end (( ^ here) - [255] + [10] $ cd .. diff --git a/tests/test-diffdir.t b/tests/test-diffdir.t --- a/tests/test-diffdir.t +++ b/tests/test-diffdir.t @@ -34,10 +34,10 @@ $ hg diff -r "" hg: parse error: empty query - [255] + [10] $ hg diff -r tip -r "" hg: parse error: empty query - [255] + [10] Remove a file that was added via merge. Since the file is not in parent 1, it should not be in the diff. diff --git a/tests/test-export.t b/tests/test-export.t --- a/tests/test-export.t +++ b/tests/test-export.t @@ -337,7 +337,7 @@ Invalid pattern in file name: hg: parse error at 3: unterminated template expansion (%m{ ^ here) - [255] + [10] $ hg export -o '%\' tip abort: invalid format spec '%\' in output filename [255] @@ -367,7 +367,7 @@ Catch exporting unknown revisions (espec $ hg export "" hg: parse error: empty query - [255] + [10] $ hg export 999 abort: unknown revision '999'! [255] diff --git a/tests/test-extdata.t b/tests/test-extdata.t --- a/tests/test-extdata.t +++ b/tests/test-extdata.t @@ -54,7 +54,7 @@ test bad extdata() revset source $ hg log -qr "extdata()" hg: parse error: extdata takes at least 1 string argument - [255] + [10] $ hg log -qr "extdata(unknown)" abort: unknown extdata source 'unknown' [255] @@ -73,7 +73,7 @@ that we don't crash before we can print hg: parse error at 0: not a prefix: + (+---------------------------------------+ ^ here) - [255] + [10] test template support: @@ -95,17 +95,17 @@ test bad extdata() template source $ hg log -T "{extdata()}\n" hg: parse error: extdata expects one argument - [255] + [10] $ hg log -T "{extdata('unknown')}\n" abort: unknown extdata source 'unknown' [255] $ hg log -T "{extdata(unknown)}\n" hg: parse error: empty data source specified (did you mean extdata('unknown')?) - [255] + [10] $ hg log -T "{extdata('{unknown}')}\n" hg: parse error: empty data source specified - [255] + [10] we don't fix up relative file URLs, but we do run shell commands in repo root diff --git a/tests/test-fileset.t b/tests/test-fileset.t --- a/tests/test-fileset.t +++ b/tests/test-fileset.t @@ -81,7 +81,7 @@ Test operators and basic patterns $ fileset 'a_b' $ fileset '"\xy"' hg: parse error: invalid \x escape* (glob) - [255] + [10] Test invalid syntax @@ -90,25 +90,25 @@ Test invalid syntax (string 'added') None) hg: parse error: not a symbol - [255] + [10] $ fileset -v '()()' (func (group None) None) hg: parse error: not a symbol - [255] + [10] $ fileset -v -- '-x' (negate (symbol 'x')) hg: parse error: can't use negate operator in this context - [255] + [10] $ fileset -v -- '-()' (negate (group None)) hg: parse error: can't use negate operator in this context - [255] + [10] $ fileset -p parsed 'a, b, c' * parsed: (list @@ -117,23 +117,23 @@ Test invalid syntax (symbol 'c')) hg: parse error: can't use a list in this context (see 'hg help "filesets.x or y"') - [255] + [10] $ fileset '"path":.' hg: parse error: not a symbol - [255] + [10] $ fileset 'path:foo bar' hg: parse error at 9: invalid token - [255] + [10] $ fileset 'foo:bar:baz' hg: parse error: not a symbol - [255] + [10] $ fileset 'foo:bar()' hg: parse error: pattern must be a string - [255] + [10] $ fileset 'foo:bar' hg: parse error: invalid pattern kind: foo - [255] + [10] Show parsed tree at stages: @@ -562,7 +562,7 @@ Test files properties c1 $ fileset 'grep("missingparens(")' hg: parse error: invalid match pattern: (unbalanced parenthesis|missing \)).* (re) - [255] + [10] #if execbit $ chmod +x b2 @@ -589,11 +589,11 @@ Test files properties $ hg add 1k 2k $ fileset 'size("bar")' hg: parse error: couldn't parse size: bar - [255] + [10] $ fileset '(1k, 2k)' hg: parse error: can't use a list in this context (see 'hg help "filesets.x or y"') - [255] + [10] $ fileset 'size(1k)' 1k $ fileset '(1k or 2k) and size("< 2k")' @@ -1018,10 +1018,10 @@ Fully empty revset $ fileset "status('', '4', added())" hg: parse error: first argument to status must be a revision - [255] + [10] $ fileset "status('2', '', added())" hg: parse error: second argument to status must be a revision - [255] + [10] Empty revset will error at the revset layer @@ -1029,9 +1029,9 @@ Empty revset will error at the revset la hg: parse error at 1: not a prefix: end ( ^ here) - [255] + [10] $ fileset "status('2', ' ', added())" hg: parse error at 1: not a prefix: end ( ^ here) - [255] + [10] diff --git a/tests/test-glog-beautifygraph.t b/tests/test-glog-beautifygraph.t --- a/tests/test-glog-beautifygraph.t +++ b/tests/test-glog-beautifygraph.t @@ -1682,7 +1682,7 @@ glog always reorders nodes which explain > $ hg log -G -d 'brace ) in a date' hg: parse error: invalid date: 'brace ) in a date' - [255] + [10] $ testlog --prune 31 --prune 32 [] (not diff --git a/tests/test-glog.t b/tests/test-glog.t --- a/tests/test-glog.t +++ b/tests/test-glog.t @@ -1532,7 +1532,7 @@ glog always reorders nodes which explain > $ hg log -G -d 'brace ) in a date' hg: parse error: invalid date: 'brace ) in a date' - [255] + [10] $ testlog --prune 31 --prune 32 [] (not diff --git a/tests/test-grep.t b/tests/test-grep.t --- a/tests/test-grep.t +++ b/tests/test-grep.t @@ -25,13 +25,13 @@ invalid revset syntax $ hg log -r 'diffcontains()' hg: parse error: diffcontains takes at least 1 argument - [255] + [10] $ hg log -r 'diffcontains(:)' hg: parse error: diffcontains requires a string pattern - [255] + [10] $ hg log -r 'diffcontains("re:**test**")' hg: parse error: invalid regular expression: nothing to repeat* (glob) - [255] + [10] simple diff --git a/tests/test-histedit-arguments.t b/tests/test-histedit-arguments.t --- a/tests/test-histedit-arguments.t +++ b/tests/test-histedit-arguments.t @@ -187,7 +187,7 @@ Test that missing revisions are detected > EOF hg: parse error: missing rules for changeset c8e68270e35a (use "drop c8e68270e35a" to discard, see also: 'hg help -e histedit.config') - [255] + [10] Test that extra revisions are detected --------------------------------------- @@ -199,7 +199,7 @@ Test that extra revisions are detected > EOF hg: parse error: pick "6058cbb6cfd7" changeset was not a candidate (only use listed changesets) - [255] + [10] Test malformed line --------------------------------------- @@ -210,7 +210,7 @@ Test malformed line > pick 08d98a8350f3 4 five > EOF hg: parse error: malformed line "pickeb57da33312f2three" - [255] + [10] Test unknown changeset --------------------------------------- @@ -221,7 +221,7 @@ Test unknown changeset > pick 08d98a8350f3 4 five > EOF hg: parse error: unknown changeset 0123456789ab listed - [255] + [10] Test unknown command --------------------------------------- @@ -232,7 +232,7 @@ Test unknown command > pick 08d98a8350f3 4 five > EOF hg: parse error: unknown action "coin" - [255] + [10] Test duplicated changeset --------------------------------------- @@ -245,7 +245,7 @@ So one is missing and one appear twice. > pick 08d98a8350f3 4 five > EOF hg: parse error: duplicated command for changeset eb57da33312f - [255] + [10] Test bogus rev --------------------------------------- @@ -256,7 +256,7 @@ Test bogus rev > pick 08d98a8350f3 4 five > EOF hg: parse error: invalid changeset 0u98 - [255] + [10] Test short version of command --------------------------------------- diff --git a/tests/test-histedit-edit.t b/tests/test-histedit-edit.t --- a/tests/test-histedit-edit.t +++ b/tests/test-histedit-edit.t @@ -463,7 +463,7 @@ Attempting to fold a change into a publi $ HGEDITOR="sh ../edit.sh" hg histedit 2 warning: histedit rules saved to: .hg/histedit-last-edit.txt hg: parse error: first changeset cannot use verb "fold" - [255] + [10] $ cat .hg/histedit-last-edit.txt fold 0012be4a27ea 2 extend a diff --git a/tests/test-histedit-fold.t b/tests/test-histedit-fold.t --- a/tests/test-histedit-fold.t +++ b/tests/test-histedit-fold.t @@ -588,7 +588,7 @@ Test rolling into a commit with multiple > r 5db65b93a12b > EOF hg: parse error: first changeset cannot use verb "roll" - [255] + [10] $ hg log -G -T '{node|short} {desc}' @ 5db65b93a12b cc | diff --git a/tests/test-lfs.t b/tests/test-lfs.t --- a/tests/test-lfs.t +++ b/tests/test-lfs.t @@ -70,7 +70,7 @@ $ hg --config lfs.track='"size(\">1000B\")"' commit -Aqm "add small file" hg: parse error: unsupported file pattern: size(">1000B") (paths must be prefixed with "path:") - [255] + [10] $ hg --config lfs.track='size(">1000B")' commit -Aqm "add small file" # Commit large file diff --git a/tests/test-log-linerange.t b/tests/test-log-linerange.t --- a/tests/test-log-linerange.t +++ b/tests/test-log-linerange.t @@ -1142,7 +1142,7 @@ Non-exact pattern kinds are not allowed. $ cd .. $ hg log -f -L glob:*a*,1:2 hg: parse error: line range pattern 'glob:*a*' must match exactly one file - [255] + [10] We get an error for removed files. diff --git a/tests/test-log.t b/tests/test-log.t --- a/tests/test-log.t +++ b/tests/test-log.t @@ -1063,7 +1063,7 @@ log -r "" $ hg log -r '' hg: parse error: empty query - [255] + [10] log -r @@ -2435,7 +2435,7 @@ simple error hg: parse error at 14: unexpected token: end ({shortest(node} ^ here) - [255] + [10] multi-line template with error $ hg log -r . -T 'line 1 @@ -2445,7 +2445,7 @@ multi-line template with error hg: parse error at 27: unexpected token: end (line 1\nline2\n{shortest(node}\nline4\nline5 ^ here) - [255] + [10] $ cd .. diff --git a/tests/test-logexchange.t b/tests/test-logexchange.t --- a/tests/test-logexchange.t +++ b/tests/test-logexchange.t @@ -500,15 +500,15 @@ Testing for multiple names, which is not $ hg log -r 'remotenames("re:default", "re:server2")' -GT "{rev}:{node|short} {remotenames}\n" hg: parse error: only one argument accepted - [255] + [10] $ hg log -r 'remotebranches("default/wat", "server2/wat")' -GT "{rev}:{node|short} {remotebranches}\n" hg: parse error: only one argument accepted - [255] + [10] $ hg log -r 'remotebookmarks("default/foo", "server2/foo")' -GT "{rev}:{node|short} {remotebookmarks}\n" hg: parse error: only one argument accepted - [255] + [10] Testing pattern matching diff --git a/tests/test-merge4.t b/tests/test-merge4.t --- a/tests/test-merge4.t +++ b/tests/test-merge4.t @@ -29,10 +29,10 @@ Test conflict*() revsets # Bad usage $ hg log -r 'conflictlocal(foo)' hg: parse error: conflictlocal takes no arguments - [255] + [10] $ hg log -r 'conflictother(foo)' hg: parse error: conflictother takes no arguments - [255] + [10] $ hg co -C . 1 files updated, 0 files merged, 0 files removed, 0 files unresolved # No merge parents when not merging diff --git a/tests/test-parse-date.t b/tests/test-parse-date.t --- a/tests/test-parse-date.t +++ b/tests/test-parse-date.t @@ -18,13 +18,13 @@ This runs with TZ="GMT" $ echo "fail" >> a $ hg ci -d "should fail" -m "fail" hg: parse error: invalid date: 'should fail' - [255] + [10] $ hg ci -d "100000000000000000 1400" -m "fail" hg: parse error: date exceeds 32 bits: 100000000000000000 - [255] + [10] $ hg ci -d "100000 1400000" -m "fail" hg: parse error: impossible time zone offset: 1400000 - [255] + [10] Check with local timezone other than GMT and with DST diff --git a/tests/test-revset-legacy-lookup.t b/tests/test-revset-legacy-lookup.t --- a/tests/test-revset-legacy-lookup.t +++ b/tests/test-revset-legacy-lookup.t @@ -172,10 +172,10 @@ Test tag with parenthesis (but not a val 6:db72e24fe069 Added tag 1.2 for changeset ff42fde8edbb [release_4.1(candidate1)] $ hg log -r '(release_4.1(candidate1))' hg: parse error: unknown identifier: release_4.1 - [255] + [10] $ hg log -r 'revset(release_4.1(candidate1))' hg: parse error: unknown identifier: release_4.1 - [255] + [10] $ hg log -r '"release_4.1(candidate1)"' 6:db72e24fe069 Added tag 1.2 for changeset ff42fde8edbb [release_4.1(candidate1)] $ hg log -r '("release_4.1(candidate1)")' @@ -190,7 +190,7 @@ Test tag with parenthesis (but not a val 6:db72e24fe069 Added tag 1.2 for changeset ff42fde8edbb [release_4.1(candidate1)] $ hg log -r '::release_4.1(candidate1)' hg: parse error: unknown identifier: release_4.1 - [255] + [10] Test tag with parenthesis and other function like char @@ -200,10 +200,10 @@ Test tag with parenthesis and other func 7:b29b25d7d687 Added tag release_4.1(candidate1) for changeset db72e24fe069 [release_4.1(arch=x86,arm)] $ hg log -r '(release_4.1(arch=x86,arm))' hg: parse error: unknown identifier: release_4.1 - [255] + [10] $ hg log -r 'revset(release_4.1(arch=x86,arm))' hg: parse error: unknown identifier: release_4.1 - [255] + [10] $ hg log -r '"release_4.1(arch=x86,arm)"' 7:b29b25d7d687 Added tag release_4.1(candidate1) for changeset db72e24fe069 [release_4.1(arch=x86,arm)] $ hg log -r '("release_4.1(arch=x86,arm)")' @@ -219,7 +219,7 @@ Test tag with parenthesis and other func 7:b29b25d7d687 Added tag release_4.1(candidate1) for changeset db72e24fe069 [release_4.1(arch=x86,arm)] $ hg log -r '::release_4.1(arch=x86,arm)' hg: parse error: unknown identifier: release_4.1 - [255] + [10] Test tag conflicting with revset function @@ -229,10 +229,10 @@ Test tag conflicting with revset functio 8:6b2e2d4ea455 Added tag release_4.1(arch=x86,arm) for changeset b29b25d7d687 [secret(team=foo,project=bar)] $ hg log -r '(secret(team=foo,project=bar))' hg: parse error: secret takes no arguments - [255] + [10] $ hg log -r 'revset(secret(team=foo,project=bar))' hg: parse error: secret takes no arguments - [255] + [10] $ hg log -r '"secret(team=foo,project=bar)"' 8:6b2e2d4ea455 Added tag release_4.1(arch=x86,arm) for changeset b29b25d7d687 [secret(team=foo,project=bar)] $ hg log -r '("secret(team=foo,project=bar)")' @@ -249,7 +249,7 @@ Test tag conflicting with revset functio 8:6b2e2d4ea455 Added tag release_4.1(arch=x86,arm) for changeset b29b25d7d687 [secret(team=foo,project=bar)] $ hg log -r '::secret(team=foo,project=bar)' hg: parse error: secret takes no arguments - [255] + [10] Test tag with space @@ -261,12 +261,12 @@ Test tag with space hg: parse error at 4: unexpected token: symbol ((my little version) ^ here) - [255] + [10] $ hg log -r 'revset(my little version)' hg: parse error at 10: unexpected token: symbol (revset(my little version) ^ here) - [255] + [10] $ hg log -r '"my little version"' 9:269192bf8fc3 Added tag secret(team=foo,project=bar) for changeset 6b2e2d4ea455 [my little version] $ hg log -r '("my little version")' @@ -286,4 +286,4 @@ Test tag with space hg: parse error at 5: invalid token (::my little version ^ here) - [255] + [10] diff --git a/tests/test-revset.t b/tests/test-revset.t --- a/tests/test-revset.t +++ b/tests/test-revset.t @@ -401,10 +401,10 @@ quoting needed hg: parse error at 10: unexpected token: symbol (date(this is a test) ^ here) - [255] + [10] $ log 'date()' hg: parse error: date requires a string - [255] + [10] $ log 'date' abort: unknown revision 'date'! [255] @@ -412,13 +412,13 @@ quoting needed hg: parse error at 5: not a prefix: end (date( ^ here) - [255] + [10] $ log 'date("\xy")' hg: parse error: invalid \x escape* (glob) - [255] + [10] $ log 'date(tip)' hg: parse error: invalid date: 'tip' - [255] + [10] $ log '0:date' abort: unknown revision 'date'! [255] @@ -450,7 +450,7 @@ function name should be a symbol $ log '"date"(2005)' hg: parse error: not a symbol - [255] + [10] keyword arguments @@ -459,25 +459,25 @@ keyword arguments $ log 'extra(branch, a, b)' hg: parse error: extra takes at most 2 positional arguments - [255] + [10] $ log 'extra(a, label=b)' hg: parse error: extra got multiple values for keyword argument 'label' - [255] + [10] $ log 'extra(label=branch, default)' hg: parse error: extra got an invalid argument - [255] + [10] $ log 'extra(branch, foo+bar=baz)' hg: parse error: extra got an invalid argument - [255] + [10] $ log 'extra(unknown=branch)' hg: parse error: extra got an unexpected keyword argument 'unknown' - [255] + [10] $ log 'extra((), x)' hg: parse error: first argument to extra must be a string - [255] + [10] $ log 'extra(label=x, ())' hg: parse error: extra got an invalid argument - [255] + [10] $ try 'foo=bar|baz' (keyvalue @@ -487,7 +487,7 @@ keyword arguments (symbol 'bar') (symbol 'baz')))) hg: parse error: can't use a key-value pair in this context - [255] + [10] right-hand side should be optimized recursively @@ -506,7 +506,7 @@ keyword arguments (symbol '_notpublic') None)) hg: parse error: can't use a key-value pair in this context - [255] + [10] relation-subscript operator has the highest binding strength (as function call): @@ -565,7 +565,7 @@ resolution of subscript and relation-sub (symbol 'tip') (symbol '0')) hg: parse error: can't use a subscript in this context - [255] + [10] $ hg debugrevspec -p analyzed 'tip#rel[0]' * analyzed: @@ -574,7 +574,7 @@ resolution of subscript and relation-sub (symbol 'rel') (symbol '0')) hg: parse error: unknown identifier: rel - [255] + [10] $ hg debugrevspec -p analyzed '(tip#rel)[0]' * analyzed: @@ -584,7 +584,7 @@ resolution of subscript and relation-sub (symbol 'rel')) (symbol '0')) hg: parse error: can't use a subscript in this context - [255] + [10] $ hg debugrevspec -p analyzed 'tip#rel[0][1]' * analyzed: @@ -595,7 +595,7 @@ resolution of subscript and relation-sub (symbol '0')) (symbol '1')) hg: parse error: can't use a subscript in this context - [255] + [10] $ hg debugrevspec -p analyzed 'tip#rel0#rel1[1]' * analyzed: @@ -606,7 +606,7 @@ resolution of subscript and relation-sub (symbol 'rel1') (symbol '1')) hg: parse error: unknown identifier: rel1 - [255] + [10] $ hg debugrevspec -p analyzed 'tip#rel0[0]#rel1[1]' * analyzed: @@ -618,7 +618,7 @@ resolution of subscript and relation-sub (symbol 'rel1') (symbol '1')) hg: parse error: unknown identifier: rel1 - [255] + [10] parse errors of relation, subscript and relation-subscript operators: @@ -626,48 +626,48 @@ parse errors of relation, subscript and hg: parse error at 0: not a prefix: [ ([0] ^ here) - [255] + [10] $ hg debugrevspec '.#' hg: parse error at 2: not a prefix: end (.# ^ here) - [255] + [10] $ hg debugrevspec '#rel' hg: parse error at 0: not a prefix: # (#rel ^ here) - [255] + [10] $ hg debugrevspec '.#rel[0' hg: parse error at 7: unexpected token: end (.#rel[0 ^ here) - [255] + [10] $ hg debugrevspec '.]' hg: parse error at 1: invalid token (.] ^ here) - [255] + [10] $ hg debugrevspec '.#generations[a]' hg: parse error: relation subscript must be an integer or a range - [255] + [10] $ hg debugrevspec '.#generations[1-2]' hg: parse error: relation subscript must be an integer or a range - [255] + [10] $ hg debugrevspec '.#generations[foo:bar]' hg: parse error: relation subscript bounds must be integers - [255] + [10] suggested relations $ hg debugrevspec '.#generafions[0]' hg: parse error: unknown identifier: generafions (did you mean generations?) - [255] + [10] $ hg debugrevspec '.#f[0]' hg: parse error: unknown identifier: f - [255] + [10] parsed tree at stages: @@ -686,7 +686,7 @@ parsed tree at stages: * optimized: None hg: parse error: missing argument - [255] + [10] $ hg debugrevspec --no-optimized -p all '()' * parsed: @@ -701,7 +701,7 @@ parsed tree at stages: * analyzed: None hg: parse error: missing argument - [255] + [10] $ hg debugrevspec -p parsed -p analyzed -p optimized '(0|1)-1' * parsed: @@ -899,7 +899,7 @@ infix/suffix resolution of ^ operator (i (rangepre (symbol '2')))) hg: parse error: ^ expects a number 0, 1, or 2 - [255] + [10] x^:y should be resolved recursively @@ -1005,7 +1005,7 @@ infix/suffix resolution of ^ operator (i (rangepre (symbol '2'))) hg: parse error: ^ expects a number 0, 1, or 2 - [255] + [10] '::' itself isn't a valid expression @@ -1013,7 +1013,7 @@ infix/suffix resolution of ^ operator (i (dagrangeall None) hg: parse error: can't use '::' in this context - [255] + [10] ancestor can accept 0 or more arguments @@ -1170,10 +1170,10 @@ test bad arguments passed to ancestors() $ log 'ancestors(., depth=-1)' hg: parse error: negative depth - [255] + [10] $ log 'ancestors(., depth=foo)' hg: parse error: ancestors expects an integer depth - [255] + [10] test descendants @@ -1447,10 +1447,10 @@ test author (symbol 'grep') (string '(')) hg: parse error: invalid match pattern: (unbalanced parenthesis|missing \),.*) (re) - [255] + [10] $ log 'desc("re:(")' hg: parse error: invalid regular expression: (unbalanced parenthesis|missing \),.*) (re) - [255] + [10] $ try 'grep("\bissue\d+")' (func (symbol 'grep') @@ -1472,7 +1472,7 @@ test author hg: parse error at 7: unterminated string (grep(r"\") ^ here) - [255] + [10] $ log 'head()' 0 1 @@ -1530,15 +1530,15 @@ Test first (=limit) and last $ log 'limit(author("re:bob|test"), offset=10)' $ log 'limit(all(), 1, -1)' hg: parse error: negative offset - [255] + [10] $ log 'limit(all(), -1)' hg: parse error: negative number to select - [255] + [10] $ log 'limit(all(), 0)' $ log 'last(all(), -1)' hg: parse error: negative number to select - [255] + [10] $ log 'last(all(), 0)' $ log 'last(all(), 1)' 9 @@ -1861,7 +1861,7 @@ Test explicit numeric revision $ log 'rev(10)' $ log 'rev(tip)' hg: parse error: rev expects a number - [255] + [10] Test hexadecimal revision $ log 'id(2)' @@ -1965,7 +1965,7 @@ Test working-directory revision $ hg debugrevspec 'wdir()^2' $ hg debugrevspec 'wdir()^3' hg: parse error: ^ expects a number 0, 1, or 2 - [255] + [10] For tests consistency $ hg up 9 1 files updated, 0 files merged, 0 files removed, 0 files unresolved @@ -2532,10 +2532,10 @@ ordering defined by it. $ log '0:2 & sort()' hg: parse error: sort requires one or two arguments - [255] + [10] $ log '0:2 & sort(all(), -invalid)' hg: parse error: unknown sort key '-invalid' - [255] + [10] for 'A & f(B)', 'B' should not be affected by the order of 'A': @@ -2762,7 +2762,7 @@ test invalid sort keys $ log 'sort(all(), -invalid)' hg: parse error: unknown sort key '-invalid' - [255] + [10] $ cd .. @@ -2980,11 +2980,11 @@ use the topo.firstbranch option when top $ hg log -r 'sort(all(), "topo user")' hg: parse error: topo sort order cannot be combined with other sort keys - [255] + [10] $ 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] + [10] topo.firstbranch should accept any kind of expressions: @@ -3003,7 +3003,7 @@ test multiline revset with errors hg: parse error at 9: not a prefix: end ( . + .^ + ^ here) - [255] + [10] $ hg debugrevspec -v 'revset(first(rev(0)))' -p all * parsed: (func @@ -3052,10 +3052,10 @@ test multiline revset with errors abort if the revset doesn't expect given size $ log 'expectsize()' hg: parse error: invalid set of arguments - [255] + [10] $ log 'expectsize(0:2, a)' hg: parse error: expectsize requires a size range or a positive integer - [255] + [10] $ log 'expectsize(0:2, 3)' 0 1 @@ -3070,7 +3070,7 @@ abort if the revset doesn't expect given [255] $ log 'expectsize(0:4, -1)' hg: parse error: negative size - [255] + [10] $ log 'expectsize(0:2, 2:4)' 0 1 @@ -3080,16 +3080,16 @@ abort if the revset doesn't expect given [255] $ log 'expectsize(0:1, -1:2)' hg: parse error: negative size - [255] + [10] $ log 'expectsize(0:1, 1:-2)' hg: parse error: negative size - [255] + [10] $ log 'expectsize(0:2, a:4)' hg: parse error: size range bounds must be integers - [255] + [10] $ log 'expectsize(0:2, 2:b)' hg: parse error: size range bounds must be integers - [255] + [10] $ log 'expectsize(0:2, 2:)' 0 1 diff --git a/tests/test-revset2.t b/tests/test-revset2.t --- a/tests/test-revset2.t +++ b/tests/test-revset2.t @@ -346,7 +346,7 @@ 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] + [10] $ try '0,1,2' (list (symbol '0') @@ -354,7 +354,7 @@ test ',' in `_list` (symbol '2')) hg: parse error: can't use a list in this context (see 'hg help "revsets.x or y"') - [255] + [10] test that chained `or` operations make balanced addsets @@ -407,7 +407,7 @@ no crash by empty group "()" while optim (symbol '0') None)) hg: parse error: missing argument - [255] + [10] test that chained `or` operations never eat up stack (issue4624) (uses `0:1` instead of `0` to avoid future optimization of trivial revisions) @@ -510,7 +510,7 @@ no crash by empty group "()" while optim (symbol '1')) None) hg: parse error: missing argument - [255] + [10] optimization to only() works only if ancestors() takes only one argument @@ -568,20 +568,20 @@ invalid function call should not be opti $ log '"ancestors"(6) and not ancestors(4)' hg: parse error: not a symbol - [255] + [10] $ log 'ancestors(6) and not "ancestors"(4)' hg: parse error: not a symbol - [255] + [10] test empty string $ log '' hg: parse error: empty query - [255] + [10] $ log 'parents("")' hg: parse error: empty string is not a valid revision - [255] + [10] test empty revset $ hg log 'none()' @@ -701,7 +701,7 @@ issue2654: report a parse error if the r hg: parse error at 2: invalid token (1 OR 2 ^ here) - [255] + [10] or operator should preserve ordering: $ log 'reverse(2::4) or tip' @@ -755,7 +755,7 @@ parentrevspec $ log 'tip^foo' hg: parse error: ^ expects a number 0, 1, or 2 - [255] + [10] $ log 'branchpoint()~-1' abort: revision in set has more than one child! @@ -765,29 +765,29 @@ Bogus function gets suggestions $ log 'add()' hg: parse error: unknown identifier: add (did you mean adds?) - [255] + [10] $ log 'added()' hg: parse error: unknown identifier: added (did you mean adds?) - [255] + [10] $ log 'remo()' hg: parse error: unknown identifier: remo (did you mean one of remote, removes?) - [255] + [10] $ log 'babar()' hg: parse error: unknown identifier: babar - [255] + [10] Bogus function with a similar internal name doesn't suggest the internal name $ log 'matches()' hg: parse error: unknown identifier: matches (did you mean matching?) - [255] + [10] Undocumented functions aren't suggested as similar either $ log 'tagged2()' hg: parse error: unknown identifier: tagged2 - [255] + [10] multiple revspecs @@ -949,7 +949,7 @@ test infinite recursion $ try recurse1 (symbol 'recurse1') hg: parse error: infinite expansion of revset alias "recurse1" detected - [255] + [10] $ echo 'level1($1, $2) = $1 or $2' >> .hg/hgrc $ echo 'level2($1, $2) = level1($2, $1)' >> .hg/hgrc @@ -1185,13 +1185,13 @@ test unknown reference: (symbol 'rs') None) hg: parse error: invalid number of arguments: 0 - [255] + [10] $ try 'rs(2)' (func (symbol 'rs') (symbol '2')) hg: parse error: invalid number of arguments: 1 - [255] + [10] $ try 'rs(2, data, 7)' (func (symbol 'rs') @@ -1200,7 +1200,7 @@ test unknown reference: (symbol 'data') (symbol '7'))) hg: parse error: invalid number of arguments: 3 - [255] + [10] $ try 'rs4(2 or 3, x, x, date)' (func (symbol 'rs4') @@ -1575,7 +1575,7 @@ test error message of bad revset hg: parse error at 3: syntax error in revset 'foo\\' (foo\\ ^ here) - [255] + [10] $ cd .. @@ -1603,7 +1603,7 @@ loading it $ hg debugrevspec "custom1()" *** failed to import extension custompredicate from $TESTTMP/custompredicate.py: intentional failure of loading extension hg: parse error: unknown identifier: custom1 - [255] + [10] Test repo.anyrevs with customized revset overrides diff --git a/tests/test-template-basic.t b/tests/test-template-basic.t --- a/tests/test-template-basic.t +++ b/tests/test-template-basic.t @@ -139,7 +139,7 @@ But negate binds closer still: * keywords: * functions: stringify hg: parse error: arithmetic only defined on integers - [255] + [10] $ hg debugtemplate -r0 -v '{-3|stringify}\n' (template (| @@ -179,7 +179,7 @@ Keyword arguments: * keywords: bar, foo * functions: baz hg: parse error: can't use a key-value pair in this context - [255] + [10] $ hg debugtemplate '{pad("foo", width=10, left=true)}\n' foo @@ -190,7 +190,7 @@ Call function which takes named argument $ hg debugtemplate '{("not", "an", "argument", "list")|separate}' hg: parse error: can't use a list in this context (check place of comma and parens) - [255] + [10] Second branch starting at nullrev: @@ -307,34 +307,34 @@ Error on syntax: $ echo 'style = t' >> .hg/hgrc $ hg log hg: parse error at t:3: unmatched quotes - [255] + [10] $ hg log -T '{date' hg: parse error at 1: unterminated template expansion ({date ^ here) - [255] + [10] $ hg log -T '{date(}' hg: parse error at 6: not a prefix: end ({date(} ^ here) - [255] + [10] $ hg log -T '{date)}' hg: parse error at 5: invalid token ({date)} ^ here) - [255] + [10] $ hg log -T '{date date}' hg: parse error at 6: invalid token ({date date} ^ here) - [255] + [10] $ hg log -T '{}' hg: parse error at 1: not a prefix: end ({} ^ here) - [255] + [10] $ hg debugtemplate -v '{()}' (template (group @@ -342,7 +342,7 @@ Error on syntax: * keywords: * functions: hg: parse error: missing argument - [255] + [10] Behind the scenes, this would throw TypeError without intype=bytes @@ -356,7 +356,7 @@ Behind the scenes, this will throw a Val $ hg log -l 3 --template 'line: {desc|shortdate}\n' hg: parse error: invalid date: 'Modify, add, remove, rename' (template filter 'shortdate' is not compatible with keyword 'desc') - [255] + [10] Behind the scenes, this would throw AttributeError without intype=bytes @@ -367,23 +367,23 @@ Behind the scenes, this would throw Attr $ hg log -l 3 --template 'line: {extras|localdate}\n' hg: parse error: localdate expects a date information - [255] + [10] Behind the scenes, this will throw ValueError $ hg tip --template '{author|email|date}\n' hg: parse error: date expects a date information - [255] + [10] $ hg tip -T '{author|email|shortdate}\n' hg: parse error: invalid date: 'test' (template filter 'shortdate' is not compatible with keyword 'author') - [255] + [10] $ hg tip -T '{get(extras, "branch")|shortdate}\n' hg: parse error: invalid date: 'default' (incompatible use of template filter 'shortdate') - [255] + [10] Error in nested template: @@ -391,19 +391,19 @@ Error in nested template: hg: parse error at 2: unterminated string ({"date ^ here) - [255] + [10] $ hg log -T '{"foo{date|?}"}' hg: parse error at 11: syntax error ({"foo{date|?}"} ^ here) - [255] + [10] Thrown an error if a template function doesn't exist $ hg tip --template '{foo()}\n' hg: parse error: unknown function 'foo' - [255] + [10] $ cd .. @@ -453,13 +453,13 @@ Test new-style inline templating: $ hg log -R latesttag -r tip -T '{rev % "a"}\n' hg: parse error: 11 is not iterable of mappings (keyword 'rev' does not support map operation) - [255] + [10] $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "a"}\n' hg: parse error: None is not iterable of mappings - [255] + [10] $ hg log -R latesttag -r tip -T '{extras % "{key}\n" % "{key}\n"}' hg: parse error: list of strings is not mappable - [255] + [10] Test new-style inline templating of non-list/dict type: @@ -474,7 +474,7 @@ Test new-style inline templating of non- branch: default $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "{key}\n"}' hg: parse error: None is not iterable of mappings - [255] + [10] $ hg log -R latesttag -r tip -T '{min(extras) % "{key}: {value}\n"}' branch: default $ hg log -R latesttag -l1 -T '{min(revset("0:9")) % "{rev}:{node|short}\n"}' @@ -506,7 +506,7 @@ Test dot operator precedence: (symbol 'bar') (symbol 'baz'))) (string '\n')) - [255] + [10] $ hg debugtemplate -R latesttag -r0 -v '{foo.bar()}\n' 2> /dev/null (template (. @@ -517,7 +517,7 @@ Test dot operator precedence: (string '\n')) * keywords: foo * functions: bar - [255] + [10] Test evaluation of dot operator: @@ -531,10 +531,10 @@ Test evaluation of dot operator: $ hg log -R latesttag -l1 -T '{author.invalid}\n' hg: parse error: 'test' is not a dictionary (keyword 'author' does not support member operation) - [255] + [10] $ hg log -R latesttag -l1 -T '{min("abc").invalid}\n' hg: parse error: 'a' is not a dictionary - [255] + [10] Test integer literal: @@ -567,10 +567,10 @@ Test integer literal: hg: parse error at 3: not a prefix: ) ({(-)}\n ^ here) - [255] + [10] $ hg debugtemplate '{(-a)}\n' hg: parse error: negation needs an integer argument - [255] + [10] top-level integer literal is interpreted as symbol (i.e. variable name): @@ -607,10 +607,10 @@ unless explicit symbol is expected: $ hg log -Ra -r0 -T '{desc|1}\n' hg: parse error: expected a symbol, got 'integer' - [255] + [10] $ hg log -Ra -r0 -T '{1()}\n' hg: parse error: expected a symbol, got 'integer' - [255] + [10] Test string literal: @@ -748,13 +748,13 @@ escaped single quotes and errors: hg: parse error at 21: unterminated string ({if(rev, "{if(rev, \")}")}\n ^ here) - [255] + [10] $ hg log -r 2 -T '{if(rev, \"\\"")}\n' hg: parse error: trailing \ in string - [255] + [10] $ hg log -r 2 -T '{if(rev, r\"\\"")}\n' hg: parse error: trailing \ in string - [255] + [10] $ cd .. @@ -900,7 +900,7 @@ Test recursive evaluation: text.1:wrapped (no-eol) $ hg log -l1 -T '{fill(desc, date, "", "")}\n' hg: parse error: fill expects an integer width - [255] + [10] $ hg log -l 1 --template '{sub(r"[0-9]", "-", author)}' {node|short} (no-eol) @@ -926,16 +926,16 @@ Test bad template with better error mess $ hg log -Gv -R a --template '{desc|user()}' hg: parse error: expected a symbol, got 'func' - [255] + [10] Test broken string escapes: $ hg log -T "bogus\\" -R a hg: parse error: trailing \ in string - [255] + [10] $ hg log -T "\\xy" -R a hg: parse error: invalid \x escape* (glob) - [255] + [10] Templater supports aliases of symbol and func() styles: diff --git a/tests/test-template-functions.t b/tests/test-template-functions.t --- a/tests/test-template-functions.t +++ b/tests/test-template-functions.t @@ -240,7 +240,7 @@ commondir() filter: $ hg log -r null -T '{rev|commondir}' hg: parse error: argument is not a list of text (template filter 'commondir' is not compatible with keyword 'rev') - [255] + [10] Add a dummy commit to make up for the instability of the above: @@ -283,7 +283,7 @@ Count filter: $ hg log -l1 -T '{termwidth|count}\n' hg: parse error: not countable (template filter 'count' is not compatible with keyword 'termwidth') - [255] + [10] Upper/lower filters: @@ -478,25 +478,25 @@ Test filter() unsupported arguments: $ hg log -R a -r 0 -T '{filter()}\n' hg: parse error: filter expects one or two arguments - [255] + [10] $ hg log -R a -r 0 -T '{filter(date)}\n' hg: parse error: date is not iterable - [255] + [10] $ hg log -R a -r 0 -T '{filter(rev)}\n' hg: parse error: 0 is not iterable - [255] + [10] $ hg log -R a -r 0 -T '{filter(desc|firstline)}\n' hg: parse error: 'line 1' is not filterable - [255] + [10] $ hg log -R a -r 0 -T '{filter(manifest)}\n' hg: parse error: '0:a0c8bcbbb45c' is not filterable - [255] + [10] $ hg log -R a -r 0 -T '{filter(succsandmarkers)}\n' hg: parse error: not filterable without template - [255] + [10] $ hg log -R a -r 0 -T '{filter(desc|splitlines % "{line}", "")}\n' hg: parse error: not filterable by expression - [255] + [10] Test manifest/get() can be join()-ed as string, though it's silly: @@ -514,7 +514,7 @@ Test join() over uniterable $ hg log -R latesttag -r tip -T '{join(rev, "")}\n' hg: parse error: 11 is not iterable - [255] + [10] Test min/max of integers @@ -542,47 +542,47 @@ Test min/max of non-iterable: $ hg debugtemplate '{min(1)}' hg: parse error: 1 is not iterable (min first argument should be an iterable) - [255] + [10] $ hg debugtemplate '{max(2)}' hg: parse error: 2 is not iterable (max first argument should be an iterable) - [255] + [10] $ hg log -R latesttag -l1 -T '{min(date)}' hg: parse error: date is not iterable (min first argument should be an iterable) - [255] + [10] $ hg log -R latesttag -l1 -T '{max(date)}' hg: parse error: date is not iterable (max first argument should be an iterable) - [255] + [10] Test min/max of empty sequence: $ hg debugtemplate '{min("")}' hg: parse error: empty string (min first argument should be an iterable) - [255] + [10] $ hg debugtemplate '{max("")}' hg: parse error: empty string (max first argument should be an iterable) - [255] + [10] $ hg debugtemplate '{min(dict())}' hg: parse error: empty sequence (min first argument should be an iterable) - [255] + [10] $ hg debugtemplate '{max(dict())}' hg: parse error: empty sequence (max first argument should be an iterable) - [255] + [10] $ hg debugtemplate '{min(dict() % "")}' hg: parse error: empty sequence (min first argument should be an iterable) - [255] + [10] $ hg debugtemplate '{max(dict() % "")}' hg: parse error: empty sequence (max first argument should be an iterable) - [255] + [10] Test min/max of if() result @@ -606,7 +606,7 @@ Test laziness of if() then/else clause $ hg debugtemplate '{count(0)}' hg: parse error: not countable (incompatible use of template filter 'count') - [255] + [10] $ hg debugtemplate '{if(true, "", count(0))}' $ hg debugtemplate '{if(false, count(0), "")}' $ hg debugtemplate '{ifcontains("a", "aa", "", count(0))}' @@ -654,10 +654,10 @@ Test search() function: $ hg log -R a -r2 -T '{search(r"(?P<0>.)", desc) % "{0}"}\n' hg: parse error: search got an invalid pattern: (?P<0>.) - [255] + [10] $ hg log -R a -r2 -T '{search(r"(?P.)", desc) % "{repo}"}\n' hg: parse error: invalid group 'repo' in search pattern: (?P.) - [255] + [10] Test the sub function of templating for expansion: @@ -666,10 +666,10 @@ Test the sub function of templating for $ hg log -R latesttag -r 10 -T '{sub("[", "x", rev)}\n' hg: parse error: sub got an invalid pattern: [ - [255] + [10] $ hg log -R latesttag -r 10 -T '{sub("[0-9]", r"\1", rev)}\n' hg: parse error: sub got an invalid replacement: \1 - [255] + [10] Test the strip function with chars specified: @@ -721,7 +721,7 @@ Test invalid date: $ hg log -R latesttag -T '{date(rev)}\n' hg: parse error: date expects a date information - [255] + [10] Set up repository containing template fragments in commit metadata: @@ -789,17 +789,17 @@ Test dict constructor: $ hg log -r 0 -T '{dict(rev, rev=rev)}\n' hg: parse error: duplicated dict key 'rev' inferred - [255] + [10] $ hg log -r 0 -T '{dict(node, node|short)}\n' hg: parse error: duplicated dict key 'node' inferred - [255] + [10] $ hg log -r 0 -T '{dict(1 + 2)}' hg: parse error: dict key cannot be inferred - [255] + [10] $ hg log -r 0 -T '{dict(x=rev, x=node)}' hg: parse error: dict got multiple values for keyword argument 'x' - [255] + [10] Test get function: @@ -810,7 +810,7 @@ Test get function: $ hg log -r 0 --template '{get(files, "should_fail")}\n' hg: parse error: not a dictionary (get() expects a dict as first argument) - [255] + [10] Test json filter applied to wrapped object: @@ -836,7 +836,7 @@ Test localdate(date, tz) function: 1970-01-01 00:00 +0000 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "blahUTC")|isodate}\n' hg: parse error: localdate expects a timezone - [255] + [10] $ TZ=JST-09 hg log -r0 -T '{localdate(date, "+0200")|isodate}\n' 1970-01-01 02:00 +0200 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "0")|isodate}\n' @@ -845,10 +845,10 @@ Test localdate(date, tz) function: 1970-01-01 00:00 +0000 $ hg log -r0 -T '{localdate(date, "invalid")|isodate}\n' hg: parse error: localdate expects a timezone - [255] + [10] $ hg log -r0 -T '{localdate(date, date)|isodate}\n' hg: parse error: localdate expects a timezone - [255] + [10] Test shortest(node) function: @@ -871,7 +871,7 @@ Test shortest(node) function: f7769ec2ab $ hg log -r 0 -T '{shortest(node, "not an int")}\n' hg: parse error: shortest() expects an integer minlength - [255] + [10] $ hg log -r 'wdir()' -T '{node|shortest}\n' ffff @@ -1070,16 +1070,16 @@ Test width argument passed to pad functi 0 test $ hg log -r 0 -T '{pad(rev, "not an int")}\n' hg: parse error: pad() expects an integer width - [255] + [10] Test invalid fillchar passed to pad function $ hg log -r 0 -T '{pad(rev, 10, "")}\n' hg: parse error: pad() expects a single fill character - [255] + [10] $ hg log -r 0 -T '{pad(rev, 10, "--")}\n' hg: parse error: pad() expects a single fill character - [255] + [10] Test boolean argument passed to pad function @@ -1304,50 +1304,50 @@ Invalid arguments passed to revset() $ hg log -T '{revset("%whatever", 0)}\n' hg: parse error: unexpected revspec format character w - [255] + [10] $ hg log -T '{revset("%lwhatever", files)}\n' hg: parse error: unexpected revspec format character w - [255] + [10] $ hg log -T '{revset("%s %s", 0)}\n' hg: parse error: missing argument for revspec - [255] + [10] $ hg log -T '{revset("", 0)}\n' hg: parse error: too many revspec arguments specified - [255] + [10] $ hg log -T '{revset("%s", 0, 1)}\n' hg: parse error: too many revspec arguments specified - [255] + [10] $ hg log -T '{revset("%", 0)}\n' hg: parse error: incomplete revspec format character - [255] + [10] $ hg log -T '{revset("%l", 0)}\n' hg: parse error: incomplete revspec format character - [255] + [10] $ hg log -T '{revset("%d", 'foo')}\n' hg: parse error: invalid argument for revspec - [255] + [10] $ hg log -T '{revset("%ld", files)}\n' hg: parse error: invalid argument for revspec - [255] + [10] $ hg log -T '{revset("%ls", 0)}\n' hg: parse error: invalid argument for revspec - [255] + [10] $ hg log -T '{revset("%b", 'foo')}\n' hg: parse error: invalid argument for revspec - [255] + [10] $ hg log -T '{revset("%lb", files)}\n' hg: parse error: invalid argument for revspec - [255] + [10] $ hg log -T '{revset("%r", 0)}\n' hg: parse error: invalid argument for revspec - [255] + [10] Invalid operation on revset() $ hg log -T '{get(revset(":"), "foo")}\n' hg: parse error: not a dictionary (get() expects a dict as first argument) - [255] + [10] Test files function @@ -1432,7 +1432,7 @@ Test splitlines Test startswith $ hg log -Gv -R a --template "{startswith(desc)}" hg: parse error: startswith expects two arguments - [255] + [10] $ hg log -Gv -R a --template "{startswith('line', desc)}" @ @@ -1514,11 +1514,11 @@ Test word error messages for not enough $ hg log -Gv -R a --template "{word('0')}" hg: parse error: word expects two or three arguments, got 1 - [255] + [10] $ hg log -Gv -R a --template "{word('0', desc, 'o', 'h', 'b', 'o', 'y')}" hg: parse error: word expects two or three arguments, got 7 - [255] + [10] Test word for integer literal @@ -1529,7 +1529,7 @@ Test word for invalid numbers $ hg log -Gv -R a --template "{word('a', desc)}" hg: parse error: word expects an integer index - [255] + [10] Test word for out of range diff --git a/tests/test-template-graph.t b/tests/test-template-graph.t --- a/tests/test-template-graph.t +++ b/tests/test-template-graph.t @@ -381,13 +381,13 @@ Invalid arguments: $ hg log -T '{subsetparents()}\n' hg: parse error: subsetparents expects two arguments - [255] + [10] $ hg log -T '{subsetparents("a")}\n' hg: parse error: subsetparents expects two arguments - [255] + [10] $ hg log -T '{subsetparents(rev, extras)}\n' hg: parse error: subsetparents expects a queried revset - [255] + [10] $ cd .. diff --git a/tests/test-template-map.t b/tests/test-template-map.t --- a/tests/test-template-map.t +++ b/tests/test-template-map.t @@ -1242,7 +1242,7 @@ Unparsable function-style references: hg: parse error at 6: not a prefix: ) (json(-) ^ here) - [255] + [10] For backward compatibility, the following examples are not parsed as function-style references: @@ -1301,7 +1301,7 @@ Error if style missing value: $ echo 'changeset =' > t $ hg log --style t hg: parse error at t:1: missing value - [255] + [10] Error if include fails: