trydiff: replace dodiff=True/'binary' by binarydiff=False/True
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 07 Jan 2015 11:02:10 -0800
changeset 23754 ed645dc672e5
parent 23753 e30c6aa6f2a2
child 23755 d43948a910a5
trydiff: replace dodiff=True/'binary' by binarydiff=False/True
mercurial/patch.py
--- a/mercurial/patch.py	Wed Jan 07 10:59:40 2015 -0800
+++ b/mercurial/patch.py	Wed Jan 07 11:02:10 2015 -0800
@@ -1798,7 +1798,7 @@
     for f in sorted(modified + added + removed):
         to = None
         tn = None
-        dodiff = True
+        binarydiff = False
         header = []
         if f not in addedset:
             to = getfilectx(f, ctx1).data()
@@ -1836,7 +1836,7 @@
                 # forces git mode.
                 if util.binary(tn):
                     if opts.git:
-                        dodiff = 'binary'
+                        binarydiff = True
                     else:
                         losedatafn(f)
                 if not opts.git and not tn:
@@ -1854,7 +1854,7 @@
                         header.append('deleted file mode %s\n' %
                                       gitmode[ctx1.flags(f)])
                         if util.binary(to):
-                            dodiff = 'binary'
+                            binarydiff = True
                 elif not to or util.binary(to):
                     # regular diffs cannot represent empty file deletion
                     losedatafn(f)
@@ -1865,13 +1865,13 @@
                 if opts.git:
                     addmodehdr(header, gitmode[oflag], gitmode[nflag])
                     if binary:
-                        dodiff = 'binary'
+                        binarydiff = True
                 elif binary or nflag != oflag:
                     losedatafn(f)
 
         if opts.git or revs:
             header.insert(0, diffline(join(a), join(b), revs))
-        if dodiff == 'binary' and not opts.nobinary:
+        if binarydiff and not opts.nobinary:
             text = mdiff.b85diff(to, tn)
             if text and opts.git:
                 addindexmeta(header, gitindex(to), gitindex(tn))