Patchwork [6,of,8] largefiles: rename local variable appropriately

login
register
mail settings
Submitter Katsunori FUJIWARA
Date March 27, 2017, 1:53 a.m.
Message ID <a26720a7404871d286ac.1490579626@speaknoevil>
Download mbox | patch
Permalink /patch/19725/
State Accepted
Headers show

Comments

Katsunori FUJIWARA - March 27, 2017, 1:53 a.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1490575476 -32400
#      Mon Mar 27 09:44:36 2017 +0900
# Node ID a26720a7404871d286ac4070710022b448572cb2
# Parent  77257838e7eb6abf1796e30539c996b4bdfc57a5
largefiles: rename local variable appropriately

repo['.'] is called not as "working context" but as "parent context".

In this code path, hash value of current content of file should be
compared against hash value recorded in "parent context".

Therefore, "wctx" may cause misunderstanding in this case.

Patch

diff --git a/hgext/largefiles/lfutil.py b/hgext/largefiles/lfutil.py
--- a/hgext/largefiles/lfutil.py
+++ b/hgext/largefiles/lfutil.py
@@ -165,13 +165,13 @@  def openlfdirstate(ui, repo, create=True
     return lfdirstate
 
 def lfdirstatestatus(lfdirstate, repo):
-    wctx = repo['.']
+    pctx = repo['.']
     match = matchmod.always(repo.root, repo.getcwd())
     unsure, s = lfdirstate.status(match, [], False, False, False)
     modified, clean = s.modified, s.clean
     for lfile in unsure:
         try:
-            fctx = wctx[standin(lfile)]
+            fctx = pctx[standin(lfile)]
         except LookupError:
             fctx = None
         if not fctx or fctx.data().strip() != hashfile(repo.wjoin(lfile)):