[PATCH 5 of 6] dirstate._walkexplicit: rename work to dirsfound

Siddharth Agarwal sid0 at fb.com
Tue May 7 16:32:12 CDT 2013


# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1367961544 25200
#      Tue May 07 14:19:04 2013 -0700
# Node ID 97f4593c28baba2cdda1d893241680dda0c3e2cb
# Parent  935ab007bcdcf391c9bb4c9e5dfff2a0f5c803ac
dirstate._walkexplicit: rename work to dirsfound

Now that this code is factored out, work is too specific a name.

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -525,10 +525,10 @@
     def _walkexplicit(self, match, subrepos):
         '''Get stat data about the files explicitly specified by match.
 
-        Return a triple (results, work, dirsnotfound).
+        Return a triple (results, dirsfound, dirsnotfound).
         - results is a mapping from filename to stat result. It also contains
           listings mapping subrepos and .hg to None.
-        - work is a list of files found to be directories.
+        - dirsfound is a list of files found to be directories.
         - dirsnotfound is a list of files that the dirstate thinks are
           directories and that were not found.'''
 
@@ -556,8 +556,8 @@
         regkind = stat.S_IFREG
         lnkkind = stat.S_IFLNK
         join = self._join
-        work = []
-        wadd = work.append
+        dirsfound = []
+        foundadd = dirsfound.append
         dirsnotfound = []
 
         if match.matchfn != match.exact and self._checkcase:
@@ -599,7 +599,7 @@
                         results[nf] = None
                     if matchedir:
                         matchedir(nf)
-                    wadd(nf)
+                    foundadd(nf)
                 elif kind == regkind or kind == lnkkind:
                     results[nf] = st
                 else:
@@ -620,7 +620,7 @@
                     else:
                         badfn(ff, inst.strerror)
 
-        return results, work, dirsnotfound
+        return results, dirsfound, dirsnotfound
 
     def walk(self, match, subrepos, unknown, ignored):
         '''


More information about the Mercurial-devel mailing list