Patchwork [2,of,7] trydiff: break 'if opts.git or losedatafn' into two

login
register
mail settings
Submitter Martin von Zweigbergk
Date Feb. 7, 2015, 1:13 a.m.
Message ID <446a4c532ae41128967d.1423271611@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/7735/
State Accepted
Headers show

Comments

Martin von Zweigbergk - Feb. 7, 2015, 1:13 a.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1423264916 28800
#      Fri Feb 06 15:21:56 2015 -0800
# Node ID 446a4c532ae41128967da6ed846478bbd6db057d
# Parent  b10f8481c86598ca1e4401577e13bcd9ec65415c
trydiff: break 'if opts.git or losedatafn' into two

This moves the initialization 'binary' closer to its other assignment,
but exists mostly to simplify future patches.

Patch

diff -r b10f8481c865 -r 446a4c532ae4 mercurial/patch.py
--- a/mercurial/patch.py	Thu Jan 22 22:42:35 2015 -0800
+++ b/mercurial/patch.py	Fri Feb 06 15:21:56 2015 -0800
@@ -1776,7 +1776,6 @@ 
         flag2 = None
         content1 = None
         content2 = None
-        binary = False
         copyop = None
         if f not in addedset:
             content1 = getfilectx(f, ctx1).data()
@@ -1810,6 +1809,8 @@ 
                 flag1 = ctx1.flags(f)
                 flag2 = ctx2.flags(f)
 
+        binary = False
+        if opts.git or losedatafn:
             binary = util.binary(content1) or util.binary(content2)
 
         if losedatafn and not opts.git: