comparison mercurial/patch.py @ 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 3acb83c6c0f1
comparison
equal deleted inserted replaced
24106:9cf9432a505b 24107:32e8d94b9473
1802 1802
1803 for f1, f2, copyop in _filepairs( 1803 for f1, f2, copyop in _filepairs(
1804 ctx1, modified, added, removed, copy, opts): 1804 ctx1, modified, added, removed, copy, opts):
1805 content1 = None 1805 content1 = None
1806 content2 = None 1806 content2 = None
1807 flag1 = None
1808 flag2 = None
1807 if f1: 1809 if f1:
1808 content1 = getfilectx(f1, ctx1).data() 1810 content1 = getfilectx(f1, ctx1).data()
1811 if opts.git or losedatafn:
1812 flag1 = ctx1.flags(f1)
1809 if f2: 1813 if f2:
1810 content2 = getfilectx(f2, ctx2).data() 1814 content2 = getfilectx(f2, ctx2).data()
1811 flag1 = None 1815 if opts.git or losedatafn:
1812 flag2 = None 1816 flag2 = ctx2.flags(f2)
1813 binary = False 1817 binary = False
1814 if opts.git or losedatafn: 1818 if opts.git or losedatafn:
1815 if f1:
1816 flag1 = ctx1.flags(f1)
1817 if f2:
1818 flag2 = ctx2.flags(f2)
1819 binary = util.binary(content1) or util.binary(content2) 1819 binary = util.binary(content1) or util.binary(content2)
1820 1820
1821 if losedatafn and not opts.git: 1821 if losedatafn and not opts.git:
1822 if (binary or 1822 if (binary or
1823 # copy/rename 1823 # copy/rename