Mercurial > hg
annotate tests/test-alias @ 8849:80cc4b1a62d0
compare grep result between target and its parent
I found that typical case is that grep target is added at (*) revision
in the tree shown below.
+--- 1(*) --- 3
0
+--- 2 ------ 4
Now, I expect 'hg grep --all' to show only rev:1 which is first
appearance of target line.
But 'hg grep --all' will tell:
target line dis-appeared at 3 => 4
target line appeared at 2 => 3
target line dis-appeared at 1 => 2
target line appeared at 0 => 1
because current 'hg grep' implementation compares not between target
revision and its parent, but between neighbor revisions in walkthrough
order.
I checked performance of this patch by "hg grep --follow --all
walkchangerevs" on whole Mercurial repo, and patched version could
complete as fast as un-patched one.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Tue, 19 May 2009 16:49:54 +0900 |
parents | 21688b8a594b |
children | 8bce1e0d2801 |
rev | line source |
---|---|
4801 | 1 #!/bin/sh |
2 | |
5523
5db730475d6d
tests/*: avoid losing the original settings from $HGRCPATH
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4801
diff
changeset
|
3 cat >> $HGRCPATH <<EOF |
4801 | 4 [alias] |
5 myinit = init | |
6 cleanstatus = status -c | |
7 unknown = bargle | |
8 ambiguous = s | |
9 recursive = recursive | |
8655 | 10 nodefinition = |
8477
a0104303f400
alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
11 mylog = log |
a0104303f400
alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
12 lognull = log -r null |
8519
5fbee915ea5d
alias: a0104303f400 did not correctly handle whitespace in the args
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8477
diff
changeset
|
13 shortlog = log --template '{rev} {node|short} | {date|isodate}\n' |
8655 | 14 dln = lognull --debug |
8477
a0104303f400
alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
15 |
a0104303f400
alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
16 [defaults] |
a0104303f400
alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
17 mylog = -q |
a0104303f400
alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
18 lognull = -q |
a0104303f400
alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
19 log = -v |
4801 | 20 EOF |
21 | |
22 echo '% basic' | |
23 hg myinit alias | |
24 | |
25 echo '% unknown' | |
26 hg unknown | |
27 | |
28 echo '% ambiguous' | |
29 hg ambiguous | |
30 | |
31 echo '% recursive' | |
32 hg recursive | |
33 | |
8655 | 34 echo '% no definition' |
35 hg nodef | |
36 | |
4801 | 37 cd alias |
38 echo foo > foo | |
39 hg ci -Amfoo | |
40 | |
41 echo '% with opts' | |
42 hg cleanst | |
8477
a0104303f400
alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
43 |
8519
5fbee915ea5d
alias: a0104303f400 did not correctly handle whitespace in the args
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8477
diff
changeset
|
44 echo '% with opts and whitespace' |
5fbee915ea5d
alias: a0104303f400 did not correctly handle whitespace in the args
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8477
diff
changeset
|
45 hg shortlog |
5fbee915ea5d
alias: a0104303f400 did not correctly handle whitespace in the args
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8477
diff
changeset
|
46 |
8477
a0104303f400
alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
47 echo '% interaction with defaults' |
a0104303f400
alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
48 hg mylog |
a0104303f400
alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
49 hg lognull |
8655 | 50 |
51 echo '% properly recursive' | |
52 hg dln |