tests/test-dispatch.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Mon, 21 Dec 2020 11:20:31 +0100
changeset 46584 aa19d60ac974
parent 46417 768056549737
child 46749 5a2212d40398
permissions -rw-r--r--
copies-rust: use simpler overwrite when value on both side are identical If the value are the same, their "overwritten" set is the same and we don't need to combine them. It helps our slower cases Repo Case Source-Rev Dest-Rev # of revisions old time new time Difference Factor time per rev --------------------------------------------------------------------------------------------------------------------------------------------------------------- mozilla-try x00000_revs_x00000_added_x0000_copies 1b661134e2ca 1ae03d022d6d : 228985 revs, 86.722016 s, 80.828689 s, -5.893327 s, × 0.9320, 352 µs/rev mozilla-try x00000_revs_x00000_added_x000_copies 9b2a99adc05e 8e29777b48e6 : 382065 revs, 35.113727 s, 34.094064 s, -1.019663 s, × 0.9710, 89 µs/rev Full comparison with the previous revision below: Repo Case Source-Rev Dest-Rev # of revisions old time new time Difference Factor time per rev --------------------------------------------------------------------------------------------------------------------------------------------------------------- mercurial x_revs_x_added_0_copies ad6b123de1c7 39cfcef4f463 : 1 revs, 0.000043 s, 0.000043 s, +0.000000 s, × 1.0000, 43 µs/rev mercurial x_revs_x_added_x_copies 2b1c78674230 0c1d10351869 : 6 revs, 0.000114 s, 0.000114 s, +0.000000 s, × 1.0000, 19 µs/rev mercurial x000_revs_x000_added_x_copies 81f8ff2a9bf2 dd3267698d84 : 1032 revs, 0.004899 s, 0.004899 s, +0.000000 s, × 1.0000, 4 µs/rev pypy x_revs_x_added_0_copies aed021ee8ae8 099ed31b181b : 9 revs, 0.000196 s, 0.000196 s, +0.000000 s, × 1.0000, 21 µs/rev pypy x_revs_x000_added_0_copies 4aa4e1f8e19a 359343b9ac0e : 1 revs, 0.000050 s, 0.000049 s, -0.000001 s, × 0.9800, 49 µs/rev pypy x_revs_x_added_x_copies ac52eb7bbbb0 72e022663155 : 7 revs, 0.000125 s, 0.000117 s, -0.000008 s, × 0.9360, 16 µs/rev pypy x_revs_x00_added_x_copies c3b14617fbd7 ace7255d9a26 : 1 revs, 0.000321 s, 0.6f1f4a s, +0.000001 s, × 1.0031, 322 µs/rev pypy x_revs_x000_added_x000_copies df6f7a526b60 a83dc6a2d56f : 6 revs, 0.011948 s, 0.011856 s, -0.000092 s, × 0.9923, 1976 µs/rev pypy x000_revs_xx00_added_0_copies 89a76aede314 2f22446ff07e : 4785 revs, 0.051267 s, 0.050992 s, -0.000275 s, × 0.9946, 10 µs/rev pypy x000_revs_x000_added_x_copies 8a3b5bfd266e 2c68e87c3efe : 6780 revs, 0.087755 s, 0.087444 s, -0.000311 s, × 0.9965, 12 µs/rev pypy x000_revs_x000_added_x000_copies 89a76aede314 7b3dda341c84 : 5441 revs, 0.061818 s, 0.062487 s, +0.000669 s, × 1.0108, 11 µs/rev pypy x0000_revs_x_added_0_copies d1defd0dc478 c9cb1334cc78 : 43645 revs, 0.634253 s, 0.634909 s, +0.000656 s, × 1.0010, 14 µs/rev pypy x0000_revs_xx000_added_0_copies bf2c629d0071 4ffed77c095c : 2 revs, 0.013179 s, 0.013360 s, +0.000181 s, × 1.0137, 6680 µs/rev pypy x0000_revs_xx000_added_x000_copies 08ea3258278e d9fa043f30c0 : 11316 revs, 0.119643 s, 0.120775 s, +0.001132 s, × 1.0095, 10 µs/rev netbeans x_revs_x_added_0_copies fb0955ffcbcd a01e9239f9e7 : 2 revs, 0.000085 s, 0.000085 s, +0.000000 s, × 1.0000, 42 µs/rev netbeans x_revs_x000_added_0_copies 6f360122949f 20eb231cc7d0 : 2 revs, 0.000107 s, 0.000108 s, +0.000001 s, × 1.0093, 54 µs/rev netbeans x_revs_x_added_x_copies 1ada3faf6fb6 5a39d12eecf4 : 3 revs, 0.000176 s, 0.000176 s, +0.000000 s, × 1.0000, 58 µs/rev netbeans x_revs_x00_added_x_copies 35be93ba1e2c 9eec5e90c05f : 9 revs, 0.000743 s, 0.000747 s, +0.000004 s, × 1.0054, 83 µs/rev netbeans x000_revs_xx00_added_0_copies eac3045b4fdd 51d4ae7f1290 : 1421 revs, 0.010246 s, 0.010128 s, -0.000118 s, × 0.9885, 7 µs/rev netbeans x000_revs_x000_added_x_copies e2063d266acd 6081d72689dc : 1533 revs, 0.015853 s, 0.015899 s, +0.000046 s, × 1.0029, 10 µs/rev netbeans x000_revs_x000_added_x000_copies ff453e9fee32 411350406ec2 : 5750 revs, 0.062971 s, 0.062215 s, -0.000756 s, × 0.9880, 10 µs/rev netbeans x0000_revs_xx000_added_x000_copies 588c2d1ced70 1aad62e59ddd : 66949 revs, 0.518337 s, 0.521004 s, +0.002667 s, × 1.0051, 7 µs/rev mozilla-central x_revs_x_added_0_copies 3697f962bb7b 7015fcdd43a2 : 2 revs, 0.000090 s, 0.000090 s, +0.000000 s, × 1.0000, 45 µs/rev mozilla-central x_revs_x000_added_0_copies dd390860c6c9 40d0c5bed75d : 8 revs, 0.000268 s, 0.000264 s, -0.000004 s, × 0.9851, 33 µs/rev mozilla-central x_revs_x_added_x_copies 8d198483ae3b 14207ffc2b2f : 9 revs, 0.000187 s, 0.000186 s, -0.000001 s, × 0.9947, 20 µs/rev mozilla-central x_revs_x00_added_x_copies 98cbc58cc6bc 446a150332c3 : 7 revs, 0.000661 s, 0.000660 s, -0.000001 s, × 0.9985, 94 µs/rev mozilla-central x_revs_x000_added_x000_copies 3c684b4b8f68 0a5e72d1b479 : 3 revs, 0.003494 s, 0.003542 s, +0.000048 s, × 1.0137, 1180 µs/rev mozilla-central x_revs_x0000_added_x0000_copies effb563bb7e5 c07a39dc4e80 : 6 revs, 0.070509 s, 0.071574 s, +0.001065 s, × 1.0151, 11929 µs/rev mozilla-central x000_revs_xx00_added_0_copies 6100d773079a 04a55431795e : 1593 revs, 0.006489 s, 0.006498 s, +0.000009 s, × 1.0014, 4 µs/rev mozilla-central x000_revs_x000_added_x_copies 9f17a6fc04f9 2d37b966abed : 41 revs, 0.005070 s, 0.005206 s, +0.000136 s, × 1.0268, 126 µs/rev mozilla-central x000_revs_x000_added_x000_copies 7c97034feb78 4407bd0c6330 : 7839 revs, 0.065241 s, 0.065535 s, +0.000294 s, × 1.0045, 8 µs/rev mozilla-central x0000_revs_xx000_added_0_copies 9eec5917337d 67118cc6dcad : 615 revs, 0.027284 s, 0.027139 s, -0.000145 s, × 0.9947, 44 µs/rev mozilla-central x0000_revs_xx000_added_x000_copies f78c615a656c 96a38b690156 : 30263 revs, 0.203671 s, 0.201924 s, -0.001747 s, × 0.9914, 6 µs/rev mozilla-central x00000_revs_x0000_added_x0000_copies 6832ae71433c 4c222a1d9a00 : 153721 revs, 1.239373 s, 1.257201 s, +0.017828 s, × 1.0144, 8 µs/rev mozilla-central x00000_revs_x00000_added_x000_copies 76caed42cf7c 1daa622bbe42 : 204976 revs, 1.649803 s, 1.663045 s, +0.013242 s, × 1.0080, 8 µs/rev mozilla-try x_revs_x_added_0_copies aaf6dde0deb8 9790f499805a : 2 revs, 0.000868 s, 0.000866 s, -0.000002 s, × 0.9977, 433 µs/rev mozilla-try x_revs_x000_added_0_copies d8d0222927b4 5bb8ce8c7450 : 2 revs, 0.000885 s, 0.000883 s, -0.000002 s, × 0.9977, 441 µs/rev mozilla-try x_revs_x_added_x_copies 092fcca11bdb 936255a0384a : 4 revs, 0.000165 s, 0.000163 s, -0.000002 s, × 0.9879, 40 µs/rev mozilla-try x_revs_x00_added_x_copies b53d2fadbdb5 017afae788ec : 2 revs, 0.001147 s, 0.001139 s, -0.000008 s, × 0.9930, 569 µs/rev mozilla-try x_revs_x000_added_x000_copies 20408ad61ce5 6f0ee96e21ad : 1 revs, 0.032885 s, 0.032753 s, -0.000132 s, × 0.9960, 32752 µs/rev mozilla-try x_revs_x0000_added_x0000_copies effb563bb7e5 c07a39dc4e80 : 6 revs, 0.071304 s, 0.073266 s, +0.001962 s, × 1.0275, 12211 µs/rev mozilla-try x000_revs_xx00_added_0_copies 6100d773079a 04a55431795e : 1593 revs, 0.006506 s, 0.006567 s, +0.000061 s, × 1.0094, 4 µs/rev mozilla-try x000_revs_x000_added_x_copies 9f17a6fc04f9 2d37b966abed : 41 revs, 0.005486 s, 0.005427 s, -0.000059 s, × 0.9892, 132 µs/rev mozilla-try x000_revs_x000_added_x000_copies 1346fd0130e4 4c65cbdabc1f : 6657 revs, 0.064677 s, 0.064058 s, -0.000619 s, × 0.9904, 9 µs/rev mozilla-try x0000_revs_x_added_0_copies 63519bfd42ee a36a2a865d92 : 40314 revs, 0.306000 s, 0.303320 s, -0.002680 s, × 0.9912, 7 µs/rev mozilla-try x0000_revs_x_added_x_copies 9fe69ff0762d bcabf2a78927 : 38690 revs, 0.288217 s, 0.288456 s, +0.000239 s, × 1.0008, 7 µs/rev mozilla-try x0000_revs_xx000_added_x_copies 156f6e2674f2 4d0f2c178e66 : 8598 revs, 0.086117 s, 0.085925 s, -0.000192 s, × 0.9978, 9 µs/rev mozilla-try x0000_revs_xx000_added_0_copies 9eec5917337d 67118cc6dcad : 615 revs, 0.027512 s, 0.027302 s, -0.000210 s, × 0.9924, 44 µs/rev mozilla-try x0000_revs_xx000_added_x000_copies 89294cd501d9 7ccb2fc7ccb5 : 97052 revs, 1.998239 s, 2.034596 s, +0.036357 s, × 1.0182, 20 µs/rev mozilla-try x0000_revs_x0000_added_x0000_copies e928c65095ed e951f4ad123a : 52031 revs, 0.688201 s, 0.694030 s, +0.005829 s, × 1.0085, 13 µs/rev mozilla-try x00000_revs_x_added_0_copies 6a320851d377 1ebb79acd503 : 363753 revs, 4.389428 s, 4.407723 s, +0.018295 s, × 1.0042, 12 µs/rev mozilla-try x00000_revs_x00000_added_0_copies dc8a3ca7010e d16fde900c9c : 34414 revs, 0.578736 s, 0.574355 s, -0.004381 s, × 0.9924, 16 µs/rev mozilla-try x00000_revs_x_added_x_copies 5173c4b6f97c 95d83ee7242d : 362229 revs, 4.363599 s, 4.457827 s, +0.094228 s, × 1.0216, 12 µs/rev mozilla-try x00000_revs_x000_added_x_copies 9126823d0e9c ca82787bb23c : 359344 revs, 4.324129 s, 4.351696 s, +0.027567 s, × 1.0064, 12 µs/rev mozilla-try x00000_revs_x0000_added_x0000_copies 8d3fafa80d4b eb884023b810 : 192665 revs, 1.565727 s, 1.570065 s, +0.004338 s, × 1.0028, 8 µs/rev mozilla-try x00000_revs_x00000_added_x0000_copies 1b661134e2ca 1ae03d022d6d : 228985 revs, 86.722016 s, 80.828689 s, -5.893327 s, × 0.9320, 352 µs/rev mozilla-try x00000_revs_x00000_added_x000_copies 9b2a99adc05e 8e29777b48e6 : 382065 revs, 35.113727 s, 34.094064 s, -1.019663 s, × 0.9710, 89 µs/rev private : 459513 revs, 27.397070 s, 27.435529 s, +0.038459 s, × 1.0014, 59 µs/rev Differential Revision: https://phab.mercurial-scm.org/D9655
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12157
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
     1
