Patchwork [2,of,2,remotenames-ext,v2] lazyremotenamedict: rename resolvekeys to resolvenodes

login
register
mail settings
Submitter Kostia Balytskyi
Date Feb. 6, 2017, 10:48 a.m.
Message ID <b6b0363782555a9acc98.1486378101@devvm1416.lla2.facebook.com>
Download mbox | patch
Permalink /patch/18334/
State Accepted
Headers show

Comments

Kostia Balytskyi - Feb. 6, 2017, 10:48 a.m.
# HG changeset patch
# User Kostia Balytskyi <ikostia@fb.com>
# Date 1486377812 28800
#      Mon Feb 06 02:43:32 2017 -0800
# Node ID b6b0363782555a9acc98c79c25aa7b1c38ece709
# Parent  f7a3dffec18438cffeef930c8e2ed4f2da0bd4bb
lazyremotenamedict: rename resolvekeys to resolvenodes

I think my initial decision to call it resolvekeys was a mistake.
Resolvenodes is clearer becuase the meaning is clearly hg-related
instead of dict-related.
Sean Farley - Feb. 6, 2017, 7:19 p.m.
Kostia Balytskyi <ikostia@fb.com> writes:

> # HG changeset patch
> # User Kostia Balytskyi <ikostia@fb.com>
> # Date 1486377812 28800
> #      Mon Feb 06 02:43:32 2017 -0800
> # Node ID b6b0363782555a9acc98c79c25aa7b1c38ece709
> # Parent  f7a3dffec18438cffeef930c8e2ed4f2da0bd4bb
> lazyremotenamedict: rename resolvekeys to resolvenodes
>
> I think my initial decision to call it resolvekeys was a mistake.
> Resolvenodes is clearer becuase the meaning is clearly hg-related
> instead of dict-related.

Thanks! Queued!

Patch

diff --git a/remotenames.py b/remotenames.py
--- a/remotenames.py
+++ b/remotenames.py
@@ -347,37 +347,37 @@  class lazyremotenamedict(UserDict.DictMi
         else:
             return None
 
-    def keys(self, resolvekeys=None):
+    def keys(self, resolvenodes=None):
         """Get a list of bookmark names
 
-        `resolvekeys` allows callee to ask whether nodes to which these keys
+        `resolvenodes` allows callee to ask whether nodes to which these keys
         point should be resolved in a revlog (to safeguard against a key
         pointing to a non-existent node). If this kwarg:
-            - is None: remotenames.resolvekeys config value is read,
+            - is None: remotenames.resolvenodes config value is read,
               defaulting to True, as the behavior before this fix
-            - is not None: the bool value of resolvekeys is used"""
-        if resolvekeys is None:
-            resolvekeys = self._repo.ui.configbool("remotenames",
-                                                   "resolvekeys", True)
+            - is not None: the bool value of resolvenodes is used"""
+        if resolvenodes is None:
+            resolvenodes = self._repo.ui.configbool("remotenames",
+                                                   "resolvenodes", True)
         if not self.loaded:
             self._load()
-        if resolvekeys:
+        if resolvenodes:
             for u in self.potentialentries.keys():
                 self._fetchandcache(u)
             return self.cache.keys()
         return self.potentialentries.keys()
 
-    def iteritems(self, resolvekeys=None):
+    def iteritems(self, resolvenodes=None):
         """Iterate over (name, node) tuples
 
-        `resolvekeys` has the same meaning as in `keys()` method"""
+        `resolvenodes` has the same meaning as in `keys()` method"""
         if not self.loaded:
             self._load()
-        if resolvekeys is None:
-            resolvekeys = self._repo.ui.configbool("remotenames",
-                                                   "resolvekeys", True)
+        if resolvenodes is None:
+            resolvenodes = self._repo.ui.configbool("remotenames",
+                                                   "resolvenodes", True)
         for k, vtup in self.potentialentries.iteritems():
-            if resolvekeys:
+            if resolvenodes:
                 self._fetchandcache(k)
             yield (k, [bin(vtup[0])])