[PATCH 2 of 5] import: rename some local variables

Greg Ward greg-hg at gerg.ca
Sun Oct 2 13:37:31 CDT 2011


# HG changeset patch
# User Greg Ward <greg at gerg.ca>
# Date 1317520144 14400
# Node ID fdb3ef969f2ec1f3f8fac73caf5bbcf40f48f830
# Parent  df74de0bb682c020b7dd42ee54ceb6fc978e58bb
import: rename some local variables

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3260,7 +3260,7 @@
     if (opts.get('exact') or not opts.get('force')) and update:
         cmdutil.bailifchanged(repo)
 
-    d = opts["base"]
+    base = opts["base"]
     strip = opts["strip"]
     wlock = lock = None
     msgs = []
@@ -3370,18 +3370,17 @@
         wlock = repo.wlock()
         lock = repo.lock()
         parents = repo.parents()
-        for p in patches:
-            pf = os.path.join(d, p)
-
-            if pf == '-':
-                ui.status(_("applying patch from stdin\n"))
-                pf = ui.fin
+        for patchurl in patches:
+            patchurl = os.path.join(base, patchurl)
+            if patchurl == '-':
+                ui.status(_('applying patch from stdin\n'))
+                patchfile = ui.fin
             else:
-                ui.status(_("applying %s\n") % p)
-                pf = url.open(ui, pf)
+                ui.status(_('applying %s\n') % patchurl)
+                patchfile = url.open(ui, patchurl)
 
             haspatch = False
-            for hunk in patch.split(pf):
+            for hunk in patch.split(patchfile):
                 (msg, node) = tryone(ui, hunk, parents)
                 if msg:
                     haspatch = True


More information about the Mercurial-devel mailing list