test command parsing and dispatch
4563
8044be585b91 dispatch: restore a dropped shlex import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     2
12157
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
     3
  $ hg init a
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
     4
  $ cd a
14115
1d5faa2c970f tests: move test-issue436 in test-dispatch where fancyopts is tested
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 13967
diff changeset
     5
1d5faa2c970f tests: move test-issue436 in test-dispatch where fancyopts is tested
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 13967
diff changeset
     6
Redundant options used to crash (issue436):
1d5faa2c970f tests: move test-issue436 in test-dispatch where fancyopts is tested
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 13967
diff changeset
     7
  $ hg -v log -v
1d5faa2c970f tests: move test-issue436 in test-dispatch where fancyopts is tested
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 13967
diff changeset
     8
  $ hg -v log -v x
1d5faa2c970f tests: move test-issue436 in test-dispatch where fancyopts is tested
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 13967
diff changeset
     9
12157
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
    10
  $ echo a > a
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
    11
  $ hg ci -Ama
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
    12
  adding a
4563
8044be585b91 dispatch: restore a dropped shlex import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    13
12157
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
    14
Missing arg:
4621
6fc26982f203 dispatch: fix handling of incorrect number of arguments
Matt Mackall <mpm@selenic.com>
parents: 4563
diff changeset
    15
