# HG changeset patch # User Martin von Zweigbergk # Date 2015-01-07 19:02:10 # Node ID ed645dc672e56a44145fae3ae9f2c09021035da9 # Parent e30c6aa6f2a22f965ce62870610f3a9079a68466 trydiff: replace dodiff=True/'binary' by binarydiff=False/True diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -1798,7 +1798,7 @@ def trydiff(repo, revs, ctx1, ctx2, modi 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 @@ def trydiff(repo, revs, ctx1, ctx2, modi # 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 @@ def trydiff(repo, revs, ctx1, ctx2, modi 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 @@ def trydiff(repo, revs, ctx1, ctx2, modi 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))