Patchwork [2,of,6] scmutil.addremove: rename local 'copies' to 'renames'

login
register
mail settings
Submitter Siddharth Agarwal
Date May 7, 2013, 12:12 a.m.
Message ID <7873f7c6b8a355aa6f71.1367885548@sid0x220>
Download mbox | patch
Permalink /patch/1573/
State Accepted, archived
Commit 2487a594b439d4db87b94338b70e791736016026
Delegated to: Augie Fackler
Headers show

Comments

Siddharth Agarwal - May 7, 2013, 12:12 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1365028335 25200
#      Wed Apr 03 15:32:15 2013 -0700
# Node ID 7873f7c6b8a355aa6f710b9af682275a12f241e4
# Parent  01f24c137497e182dd0fe2c76e67896be2a2f529
scmutil.addremove: rename local 'copies' to 'renames'

An upcoming patch will refactor some code out into a method called
_findrenames. Having a line saying "copies = _findrenames..." is confusing.
Besides, 'renames' is a more precise name for this local anyway.

Patch

diff -r 01f24c137497 -r 7873f7c6b8a3 mercurial/scmutil.py
--- a/mercurial/scmutil.py	Tue Apr 02 17:19:36 2013 -0700
+++ b/mercurial/scmutil.py	Wed Apr 03 15:32:15 2013 -0700
@@ -703,7 +703,7 @@  def addremove(repo, pats=[], opts={}, dr
                 status = _('removing %s\n') % ((pats and rel) or abs)
             repo.ui.status(status)
 
-    copies = {}
+    renames = {}
     if similarity > 0:
         for old, new, score in similar.findrenames(repo,
                 added + unknown, removed + deleted, similarity):
@@ -711,7 +711,7 @@  def addremove(repo, pats=[], opts={}, dr
                 repo.ui.status(_('recording removal of %s as rename to %s '
                                  '(%d%% similar)\n') %
                                (m.rel(old), m.rel(new), score * 100))
-            copies[new] = old
+            renames[new] = old
 
     if not dry_run:
         wctx = repo[None]
@@ -719,7 +719,7 @@  def addremove(repo, pats=[], opts={}, dr
         try:
             wctx.forget(deleted)
             wctx.add(unknown)
-            for new, old in copies.iteritems():
+            for new, old in renames.iteritems():
                 wctx.copy(old, new)
         finally:
             wlock.release()