# HG changeset patch
# User Simon Heimberg <[email protected]>
# Date 1242157352 -7200
# Node ID 4cfc04befcdc649d6272deb3ae99554efda2fdef
# Parent  6440156bc2f9bf6ea0c1639ba64f5175bfbfabb9
nautilus: invalidate parent directories of changed files

invalidate parent directory of file which changed on disc
do not stop display of overlay icons on error

diff -r 6440156bc2f9 -r 4cfc04befcdc contrib/nautilus-thg.py
--- a/contrib/nautilus-thg.py   Fre Mär 27 20:43:30 2009 +0100
+++ b/contrib/nautilus-thg.py   Die Mai 12 21:42:32 2009 +0200
@@ -255,14 +255,23 @@
         '''Update emblem and hg status for files when there is time'''
         if not self.scanStack:
             return False
-        vfs_file = self.scanStack.pop()
-        path = self.get_path_for_vfs_file(vfs_file)
-        if not path:
-            return True
-        emblem, status = self._get_file_status(self.cacherepo, path)
-        if emblem is not None:
-            vfs_file.add_emblem(emblem)
-        vfs_file.add_string_attribute('hg_status', status)
+        try:
+            vfs_file = self.scanStack.pop()
+            path = self.get_path_for_vfs_file(vfs_file, False)
+            if not path:
+                return True
+            oldvfs = self.get_vfs(path)
+            if oldvfs and oldvfs != vfs_file:
+                #file has changed on disc (not invalidated)
+                self.get_path_for_vfs_file(vfs_file) #save new vfs
+                root = self.cacherepo and self.cacherepo.root or ''
+                self.invalidate([os.path.dirname(path)], root)
+            emblem, status = self._get_file_status(self.cacherepo, path)
+            if emblem is not None:
+                vfs_file.add_emblem(emblem)
+            vfs_file.add_string_attribute('hg_status', status)
+        except StandardError, e:
+            debugf(e)
         return True
 
     def notified(self, mon_uri=None, event_uri=None, event=None):
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Tortoisehg-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to