12157
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
    16
  $ hg cat
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
    17
  hg cat: invalid arguments
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
    18
  hg cat [OPTION]... FILE...
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
    19
  
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
    20
  output the current or given revision of files
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
    21
  
22117
c1d93edcf004 help: fold repeatable option message into option table header
Matt Mackall <mpm@selenic.com>
parents: 22111
diff changeset
    22
  options ([+] can be repeated):
12157
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
    23
  
15145
ff26712a0c50 help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents: 14115
diff changeset
    24
   -o --output FORMAT       print output to file with formatted name
ff26712a0c50 help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents: 14115
diff changeset
    25
   -r --rev REV             print the given revision
30152
d65e246100ed help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 30024
diff changeset
    26
      --decode              apply any matching decode filter
15145
ff26712a0c50 help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents: 14115
diff changeset
    27
   -I --include PATTERN [+] include names matching the given patterns
ff26712a0c50 help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents: 14115
diff changeset
    28
   -X --exclude PATTERN [+] exclude names matching the given patterns
39931
0d703063d0c8 formatter: remove experimental marker from -T option
Yuya Nishihara <yuya@tcha.org>
parents: 35393
diff changeset
    29
   -T --template TEMPLATE   display with template
12157
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
    30
  
29974
7109d5ddeb0c help: use single quotes in use warning
timeless <timeless@mozdev.org>
parents: 22117
diff changeset
    31
  (use 'hg cat -h' to show more help)
