Mercurial > hg-stable
annotate tests/test-dispatch.t @ 18275:9818f22785b7
performance: speedup computation of unstable revisions
In their current state, revset calls can be very costly, as we test
predicates on the entire repository.
This change drops revset call in favor of direct testing of the
phase of changesets.
Performance test on my Mercurial checkout
- 19857 total changesets,
- 1584 obsolete changesets,
- 13310 obsolescence markers.
Before:
! unstable
! wall 0.017366
After this changes:
! unstable
! wall 0.008093
Performance test on a Mozilla central checkout:
- 117293 total changesets,
- 1 obsolete changeset,
- 1 obsolescence marker.
Before:
! unstable
! wall 0.045190
After:
! unstable
! wall 0.000032
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Fri, 04 Jan 2013 03:15:21 +0100 |
parents | 720308f741cb |
children | ef60083b5536 |
rev | line source |
---|---|
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 |
88250a460bf8
tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents:
12028
diff
changeset
|
22 options: |
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 |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14115
diff
changeset
|
26 --decode apply any matching decode filter |
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 |
12157
88250a460bf8
tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents:
12028
diff
changeset
|
29 |
88250a460bf8
tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents:
12028
diff
changeset
|
30 [+] marked option can be specified multiple times |
88250a460bf8
tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents:
12028
diff
changeset
|
31 |
13950
14d0553bd48b
help: do not show full help text for command on option errors
Adrian Buehlmann <adrian@cadifra.com>
parents:
12327
diff
changeset
|
32 use "hg help cat" to show the full help text |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12157
diff
changeset
|
33 [255] |
12157
88250a460bf8
tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents:
12028
diff
changeset
|
34 |
4563
8044be585b91
dispatch: restore a dropped shlex import
Brendan Cully <brendan@kublai.com>
parents:
diff
changeset
|
35 [defaults] |
4621
6fc26982f203
dispatch: fix handling of incorrect number of arguments
Matt Mackall <mpm@selenic.com>
parents:
4563
diff
changeset
|
36 |
12157
88250a460bf8
tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents:
12028
diff
changeset
|
37 $ hg cat a |
88250a460bf8
tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents:
12028
diff
changeset
|
38 a |
88250a460bf8
tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents:
12028
diff
changeset
|
39 $ cat >> $HGRCPATH <<EOF |
88250a460bf8
tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents:
12028
diff
changeset
|
40 > [defaults] |
88250a460bf8
tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents:
12028
diff
changeset
|
41 > cat = -r null |
88250a460bf8
tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents:
12028
diff
changeset
|
42 > EOF |
88250a460bf8
tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents:
12028
diff
changeset
|
43 $ hg cat a |
88250a460bf8
tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents:
12028
diff
changeset
|
44 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
|
45 [1] |
4654
e0e73ba37983
Fix dispatch error message when not in a repo
Brendan Cully <brendan@kublai.com>
parents:
4621
diff
changeset
|
46 |
17014
50fbe9063ff2
tests: convert some 'hghave no-outer-repo' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
15145
diff
changeset
|
47 $ cd "$TESTTMP" |
50fbe9063ff2
tests: convert some 'hghave no-outer-repo' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
15145
diff
changeset
|
48 |
18227
720308f741cb
dispatch: show empty filename in OSError aborts
Mads Kiilerich <mads@kiilerich.com>
parents:
18226
diff
changeset
|
49 OSError ... and with filename even when it is empty |
720308f741cb
dispatch: show empty filename in OSError aborts
Mads Kiilerich <mads@kiilerich.com>
parents:
18226
diff
changeset
|
50 |
720308f741cb
dispatch: show empty filename in OSError aborts
Mads Kiilerich <mads@kiilerich.com>
parents:
18226
diff
changeset
|
51 $ hg -R a archive '' |
720308f741cb
dispatch: show empty filename in OSError aborts
Mads Kiilerich <mads@kiilerich.com>
parents:
18226
diff
changeset
|
52 abort: No such file or directory: '' |
720308f741cb
dispatch: show empty filename in OSError aborts
Mads Kiilerich <mads@kiilerich.com>
parents:
18226
diff
changeset
|
53 [255] |
720308f741cb
dispatch: show empty filename in OSError aborts
Mads Kiilerich <mads@kiilerich.com>
parents:
18226
diff
changeset
|
54 |
17014
50fbe9063ff2
tests: convert some 'hghave no-outer-repo' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
15145
diff
changeset
|
55 #if no-outer-repo |
50fbe9063ff2
tests: convert some 'hghave no-outer-repo' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
15145
diff
changeset
|
56 |
12157
88250a460bf8
tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents:
12028
diff
changeset
|
57 No repo: |
4659
7a7d4937272b
Kill trailing spaces
Thomas Arendsen Hein <thomas@intevation.de>
parents:
4654
diff
changeset
|
58 |
12157
88250a460bf8
tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents:
12028
diff
changeset
|
59 $ hg cat |
13967
f85c9b0fdb32
dispatch: improve repository not found message
Matt Mackall <mpm@selenic.com>
parents:
13950
diff
changeset
|
60 abort: no repository found in '$TESTTMP' (.hg not found)! |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12157
diff
changeset
|
61 [255] |
12157
88250a460bf8
tests: unify test-dispatch
Adrian Buehlmann <adrian@cadifra.com>
parents:
12028
diff
changeset
|
62 |
17014
50fbe9063ff2
tests: convert some 'hghave no-outer-repo' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
15145
diff
changeset
|
63 #endif |