diff --git a/tests/test-annotate.t b/tests/test-annotate.t --- a/tests/test-annotate.t +++ b/tests/test-annotate.t @@ -87,7 +87,7 @@ $ cat <>a > a - > a + > a3 > EOF $ hg ci -ma1 -d '1 0' $ hg cp a b @@ -104,22 +104,22 @@ $ hg annotate -T'{lines}' a 0: a 1: a - 1: a + 1: a3 $ hg annotate -T'{join(lines, "\n")}' a 0: a 1: a - 1: a + 1: a3 several filters can be applied to '{lines}' $ hg annotate -T'{lines|json}\n' a - [{"line": "a\n", "rev": 0}, {"line": "a\n", "rev": 1}, {"line": "a\n", "rev": 1}] + [{"line": "a\n", "rev": 0}, {"line": "a\n", "rev": 1}, {"line": "a3\n", "rev": 1}] $ hg annotate -T'{lines|stringify}' a 0: a 1: a - 1: a + 1: a3 $ hg annotate -T'{lines|count}\n' a 3 @@ -128,11 +128,11 @@ $ hg annotate -Tjson a b [ { - "lines": [{"line": "a\n", "rev": 0}, {"line": "a\n", "rev": 1}, {"line": "a\n", "rev": 1}], + "lines": [{"line": "a\n", "rev": 0}, {"line": "a\n", "rev": 1}, {"line": "a3\n", "rev": 1}], "path": "a" }, { - "lines": [{"line": "a\n", "rev": 0}, {"line": "a\n", "rev": 1}, {"line": "a\n", "rev": 1}, {"line": "b4\n", "rev": 3}, {"line": "b5\n", "rev": 3}, {"line": "b6\n", "rev": 3}], + "lines": [{"line": "a\n", "rev": 0}, {"line": "a\n", "rev": 1}, {"line": "a3\n", "rev": 1}, {"line": "b4\n", "rev": 3}, {"line": "b5\n", "rev": 3}, {"line": "b6\n", "rev": 3}], "path": "b" } ] @@ -143,11 +143,11 @@ == a == 0: a 1: a - 1: a + 1: a3 == b == 0: a 1: a - 1: a + 1: a3 3: b4 3: b5 3: b6 @@ -157,7 +157,7 @@ $ hg annotate -n b 0: a 1: a - 1: a + 1: a3 3: b4 3: b5 3: b6 @@ -167,7 +167,7 @@ $ hg annotate --no-follow b 2: a 2: a - 2: a + 2: a3 3: b4 3: b5 3: b6 @@ -177,7 +177,7 @@ $ hg annotate -nl b 0:1: a 1:2: a - 1:3: a + 1:3: a3 3:4: b4 3:5: b5 3:6: b6 @@ -187,7 +187,7 @@ $ hg annotate -nf b 0 a: a 1 a: a - 1 a: a + 1 a: a3 3 b: b4 3 b: b5 3 b: b6 @@ -197,7 +197,7 @@ $ hg annotate -nlf b 0 a:1: a 1 a:2: a - 1 a:3: a + 1 a:3: a3 3 b:4: b4 3 b:5: b5 3 b:6: b6 @@ -220,8 +220,8 @@ $ cat b a a - a - <<<<<<< working copy: 5fbdc1152d97 - test: b2.1 + a3 + <<<<<<< working copy: 5b11d30c501c - test: b2.1 b4 c b5 @@ -230,11 +230,11 @@ b4 b5 b6 - >>>>>>> merge rev: 37ec9f5c3d1f - test: b2 + >>>>>>> merge rev: 00283b69e93a - test: b2 $ cat < b > a > a - > a + > a3 > b4 > c > b5 @@ -248,7 +248,7 @@ $ hg annotate -nf b 0 a: a 1 a: a - 1 a: a + 1 a: a3 3 b: b4 4 b: c 3 b: b5 @@ -258,7 +258,7 @@ $ hg annotate -nlf b 0 a:1: a 1 a:2: a - 1 a:3: a + 1 a:3: a3 3 b:4: b4 4 b:5: c 3 b:5: b5 @@ -269,7 +269,7 @@ $ cat < b > a > z - > a + > a3 > EOF $ hg ci -mc -d '3 0' created new head @@ -285,7 +285,7 @@ $ hg annotate -nf b 0 a: a 6 b: z - 1 a: a + 1 a: a3 3 b: b4 4 b: c 3 b: b5 @@ -296,7 +296,7 @@ $ hg annotate -nlf b 0 a:1: a 6 b:2: z - 1 a:3: a + 1 a:3: a3 3 b:4: b4 4 b:5: c 3 b:5: b5 @@ -307,20 +307,18 @@ $ hg annotate -nlf b --skip '1::0' 0 a:1: a 6 b:2: z - 1 a:3: a + 1 a:3: a3 3 b:4: b4 4 b:5: c 3 b:5: b5 7 b:7: d ---skip a modified line. Note a slight behavior difference in pure - this is -because the pure code comes up with slightly different deltas internally. +--skip a modified line $ hg annotate -nlf b --skip 6 0 a:1: a - 1 a:2* z (no-pure !) - 0 a:1* z (pure !) - 1 a:3: a + 1 a:2* z + 1 a:3: a3 3 b:4: b4 4 b:5: c 3 b:5: b5 @@ -331,7 +329,7 @@ $ hg annotate -nlf b --skip 3 0 a:1: a 6 b:2: z - 1 a:3: a + 1 a:3: a3 1 a:3* b4 4 b:5: c 1 a:3* b5 @@ -340,7 +338,7 @@ $ hg annotate -nlf b --skip 4 0 a:1: a 6 b:2: z - 1 a:3: a + 1 a:3: a3 3 b:4: b4 1 a:3* c 3 b:5: b5 @@ -349,7 +347,7 @@ $ hg annotate -nlf b --skip 3 --skip 4 0 a:1: a 6 b:2: z - 1 a:3: a + 1 a:3: a3 1 a:3* b4 1 a:3* c 1 a:3* b5 @@ -358,7 +356,7 @@ $ hg annotate -nlf b --skip 'merge()' 0 a:1: a 6 b:2: z - 1 a:3: a + 1 a:3: a3 3 b:4: b4 4 b:5: c 3 b:5: b5 @@ -369,7 +367,7 @@ $ hg annotate -nlf b --skip 'all()' 0 a:1: a 0 a:1* z - 0 a:1* a + 0 a:1* a3 0 a:1* b4 0 a:1* c 0 a:1* b5 @@ -386,7 +384,7 @@ $ hg annotate -nlf b 0 a: 1: a 6 b: 2: z - 1 a: 3: a + 1 a: 3: a3 3 b: 4: b4 4 b: 5: c 3 b: 5: b5 @@ -400,14 +398,14 @@ $ hg annotate -r tip -n a 0: a 1: a - 1: a + 1: a3 linkrev vs rev with -l $ hg annotate -r tip -nl a 0:1: a 1:2: a - 1:3: a + 1:3: a3 Issue589: "undelete" sequence leads to crash @@ -433,7 +431,7 @@ missing file $ hg ann nosuchfile - abort: nosuchfile: no such file in rev e9e6b4fa872f + abort: nosuchfile: no such file in rev 4bb0cf7b70e4 [255] annotate file without '\n' on last line @@ -560,7 +558,7 @@ annotate clean file $ hg annotate -ncr "wdir()" foo - 11 472b18db256d : foo + 11 d52714cca963 : foo annotate modified file @@ -570,16 +568,16 @@ 20+: foofoo $ hg annotate -cr "wdir()" foo - 472b18db256d : foo - b6bedd5477e7+: foofoo + d52714cca963 : foo + 3435b4560d2c+: foofoo $ hg annotate -ncr "wdir()" foo - 11 472b18db256d : foo - 20 b6bedd5477e7+: foofoo + 11 d52714cca963 : foo + 20 3435b4560d2c+: foofoo $ hg annotate --debug -ncr "wdir()" foo - 11 472b18db256d1e8282064eab4bfdaf48cbfe83cd : foo - 20 b6bedd5477e797f25e568a6402d4697f3f895a72+: foofoo + 11 d52714cca963b6bb9b945743d1fbee072d1f3bd9 : foo + 20 3435b4560d2cf6aa2bb09bcb5aa12ac15d8ba9ef+: foofoo $ hg annotate -udr "wdir()" foo test Thu Jan 01 00:00:00 1970 +0000: foo @@ -588,7 +586,7 @@ $ hg annotate -ncr "wdir()" -Tjson foo [ { - "lines": [{"line": "foo\n", "node": "472b18db256d1e8282064eab4bfdaf48cbfe83cd", "rev": 11}, {"line": "foofoo\n", "node": "ffffffffffffffffffffffffffffffffffffffff", "rev": 2147483647}], + "lines": [{"line": "foo\n", "node": "d52714cca963b6bb9b945743d1fbee072d1f3bd9", "rev": 11}, {"line": "foofoo\n", "node": "ffffffffffffffffffffffffffffffffffffffff", "rev": 2147483647}], "path": "foo" } ] @@ -598,14 +596,14 @@ $ echo bar > bar $ hg add bar $ hg annotate -ncr "wdir()" bar - 20 b6bedd5477e7+: bar + 20 3435b4560d2c+: bar annotate renamed file $ hg rename foo renamefoo2 $ hg annotate -ncr "wdir()" renamefoo2 - 11 472b18db256d : foo - 20 b6bedd5477e7+: foofoo + 11 d52714cca963 : foo + 20 3435b4560d2c+: foofoo annotate missing file @@ -728,7 +726,7 @@ 0 1 baz:1 2 baz:2 - <<<<<<< working copy: 863de62655ef - test: baz:3+->3- + <<<<<<< working copy: 947cbfbb62c3 - test: baz:3+->3- 3- baz:3 4 baz:4 ||||||| base @@ -737,7 +735,7 @@ ======= 3+ baz:3 4+ baz:4 - >>>>>>> merge rev: cb8df70ae185 - test: qux:4->4+ + >>>>>>> merge rev: e8af2f3d2d91 - test: qux:4->4+ 5 6 7 @@ -775,7 +773,7 @@ 0 1 baz:1 2 baz:2 - <<<<<<< working copy: cb8df70ae185 - test: qux:4->4+ + <<<<<<< working copy: e8af2f3d2d91 - test: qux:4->4+ 3+ baz:3 4+ baz:4 ||||||| base @@ -784,7 +782,7 @@ ======= 3- baz:3 4 baz:4 - >>>>>>> merge rev: 863de62655ef - test: baz:3+->3- + >>>>>>> merge rev: 947cbfbb62c3 - test: baz:3+->3- 5 6 7 @@ -901,7 +899,7 @@ An integer as a line range, which is parsed as '1:1' $ hg log -r 'followlines(baz, 1)' - changeset: 22:2174d0bf352a + changeset: 22:43fc27bf31ab user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: added two lines with 0 diff --git a/tests/test-fastannotate-hg.t b/tests/test-fastannotate-hg.t --- a/tests/test-fastannotate-hg.t +++ b/tests/test-fastannotate-hg.t @@ -84,7 +84,7 @@ $ cat <>a > a - > a + > a3 > EOF $ hg ci -ma1 -d '1 0' $ hg cp a b @@ -101,7 +101,7 @@ $ hg annotate -n b 0: a 1: a - 1: a + 1: a3 3: b4 3: b5 3: b6 @@ -111,7 +111,7 @@ $ hg annotate --no-follow b 2: a 2: a - 2: a + 2: a3 3: b4 3: b5 3: b6 @@ -121,7 +121,7 @@ $ hg annotate -nl b 0:1: a 1:2: a - 1:3: a + 1:3: a3 3:4: b4 3:5: b5 3:6: b6 @@ -131,7 +131,7 @@ $ hg annotate -nf b 0 a: a 1 a: a - 1 a: a + 1 a: a3 3 b: b4 3 b: b5 3 b: b6 @@ -141,7 +141,7 @@ $ hg annotate -nlf b 0 a:1: a 1 a:2: a - 1 a:3: a + 1 a:3: a3 3 b:4: b4 3 b:5: b5 3 b:6: b6 @@ -164,8 +164,8 @@ $ cat b a a - a - <<<<<<< working copy: 5fbdc1152d97 - test: b2.1 + a3 + <<<<<<< working copy: 5b11d30c501c - test: b2.1 b4 c b5 @@ -174,11 +174,11 @@ b4 b5 b6 - >>>>>>> merge rev: 37ec9f5c3d1f - test: b2 + >>>>>>> merge rev: 00283b69e93a - test: b2 $ cat < b > a > a - > a + > a3 > b4 > c > b5 @@ -195,7 +195,7 @@ fastannotate: b: 5 new changesets in the main branch 0 a: a 1 a: a - 1 a: a + 1 a: a3 3 b: b4 4 b: c 3 b: b5 @@ -206,7 +206,7 @@ fastannotate: b: using fast path (resolved fctx: False) 0 a: a 1 a: a - 1 a: a + 1 a: a3 4 b: b4 4 b: c 4 b: b5 @@ -215,31 +215,31 @@ (fastannotate differs from annotate) $ hg log -Gp -T '{rev}:{node}' -r '2..5' - @ 5:64afcdf8e29e063c635be123d8d2fb160af00f7e + @ 5:90287468742e2e0246cb6367db2041531ce70103 |\ - | o 4:5fbdc1152d97597717021ad9e063061b200f146bdiff --git a/b b/b + | o 4:5b11d30c501ca9f279ad7fbe6bd6cfb24914ee59diff --git a/b b/b | | --- a/b | | +++ b/b | | @@ -1,3 +1,6 @@ | | a | | a - | | a + | | a3 | | +b4 | | +c | | +b5 | | - o | 3:37ec9f5c3d1f99572d7075971cb4876e2139b52fdiff --git a/b b/b + o | 3:00283b69e93aa814ca9b86460c411015405fb19adiff --git a/b b/b |/ --- a/b | +++ b/b | @@ -1,3 +1,6 @@ | a | a - | a + | a3 | +b4 | +b5 | +b6 | - o 2:3086dbafde1ce745abfc8d2d367847280aabae9ddiff --git a/a b/b + o 2:6ad008faa136fdf083e91083a4aa4e6e18b5e8c4diff --git a/a b/b | copy from a ~ copy to b @@ -250,7 +250,7 @@ $ hg annotate -nlf b --config fastannotate.modes= 0 a:1: a 1 a:2: a - 1 a:3: a + 1 a:3: a3 3 b:4: b4 4 b:5: c 3 b:5: b5 @@ -258,7 +258,7 @@ $ hg annotate -nlf b 0 a:1: a 1 a:2: a - 1 a:3: a + 1 a:3: a3 4 b:4: b4 4 b:5: c 4 b:6: b5 @@ -269,7 +269,7 @@ $ cat < b > a > z - > a + > a3 > EOF $ hg ci -mc -d '3 0' created new head @@ -285,7 +285,7 @@ $ hg annotate -nf b 0 a: a 6 b: z - 1 a: a + 1 a: a3 3 b: b4 4 b: c 3 b: b5 @@ -295,19 +295,19 @@ (fastannotate differs from annotate) $ hg log -Gp -T '{rev}:{node}' -r '0+1+6+7' - @ 7:6284bb6c38fef984a929862a53bbc71ce9eafa81diff --git a/b b/b + @ 7:8868d0fca4d2d22079990f4a772d0af2664d35fediff --git a/b b/b |\ --- a/b | : +++ b/b | : @@ -1,3 +1,7 @@ | : a | : z - | : a + | : a3 | : +b4 | : +c | : +b5 | : +d | : - o : 6:b80e3e32f75a6a67cd4ac85496a11511e9112816diff --git a/a b/b + o : 6:189fc23b8ce7bbf4dc1bba9e52c4bfdb38922ad9diff --git a/a b/b :/ copy from a : copy to b : --- a/a @@ -315,17 +315,18 @@ : @@ -1,3 +1,3 @@ : -a (?) : a + : -a : +z - : a : -a (?) + : a3 : - o 1:762f04898e6684ff713415f7b8a8d53d33f96c92diff --git a/a b/a + o 1:151465fa4cb9d404da352ad0bdef38aa2020dc37diff --git a/a b/a | --- a/a | +++ b/a | @@ -1,1 +1,3 @@ | a | +a - | +a + | +a3 | o 0:8435f90966e442695d2ded29fdade2bac5ad8065diff --git a/a b/a new file mode 100644 @@ -358,7 +359,7 @@ $ hg annotate -nlf b --config fastannotate.modes= 0 a:1: a 6 b:2: z - 1 a:3: a + 1 a:3: a3 3 b:4: b4 4 b:5: c 3 b:5: b5 @@ -370,6 +371,7 @@ 6 b:2: z 1 a:2: a (?) 1 a:3: a (?) + 1 a:3: a3 3 b:4: b4 4 b:5: c 3 b:5: b5 @@ -390,6 +392,7 @@ 6 b: 2: z 1 a: 2: a (?) 1 a: 3: a (?) + 1 a: 3: a3 3 b: 4: b4 4 b: 5: c 3 b: 5: b5 @@ -403,14 +406,14 @@ $ hg annotate -r tip -n a 0: a 1: a - 1: a + 1: a3 linkrev vs rev with -l $ hg annotate -r tip -nl a 0:1: a 1:2: a - 1:3: a + 1:3: a3 Issue589: "undelete" sequence leads to crash @@ -436,7 +439,7 @@ missing file $ hg ann nosuchfile - abort: nosuchfile: no such file in rev e9e6b4fa872f + abort: nosuchfile: no such file in rev 4bb0cf7b70e4 [255] annotate file without '\n' on last line @@ -562,7 +565,7 @@ annotate clean file $ hg annotate -ncr "wdir()" foo - 11 472b18db256d : foo + 11 d52714cca963 : foo annotate modified file @@ -572,16 +575,16 @@ 20+: foofoo $ hg annotate -cr "wdir()" foo - 472b18db256d : foo - b6bedd5477e7+: foofoo + d52714cca963 : foo + 3435b4560d2c+: foofoo $ hg annotate -ncr "wdir()" foo - 11 472b18db256d : foo - 20 b6bedd5477e7+: foofoo + 11 d52714cca963 : foo + 20 3435b4560d2c+: foofoo $ hg annotate --debug -ncr "wdir()" foo - 11 472b18db256d1e8282064eab4bfdaf48cbfe83cd : foo - 20 b6bedd5477e797f25e568a6402d4697f3f895a72+: foofoo + 11 d52714cca963b6bb9b945743d1fbee072d1f3bd9 : foo + 20 3435b4560d2cf6aa2bb09bcb5aa12ac15d8ba9ef+: foofoo $ hg annotate -udr "wdir()" foo test Thu Jan 01 00:00:00 1970 +0000: foo @@ -590,7 +593,7 @@ $ hg annotate -ncr "wdir()" -Tjson foo [ { - "lines": [{"line": "foo\n", "node": "472b18db256d1e8282064eab4bfdaf48cbfe83cd", "rev": 11}, {"line": "foofoo\n", "node": "ffffffffffffffffffffffffffffffffffffffff", "rev": 2147483647}], + "lines": [{"line": "foo\n", "node": "d52714cca963b6bb9b945743d1fbee072d1f3bd9", "rev": 11}, {"line": "foofoo\n", "node": "ffffffffffffffffffffffffffffffffffffffff", "rev": 2147483647}], "path": "foo" } ] @@ -600,14 +603,14 @@ $ echo bar > bar $ hg add bar $ hg annotate -ncr "wdir()" bar - 20 b6bedd5477e7+: bar + 20 3435b4560d2c+: bar annotate renamed file $ hg rename foo renamefoo2 $ hg annotate -ncr "wdir()" renamefoo2 - 11 472b18db256d : foo - 20 b6bedd5477e7+: foofoo + 11 d52714cca963 : foo + 20 3435b4560d2c+: foofoo annotate missing file