comparison mercurial/patch.py @ 24055:7f4e6b5fce03

trydiff: rename 'op' to make it more specific Rename the 'op' variable that can take values None/'copy'/'rename' to 'copyop' to make it a little more specific.
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 16 Jan 2015 15:09:21 -0800
parents bbb011f4eb32
children ae453d166d51
comparison
equal deleted inserted replaced
24054:fdf7794be41d 24055:7f4e6b5fce03
1775 flag1 = None 1775 flag1 = None
1776 flag2 = None 1776 flag2 = None
1777 content1 = None 1777 content1 = None
1778 content2 = None 1778 content2 = None
1779 binarydiff = False 1779 binarydiff = False
1780 op = None 1780 copyop = None
1781 if f not in addedset: 1781 if f not in addedset:
1782 content1 = getfilectx(f, ctx1).data() 1782 content1 = getfilectx(f, ctx1).data()
1783 if f not in removedset: 1783 if f not in removedset:
1784 content2 = getfilectx(f, ctx2).data() 1784 content2 = getfilectx(f, ctx2).data()
1785 f1, f2 = f, f 1785 f1, f2 = f, f
1789 if f in copy: 1789 if f in copy:
1790 if opts.git: 1790 if opts.git:
1791 f1 = copy[f] 1791 f1 = copy[f]
1792 flag1 = ctx1.flags(f1) 1792 flag1 = ctx1.flags(f1)
1793 if f1 in removedset and f1 not in gone: 1793 if f1 in removedset and f1 not in gone:
1794 op = 'rename' 1794 copyop = 'rename'
1795 gone.add(f1) 1795 gone.add(f1)
1796 else: 1796 else:
1797 op = 'copy' 1797 copyop = 'copy'
1798 content1 = getfilectx(f1, ctx1).data() 1798 content1 = getfilectx(f1, ctx1).data()
1799 else: 1799 else:
1800 losedatafn(f) 1800 losedatafn(f)
1801 else: 1801 else:
1802 if not opts.git and flag2: 1802 if not opts.git and flag2:
1845 else: # modified/copied/renamed 1845 else: # modified/copied/renamed
1846 mode1, mode2 = gitmode[flag1], gitmode[flag2] 1846 mode1, mode2 = gitmode[flag1], gitmode[flag2]
1847 if mode1 != mode2: 1847 if mode1 != mode2:
1848 header.append('old mode %s' % mode1) 1848 header.append('old mode %s' % mode1)
1849 header.append('new mode %s' % mode2) 1849 header.append('new mode %s' % mode2)
1850 if op is not None: 1850 if copyop is not None:
1851 header.append('%s from %s' % (op, path1)) 1851 header.append('%s from %s' % (copyop, path1))
1852 header.append('%s to %s' % (op, path2)) 1852 header.append('%s to %s' % (copyop, path2))
1853 elif revs and not repo.ui.quiet: 1853 elif revs and not repo.ui.quiet:
1854 header.append(diffline(path1, revs)) 1854 header.append(diffline(path1, revs))
1855 1855
1856 if binarydiff and not opts.nobinary: 1856 if binarydiff and not opts.nobinary:
1857 text = mdiff.b85diff(content1, content2) 1857 text = mdiff.b85diff(content1, content2)