Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

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

Changeset b382a71dd8c4

Parent 84d9de782a48

by Simon Heimberg

Changes to one file · Browse files at b382a71dd8c4 Showing diff from parent 84d9de782a48 Diff from another changeset...

 
255
256
257
258
259
260
261
262
263
264
265
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
266
267
268
 
255
256
257
 
 
 
 
 
 
 
 
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
@@ -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):