changeset 4375:109077e7048d

When reloading the dirstate, recompute ignore information if needed.
author Bryan O'Sullivan <bos@serpentine.com>
date Tue, 24 Apr 2007 12:02:51 -0700
parents 9edc2d6f7c10
children de612b5f8d59
files mercurial/dirstate.py mercurial/localrepo.py
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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()