tests/test-fastannotate-hg.t
changeset 39238 1ddb296e0dee
child 39277 aec7109aeb39
equal deleted inserted replaced
39237:1af95139e5ec 39238:1ddb296e0dee
       
     1 (this file is backported from core hg tests/test-annotate.t)
       
     2 
       
     3   $ cat >> $HGRCPATH << EOF
       
     4   > [diff]
       
     5   > git=1
       
     6   > [extensions]
       
     7   > fastannotate=
       
     8   > [fastannotate]
       
     9   > modes=fctx
       
    10   > forcefollow=False
       
    11   > mainbranch=.
       
    12   > EOF
       
    13 
       
    14   $ HGMERGE=true; export HGMERGE
       
    15 
       
    16 init
       
    17 
       
    18   $ hg init repo
       
    19   $ cd repo
       
    20 
       
    21 commit
       
    22 
       
    23   $ echo 'a' > a
       
    24   $ hg ci -A -m test -u nobody -d '1 0'
       
    25   adding a
       
    26 
       
    27 annotate -c
       
    28 
       
    29   $ hg annotate -c a
       
    30   8435f90966e4: a
       
    31 
       
    32 annotate -cl
       
    33 
       
    34   $ hg annotate -cl a
       
    35   8435f90966e4:1: a
       
    36 
       
    37 annotate -d
       
    38 
       
    39   $ hg annotate -d a
       
    40   Thu Jan 01 00:00:01 1970 +0000: a
       
    41 
       
    42 annotate -n
       
    43 
       
    44   $ hg annotate -n a
       
    45   0: a
       
    46 
       
    47 annotate -nl
       
    48 
       
    49   $ hg annotate -nl a
       
    50   0:1: a
       
    51 
       
    52 annotate -u
       
    53 
       
    54   $ hg annotate -u a
       
    55   nobody: a
       
    56 
       
    57 annotate -cdnu
       
    58 
       
    59   $ hg annotate -cdnu a
       
    60   nobody 0 8435f90966e4 Thu Jan 01 00:00:01 1970 +0000: a
       
    61 
       
    62 annotate -cdnul
       
    63 
       
    64   $ hg annotate -cdnul a
       
    65   nobody 0 8435f90966e4 Thu Jan 01 00:00:01 1970 +0000:1: a
       
    66 
       
    67 annotate (JSON)
       
    68 
       
    69   $ hg annotate -Tjson a
       
    70   [
       
    71    {
       
    72     "abspath": "a",
       
    73     "lines": [{"line": "a\n", "rev": 0}],
       
    74     "path": "a"
       
    75    }
       
    76   ]
       
    77 
       
    78   $ hg annotate -Tjson -cdfnul a
       
    79   [
       
    80    {
       
    81     "abspath": "a",
       
    82     "lines": [{"date": [1.0, 0], "file": "a", "line": "a\n", "line_number": 1, "node": "8435f90966e442695d2ded29fdade2bac5ad8065", "rev": 0, "user": "nobody"}],
       
    83     "path": "a"
       
    84    }
       
    85   ]
       
    86 
       
    87   $ cat <<EOF >>a
       
    88   > a
       
    89   > a
       
    90   > EOF
       
    91   $ hg ci -ma1 -d '1 0'
       
    92   $ hg cp a b
       
    93   $ hg ci -mb -d '1 0'
       
    94   $ cat <<EOF >> b
       
    95   > b4
       
    96   > b5
       
    97   > b6
       
    98   > EOF
       
    99   $ hg ci -mb2 -d '2 0'
       
   100 
       
   101 annotate -n b
       
   102 
       
   103   $ hg annotate -n b
       
   104   0: a
       
   105   1: a
       
   106   1: a
       
   107   3: b4
       
   108   3: b5
       
   109   3: b6
       
   110 
       
   111 annotate --no-follow b
       
   112 
       
   113   $ hg annotate --no-follow b
       
   114   2: a
       
   115   2: a
       
   116   2: a
       
   117   3: b4
       
   118   3: b5
       
   119   3: b6
       
   120 
       
   121 annotate -nl b
       
   122 
       
   123   $ hg annotate -nl b
       
   124   0:1: a
       
   125   1:2: a
       
   126   1:3: a
       
   127   3:4: b4
       
   128   3:5: b5
       
   129   3:6: b6
       
   130 
       
   131 annotate -nf b
       
   132 
       
   133   $ hg annotate -nf b
       
   134   0 a: a
       
   135   1 a: a
       
   136   1 a: a
       
   137   3 b: b4
       
   138   3 b: b5
       
   139   3 b: b6
       
   140 
       
   141 annotate -nlf b
       
   142 
       
   143   $ hg annotate -nlf b
       
   144   0 a:1: a
       
   145   1 a:2: a
       
   146   1 a:3: a
       
   147   3 b:4: b4
       
   148   3 b:5: b5
       
   149   3 b:6: b6
       
   150 
       
   151   $ hg up -C 2
       
   152   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   153   $ cat <<EOF >> b
       
   154   > b4
       
   155   > c
       
   156   > b5
       
   157   > EOF
       
   158   $ hg ci -mb2.1 -d '2 0'
       
   159   created new head
       
   160   $ hg merge
       
   161   merging b
       
   162   0 files updated, 1 files merged, 0 files removed, 0 files unresolved
       
   163   (branch merge, don't forget to commit)
       
   164   $ hg ci -mmergeb -d '3 0'
       
   165 
       
   166 annotate after merge
       
   167 (note: the first one falls back to the vanilla annotate which does not use linelog)
       
   168 
       
   169   $ hg annotate -nf b --debug
       
   170   fastannotate: b: rebuilding broken cache
       
   171   fastannotate: b: 5 new changesets in the main branch
       
   172   0 a: a
       
   173   1 a: a
       
   174   1 a: a
       
   175   3 b: b4
       
   176   4 b: c
       
   177   3 b: b5
       
   178 
       
   179 (difference explained below)
       
   180 
       
   181   $ hg annotate -nf b --debug
       
   182   fastannotate: b: using fast path (resolved fctx: False)
       
   183   0 a: a
       
   184   1 a: a
       
   185   1 a: a
       
   186   4 b: b4
       
   187   4 b: c
       
   188   4 b: b5
       
   189 
       
   190 annotate after merge with -l
       
   191 (fastannotate differs from annotate)
       
   192 
       
   193   $ hg log -Gp -T '{rev}:{node}' -r '2..5'
       
   194   @    5:64afcdf8e29e063c635be123d8d2fb160af00f7e
       
   195   |\
       
   196   | o  4:5fbdc1152d97597717021ad9e063061b200f146bdiff --git a/b b/b
       
   197   | |  --- a/b
       
   198   | |  +++ b/b
       
   199   | |  @@ -1,3 +1,6 @@
       
   200   | |   a
       
   201   | |   a
       
   202   | |   a
       
   203   | |  +b4
       
   204   | |  +c
       
   205   | |  +b5
       
   206   | |
       
   207   o |  3:37ec9f5c3d1f99572d7075971cb4876e2139b52fdiff --git a/b b/b
       
   208   |/   --- a/b
       
   209   |    +++ b/b
       
   210   |    @@ -1,3 +1,6 @@
       
   211   |     a
       
   212   |     a
       
   213   |     a
       
   214   |    +b4
       
   215   |    +b5
       
   216   |    +b6
       
   217   |
       
   218   o  2:3086dbafde1ce745abfc8d2d367847280aabae9ddiff --git a/a b/b
       
   219   |  copy from a
       
   220   ~  copy to b
       
   221   
       
   222 
       
   223 (in this case, "b4", "b5" could be considered introduced by either rev 3, or rev 4.
       
   224  and that causes the rev number difference)
       
   225 
       
   226   $ hg annotate -nlf b --config fastannotate.modes=
       
   227   0 a:1: a
       
   228   1 a:2: a
       
   229   1 a:3: a
       
   230   3 b:4: b4
       
   231   4 b:5: c
       
   232   3 b:5: b5
       
   233 
       
   234   $ hg annotate -nlf b
       
   235   0 a:1: a
       
   236   1 a:2: a
       
   237   1 a:3: a
       
   238   4 b:4: b4
       
   239   4 b:5: c
       
   240   4 b:6: b5
       
   241 
       
   242   $ hg up -C 1
       
   243   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
   244   $ hg cp a b
       
   245   $ cat <<EOF > b
       
   246   > a
       
   247   > z
       
   248   > a
       
   249   > EOF
       
   250   $ hg ci -mc -d '3 0'
       
   251   created new head
       
   252   $ hg merge
       
   253   merging b
       
   254   0 files updated, 1 files merged, 0 files removed, 0 files unresolved
       
   255   (branch merge, don't forget to commit)
       
   256   $ cat <<EOF >> b
       
   257   > b4
       
   258   > c
       
   259   > b5
       
   260   > EOF
       
   261   $ echo d >> b
       
   262   $ hg ci -mmerge2 -d '4 0'
       
   263 
       
   264 annotate after rename merge
       
   265 
       
   266   $ hg annotate -nf b
       
   267   0 a: a
       
   268   6 b: z
       
   269   1 a: a
       
   270   3 b: b4
       
   271   4 b: c
       
   272   3 b: b5
       
   273   7 b: d
       
   274 
       
   275 annotate after rename merge with -l
       
   276 (fastannotate differs from annotate)
       
   277 
       
   278   $ hg log -Gp -T '{rev}:{node}' -r '0+1+6+7'
       
   279   @    7:6284bb6c38fef984a929862a53bbc71ce9eafa81diff --git a/b b/b
       
   280   |\   --- a/b
       
   281   | :  +++ b/b
       
   282   | :  @@ -1,3 +1,7 @@
       
   283   | :   a
       
   284   | :   z
       
   285   | :   a
       
   286   | :  +b4
       
   287   | :  +c
       
   288   | :  +b5
       
   289   | :  +d
       
   290   | :
       
   291   o :  6:b80e3e32f75a6a67cd4ac85496a11511e9112816diff --git a/a b/b
       
   292   :/   copy from a
       
   293   :    copy to b
       
   294   :    --- a/a
       
   295   :    +++ b/b
       
   296   :    @@ -1,3 +1,3 @@
       
   297   :    -a (?)
       
   298   :     a
       
   299   :    +z
       
   300   :     a
       
   301   :    -a (?)
       
   302   :
       
   303   o  1:762f04898e6684ff713415f7b8a8d53d33f96c92diff --git a/a b/a
       
   304   |  --- a/a
       
   305   |  +++ b/a
       
   306   |  @@ -1,1 +1,3 @@
       
   307   |   a
       
   308   |  +a
       
   309   |  +a
       
   310   |
       
   311   o  0:8435f90966e442695d2ded29fdade2bac5ad8065diff --git a/a b/a
       
   312      new file mode 100644
       
   313      --- /dev/null
       
   314      +++ b/a
       
   315      @@ -0,0 +1,1 @@
       
   316      +a
       
   317   
       
   318 
       
   319 (note on question marks:
       
   320  the upstream bdiff change (96f2f50d923f+3633403888ae+8c0c75aa3ff4+5c4e2636c1a9
       
   321  +38ed54888617) alters the output so deletion is not always at the end of the
       
   322  output. for example:
       
   323  | a | b | old | new | # old: e1d6aa0e4c3a, new: 8836f13e3c5b
       
   324  |-------------------|
       
   325  | a | a |  a  | -a  |
       
   326  | a | z | +z  |  a  |
       
   327  | a | a |  a  | +z  |
       
   328  |   |   | -a  |  a  |
       
   329  |-------------------|
       
   330  | a | a |     a     |
       
   331  | a | a |     a     |
       
   332  | a |   |    -a     |
       
   333  this leads to more question marks below)
       
   334 
       
   335 (rev 1 adds two "a"s and rev 6 deletes one "a".
       
   336  the "a" that rev 6 deletes could be either the first or the second "a" of those two "a"s added by rev 1.
       
   337  and that causes the line number difference)
       
   338 
       
   339   $ hg annotate -nlf b --config fastannotate.modes=
       
   340   0 a:1: a
       
   341   6 b:2: z
       
   342   1 a:3: a
       
   343   3 b:4: b4
       
   344   4 b:5: c
       
   345   3 b:5: b5
       
   346   7 b:7: d
       
   347 
       
   348   $ hg annotate -nlf b
       
   349   0 a:1: a (?)
       
   350   1 a:2: a (?)
       
   351   6 b:2: z
       
   352   1 a:2: a (?)
       
   353   1 a:3: a (?)
       
   354   3 b:4: b4
       
   355   4 b:5: c
       
   356   3 b:5: b5
       
   357   7 b:7: d
       
   358 
       
   359 Issue2807: alignment of line numbers with -l
       
   360 (fastannotate differs from annotate, same reason as above)
       
   361 
       
   362   $ echo more >> b
       
   363   $ hg ci -mmore -d '5 0'
       
   364   $ echo more >> b
       
   365   $ hg ci -mmore -d '6 0'
       
   366   $ echo more >> b
       
   367   $ hg ci -mmore -d '7 0'
       
   368   $ hg annotate -nlf b
       
   369    0 a: 1: a (?)
       
   370    1 a: 2: a (?)
       
   371    6 b: 2: z
       
   372    1 a: 2: a (?)
       
   373    1 a: 3: a (?)
       
   374    3 b: 4: b4
       
   375    4 b: 5: c
       
   376    3 b: 5: b5
       
   377    7 b: 7: d
       
   378    8 b: 8: more
       
   379    9 b: 9: more
       
   380   10 b:10: more
       
   381 
       
   382 linkrev vs rev
       
   383 
       
   384   $ hg annotate -r tip -n a
       
   385   0: a
       
   386   1: a
       
   387   1: a
       
   388 
       
   389 linkrev vs rev with -l
       
   390 
       
   391   $ hg annotate -r tip -nl a
       
   392   0:1: a
       
   393   1:2: a
       
   394   1:3: a
       
   395 
       
   396 Issue589: "undelete" sequence leads to crash
       
   397 
       
   398 annotate was crashing when trying to --follow something
       
   399 
       
   400 like A -> B -> A
       
   401 
       
   402 generate ABA rename configuration
       
   403 
       
   404   $ echo foo > foo
       
   405   $ hg add foo
       
   406   $ hg ci -m addfoo
       
   407   $ hg rename foo bar
       
   408   $ hg ci -m renamefoo
       
   409   $ hg rename bar foo
       
   410   $ hg ci -m renamebar
       
   411 
       
   412 annotate after ABA with follow
       
   413 
       
   414   $ hg annotate --follow foo
       
   415   foo: foo
       
   416 
       
   417 missing file
       
   418 
       
   419   $ hg ann nosuchfile
       
   420   abort: nosuchfile: no such file in rev e9e6b4fa872f
       
   421   [255]
       
   422 
       
   423 annotate file without '\n' on last line
       
   424 
       
   425   $ printf "" > c
       
   426   $ hg ci -A -m test -u nobody -d '1 0'
       
   427   adding c
       
   428   $ hg annotate c
       
   429   $ printf "a\nb" > c
       
   430   $ hg ci -m test
       
   431   $ hg annotate c
       
   432   [0-9]+: a (re)
       
   433   [0-9]+: b (re)
       
   434 
       
   435 Issue3841: check annotation of the file of which filelog includes
       
   436 merging between the revision and its ancestor
       
   437 
       
   438 to reproduce the situation with recent Mercurial, this script uses (1)
       
   439 "hg debugsetparents" to merge without ancestor check by "hg merge",
       
   440 and (2) the extension to allow filelog merging between the revision
       
   441 and its ancestor by overriding "repo._filecommit".
       
   442 
       
   443   $ cat > ../legacyrepo.py <<EOF
       
   444   > from mercurial import node, error
       
   445   > def reposetup(ui, repo):
       
   446   >     class legacyrepo(repo.__class__):
       
   447   >         def _filecommit(self, fctx, manifest1, manifest2,
       
   448   >                         linkrev, tr, changelist):
       
   449   >             fname = fctx.path()
       
   450   >             text = fctx.data()
       
   451   >             flog = self.file(fname)
       
   452   >             fparent1 = manifest1.get(fname, node.nullid)
       
   453   >             fparent2 = manifest2.get(fname, node.nullid)
       
   454   >             meta = {}
       
   455   >             copy = fctx.renamed()
       
   456   >             if copy and copy[0] != fname:
       
   457   >                 raise error.Abort('copying is not supported')
       
   458   >             if fparent2 != node.nullid:
       
   459   >                 changelist.append(fname)
       
   460   >                 return flog.add(text, meta, tr, linkrev,
       
   461   >                                 fparent1, fparent2)
       
   462   >             raise error.Abort('only merging is supported')
       
   463   >     repo.__class__ = legacyrepo
       
   464   > EOF
       
   465 
       
   466   $ cat > baz <<EOF
       
   467   > 1
       
   468   > 2
       
   469   > 3
       
   470   > 4
       
   471   > 5
       
   472   > EOF
       
   473   $ hg add baz
       
   474   $ hg commit -m "baz:0"
       
   475 
       
   476   $ cat > baz <<EOF
       
   477   > 1 baz:1
       
   478   > 2
       
   479   > 3
       
   480   > 4
       
   481   > 5
       
   482   > EOF
       
   483   $ hg commit -m "baz:1"
       
   484 
       
   485   $ cat > baz <<EOF
       
   486   > 1 baz:1
       
   487   > 2 baz:2
       
   488   > 3
       
   489   > 4
       
   490   > 5
       
   491   > EOF
       
   492   $ hg debugsetparents 17 17
       
   493   $ hg --config extensions.legacyrepo=../legacyrepo.py  commit -m "baz:2"
       
   494   $ hg debugindexdot .hg/store/data/baz.i
       
   495   digraph G {
       
   496   	-1 -> 0
       
   497   	0 -> 1
       
   498   	1 -> 2
       
   499   	1 -> 2
       
   500   }
       
   501   $ hg annotate baz
       
   502   17: 1 baz:1
       
   503   18: 2 baz:2
       
   504   16: 3
       
   505   16: 4
       
   506   16: 5
       
   507 
       
   508   $ cat > baz <<EOF
       
   509   > 1 baz:1
       
   510   > 2 baz:2
       
   511   > 3 baz:3
       
   512   > 4
       
   513   > 5
       
   514   > EOF
       
   515   $ hg commit -m "baz:3"
       
   516 
       
   517   $ cat > baz <<EOF
       
   518   > 1 baz:1
       
   519   > 2 baz:2
       
   520   > 3 baz:3
       
   521   > 4 baz:4
       
   522   > 5
       
   523   > EOF
       
   524   $ hg debugsetparents 19 18
       
   525   $ hg --config extensions.legacyrepo=../legacyrepo.py  commit -m "baz:4"
       
   526   $ hg debugindexdot .hg/store/data/baz.i
       
   527   digraph G {
       
   528   	-1 -> 0
       
   529   	0 -> 1
       
   530   	1 -> 2
       
   531   	1 -> 2
       
   532   	2 -> 3
       
   533   	3 -> 4
       
   534   	2 -> 4
       
   535   }
       
   536   $ hg annotate baz
       
   537   17: 1 baz:1
       
   538   18: 2 baz:2
       
   539   19: 3 baz:3
       
   540   20: 4 baz:4
       
   541   16: 5
       
   542 
       
   543 annotate clean file
       
   544 
       
   545   $ hg annotate -ncr "wdir()" foo
       
   546   11 472b18db256d : foo
       
   547 
       
   548 annotate modified file
       
   549 
       
   550   $ echo foofoo >> foo
       
   551   $ hg annotate -r "wdir()" foo
       
   552   11 : foo
       
   553   20+: foofoo
       
   554 
       
   555   $ hg annotate -cr "wdir()" foo
       
   556   472b18db256d : foo
       
   557   b6bedd5477e7+: foofoo
       
   558 
       
   559   $ hg annotate -ncr "wdir()" foo
       
   560   11 472b18db256d : foo
       
   561   20 b6bedd5477e7+: foofoo
       
   562 
       
   563   $ hg annotate --debug -ncr "wdir()" foo
       
   564   11 472b18db256d1e8282064eab4bfdaf48cbfe83cd : foo
       
   565   20 b6bedd5477e797f25e568a6402d4697f3f895a72+: foofoo
       
   566 
       
   567   $ hg annotate -udr "wdir()" foo
       
   568   test Thu Jan 01 00:00:00 1970 +0000: foo
       
   569   test [A-Za-z0-9:+ ]+: foofoo (re)
       
   570 
       
   571   $ hg annotate -ncr "wdir()" -Tjson foo
       
   572   [
       
   573    {
       
   574     "abspath": "foo",
       
   575     "lines": [{"line": "foo\n", "node": "472b18db256d1e8282064eab4bfdaf48cbfe83cd", "rev": 11}, {"line": "foofoo\n", "node": null, "rev": null}],
       
   576     "path": "foo"
       
   577    }
       
   578   ]
       
   579 
       
   580 annotate added file
       
   581 
       
   582   $ echo bar > bar
       
   583   $ hg add bar
       
   584   $ hg annotate -ncr "wdir()" bar
       
   585   20 b6bedd5477e7+: bar
       
   586 
       
   587 annotate renamed file
       
   588 
       
   589   $ hg rename foo renamefoo2
       
   590   $ hg annotate -ncr "wdir()" renamefoo2
       
   591   11 472b18db256d : foo
       
   592   20 b6bedd5477e7+: foofoo
       
   593 
       
   594 annotate missing file
       
   595 
       
   596   $ rm baz
       
   597 #if windows
       
   598   $ hg annotate -ncr "wdir()" baz
       
   599   abort: $TESTTMP\repo\baz: The system cannot find the file specified
       
   600   [255]
       
   601 #else
       
   602   $ hg annotate -ncr "wdir()" baz
       
   603   abort: $ENOENT$: $TESTTMP/repo/baz
       
   604   [255]
       
   605 #endif
       
   606 
       
   607 annotate removed file
       
   608 
       
   609   $ hg rm baz
       
   610 #if windows
       
   611   $ hg annotate -ncr "wdir()" baz
       
   612   abort: $TESTTMP\repo\baz: The system cannot find the file specified
       
   613   [255]
       
   614 #else
       
   615   $ hg annotate -ncr "wdir()" baz
       
   616   abort: $ENOENT$: $TESTTMP/repo/baz
       
   617   [255]
       
   618 #endif
       
   619 
       
   620 Test annotate with whitespace options
       
   621 
       
   622   $ cd ..
       
   623   $ hg init repo-ws
       
   624   $ cd repo-ws
       
   625   $ cat > a <<EOF
       
   626   > aa
       
   627   > 
       
   628   > b b
       
   629   > EOF
       
   630   $ hg ci -Am "adda"
       
   631   adding a
       
   632   $ sed 's/EOL$//g' > a <<EOF
       
   633   > a  a
       
   634   > 
       
   635   >  EOL
       
   636   > b  b
       
   637   > EOF
       
   638   $ hg ci -m "changea"
       
   639 
       
   640 Annotate with no option
       
   641 
       
   642   $ hg annotate a
       
   643   1: a  a
       
   644   0: 
       
   645   1:  
       
   646   1: b  b
       
   647 
       
   648 Annotate with --ignore-space-change
       
   649 
       
   650   $ hg annotate --ignore-space-change a
       
   651   1: a  a
       
   652   1: 
       
   653   0:  
       
   654   0: b  b
       
   655 
       
   656 Annotate with --ignore-all-space
       
   657 
       
   658   $ hg annotate --ignore-all-space a
       
   659   0: a  a
       
   660   0: 
       
   661   1:  
       
   662   0: b  b
       
   663 
       
   664 Annotate with --ignore-blank-lines (similar to no options case)
       
   665 
       
   666   $ hg annotate --ignore-blank-lines a
       
   667   1: a  a
       
   668   0: 
       
   669   1:  
       
   670   1: b  b
       
   671 
       
   672   $ cd ..
       
   673 
       
   674 Annotate with linkrev pointing to another branch
       
   675 ------------------------------------------------
       
   676 
       
   677 create history with a filerev whose linkrev points to another branch
       
   678 
       
   679   $ hg init branchedlinkrev
       
   680   $ cd branchedlinkrev
       
   681   $ echo A > a
       
   682   $ hg commit -Am 'contentA'
       
   683   adding a
       
   684   $ echo B >> a
       
   685   $ hg commit -m 'contentB'
       
   686   $ hg up --rev 'desc(contentA)'
       
   687   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   688   $ echo unrelated > unrelated
       
   689   $ hg commit -Am 'unrelated'
       
   690   adding unrelated
       
   691   created new head
       
   692   $ hg graft -r 'desc(contentB)'
       
   693   grafting 1:fd27c222e3e6 "contentB"
       
   694   $ echo C >> a
       
   695   $ hg commit -m 'contentC'
       
   696   $ echo W >> a
       
   697   $ hg log -G
       
   698   @  changeset:   4:072f1e8df249
       
   699   |  tag:         tip
       
   700   |  user:        test
       
   701   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
   702   |  summary:     contentC
       
   703   |
       
   704   o  changeset:   3:ff38df03cc4b
       
   705   |  user:        test
       
   706   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
   707   |  summary:     contentB
       
   708   |
       
   709   o  changeset:   2:62aaf3f6fc06
       
   710   |  parent:      0:f0932f74827e
       
   711   |  user:        test
       
   712   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
   713   |  summary:     unrelated
       
   714   |
       
   715   | o  changeset:   1:fd27c222e3e6
       
   716   |/   user:        test
       
   717   |    date:        Thu Jan 01 00:00:00 1970 +0000
       
   718   |    summary:     contentB
       
   719   |
       
   720   o  changeset:   0:f0932f74827e
       
   721      user:        test
       
   722      date:        Thu Jan 01 00:00:00 1970 +0000
       
   723      summary:     contentA
       
   724   
       
   725 
       
   726 Annotate should list ancestor of starting revision only
       
   727 
       
   728   $ hg annotate a
       
   729   0: A
       
   730   3: B
       
   731   4: C
       
   732 
       
   733   $ hg annotate a -r 'wdir()'
       
   734   0 : A
       
   735   3 : B
       
   736   4 : C
       
   737   4+: W
       
   738 
       
   739 Even when the starting revision is the linkrev-shadowed one:
       
   740 
       
   741   $ hg annotate a -r 3
       
   742   0: A
       
   743   3: B
       
   744 
       
   745   $ cd ..
       
   746 
       
   747 Issue5360: Deleted chunk in p1 of a merge changeset
       
   748 
       
   749   $ hg init repo-5360
       
   750   $ cd repo-5360
       
   751   $ echo 1 > a
       
   752   $ hg commit -A a -m 1
       
   753   $ echo 2 >> a
       
   754   $ hg commit -m 2
       
   755   $ echo a > a
       
   756   $ hg commit -m a
       
   757   $ hg update '.^' -q
       
   758   $ echo 3 >> a
       
   759   $ hg commit -m 3 -q
       
   760   $ hg merge 2 -q
       
   761   $ cat > a << EOF
       
   762   > b
       
   763   > 1
       
   764   > 2
       
   765   > 3
       
   766   > a
       
   767   > EOF
       
   768   $ hg resolve --mark -q
       
   769   $ hg commit -m m
       
   770   $ hg annotate a
       
   771   4: b
       
   772   0: 1
       
   773   1: 2
       
   774   3: 3
       
   775   2: a
       
   776 
       
   777   $ cd ..