Mercurial > hg
annotate tests/test-revset-outgoing.t @ 22503:300e07582e9b stable
revset: add an optimised baseset.__contains__ (issue4371)
The baseset class is based on a python list. This means that base.__contains__
was absolutely as crappy as list.__contains__. We now rely on __contains__ from
the underlying set.
This will avoid having to explicitly convert the baseset to a set (using
baseset.set()) whenever one want fast membership test.
Apparently there is already code that forgot to do such conversions since we
observe a massive speedup in some test.
revset #25: roots((0::) - (0::tip))
0) wall 2.079454 comb 2.080000 user 2.080000 sys 0.000000 (best of 5)
1) wall 0.132970 comb 0.130000 user 0.130000 sys 0.000000 (best of 65)
No regression is observed in benchmarks.
This change improve the issue4371 back to acceptable situation (but are still
slower than manual substraction)
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 16 Sep 2014 23:59:29 -0700 |
parents | aa9385f983fa |
children | 82b2ba904e3e |
rev | line source |
---|---|
12614
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
1 $ cat >> $HGRCPATH <<EOF |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
2 > [alias] |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
3 > tlog = log --template "{rev}:{node|short}: '{desc}' {branches}\n" |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
4 > tglog = tlog -G |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
5 > tout = out --template "{rev}:{node|short}: '{desc}' {branches}\n" |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
6 > EOF |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
7 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
8 $ hg init a |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
9 $ cd a |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
10 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
11 $ echo a > a |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
12 $ hg ci -Aqm0 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
13 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
14 $ echo foo >> a |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
15 $ hg ci -Aqm1 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
16 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
17 $ hg up -q 0 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
18 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
19 $ hg branch stable |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
20 marked working directory as branch stable |
15615 | 21 (branches are permanent and global, did you want a bookmark?) |
12614
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
22 $ echo bar >> a |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
23 $ hg ci -qm2 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
24 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
25 $ hg tglog |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
26 @ 2:7bee6c3bea3a: '2' stable |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
27 | |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
28 | o 1:3560197d8331: '1' |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
29 |/ |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
30 o 0:f7b1eb17ad24: '0' |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
31 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
32 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
33 $ cd .. |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
34 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
35 $ hg clone -q a#stable b |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
36 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
37 $ cd b |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
38 $ cat .hg/hgrc |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
39 [paths] |
15447
9910f60a37ee
tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents:
13572
diff
changeset
|
40 default = $TESTTMP/a#stable (glob) |
12614
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
41 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
42 $ echo red >> a |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
43 $ hg ci -qm3 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
44 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
45 $ hg up -q default |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
46 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
47 $ echo blue >> a |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
48 $ hg ci -qm4 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
49 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
50 $ hg tglog |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
51 @ 3:f0461977a3db: '4' |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
52 | |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
53 | o 2:1d4099801a4e: '3' stable |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
54 | | |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
55 | o 1:7bee6c3bea3a: '2' stable |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
56 |/ |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
57 o 0:f7b1eb17ad24: '0' |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
58 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
59 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
60 $ hg tout |
15447
9910f60a37ee
tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents:
13572
diff
changeset
|
61 comparing with $TESTTMP/a (glob) |
12614
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
62 searching for changes |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
63 2:1d4099801a4e: '3' stable |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
64 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
65 $ hg tlog -r 'outgoing()' |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
66 2:1d4099801a4e: '3' stable |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
67 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
68 $ hg tout ../a#default |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
69 comparing with ../a |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
70 searching for changes |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
71 3:f0461977a3db: '4' |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
72 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
73 $ hg tlog -r 'outgoing("../a#default")' |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
74 3:f0461977a3db: '4' |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
75 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
76 $ echo "green = ../a#default" >> .hg/hgrc |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
77 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
78 $ cat .hg/hgrc |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
79 [paths] |
15447
9910f60a37ee
tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents:
13572
diff
changeset
|
80 default = $TESTTMP/a#stable (glob) |
12614
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
81 green = ../a#default |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
82 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
83 $ hg tout green |
15447
9910f60a37ee
tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents:
13572
diff
changeset
|
84 comparing with $TESTTMP/a (glob) |
12614
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
85 searching for changes |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
86 3:f0461977a3db: '4' |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
87 |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
88 $ hg tlog -r 'outgoing("green")' |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
89 3:f0461977a3db: '4' |
f314723f36f5
revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff
changeset
|
90 |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
15623
diff
changeset
|
91 $ cd .. |