# HG changeset patch # User Martin von Zweigbergk # Date 2015-02-07 00:09:43 # Node ID 32e8d94b947351231b42833a9cd92a48b62ad854 # Parent 9cf9432a505b65e486524198e6e263a0c7b190aa trydiff: transpose 'if opts.git or losedatafn' with 'if f[12]' Perhaps it's more readable this way... diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -1804,18 +1804,18 @@ def trydiff(repo, revs, ctx1, ctx2, modi 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: