--- a/hgext3rd/evolve/obshistory.py Thu Jul 25 18:37:16 2019 +0800
+++ b/hgext3rd/evolve/obshistory.py Tue Sep 03 12:48:47 2019 +0200
@@ -604,13 +604,17 @@
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(b'\n')
firstline = False
- if chunk and chunk != b'\n':
+ if linestart:
fm.plain(b' ')
+ linestart = False
+ if chunk == b'\n':
+ linestart = True
fm.write(b'patch', b'%s', chunk, label=label)
else:
nopatch = b" (No patch available, %s)" % _patchavailable[1]
@@ -740,13 +744,17 @@
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(b'\n')
firstline = False
- if chunk and chunk != b'\n':
+ if linestart:
fm.plain(b' ')
+ linestart = False
+ if chunk == b'\n':
+ linestart = True
fm.write(b'patch', b'%s', chunk, label=label)
else:
nopatch = b" (No patch available, %s)" % _patchavailable[1]