When reloading the dirstate, recompute ignore information if needed.
authorBryan O'Sullivan <bos@serpentine.com>
Tue, 24 Apr 2007 12:02:51 -0700
changeset 4375 109077e7048d
parent 4374 9edc2d6f7c10
child 4376 de612b5f8d59
When reloading the dirstate, recompute ignore information if needed.
mercurial/dirstate.py
mercurial/localrepo.py
--- a/mercurial/dirstate.py	Tue Apr 24 12:02:42 2007 -0700
+++ b/mercurial/dirstate.py	Tue Apr 24 12:02:51 2007 -0700
@@ -231,6 +231,16 @@
         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	Tue Apr 24 12:02:42 2007 -0700
+++ b/mercurial/localrepo.py	Tue Apr 24 12:02:51 2007 -0700
@@ -596,7 +596,7 @@
             self.ui.warn(_("no rollback information available\n"))
 
     def wreload(self):
-        self.dirstate.read()
+        self.dirstate.reload()
 
     def reload(self):
         self.changelog.load()