diff -r 02cc51ca6795 -r cb5983c0287f tests/test-evolve-obshistory-amend.t --- a/tests/test-evolve-obshistory-amend.t Wed Apr 08 01:16:59 2020 +0800 +++ b/tests/test-evolve-obshistory-amend.t Fri May 08 22:18:15 2020 +0800 @@ -1,12 +1,10 @@ -This test file test the various messages when accessing obsolete -revisions. +Testing obslog and other commands accessing obsolete revisions. Global setup ============ $ . $TESTDIR/testlib/obshistory_setup.sh - Test output on amended commit ============================= @@ -47,54 +45,52 @@ ------------------------------- $ hg obslog --patch 4ae3a4151de9 @ 4ae3a4151de9 (2) A1 + | rewritten(description, content) from 471f378eab4c using amend by test (*) (glob) + | diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description + | --- a/changeset-description + | +++ b/changeset-description + | @@ -1,1 +1,3 @@ + | -A0 + | +A1 + | + + | +Better commit message + | + | diff -r 471f378eab4c -r 4ae3a4151de9 A0 + | --- a/A0 Thu Jan 01 00:00:00 1970 +0000 + | +++ b/A0 Thu Jan 01 00:00:00 1970 +0000 + | @@ -1,1 +1,2 @@ + | A0 + | +42 + | | x 471f378eab4c (1) A0 - rewritten(description, content) as 4ae3a4151de9 using amend by test (*) (glob) - diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description - --- a/changeset-description - +++ b/changeset-description - @@ -1,1 +1,3 @@ - -A0 - +A1 - + - +Better commit message - - diff -r 471f378eab4c -r 4ae3a4151de9 A0 - --- a/A0 Thu Jan 01 00:00:00 1970 +0000 - +++ b/A0 Thu Jan 01 00:00:00 1970 +0000 - @@ -1,1 +1,2 @@ - A0 - +42 - $ hg obslog --patch --color debug @ [evolve.node|4ae3a4151de9] [evolve.rev|(2)] [evolve.short_description|A1] + | [evolve.verb|rewritten](description, content) from [evolve.node|471f378eab4c] using [evolve.operation|amend] by [evolve.user|test] [evolve.date|(Thu Jan 01 00:00:00 1970 +0000)] + | [diff.diffline|diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description] + | [diff.file_a|--- a/changeset-description] + | [diff.file_b|+++ b/changeset-description] + | [diff.hunk|@@ -1,1 +1,3 @@] + | [diff.deleted|-A0] + | [diff.inserted|+A1] + | [diff.inserted|+] + | [diff.inserted|+Better commit message] + | + | [diff.diffline|diff -r 471f378eab4c -r 4ae3a4151de9 A0] + | [diff.file_a|--- a/A0 Thu Jan 01 00:00:00 1970 +0000] + | [diff.file_b|+++ b/A0 Thu Jan 01 00:00:00 1970 +0000] + | [diff.hunk|@@ -1,1 +1,2 @@] + | A0 + | [diff.inserted|+42] + | | x [evolve.node|471f378eab4c] [evolve.rev|(1)] [evolve.short_description|A0] - [evolve.verb|rewritten](description, content) as [evolve.node|4ae3a4151de9] using [evolve.operation|amend] by [evolve.user|test] [evolve.date|(Thu Jan 01 00:00:00 1970 +0000)] - [diff.diffline|diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description] - [diff.file_a|--- a/changeset-description] - [diff.file_b|+++ b/changeset-description] - [diff.hunk|@@ -1,1 +1,3 @@] - [diff.deleted|-A0] - [diff.inserted|+A1] - [diff.inserted|+] - [diff.inserted|+Better commit message] - - [diff.diffline|diff -r 471f378eab4c -r 4ae3a4151de9 A0] - [diff.file_a|--- a/A0 Thu Jan 01 00:00:00 1970 +0000] - [diff.file_b|+++ b/A0 Thu Jan 01 00:00:00 1970 +0000] - [diff.hunk|@@ -1,1 +1,2 @@] - A0 - [diff.inserted|+42] - $ hg obslog --no-graph --patch 4ae3a4151de9 4ae3a4151de9 (2) A1 - - 471f378eab4c (1) A0 - rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000) + rewritten(description, content) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000) diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description --- a/changeset-description +++ b/changeset-description @@ -112,106 +108,90 @@ +42 + 471f378eab4c (1) A0 + Test that content diff works with templating $ hg obslog --color=debug --patch 4ae3a4151de9 \ > -T '{node|short} {desc|firstline}\n{markers % "patch:\n```{patch}```\n"}' @ 4ae3a4151de9 A1 - | + | patch: + | ``` + | [diff.diffline|diff -r 471f378eab4c -r 4ae3a4151de9 A0] + | [diff.file_a|--- a/A0 Thu Jan 01 00:00:00 1970 +0000] + | [diff.file_b|+++ b/A0 Thu Jan 01 00:00:00 1970 +0000] + | [diff.hunk|@@ -1,1 +1,2 @@] + | A0 + | [diff.inserted|+42] + | ``` x 471f378eab4c A0 - patch: - ``` - [diff.diffline|diff -r 471f378eab4c -r 4ae3a4151de9 A0] - [diff.file_a|--- a/A0 Thu Jan 01 00:00:00 1970 +0000] - [diff.file_b|+++ b/A0 Thu Jan 01 00:00:00 1970 +0000] - [diff.hunk|@@ -1,1 +1,2 @@] - A0 - [diff.inserted|+42] - ``` + - $ hg obslog 4ae3a4151de9 --graph -T'{label("log.summary", desc|firstline)} {if(markers, join(markers % "at {date|hgdate} by {user|person} ", " also "))}' + $ hg obslog 4ae3a4151de9 --graph --no-origin -T'{label("log.summary", desc|firstline)} {if(markers, join(markers % "at {date|hgdate} by {users} ", " also "))}' @ A1 | x A0 at 0 0 by test + $ hg obslog 4ae3a4151de9 --graph -T'{label("log.summary", desc|firstline)} {if(markers, join(markers % "at {date|hgdate} by {users} ", " also "))}' + @ A1 at 0 0 by test + | + x A0 + Check that the same thing works with the old {shortdescription} form - $ hg obslog 4ae3a4151de9 --graph -T'{label("log.summary", shortdescription)} {if(markers, join(markers % "at {date|hgdate} by {user|person} ", " also "))}' + $ hg obslog 4ae3a4151de9 --graph --no-origin -T'{label("log.summary", shortdescription)} {if(markers, join(markers % "at {date|hgdate} by {users} ", " also "))}' @ A1 | x A0 at 0 0 by test + $ hg obslog 4ae3a4151de9 --graph -T'{label("log.summary", shortdescription)} {if(markers, join(markers % "at {date|hgdate} by {users} ", " also "))}' + @ A1 at 0 0 by test + | + x A0 + $ hg obslog 4ae3a4151de9 --no-graph -Tjson | python -m json.tool [ { - "markers": [], - "node": "4ae3a4151de9aa872113f0b196e28323308981e8", - "shortdescription": "A1" - }, - { "markers": [ { - "date": [ - *, (glob) - 0 + "dates": [ + [ + *, (glob) + 0 + ] ], "effects": [ "description", "content" ], - "operation": "amend", - "succnodes": [ - "4ae3a4151de9aa872113f0b196e28323308981e8" + "operations": [ + "amend" ], - "user": "test", + "prednodes": [ + "471f378eab4c5e25f6c77f785b27c936efb22874" + ], + "users": [ + "test" + ], "verb": "rewritten" } ], + "node": "4ae3a4151de9aa872113f0b196e28323308981e8", + "shortdescription": "A1" + }, + { + "markers": [], "node": "471f378eab4c5e25f6c77f785b27c936efb22874", "shortdescription": "A0" } ] $ hg obslog --hidden --patch 471f378eab4c x 471f378eab4c (1) A0 - rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000) - diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description - --- a/changeset-description - +++ b/changeset-description - @@ -1,1 +1,3 @@ - -A0 - +A1 - + - +Better commit message - - diff -r 471f378eab4c -r 4ae3a4151de9 A0 - --- a/A0 Thu Jan 01 00:00:00 1970 +0000 - +++ b/A0 Thu Jan 01 00:00:00 1970 +0000 - @@ -1,1 +1,2 @@ - A0 - +42 - $ hg obslog --hidden 471f378eab4c --no-graph -Tjson | python -m json.tool [ { - "markers": [ - { - "date": [ - *, (glob) - 0 - ], - "effects": [ - *, (glob) - "content" - ], - "operation": "amend", - "succnodes": [ - "4ae3a4151de9aa872113f0b196e28323308981e8" - ], - "user": "test", - "verb": "rewritten" - } - ], + "markers": [], "node": "471f378eab4c5e25f6c77f785b27c936efb22874", "shortdescription": "A0" } @@ -230,30 +210,46 @@ Check output on the server side ------------------------------- - $ hg obslog -R $TESTTMP/server --patch 4ae3a4151de9 + $ hg obslog -R $TESTTMP/server --patch 4ae3a4151de9 --no-origin o 4ae3a4151de9 (1) A1 | x 471f378eab4c rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000) (No patch available, context is not local) - $ hg obslog -R $TESTTMP/server -f --patch 4ae3a4151de9 + $ hg obslog -R $TESTTMP/server --patch 4ae3a4151de9 o 4ae3a4151de9 (1) A1 + | rewritten(description, content) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000) + | (No patch available, predecessor is unknown locally) + | + x 471f378eab4c - $ hg obslog -R $TESTTMP/server --no-graph --patch 4ae3a4151de9 + $ hg obslog -R $TESTTMP/server --no-graph --patch 4ae3a4151de9 --no-origin 4ae3a4151de9 (1) A1 471f378eab4c rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000) (No patch available, context is not local) + $ hg obslog -R $TESTTMP/server --no-graph --patch 4ae3a4151de9 + 4ae3a4151de9 (1) A1 + rewritten(description, content) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000) + (No patch available, predecessor is unknown locally) + + 471f378eab4c + - $ hg obslog -R $TESTTMP/server --no-graph -f --patch 4ae3a4151de9 + $ hg obslog -R $TESTTMP/server -f --patch 4ae3a4151de9 --no-origin + o 4ae3a4151de9 (1) A1 + + $ hg obslog -R $TESTTMP/server -f --patch 4ae3a4151de9 + o 4ae3a4151de9 (1) A1 + + $ hg obslog -R $TESTTMP/server --no-graph -f --patch 4ae3a4151de9 --no-origin 4ae3a4151de9 (1) A1 - 471f378eab4c - rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000) - (No patch available, context is not local) + $ hg obslog -R $TESTTMP/server --no-graph -f --patch 4ae3a4151de9 + 4ae3a4151de9 (1) A1 Amend two more times @@ -285,7 +281,7 @@ $ hg amend -m "A2 > > Better better commit message" - $ hg amend -m "A3 + $ hg amend --config devel.default-date='1 0' -m "A3 > > Better better better commit message" $ sync @@ -327,9 +323,7 @@ $ hg obslog --patch 92210308515b @ 92210308515b (4) A3 - | - x 4f1685185907 (3) A2 - | reworded(description) as 92210308515b using amend by test (Thu Jan 01 00:00:00 1970 +0000) + | reworded(description) from 4f1685185907 using amend by test (Thu Jan 01 00:00:01 1970 +0000) | diff -r 4f1685185907 -r 92210308515b changeset-description | --- a/changeset-description | +++ b/changeset-description @@ -341,8 +335,8 @@ | +Better better better commit message | | - x 4ae3a4151de9 (2) A1 - | reworded(description) as 4f1685185907 using amend by test (Thu Jan 01 00:00:00 1970 +0000) + x 4f1685185907 (3) A2 + | reworded(description) from 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000) | diff -r 4ae3a4151de9 -r 4f1685185907 changeset-description | --- a/changeset-description | +++ b/changeset-description @@ -354,31 +348,31 @@ | +Better better commit message | | + x 4ae3a4151de9 (2) A1 + | rewritten(description, content) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000) + | diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description + | --- a/changeset-description + | +++ b/changeset-description + | @@ -1,1 +1,3 @@ + | -A0 + | +A1 + | + + | +Better commit message + | + | diff -r 471f378eab4c -r 4ae3a4151de9 A0 + | --- a/A0 Thu Jan 01 00:00:00 1970 +0000 + | +++ b/A0 Thu Jan 01 00:00:00 1970 +0000 + | @@ -1,1 +1,2 @@ + | A0 + | +42 + | + | x 471f378eab4c (1) A0 - rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000) - diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description - --- a/changeset-description - +++ b/changeset-description - @@ -1,1 +1,3 @@ - -A0 - +A1 - + - +Better commit message - - diff -r 471f378eab4c -r 4ae3a4151de9 A0 - --- a/A0 Thu Jan 01 00:00:00 1970 +0000 - +++ b/A0 Thu Jan 01 00:00:00 1970 +0000 - @@ -1,1 +1,2 @@ - A0 - +42 - Test that description diff works with templating $ hg obslog --color=debug --patch 92210308515b \ > -T '{node|short} {desc|firstline}\n{markers % "description diff:\n```{descdiff}```\n"}' @ 92210308515b A3 - | - x 4f1685185907 A2 | description diff: | ``` | [diff.diffline|diff -r 4f1685185907 -r 92210308515b changeset-description] @@ -391,7 +385,7 @@ | [diff.deleted|-Better better commit message] | [diff.inserted|+Better better better commit message] | ``` - x 4ae3a4151de9 A1 + x 4f1685185907 A2 | description diff: | ``` | [diff.diffline|diff -r 4ae3a4151de9 -r 4f1685185907 changeset-description] @@ -404,81 +398,83 @@ | [diff.deleted|-Better commit message] | [diff.inserted|+Better better commit message] | ``` + x 4ae3a4151de9 A1 + | description diff: + | ``` + | [diff.diffline|diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description] + | [diff.file_a|--- a/changeset-description] + | [diff.file_b|+++ b/changeset-description] + | [diff.hunk|@@ -1,1 +1,3 @@] + | [diff.deleted|-A0] + | [diff.inserted|+A1] + | [diff.inserted|+] + | [diff.inserted|+Better commit message] + | ``` x 471f378eab4c A0 - description diff: - ``` - [diff.diffline|diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description] - [diff.file_a|--- a/changeset-description] - [diff.file_b|+++ b/changeset-description] - [diff.hunk|@@ -1,1 +1,3 @@] - [diff.deleted|-A0] - [diff.inserted|+A1] - [diff.inserted|+] - [diff.inserted|+Better commit message] - ``` + Check the output on the server ------------------------------ $ hg obslog -R $TESTTMP/server --patch 92210308515b o 92210308515b (2) A3 + | reworded(description) from 4f1685185907 using amend by test (Thu Jan 01 00:00:01 1970 +0000) + | (No patch available, predecessor is unknown locally) | x 4f1685185907 - | reworded(description) as 92210308515b using amend by test (Thu Jan 01 00:00:00 1970 +0000) + | reworded(description) from 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000) | (No patch available, context is not local) | x 4ae3a4151de9 (1) A1 - | reworded(description) as 4f1685185907 using amend by test (Thu Jan 01 00:00:00 1970 +0000) - | (No patch available, successor is unknown locally) + | rewritten(description, content) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000) + | (No patch available, predecessor is unknown locally) | x 471f378eab4c - rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000) - (No patch available, context is not local) $ hg obslog -R $TESTTMP/server -f --patch 92210308515b o 92210308515b (2) A3 + | reworded(description) from 4ae3a4151de9 using amend by test (between Thu Jan 01 00:00:00 1970 +0000 and Thu Jan 01 00:00:01 1970 +0000) + | diff -r 4ae3a4151de9 -r 92210308515b changeset-description + | --- a/changeset-description + | +++ b/changeset-description + | @@ -1,3 +1,3 @@ + | -A1 + | +A3 + | + | -Better commit message + | +Better better better commit message + | | x 4ae3a4151de9 (1) A1 - reworded(description) as 92210308515b using amend by test (at Thu Jan 01 00:00:00 1970 +0000) - diff -r 4ae3a4151de9 -r 92210308515b changeset-description - --- a/changeset-description - +++ b/changeset-description - @@ -1,3 +1,3 @@ - -A1 - +A3 - - -Better commit message - +Better better better commit message - $ hg obslog -R $TESTTMP/server --no-graph --patch 92210308515b 92210308515b (2) A3 + reworded(description) from 4f1685185907 using amend by test (Thu Jan 01 00:00:01 1970 +0000) + (No patch available, predecessor is unknown locally) 4f1685185907 - reworded(description) as 92210308515b using amend by test (Thu Jan 01 00:00:00 1970 +0000) + reworded(description) from 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000) (No patch available, context is not local) 4ae3a4151de9 (1) A1 - reworded(description) as 4f1685185907 using amend by test (Thu Jan 01 00:00:00 1970 +0000) - (No patch available, successor is unknown locally) + rewritten(description, content) from 471f378eab4c using amend by test (Thu Jan 01 00:00:00 1970 +0000) + (No patch available, predecessor is unknown locally) 471f378eab4c - rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000) - (No patch available, context is not local) - $ hg obslog -R $TESTTMP/server --no-graph -f --patch 92210308515b 92210308515b (2) A3 - - 4f1685185907 - reworded(description) as 92210308515b using amend by test (Thu Jan 01 00:00:00 1970 +0000) - (No patch available, context is not local) + reworded(description) from 4ae3a4151de9 using amend by test (between Thu Jan 01 00:00:00 1970 +0000 and Thu Jan 01 00:00:01 1970 +0000) + diff -r 4ae3a4151de9 -r 92210308515b changeset-description + --- a/changeset-description + +++ b/changeset-description + @@ -1,3 +1,3 @@ + -A1 + +A3 + + -Better commit message + +Better better better commit message + 4ae3a4151de9 (1) A1 - reworded(description) as 4f1685185907 using amend by test (Thu Jan 01 00:00:00 1970 +0000) - (No patch available, successor is unknown locally) - 471f378eab4c - rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000) - (No patch available, context is not local) -