mercurial/patch.py
changeset 4092 4ced663bebf0
parent 3900 2b3175acb653
child 4096 49237d6ae97d
child 4105 ed46895aa38c
--- a/mercurial/patch.py	Thu Feb 15 08:49:20 2007 -0200
+++ b/mercurial/patch.py	Fri Feb 16 04:54:46 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' %
@@ -593,8 +595,8 @@
                     to = getfile(a).read(arev)
                 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