46262
9c9e0b4b2ca7 error: use detailed exit code 10 for command errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 45918
diff changeset
    32
  [10]
12157
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
    33
35027
7384250eabd9 dispatch: do not drop unpaired argument at _earlygetopt()
Yuya Nishihara <yuya@tcha.org>
parents: 34953
diff changeset
    34
Missing parameter for early option:
7384250eabd9 dispatch: do not drop unpaired argument at _earlygetopt()
Yuya Nishihara <yuya@tcha.org>
parents: 34953
diff changeset
    35
7384250eabd9 dispatch: do not drop unpaired argument at _earlygetopt()
Yuya Nishihara <yuya@tcha.org>
parents: 34953
diff changeset
    36
  $ hg log -R 2>&1 | grep 'hg log'
7384250eabd9 dispatch: do not drop unpaired argument at _earlygetopt()
Yuya Nishihara <yuya@tcha.org>
parents: 34953
diff changeset
    37
  hg log: option -R requires argument
7384250eabd9 dispatch: do not drop unpaired argument at _earlygetopt()
Yuya Nishihara <yuya@tcha.org>
parents: 34953
diff changeset
    38
  hg log [OPTION]... [FILE]
7384250eabd9 dispatch: do not drop unpaired argument at _earlygetopt()
Yuya Nishihara <yuya@tcha.org>
parents: 34953
diff changeset
    39
  (use 'hg log -h' to show more help)
7384250eabd9 dispatch: do not drop unpaired argument at _earlygetopt()
Yuya Nishihara <yuya@tcha.org>
parents: 34953
diff changeset
    40
35226
5b569d512fbd fancyopts: use getopt.gnu_getopt()
Yuya Nishihara <yuya@tcha.org>
parents: 35223
diff changeset
    41
"--" may be an option value:
5b569d512fbd fancyopts: use getopt.gnu_getopt()
Yuya Nishihara <yuya@tcha.org>
parents: 35223
diff changeset
    42
5b569d512fbd fancyopts: use getopt.gnu_getopt()
Yuya Nishihara <yuya@tcha.org>
parents: 35223
diff changeset
    43
  $ hg -R -- log
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45894
diff changeset
    44
  abort: repository -- not found
35226
5b569d512fbd fancyopts: use getopt.gnu_getopt()
Yuya Nishihara <yuya@tcha.org>
parents: 35223
diff changeset
    45
  [255]
5b569d512fbd fancyopts: use getopt.gnu_getopt()
Yuya Nishihara <yuya@tcha.org>
parents: 35223
diff changeset
    46
  $ hg log -R --
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45894
diff changeset
    47
  abort: repository -- not found
35226
5b569d512fbd fancyopts: use getopt.gnu_getopt()
Yuya Nishihara <yuya@tcha.org>
parents: 35223
diff changeset
    48
  [255]
5b569d512fbd fancyopts: use getopt.gnu_getopt()
Yuya Nishihara <yuya@tcha.org>
parents: 35223
diff changeset
    49
  $ hg log -T --
