changeset 6753:ed5ffb2c12f3

repo.status: eliminate list_
author Matt Mackall <mpm@selenic.com>
date Thu, 26 Jun 2008 14:35:50 -0500
parents e79a8f36c2a5
children 0b700faaef32
files hgext/inotify/__init__.py hgext/inotify/client.py hgext/keyword.py mercurial/dirstate.py mercurial/localrepo.py
diffstat 5 files changed, 24 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/inotify/__init__.py	Thu Jun 26 14:35:50 2008 -0500
+++ b/hgext/inotify/__init__.py	Thu Jun 26 14:35:50 2008 -0500
@@ -47,13 +47,12 @@
         # to recurse.
         inotifyserver = False
 
-        def status(self, match, list_ignored, list_clean,
-                   list_unknown=True):
+        def status(self, match, ignored, clean, unknown=True):
             files = match.files()
             try:
-                if not list_ignored and not self.inotifyserver:
+                if not ignored and not self.inotifyserver:
                     result = client.query(ui, repo, files, match, False,
-                                          list_clean, list_unknown)
+                                          clean, unknown)
                     if result is not None:
                         return result
             except socket.error, err:
@@ -82,15 +81,14 @@
                     if query:
                         try:
                             return query(ui, repo, files or [], match,
-                                         list_ignored, list_clean, list_unknown)
+                                         ignored, clean, unknown)
                         except socket.error, err:
                             ui.warn(_('could not talk to new inotify '
                                            'server: %s\n') % err[1])
                             ui.print_exc()
 
             return super(inotifydirstate, self).status(
-                match, list_ignored, list_clean,
-                list_unknown)
+                match, ignored, clean, unknown)
 
     repo.dirstate.__class__ = inotifydirstate
 
--- a/hgext/inotify/client.py	Thu Jun 26 14:35:50 2008 -0500
+++ b/hgext/inotify/client.py	Thu Jun 26 14:35:50 2008 -0500
@@ -11,7 +11,7 @@
 import common
 import os, select, socket, stat, struct, sys
 
-def query(ui, repo, names, match, list_ignored, list_clean, list_unknown=True):
+def query(ui, repo, names, match, ignored, clean, unknown=True):
     sock = socket.socket(socket.AF_UNIX)
     sockpath = repo.join('inotify.sock')
     sock.connect(sockpath)
@@ -20,10 +20,10 @@
         for n in names or []:
             yield n
         states = 'almrx!'
-        if list_ignored:
+        if ignored:
             raise ValueError('this is insanity')
-        if list_clean: states += 'n'
-        if list_unknown: states += '?'
+        if clean: states += 'n'
+        if unknown: states += '?'
         yield states
 
     req = '\0'.join(genquery())
--- a/hgext/keyword.py	Thu Jun 26 14:35:50 2008 -0500
+++ b/hgext/keyword.py	Thu Jun 26 14:35:50 2008 -0500
@@ -258,7 +258,7 @@
     Returns status of working directory.'''
     if kwt:
         matcher = cmdutil.match(repo, pats, opts)
-        return repo.status(match=matcher, list_clean=True)
+        return repo.status(match=matcher, clean=True)
     if ui.configitems('keyword'):
         raise util.Abort(_('[keyword] patterns cannot match'))
     raise util.Abort(_('no [keyword] patterns configured'))
--- a/mercurial/dirstate.py	Thu Jun 26 14:35:50 2008 -0500
+++ b/mercurial/dirstate.py	Thu Jun 26 14:35:50 2008 -0500
@@ -629,7 +629,9 @@
             if imatch(k):
                 yield 'm', k, None
 
-    def status(self, match, list_ignored, list_clean, list_unknown):
+    def status(self, match, ignored, clean, unknown):
+        listignored, listclean, listunknown = ignored, clean, unknown
+
         lookup, modified, added, unknown, ignored = [], [], [], [], []
         removed, deleted, clean = [], [], []
 
@@ -646,13 +648,12 @@
         dadd = deleted.append
         cadd = clean.append
 
-        for src, fn, st in self.statwalk(match, unknown=list_unknown,
-                                         ignored=list_ignored):
+        for src, fn, st in self.statwalk(match, listunknown, listignored):
             if fn not in dmap:
-                if (list_ignored or match.exact(fn)) and self._dirignore(fn):
-                    if list_ignored:
+                if (listignored or match.exact(fn)) and self._dirignore(fn):
+                    if listignored:
                         iadd(fn)
-                elif list_unknown:
+                elif listunknown:
                     uadd(fn)
                 continue
 
@@ -685,7 +686,7 @@
                     madd(fn)
                 elif time != int(st.st_mtime):
                     ladd(fn)
-                elif list_clean:
+                elif listclean:
                     cadd(fn)
             elif state == 'm':
                 madd(fn)
--- a/mercurial/localrepo.py	Thu Jun 26 14:35:50 2008 -0500
+++ b/mercurial/localrepo.py	Thu Jun 26 14:35:50 2008 -0500
@@ -972,7 +972,7 @@
                 yield fn
 
     def status(self, node1=None, node2=None, match=None,
-               list_ignored=False, list_clean=False, list_unknown=True):
+               ignored=False, clean=False, unknown=True):
         """return status of files between two nodes or node and working directory
 
         If node1 is None, use the first dirstate parent instead.
@@ -994,6 +994,7 @@
         if not match:
             match = match_.always(self.root, self.getcwd())
 
+        listignored, listclean, listunknown = ignored, clean, unknown
         modified, added, removed, deleted, unknown = [], [], [], [], []
         ignored, clean = [], []
 
@@ -1010,8 +1011,8 @@
         # are we comparing the working directory?
         if not node2:
             (lookup, modified, added, removed, deleted, unknown,
-             ignored, clean) = self.dirstate.status(match, list_ignored,
-                                                    list_clean, list_unknown)
+             ignored, clean) = self.dirstate.status(match, listignored,
+                                                    listclean, listunknown)
             # are we comparing working dir against its parent?
             if compareworking:
                 if lookup:
@@ -1025,7 +1026,7 @@
                             modified.append(f)
                         else:
                             fixup.append(f)
-                            if list_clean:
+                            if listclean:
                                 clean.append(f)
 
                     # update dirstate for files that are actually clean
@@ -1073,7 +1074,7 @@
                         (mf1[fn] != mf2[fn] and
                          (mf2[fn] != "" or fcmp(fn, getnode)))):
                         modified.append(fn)
-                    elif list_clean:
+                    elif listclean:
                         clean.append(fn)
                     del mf1[fn]
                 else: