Patchwork [5,of,5] trydiff: replace dodiff=True/'binary' by binarydiff=False/True

login
register
mail settings
Submitter Martin von Zweigbergk
Date Jan. 7, 2015, 7:53 p.m.
Message ID <5d239bbd02dc8ca79e94.1420660400@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/7350/
State Accepted
Commit ed645dc672e56a44145fae3ae9f2c09021035da9
Headers show

Comments

Martin von Zweigbergk - Jan. 7, 2015, 7:53 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1420657330 28800
#      Wed Jan 07 11:02:10 2015 -0800
# Node ID 5d239bbd02dc8ca79e946c7209ce905d53af87ce
# Parent  dd66ac280e5bf951aaee2958617ceaf038b441c7
trydiff: replace dodiff=True/'binary' by binarydiff=False/True
Matt Mackall - Jan. 7, 2015, 10:07 p.m.
On Wed, 2015-01-07 at 11:53 -0800, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1420657330 28800
> #      Wed Jan 07 11:02:10 2015 -0800
> # Node ID 5d239bbd02dc8ca79e946c7209ce905d53af87ce
> # Parent  dd66ac280e5bf951aaee2958617ceaf038b441c7
> trydiff: replace dodiff=True/'binary' by binarydiff=False/True

Nice, these are queued for default.

Patch

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