diff --git a/mercurial/patch.py b/mercurial/patch.py --- 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