Patchwork [1,of,4] trydiff: rename 'op' to make it more specific

login
register
mail settings
Submitter Martin von Zweigbergk
Date Feb. 6, 2015, midnight
Message ID <68c7005db5d1268720f4.1423180843@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/7695/
State Accepted
Commit 7f4e6b5fce03d7e35a187b9804033bfd88cc9f1a
Headers show

Comments

Martin von Zweigbergk - Feb. 6, 2015, midnight
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1421449761 28800
#      Fri Jan 16 15:09:21 2015 -0800
# Node ID 68c7005db5d1268720f4a3806482fa5314af5283
# Parent  7f375d2de945e0e773541773db9c334f9e9f75c6
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.

Patch

diff -r 7f375d2de945 -r 68c7005db5d1 mercurial/patch.py
--- a/mercurial/patch.py	Mon Jan 26 14:30:12 2015 -0500
+++ b/mercurial/patch.py	Fri Jan 16 15:09:21 2015 -0800
@@ -1777,7 +1777,7 @@ 
         content1 = None
         content2 = None
         binarydiff = False
-        op = None
+        copyop = None
         if f not in addedset:
             content1 = getfilectx(f, ctx1).data()
         if f not in removedset:
@@ -1791,10 +1791,10 @@ 
                         f1 = copy[f]
                         flag1 = ctx1.flags(f1)
                         if f1 in removedset and f1 not in gone:
-                            op = 'rename'
+                            copyop = 'rename'
                             gone.add(f1)
                         else:
-                            op = 'copy'
+                            copyop = 'copy'
                         content1 = getfilectx(f1, ctx1).data()
                     else:
                         losedatafn(f)
@@ -1847,9 +1847,9 @@ 
                 if mode1 != mode2:
                     header.append('old mode %s' % mode1)
                     header.append('new mode %s' % mode2)
-                if op is not None:
-                    header.append('%s from %s' % (op, path1))
-                    header.append('%s to %s' % (op, path2))
+                if copyop is not None:
+                    header.append('%s from %s' % (copyop, path1))
+                    header.append('%s to %s' % (copyop, path2))
         elif revs and not repo.ui.quiet:
             header.append(diffline(path1, revs))