changeset 4620:d97fd22a0ea9

dirstate: pull ignore smarts out of ui
author Matt Mackall <mpm@selenic.com>
date Mon, 18 Jun 2007 13:24:34 -0500
parents 5fd7cc897542
children 6fc26982f203
files mercurial/dirstate.py mercurial/ui.py
diffstat 2 files changed, 4 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Mon Jun 18 13:24:34 2007 -0500
+++ b/mercurial/dirstate.py	Mon Jun 18 13:24:34 2007 -0500
@@ -52,7 +52,10 @@
                 self._incpath(f)
             return self._dirs
         elif name == '_ignore':
-            files = [self.wjoin('.hgignore')] + self._ui.hgignorefiles()
+            files = [self.wjoin('.hgignore')]
+            for name, path in self._ui.configitems("ui"):
+                if name == 'ignore' or name.startswith('ignore.'):
+                    files.append(os.path.expanduser(path))
             self._ignore = ignore.ignore(self._root, files, self._ui.warn)
             return self._ignore
         elif name == '_slash':
--- a/mercurial/ui.py	Mon Jun 18 13:24:34 2007 -0500
+++ b/mercurial/ui.py	Mon Jun 18 13:24:34 2007 -0500
@@ -312,13 +312,6 @@
             for name, value in self.configitems(section, untrusted):
                 yield section, name, str(value).replace('\n', '\\n')
 
-    def hgignorefiles(self):
-        result = []
-        for key, value in self.configitems("ui"):
-            if key == 'ignore' or key.startswith('ignore.'):
-                result.append(os.path.expanduser(value))
-        return result
-
     def username(self):
         """Return default username to be used in commits.