diff mercurial/dirstate.py @ 25163:3139900f31b1

ignore: remove .hgignore from ignore list if nonexistent Previously we would always pass the root .hgignore path to the ignore parser. The parser then had to be aware that the first path was special, and not warn if it didn't exist. In preparation for making the ignore file parser more generically usable, let's make the parse logic not aware of this special case, and instead just not pass the root .hgignore in if it doesn't exist.
author Durham Goode <durham@fb.com>
date Sat, 16 May 2015 15:24:43 -0700
parents 6eb4bdad198f
children dc562165044a
line wrap: on
line diff
--- a/mercurial/dirstate.py	Sun May 17 21:47:18 2015 -0400
+++ b/mercurial/dirstate.py	Sat May 16 15:24:43 2015 -0700
@@ -143,7 +143,9 @@
 
     @rootcache('.hgignore')
     def _ignore(self):
-        files = [self._join('.hgignore')]
+        files = []
+        if os.path.exists(self._join('.hgignore')):
+            files.append(self._join('.hgignore'))
         for name, path in self._ui.configitems("ui"):
             if name == 'ignore' or name.startswith('ignore.'):
                 # we need to use os.path.join here rather than self._join