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

dirstate.cpp: set deleted dstate pointers to 0, tweak debug output

Do all cache debug out in dirstatecache.
Show number of cached repos.
Distinguish reading / refreshing a repo.

Changeset 3208ea797743

Parent e72457ed153c

by Adrian Buehlmann

Changes to one file · Browse files at 3208ea797743 Showing diff from parent e72457ed153c Diff from another changeset...

 
133
134
135
136
137
138
139
140
 
174
175
176
177
178
179
180
181
 
226
227
228
 
229
230
231
232
233
234
235
236
 
238
239
240
241
 
242
 
 
 
 
 
243
 
 
 
244
245
246
 
133
134
135
 
 
136
137
138
 
172
173
174
 
 
175
176
177
 
222
223
224
225
226
227
228
229
 
230
231
232
 
234
235
236
 
237
238
239
240
241
242
243
244
245
246
247
248
249
250
@@ -133,8 +133,6 @@
   std::auto_ptr<dirstate> dirstate::read(const char *path)  { - TDEBUG_TRACE("dirstate::read: path = " << path); -   FILE *f = fopen(path, "rb");   if (!f)   { @@ -174,8 +172,6 @@
    fclose(f);   - TDEBUG_TRACE("dirstate::read: done. size = " << pd->entries.size()); -   return pd;  }   @@ -226,11 +222,11 @@
  {   TDEBUG_TRACE("dirstatecache::get: dropping " << _cache.back().hgroot);   delete _cache.back().dstate; + _cache.back().dstate = 0;   _cache.pop_back();   }   entry e;   e.hgroot = hgroot; - TDEBUG_TRACE("dirstatecache::get: adding " << hgroot);   _cache.push_front(e);   iter = _cache.begin();   } @@ -238,9 +234,17 @@
  if (iter->mtime < stat.st_mtime)   {   iter->mtime = stat.st_mtime; - if (iter->dstate) + if (iter->dstate) {   delete iter->dstate; + iter->dstate = 0; + TDEBUG_TRACE("dirstatecache::get: refreshing " << hgroot); + } else { + TDEBUG_TRACE("dirstatecache::get: reading " << hgroot); + }   iter->dstate = dirstate::read(path.c_str()).release(); + TDEBUG_TRACE("dirstatecache::get: " + << iter->dstate->entries.size() << " entries read. " + << _cache.size() << " repos in cache");   }     return iter->dstate;