Mercurial > hg
view tests/test-log.out @ 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 | 777a9efdae2d |
children | b34184c046ac |
line wrap: on
line source
adding a changeset: 0:8580ff50825a user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: a % -f, directory abort: cannot follow nonexistent file: "dir" % -f, but no args changeset: 4:b30c444c7c84 tag: tip user: test date: Thu Jan 01 00:00:05 1970 +0000 summary: e changeset: 3:16b60bf3f99a user: test date: Thu Jan 01 00:00:04 1970 +0000 summary: d changeset: 2:21fba396af4c user: test date: Thu Jan 01 00:00:03 1970 +0000 summary: c changeset: 1:c0296dabce9b user: test date: Thu Jan 01 00:00:02 1970 +0000 summary: b changeset: 0:8580ff50825a user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: a % one rename changeset: 0:8580ff50825a user: test date: Thu Jan 01 00:00:01 1970 +0000 files: a description: a % many renames changeset: 4:b30c444c7c84 tag: tip user: test date: Thu Jan 01 00:00:05 1970 +0000 files: dir/b e description: e changeset: 2:21fba396af4c user: test date: Thu Jan 01 00:00:03 1970 +0000 files: b dir/b description: c changeset: 1:c0296dabce9b user: test date: Thu Jan 01 00:00:02 1970 +0000 files: b description: b changeset: 0:8580ff50825a user: test date: Thu Jan 01 00:00:01 1970 +0000 files: a description: a % log copies 4 e (dir/b) 3 b (a) 2 dir/b (b) 1 b (a) 0 % log copies, non-linear manifest 1 files updated, 0 files merged, 1 files removed, 0 files unresolved adding foo created new head 5 e (dir/b) % log copies, execute bit set 6 % log -p d changeset: 3:16b60bf3f99a user: test date: Thu Jan 01 00:00:04 1970 +0000 files: a b d description: d diff -r 21fba396af4c -r 16b60bf3f99a d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/d Thu Jan 01 00:00:04 1970 +0000 @@ -0,0 +1,1 @@ +a adding base 1 files updated, 0 files merged, 0 files removed, 0 files unresolved adding b1 created new head % log -f changeset: 3:e62f78d544b4 tag: tip parent: 1:3d5bf5654eda user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: b1 changeset: 1:3d5bf5654eda user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: r1 changeset: 0:67e992f2c4f3 user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: base 1 files updated, 0 files merged, 1 files removed, 0 files unresolved adding b2 created new head % log -f -r 1:tip changeset: 1:3d5bf5654eda user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: r1 changeset: 2:60c670bf5b30 user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: r2 changeset: 3:e62f78d544b4 parent: 1:3d5bf5654eda user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: b1 2 files updated, 0 files merged, 1 files removed, 0 files unresolved 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) % log -r . with two parents changeset: 3:e62f78d544b4 parent: 1:3d5bf5654eda user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: b1 % log -r . with one parent changeset: 5:302e9dd6890d tag: tip parent: 3:e62f78d544b4 parent: 4:ddb82e70d1a1 user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: m12 % log --follow-first changeset: 6:2404bbcab562 tag: tip user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: b1.1 changeset: 5:302e9dd6890d parent: 3:e62f78d544b4 parent: 4:ddb82e70d1a1 user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: m12 changeset: 3:e62f78d544b4 parent: 1:3d5bf5654eda user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: b1 changeset: 1:3d5bf5654eda user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: r1 changeset: 0:67e992f2c4f3 user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: base % log -P 2 changeset: 6:2404bbcab562 tag: tip user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: b1.1 changeset: 5:302e9dd6890d parent: 3:e62f78d544b4 parent: 4:ddb82e70d1a1 user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: m12 changeset: 4:ddb82e70d1a1 parent: 0:67e992f2c4f3 user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: b2 changeset: 3:e62f78d544b4 parent: 1:3d5bf5654eda user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: b1 % log -r tip -p --git changeset: 6:2404bbcab562 tag: tip user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: b1.1 diff --git a/b1 b/b1 --- a/b1 +++ b/b1 @@ -1,1 +1,2 @@ b1 +postm % log -r "" abort: 00changelog.i@: ambiguous identifier! % log -r <some unknown node id> abort: unknown revision '1000000000000000000000000000000000000000'! adding a adding b changeset: 0:29a4c94f1924 user: User One <user1@example.org> date: Thu Jan 01 00:00:00 1970 +0000 summary: a changeset: 1:e834b5e69c0e tag: tip user: User Two <user2@example.org> date: Thu Jan 01 00:00:00 1970 +0000 summary: b changeset: 0:29a4c94f1924 user: User One <user1@example.org> date: Thu Jan 01 00:00:00 1970 +0000 summary: a