5b569d512fbd fancyopts: use getopt.gnu_getopt()
Yuya Nishihara <yuya@tcha.org>
parents: 35223
diff changeset
    50
  -- (no-eol)
5b569d512fbd fancyopts: use getopt.gnu_getopt()
Yuya Nishihara <yuya@tcha.org>
parents: 35223
diff changeset
    51
  $ hg log -T -- -k nomatch
35027
7384250eabd9 dispatch: do not drop unpaired argument at _earlygetopt()
Yuya Nishihara <yuya@tcha.org>
parents: 34953
diff changeset
    52
35029
e16f68c4abe3 dispatch: stop parsing of early boolean option at "--"
Yuya Nishihara <yuya@tcha.org>
parents: 35027
diff changeset
    53
Parsing of early options should stop at "--":
e16f68c4abe3 dispatch: stop parsing of early boolean option at "--"
Yuya Nishihara <yuya@tcha.org>
parents: 35027
diff changeset
    54
e16f68c4abe3 dispatch: stop parsing of early boolean option at "--"
Yuya Nishihara <yuya@tcha.org>
parents: 35027
diff changeset
    55
  $ hg cat -- --config=hooks.pre-cat=false
e16f68c4abe3 dispatch: stop parsing of early boolean option at "--"
Yuya Nishihara <yuya@tcha.org>
parents: 35027
diff changeset
    56
  --config=hooks.pre-cat=false: no such file in rev cb9a9f314b8b
e16f68c4abe3 dispatch: stop parsing of early boolean option at "--"
Yuya Nishihara <yuya@tcha.org>
parents: 35027
diff changeset
    57
  [1]
e16f68c4abe3 dispatch: stop parsing of early boolean option at "--"
Yuya Nishihara <yuya@tcha.org>
parents: 35027
diff changeset
    58
  $ hg cat -- --debugger
e16f68c4abe3 dispatch: stop parsing of early boolean option at "--"
Yuya Nishihara <yuya@tcha.org>
parents: 35027
diff changeset
    59
  --debugger: no such file in rev cb9a9f314b8b
e16f68c4abe3 dispatch: stop parsing of early boolean option at "--"
Yuya Nishihara <yuya@tcha.org>
parents: 35027
diff changeset
    60
  [1]
e16f68c4abe3 dispatch: stop parsing of early boolean option at "--"
Yuya Nishihara <yuya@tcha.org>
parents: 35027
diff changeset
    61
35030
d9aba3730d30 dispatch: abort if early boolean options can't be parsed
Yuya Nishihara <yuya@tcha.org>
parents: 35029
diff changeset
    62
Unparsable form of early options:
d9aba3730d30 dispatch: abort if early boolean options can't be parsed
Yuya Nishihara <yuya@tcha.org>
parents: 35029
diff changeset
    63
d9aba3730d30 dispatch: abort if early boolean options can't be parsed
Yuya Nishihara <yuya@tcha.org>
parents: 35029
diff changeset
    64
  $ hg cat --debugg
45909
ca39c45014fa errors: remove trailing "!" in messages about bad top-level args
Martin von Zweigbergk <martinvonz@google.com>
parents: 45906
diff changeset
    65
  abort: option --debugger may not be abbreviated
45918
ac565222b9f8 errors: raise InputError on bad top-level flags
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
    66
  [10]
35030
d9aba3730d30 dispatch: abort if early boolean options can't be parsed
Yuya Nishihara <yuya@tcha.org>
parents: 35029
diff changeset
    67
35034
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
    68
Parsing failure of early options should be detected before executing the
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
    69
command:
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
    70
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
    71
  $ hg log -b '--config=hooks.pre-log=false' default
45909
ca39c45014fa errors: remove trailing "!" in messages about bad top-level args
Martin von Zweigbergk <martinvonz@google.com>
parents: 45906
diff changeset
    72
  abort: option --config may not be abbreviated
45918
ac565222b9f8 errors: raise InputError on bad top-level flags
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
    73
  [10]
35034
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
    74
  $ hg log -b -R. default
45909
ca39c45014fa errors: remove trailing "!" in messages about bad top-level args
Martin von Zweigbergk <martinvonz@google.com>
parents: 45906
diff changeset
    75
  abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo
45918
ac565222b9f8 errors: raise InputError on bad top-level flags
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
    76
  [10]
35034
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
    77
  $ hg log --cwd .. -b --cwd=. default
45909
ca39c45014fa errors: remove trailing "!" in messages about bad top-level args
Martin von Zweigbergk <martinvonz@google.com>
parents: 45906
diff changeset
    78
  abort: option --cwd may not be abbreviated
45918
ac565222b9f8 errors: raise InputError on bad top-level flags
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
    79
  [10]
35034
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
    80
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
    81
