mercurial/patch.py
changeset 4096 49237d6ae97d
parent 4006 67982d3ee76c
parent 4092 4ced663bebf0
child 4108 226df1808f16
--- a/mercurial/patch.py	Thu Feb 15 10:15:08 2007 -0200
+++ b/mercurial/patch.py	Fri Feb 16 05:27:37 2007 -0200
@@ -412,6 +412,8 @@
             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 @@
                     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