Patchwork [04,of,10,RESEND] test: end printed diff "hunks" with an empty string in test-context.py

login
register
mail settings
Submitter Denis Laxalde
Date March 9, 2017, 8:08 a.m.
Message ID <86eaeaf2555411460760.1489046881@sh77.tls.logilab.fr>
Download mbox | patch
Permalink /patch/19054/
State Accepted
Headers show

Comments

Denis Laxalde - March 9, 2017, 8:08 a.m.
# HG changeset patch
# User Denis Laxalde <denis.laxalde@logilab.fr>
# Date 1488554237 -3600
#      Fri Mar 03 16:17:17 2017 +0100
# Node ID 86eaeaf2555411460760d4174a469b1cff533efa
# Parent  2e1294bb1b82c8379733a5cac6d939b324ff641b
# Available At http://hg.logilab.org/users/dlaxalde/hg
#              hg pull http://hg.logilab.org/users/dlaxalde/hg -r 86eaeaf25554
# EXP-Topic diffhunks
test: end printed diff "hunks" with an empty string in test-context.py

So that the resulting diff is correct and does not include a spurious empty
line between lines "diff --git a/foo b/foo" and "--- a/foo".

Patch

diff --git a/tests/test-context.py b/tests/test-context.py
--- a/tests/test-context.py
+++ b/tests/test-context.py
@@ -59,7 +59,7 @@  print(ctxb.status(ctxa))
 # test performing a diff on a memctx
 
 for d in ctxb.diff(ctxa, git=True):
-    print(d)
+    print(d, end='')
 
 # test safeness and correctness of "ctx.status()"
 print('= checking context.status():')
diff --git a/tests/test-context.py.out b/tests/test-context.py.out
--- a/tests/test-context.py.out
+++ b/tests/test-context.py.out
@@ -4,13 +4,11 @@  Latin-1 : Grüezi!
 UTF-8   : Grüezi!
 <status modified=['foo'], added=[], removed=[], deleted=[], unknown=[], ignored=[], clean=[]>
 diff --git a/foo b/foo
-
 --- a/foo
 +++ b/foo
 @@ -1,1 +1,2 @@
  foo
 +bar
-
 = checking context.status():
 == checking workingctx.status:
 wctx._status=<status modified=['bar-m'], added=['bar-a'], removed=['bar-r'], deleted=[], unknown=[], ignored=[], clean=[]>