# HG changeset patch # User Martin von Zweigbergk # Date 1573842346 28800 # Node ID 5c41bb482867978b36baa34b66f2fd6e9e05f05a # Parent b135591bec1aa3df9c1f0a183250829e8ec9d788 obslog: make {descdiff} not be indented and leave that to the template Same idea as the previous patch and same explanation for changes to the test case. diff -r b135591bec1a -r 5c41bb482867 hgext3rd/evolve/obshistory.py --- a/hgext3rd/evolve/obshistory.py Fri Nov 15 09:53:42 2019 -0800 +++ b/hgext3rd/evolve/obshistory.py Fri Nov 15 10:25:46 2019 -0800 @@ -161,7 +161,7 @@ TEMPLATE_NOTE = b"""{if(note, "\n note: {label("evolve.note", note)}")}""" TEMPLATE_PATCH = b"""{if(patch, "{patch}")}{if(nopatchreason, "\n(No patch available, {nopatchreason})")}""" DEFAULT_TEMPLATE = (b"""%(firstline)s -{markers %% " {separate(" ", "%(rewrite)s", "%(operation)s", "%(user)s", "%(date)s")}%(note)s{descdiff}{indent("%(patch)s", " ")}\n"} +{markers %% " {separate(" ", "%(rewrite)s", "%(operation)s", "%(user)s", "%(date)s")}%(note)s{indent(descdiff, " ")}{indent("%(patch)s", " ")}\n"} """) % { b"firstline": TEMPLATE_FIRST_LINE, b"rewrite": TEMPLATE_REWRITE, @@ -623,8 +623,6 @@ for chunk, label in patch.difflabel(tolist, descriptionpatch): chunk = chunk.strip(b'\t') - if chunk and chunk != b'\n': - ui.write(b' ') ui.write(chunk, label=label) fm.write(b'descdiff', b'%s', ui.popbuffer()) diff -r b135591bec1a -r 5c41bb482867 tests/test-evolve-obshistory-amend.t --- a/tests/test-evolve-obshistory-amend.t Fri Nov 15 09:53:42 2019 -0800 +++ b/tests/test-evolve-obshistory-amend.t Fri Nov 15 10:25:46 2019 -0800 @@ -381,40 +381,40 @@ x 4f1685185907 A2 | description diff: | ``` - | [diff.diffline|diff -r 4f1685185907 -r 92210308515b changeset-description] - | [diff.file_a|--- a/changeset-description] - | [diff.file_b|+++ b/changeset-description] - | [diff.hunk|@@ -1,3 +1,3 @@] - | [diff.deleted|-A2] - | [diff.inserted|+A3] + | [diff.diffline|diff -r 4f1685185907 -r 92210308515b changeset-description] + | [diff.file_a|--- a/changeset-description] + | [diff.file_b|+++ b/changeset-description] + | [diff.hunk|@@ -1,3 +1,3 @@] + | [diff.deleted|-A2] + | [diff.inserted|+A3] | - | [diff.deleted|-Better better commit message] - | [diff.inserted|+Better better better commit message] + | [diff.deleted|-Better better commit message] + | [diff.inserted|+Better better better commit message] | ``` x 4ae3a4151de9 A1 | description diff: | ``` - | [diff.diffline|diff -r 4ae3a4151de9 -r 4f1685185907 changeset-description] - | [diff.file_a|--- a/changeset-description] - | [diff.file_b|+++ b/changeset-description] - | [diff.hunk|@@ -1,3 +1,3 @@] - | [diff.deleted|-A1] - | [diff.inserted|+A2] + | [diff.diffline|diff -r 4ae3a4151de9 -r 4f1685185907 changeset-description] + | [diff.file_a|--- a/changeset-description] + | [diff.file_b|+++ b/changeset-description] + | [diff.hunk|@@ -1,3 +1,3 @@] + | [diff.deleted|-A1] + | [diff.inserted|+A2] | - | [diff.deleted|-Better commit message] - | [diff.inserted|+Better better commit message] + | [diff.deleted|-Better commit message] + | [diff.inserted|+Better 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] + [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