Rev 3923: Change the patience_diff.unified_diff code to not add trailing whitespace when no timestamp is supplied. in http://bzr.arbash-meinel.com/branches/bzr/jam-integration

John Arbash Meinel john at arbash-meinel.com
Tue Jan 6 15:03:03 GMT 2009


At http://bzr.arbash-meinel.com/branches/bzr/jam-integration

------------------------------------------------------------
revno: 3923
revision-id: john at arbash-meinel.com-20090106150242-frp82yhowbro6t1a
parent: pqm at pqm.ubuntu.com-20090106073252-m4c72a1m7004nqmz
author: Adeodato Simo <dato at net.com.org.es>
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: jam-integration
timestamp: Tue 2009-01-06 09:02:42 -0600
message:
  Change the patience_diff.unified_diff code to not add trailing whitespace when no timestamp is supplied.
-------------- next part --------------
=== modified file 'bzrlib/patiencediff.py'
--- a/bzrlib/patiencediff.py	2007-09-04 09:10:35 +0000
+++ b/bzrlib/patiencediff.py	2009-01-06 15:02:42 +0000
@@ -76,11 +76,16 @@
         import difflib
         sequencematcher = difflib.SequenceMatcher
 
+    if fromfiledate:
+        fromfiledate = ' ' + str(fromfiledate)
+    if tofiledate:
+        tofiledate = ' ' + str(tofiledate)
+
     started = False
     for group in sequencematcher(None,a,b).get_grouped_opcodes(n):
         if not started:
-            yield '--- %s %s%s' % (fromfile, fromfiledate, lineterm)
-            yield '+++ %s %s%s' % (tofile, tofiledate, lineterm)
+            yield '--- %s%s%s' % (fromfile, fromfiledate, lineterm)
+            yield '+++ %s%s%s' % (tofile, tofiledate, lineterm)
             started = True
         i1, i2, j1, j2 = group[0][1], group[-1][2], group[0][3], group[-1][4]
         yield "@@ -%d,%d +%d,%d @@%s" % (i1+1, i2-i1, j1+1, j2-j1, lineterm)



More information about the bazaar-commits mailing list