When reloading the dirstate, recompute ignore information if needed.
authorBryan O'Sullivan <bos@serpentine.com>
Tue, 24 Apr 2007 12:02:51 -0700
changeset 4373 109077e7048d
parent 4372 9edc2d6f7c10
child 4374 de612b5f8d59
When reloading the dirstate, recompute ignore information if needed.
mercurial/dirstate.py
mercurial/localrepo.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -231,6 +231,16 @@ class dirstate(object):
         except IOError, err:
             if err.errno != errno.ENOENT: raise
 
+    def reload(self):
+        def mtime():
+            m = self.map and self.map.get('.hgignore')
+            return m and m[-1]
+
+        old_mtime = self.ignorefunc and mtime()
+        self.read()
+        if old_mtime != mtime():
+            self.ignorefunc = None
+
     def copy(self, source, dest):
         self.lazyread()
         self.markdirty()
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -596,7 +596,7 @@ class localrepository(repo.repository):
             self.ui.warn(_("no rollback information available\n"))
 
     def wreload(self):
-        self.dirstate.read()
+        self.dirstate.reload()
 
     def reload(self):
         self.changelog.load()