However, we can't prevent it from loading extensions and configs:
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
    82
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
    83
  $ cat <<EOF > bad.py
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
    84
  > raise Exception('bad')
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
    85
  > EOF
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
    86
  $ hg log -b '--config=extensions.bad=bad.py' default
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
    87
  *** failed to import extension bad from bad.py: bad
45909
ca39c45014fa errors: remove trailing "!" in messages about bad top-level args
Martin von Zweigbergk <martinvonz@google.com>
parents: 45906
diff changeset
    88
  abort: option --config may not be abbreviated
45918
ac565222b9f8 errors: raise InputError on bad top-level flags
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
    89
  [10]
35034
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
    90
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
    91
  $ mkdir -p badrepo/.hg
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
    92
  $ echo 'invalid-syntax' > badrepo/.hg/hgrc
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
    93
  $ hg log -b -Rbadrepo default
45894
9dc1351d0b5f errors: raise ConfigError on failure to parse config file
Martin von Zweigbergk <martinvonz@google.com>
parents: 41385
diff changeset
    94
  config error at badrepo/.hg/hgrc:1: invalid-syntax
9dc1351d0b5f errors: raise ConfigError on failure to parse config file
Martin von Zweigbergk <martinvonz@google.com>
parents: 41385
diff changeset
    95
  [30]
35034
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
    96
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
    97
  $ hg log -b --cwd=inexistent default
35230
feecfefeba25 tests: add a substitution for ENOENT/ERROR_FILE_NOT_FOUND messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35227
diff changeset
    98
  abort: $ENOENT$: 'inexistent'
35034
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
    99
  [255]
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
   100
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
   101
  $ hg log -b '--config=ui.traceback=yes' 2>&1 | grep '^Traceback'
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
   102
  Traceback (most recent call last):
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
   103
  $ hg log -b '--config=profiling.enabled=yes' 2>&1 | grep -i sample
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
   104
  Sample count: .*|No samples recorded\. (re)
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
   105
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
   106
Early options can't be specified in [aliases] and [defaults] because they are
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
   107
applied before the command name is resolved:
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
   108
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
   109
  $ hg log -b '--config=alias.log=log --config=hooks.pre-log=false'
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
   110
  hg log: option -b not recognized
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
   111
  error in definition for alias 'log': --config may only be given on the command
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
   112
  line
46262
9c9e0b4b2ca7 error: use detailed exit code 10 for command errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 45918
diff changeset
   113
  [10]
35034
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
   114
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
   115
  $ hg log -b '--config=defaults.log=--config=hooks.pre-log=false'
45909
ca39c45014fa errors: remove trailing "!" in messages about bad top-level args
Martin von Zweigbergk <martinvonz@google.com>
parents: 45906
diff changeset
   116
  abort: option --config may not be abbreviated
45918
ac565222b9f8 errors: raise InputError on bad top-level flags
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   117
  [10]
35034
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
   118
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
   119
Shell aliases bypass any command parsing rules but for the early one:
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
   120
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
   121
  $ hg log -b '--config=alias.log=!echo howdy'
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
   122
  howdy
02845f7441af dispatch: verify result of early command parsing
Yuya Nishihara <yuya@tcha.org>
parents: 35030
diff changeset
   123
35170
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   124
Early options must come first if HGPLAIN=+strictflags is specified:
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   125
(BUG: chg cherry-picks early options to pass them as a server command)
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   126
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   127
#if no-chg
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   128
  $ HGPLAIN=+strictflags hg log -b --config='hooks.pre-log=false' default
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45894
diff changeset
   129
  abort: unknown revision '--config=hooks.pre-log=false'
35170
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   130
  [255]
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   131
  $ HGPLAIN=+strictflags hg log -b -R. default
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45894
diff changeset
   132
  abort: unknown revision '-R.'
35170
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   133
  [255]
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   134
  $ HGPLAIN=+strictflags hg log -b --cwd=. default
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45894
diff changeset
   135
  abort: unknown revision '--cwd=.'
35170
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   136
  [255]
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   137
#endif
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   138
  $ HGPLAIN=+strictflags hg log -b --debugger default
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45894
diff changeset
   139
  abort: unknown revision '--debugger'
35170
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   140
  [255]
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   141
  $ HGPLAIN=+strictflags hg log -b --config='alias.log=!echo pwned' default
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45894
diff changeset
   142
  abort: unknown revision '--config=alias.log=!echo pwned'
35170
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   143
  [255]
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   144
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   145
  $ HGPLAIN=+strictflags hg log --config='hooks.pre-log=false' -b default
45909
ca39c45014fa errors: remove trailing "!" in messages about bad top-level args
Martin von Zweigbergk <martinvonz@google.com>
parents: 45906
diff changeset
   146
  abort: option --config may not be abbreviated
45918
ac565222b9f8 errors: raise InputError on bad top-level flags
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   147
  [10]
