Skip to content
Snippets Groups Projects
Commit c16fed49 authored by Anton Shestakov's avatar Anton Shestakov
Browse files

obslog: only indent the first chunk and chunks just after newlines (issue6175)

parent e50596ff
No related branches found
No related tags found
No related merge requests found
Changelog
=========
9.1.1 - in progress
-------------------
* obslog: correct spacing of patch output with word-diff=yes (issue6175)
9.1.0 -- 2019-07-29
-------------------
......
......@@ -604,8 +604,9 @@
diffopts = patch.diffallopts(repo.ui, {})
matchfn = scmutil.matchall(repo)
firstline = True
linestart = True
for chunk, label in patch.diffui(repo, node, succ, matchfn,
opts=diffopts):
if firstline:
fm.plain('\n')
firstline = False
......@@ -607,7 +608,7 @@
for chunk, label in patch.diffui(repo, node, succ, matchfn,
opts=diffopts):
if firstline:
fm.plain('\n')
firstline = False
if chunk and chunk != '\n':
if linestart:
fm.plain(' ')
......@@ -613,4 +614,7 @@
fm.plain(' ')
linestart = False
if chunk == '\n':
linestart = True
fm.write('patch', '%s', chunk, label=label)
else:
nopatch = " (No patch available, %s)" % _patchavailable[1]
......@@ -740,8 +744,9 @@
diffopts = patch.diffallopts(repo.ui, {})
matchfn = scmutil.matchall(repo)
firstline = True
linestart = True
for chunk, label in patch.diffui(repo, node, succ, matchfn,
opts=diffopts):
if firstline:
fm.plain('\n')
firstline = False
......@@ -743,7 +748,7 @@
for chunk, label in patch.diffui(repo, node, succ, matchfn,
opts=diffopts):
if firstline:
fm.plain('\n')
firstline = False
if chunk and chunk != '\n':
if linestart:
fm.plain(' ')
......@@ -749,4 +754,7 @@
fm.plain(' ')
linestart = False
if chunk == '\n':
linestart = True
fm.write('patch', '%s', chunk, label=label)
else:
nopatch = " (No patch available, %s)" % _patchavailable[1]
......
......@@ -109,7 +109,7 @@
@@ -1,1 +1,2 @@
A0
+42
$ hg obslog 4ae3a4151de9 --graph -T'{label("log.summary", shortdescription)} {if(markers, join(markers % "at {date|hgdate} by {user|person} ", " also "))}'
@ A1
......
......@@ -1598,8 +1598,8 @@
a
b
c
- D
+ d
-D
+d
e
f
g
......@@ -1610,7 +1610,7 @@
1
2
3
- four
+ 4
-four
+4
5
6
......@@ -1615,7 +1615,7 @@
5
6
- 7
+ seven
-7
+seven
8
nine
diff -r 3074c7249d20 -r 599454370881 romans
......@@ -1623,8 +1623,8 @@
+++ b/romans Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +1,5 @@
I
- II
+ ii
-II
+ii
III
IV
V
......@@ -1786,8 +1786,8 @@
a
b
c
- D
+ d
-D
+d
e
f
g
......@@ -1798,7 +1798,7 @@
1
2
3
- four
+ 4
-four
+4
5
6
......@@ -1803,7 +1803,7 @@
5
6
- 7
+ seven
-7
+seven
8
nine
diff -r 3074c7249d20 -r 599454370881 romans
......@@ -1811,8 +1811,8 @@
+++ b/romans Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +1,5 @@
I
- II
+ ii
-II
+ii
III
IV
V
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment