diff mercurial/patch.py @ 4096:49237d6ae97d

merge with crew-stable
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Fri, 16 Feb 2007 05:27:37 -0200
parents 67982d3ee76c 4ced663bebf0
children 226df1808f16
line wrap: on
line diff
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -412,6 +412,8 @@ def b85diff(fp, to, tn):
             yield text[i:i+csize]
             i += csize
 
+    if to == tn:
+        return
     # TODO: deltas
     l = len(tn)
     fp.write('index %s..%s\nGIT binary patch\nliteral %s\n' %
@@ -560,8 +562,8 @@ def diff(repo, node1=None, node2=None, f
                     to = getfilectx(a, ctx1).data()
                 else:
                     header.append('new file mode %s\n' % mode)
-                    if util.binary(tn):
-                        dodiff = 'binary'
+                if util.binary(tn):
+                    dodiff = 'binary'
             elif f in removed:
                 if f in srcs:
                     dodiff = False