35170
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   148
  $ HGPLAIN=+strictflags hg log -q --cwd=.. -b default
45909
ca39c45014fa errors: remove trailing "!" in messages about bad top-level args
Martin von Zweigbergk <martinvonz@google.com>
parents: 45906
diff changeset
   149
  abort: option --cwd may not be abbreviated
45918
ac565222b9f8 errors: raise InputError on bad top-level flags
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   150
  [10]
35170
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   151
  $ HGPLAIN=+strictflags hg log -q -R . -b default
45909
ca39c45014fa errors: remove trailing "!" in messages about bad top-level args
Martin von Zweigbergk <martinvonz@google.com>
parents: 45906
diff changeset
   152
  abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo
45918
ac565222b9f8 errors: raise InputError on bad top-level flags
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   153
  [10]
35170
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   154
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   155
  $ HGPLAIN=+strictflags hg --config='hooks.pre-log=false' log -b default
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   156
  abort: pre-log hook exited with status 1
46417
768056549737 errors: use exit code 40 for when a hook fails
Martin von Zweigbergk <martinvonz@google.com>
parents: 46262
diff changeset
   157
  [40]
35170
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   158
  $ HGPLAIN=+strictflags hg --cwd .. -q -Ra log -b default
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   159
  0:cb9a9f314b8b
35223
4edd2202f7d7 dispatch: alias --repo to --repository while parsing early options
Yuya Nishihara <yuya@tcha.org>
parents: 35205
diff changeset
   160
  $ HGPLAIN=+strictflags hg --cwd .. -q --repository a log -b default
4edd2202f7d7 dispatch: alias --repo to --repository while parsing early options
Yuya Nishihara <yuya@tcha.org>
parents: 35205
diff changeset
   161
  0:cb9a9f314b8b
4edd2202f7d7 dispatch: alias --repo to --repository while parsing early options
Yuya Nishihara <yuya@tcha.org>
parents: 35205
diff changeset
   162
  $ HGPLAIN=+strictflags hg --cwd .. -q --repo a log -b default
4edd2202f7d7 dispatch: alias --repo to --repository while parsing early options
Yuya Nishihara <yuya@tcha.org>
parents: 35205
diff changeset
   163
  0:cb9a9f314b8b
35170
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   164
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   165
For compatibility reasons, HGPLAIN=+strictflags is not enabled by plain HGPLAIN:
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   166
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   167
  $ HGPLAIN= hg log --config='hooks.pre-log=false' -b default
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   168
  abort: pre-log hook exited with status 1
46417
768056549737 errors: use exit code 40 for when a hook fails
Martin von Zweigbergk <martinvonz@google.com>
parents: 46262
diff changeset
   169
  [40]
35170
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   170
  $ HGPLAINEXCEPT= hg log --cwd .. -q -Ra -b default
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   171
  0:cb9a9f314b8b
c9740b69b9b7 dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options
Yuya Nishihara <yuya@tcha.org>
parents: 35034
diff changeset
   172
4563
8044be585b91 dispatch: restore a dropped shlex import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   173
[defaults]
4621
6fc26982f203 dispatch: fix handling of incorrect number of arguments
Matt Mackall <mpm@selenic.com>
parents: 4563
diff changeset
   174
12157
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
   175
  $ hg cat a
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
   176
  a
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
   177
  $ cat >> $HGRCPATH <<EOF
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
   178
  > [defaults]
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
   179
  > cat = -r null
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
   180
  > EOF
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
   181
  $ hg cat a
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
   182
  a: no such file in rev 000000000000
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12157
diff changeset
   183
  [1]
4654
e0e73ba37983 Fix dispatch error message when not in a repo
Brendan Cully <brendan@kublai.com>
parents: 4621
diff changeset
   184
17014
50fbe9063ff2 tests: convert some 'hghave no-outer-repo' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 15145
diff changeset
   185
  $ cd "$TESTTMP"
50fbe9063ff2 tests: convert some 'hghave no-outer-repo' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 15145
diff changeset
   186
18506
ef60083b5536 tests: fix for windows - slashes and no serve
Mads Kiilerich <madski@unity3d.com>
parents: 18227
diff changeset
   187
OSError "No such file or directory" / "The system cannot find the path
ef60083b5536 tests: fix for windows - slashes and no serve
Mads Kiilerich <madski@unity3d.com>
parents: 18227
diff changeset
   188
specified" should include filename even when it is empty
18227
720308f741cb dispatch: show empty filename in OSError aborts
Mads Kiilerich <mads@kiilerich.com>
parents: 18226
diff changeset
   189
720308f741cb dispatch: show empty filename in OSError aborts
Mads Kiilerich <mads@kiilerich.com>
parents: 18226
diff changeset
   190
  $ hg -R a archive ''
