changeset 24107:32e8d94b9473

trydiff: transpose 'if opts.git or losedatafn' with 'if f[12]' Perhaps it's more readable this way...
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 06 Feb 2015 16:09:43 -0800
parents 9cf9432a505b
children 11d72683f3de
files mercurial/patch.py
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/patch.py	Thu Jan 22 23:29:00 2015 -0800
+++ b/mercurial/patch.py	Fri Feb 06 16:09:43 2015 -0800
@@ -1804,18 +1804,18 @@
             ctx1, modified, added, removed, copy, opts):
         content1 = None
         content2 = None
-        if f1:
-            content1 = getfilectx(f1, ctx1).data()
-        if f2:
-            content2 = getfilectx(f2, ctx2).data()
         flag1 = None
         flag2 = None
+        if f1:
+            content1 = getfilectx(f1, ctx1).data()
+            if opts.git or losedatafn:
+                flag1 = ctx1.flags(f1)
+        if f2:
+            content2 = getfilectx(f2, ctx2).data()
+            if opts.git or losedatafn:
+                flag2 = ctx2.flags(f2)
         binary = False
         if opts.git or losedatafn:
-            if f1:
-                flag1 = ctx1.flags(f1)
-            if f2:
-                flag2 = ctx2.flags(f2)
             binary = util.binary(content1) or util.binary(content2)
 
         if losedatafn and not opts.git: