Mercurial > hg
view tests/test-globalopts @ 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 | dbc40381620e |
children |
line wrap: on
line source
#!/bin/sh "$TESTDIR/hghave" no-outer-repo || exit 80 hg init a cd a echo a > a hg ci -A -d'1 0' -m a cd .. hg init b cd b echo b > b hg ci -A -d'1 0' -m b cd .. hg clone a c cd c hg pull -f ../b hg merge cd .. echo %% -R/--repository hg -R a tip hg --repository b tip echo %% implicit -R hg ann a/a hg ann a/a a/a hg ann a/a b/b hg -R b ann a/a hg log echo %% abbrev of long option hg --repo c tip echo "%% earlygetopt with duplicate options (36d23de02da1)" hg --cwd a --cwd b --cwd c tip hg --repo c --repository b -R a tip echo "%% earlygetopt short option without following space" hg -q -Rb tip echo "%% earlygetopt with illegal abbreviations" hg --confi "foo.bar=baz" hg --cw a tip hg --rep a tip hg --repositor a tip hg -qR a tip hg -qRa tip echo %% --cwd hg --cwd a parents echo %% -y/--noninteractive - just be sure it is parsed hg --cwd a tip -q --noninteractive hg --cwd a tip -q -y echo %% -q/--quiet hg -R a -q tip hg -R b -q tip hg -R c --quiet parents echo %% -v/--verbose hg --cwd c head -v hg --cwd b tip --verbose echo %% --config hg --cwd c --config paths.quuxfoo=bar paths | grep quuxfoo > /dev/null && echo quuxfoo hg --cwd c --config '' tip -q hg --cwd c --config a.b tip -q hg --cwd c --config a tip -q hg --cwd c --config a.= tip -q hg --cwd c --config .b= tip -q echo %% --debug hg --cwd c log --debug echo %% --traceback hg --cwd c --config x --traceback tip 2>&1 | grep -i 'traceback' echo %% --time hg --cwd a --time tip 2>&1 | grep '^Time:' | sed 's/[0-9][0-9]*/x/g' echo %% --version hg --version -q | sed 's/version [^)]*/version xxx/' echo %% -h/--help hg -h hg --help echo %% not tested: --debugger