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

nautilus: do not cache repo

caching is done in cachethg

Changeset 0d543fea5c4f

Parent b382a71dd8c4

by Simon Heimberg

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

 
53
54
55
56
57
58
59
 
62
63
64
65
66
67
68
69
 
110
111
112
113
114
115
116
117
118
119
 
120
121
122
123
124
125
 
148
149
150
151
152
153
154
155
156
157
158
 
232
233
234
235
 
236
237
238
 
264
265
266
267
268
269
 
 
270
271
272
 
343
344
345
346
 
347
348
349
 
53
54
55
 
56
57
58
 
61
62
63
 
 
64
65
66
 
107
108
109
 
 
 
110
 
 
 
111
112
 
 
113
114
115
 
138
139
140
 
 
 
 
 
141
142
143
 
217
218
219
 
220
221
222
223
 
249
250
251
 
 
 
252
253
254
255
256
 
327
328
329
 
330
331
332
333
@@ -53,7 +53,6 @@
     nofilecmds = 'about serve synch repoconfig userconfig merge unmerge'.split() -nocachecmds = 'about serve repoconfig userconfig'.split()      class HgExtension(nautilus.MenuProvider, @@ -62,8 +61,6 @@
  nautilus.PropertyPageProvider):     def __init__(self): - self.cacherepo = None - self.cacheroot = None   self.scanStack = []   self.allvfs = {}   self.inv_dirs = set() @@ -110,16 +107,9 @@
  '''   p = paths.find_root(path)   - if p == self.cacheroot: - return self.cacherepo - # Keep one repo cached   try: - self.cacheroot = p - self.cacherepo = hg.repository(ui.ui(), path=p) - return self.cacherepo + return hg.repository(ui.ui(), path=p)   except hglib.RepoError: - self.cacheroot = None - self.cacherepo = None   return None   except StandardError, e:   debugf(e) @@ -148,11 +138,6 @@
  proc.stdin.write('\n'.join(self.files))   proc.stdin.close()   - if hgtkcmd not in nocachecmds: - # Remove cached repo object, dirstate may change - self.cacherepo = None - self.cacheroot = None -   def buildMenu(self, vfs_files, bg):   '''Build menu'''   self.pos = 0 @@ -232,7 +217,7 @@
  "HG Status",   "Version control status"),   - def _get_file_status(self, repo, localpath): + def _get_file_status(self, localpath, repo=None):   cachestate = cachethg.get_state(localpath, repo)   cache2state = {cachethg.UNCHANGED: ('default', 'clean'),   cachethg.ADDED: ('cvs-added', 'added'), @@ -264,9 +249,8 @@
  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) + self.invalidate([os.path.dirname(path)]) + emblem, status = self._get_file_status(path)   if emblem is not None:   vfs_file.add_emblem(emblem)   vfs_file.add_string_attribute('hg_status', status) @@ -343,7 +327,7 @@
  if repo is None:   return   localpath = path[len(repo.root)+1:] - emblem, status = self._get_file_status(repo, path) + emblem, status = self._get_file_status(path, repo)     # Get the information from Mercurial   ctx = repo['.']