41385
ed99c7b52106 tests: conditionalize Windows difference in test-dispatch.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 41354
diff changeset
   191
  abort: $ENOENT$: '' (no-windows !)
ed99c7b52106 tests: conditionalize Windows difference in test-dispatch.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 41354
diff changeset
   192
  abort: $ENOTDIR$: '' (windows !)
18227
720308f741cb dispatch: show empty filename in OSError aborts
Mads Kiilerich <mads@kiilerich.com>
parents: 18226
diff changeset
   193
  [255]
720308f741cb dispatch: show empty filename in OSError aborts
Mads Kiilerich <mads@kiilerich.com>
parents: 18226
diff changeset
   194
17014
50fbe9063ff2 tests: convert some 'hghave no-outer-repo' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 15145
diff changeset
   195
#if no-outer-repo
50fbe9063ff2 tests: convert some 'hghave no-outer-repo' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 15145
diff changeset
   196
12157
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
   197
No repo:
4659
7a7d4937272b Kill trailing spaces
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4654
diff changeset
   198
12157
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
   199
  $ hg cat
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45894
diff changeset
   200
  abort: no repository found in '$TESTTMP' (.hg not found)
45911
8939062597f0 errors: raise InputError on bad repo arguments
Martin von Zweigbergk <martinvonz@google.com>
parents: 45909
diff changeset
   201
  [10]
12157
88250a460bf8 tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents: 12028
diff changeset
   202
17014
50fbe9063ff2 tests: convert some 'hghave no-outer-repo' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 15145
diff changeset
   203
#endif
34643
f42dec9c976e hgweb: do not import uuid immediately to avoid its side effect
Jun Wu <quark@fb.com>
parents: 30152
diff changeset
   204
f42dec9c976e hgweb: do not import uuid immediately to avoid its side effect
Jun Wu <quark@fb.com>
parents: 30152
diff changeset
   205
#if rmcwd
f42dec9c976e hgweb: do not import uuid immediately to avoid its side effect
Jun Wu <quark@fb.com>
parents: 30152
diff changeset
   206
f42dec9c976e hgweb: do not import uuid immediately to avoid its side effect
Jun Wu <quark@fb.com>
parents: 30152
diff changeset
   207
Current directory removed:
f42dec9c976e hgweb: do not import uuid immediately to avoid its side effect
Jun Wu <quark@fb.com>
parents: 30152
diff changeset
   208
f42dec9c976e hgweb: do not import uuid immediately to avoid its side effect
Jun Wu <quark@fb.com>
parents: 30152
diff changeset
   209
  $ mkdir $TESTTMP/repo1
f42dec9c976e hgweb: do not import uuid immediately to avoid its side effect
Jun Wu <quark@fb.com>
parents: 30152
diff changeset
   210
  $ cd $TESTTMP/repo1
f42dec9c976e hgweb: do not import uuid immediately to avoid its side effect
Jun Wu <quark@fb.com>
parents: 30152
diff changeset
   211
  $ rm -rf $TESTTMP/repo1
34953
0ccb43d4cf01 test-dispatch: stabilize the test
Jun Wu <quark@fb.com>
parents: 34789
diff changeset
   212
0ccb43d4cf01 test-dispatch: stabilize the test
Jun Wu <quark@fb.com>
parents: 34789
diff changeset
   213
The output could be one of the following and something else:
0ccb43d4cf01 test-dispatch: stabilize the test
Jun Wu <quark@fb.com>
parents: 34789
diff changeset
   214
 chg: abort: failed to getcwd (errno = *) (glob)
0ccb43d4cf01 test-dispatch: stabilize the test
Jun Wu <quark@fb.com>
parents: 34789
diff changeset
   215
 abort: error getting current working directory: * (glob)
35230
feecfefeba25 tests: add a substitution for ENOENT/ERROR_FILE_NOT_FOUND messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35227
diff changeset
   216
 sh: 0: getcwd() failed: $ENOENT$
34953
0ccb43d4cf01 test-dispatch: stabilize the test
Jun Wu <quark@fb.com>
parents: 34789
diff changeset
   217
Since the exact behavior depends on the shell, only check it returns non-zero.
0ccb43d4cf01 test-dispatch: stabilize the test
Jun Wu <quark@fb.com>
parents: 34789
diff changeset
   218
  $ HGDEMANDIMPORT=disable hg version -q 2>/dev/null || false
0ccb43d4cf01 test-dispatch: stabilize the test
Jun Wu <quark@fb.com>
parents: 34789
diff changeset
   219
  [1]
34643
f42dec9c976e hgweb: do not import uuid immediately to avoid its side effect
Jun Wu <quark@fb.com>
parents: 30152
diff changeset
   220
f42dec9c976e hgweb: do not import uuid immediately to avoid its side effect
Jun Wu <quark@fb.com>
parents: 30152
diff changeset
   221
#endif