Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

fogcreek overlay: display correct icons for kbfiles in shell extension

Changeset 319ba8067626

Parent 222c5af4beea

by David Golub

Changes to 3 files · Browse files at 319ba8067626 Showing diff from parent 222c5af4beea Diff from another changeset...

 
31
32
33
34
 
 
35
36
37
 
40
41
42
43
 
44
45
46
47
48
 
 
49
50
51
 
71
72
73
 
74
75
76
 
159
160
161
162
 
163
164
165
 
168
169
170
171
 
172
173
174
 
31
32
33
 
34
35
36
37
38
 
41
42
43
 
44
45
46
47
48
 
49
50
51
52
53
 
73
74
75
76
77
78
79
 
162
163
164
 
165
166
167
168
 
171
172
173
 
174
175
176
177
@@ -31,7 +31,8 @@
     Dirstate* Dirstatecache::get( - const std::string& hgroot, const std::string& cwd, bool& unset) + const std::string& hgroot, const std::string& cwd, bool& unset, + bool usekbfiles)  {   unset = false;   @@ -40,12 +41,13 @@
  Iter iter = cache().begin();   for (;iter != cache().end(); ++iter)   { - if (hgroot == iter->hgroot) + if (hgroot == iter->hgroot && usekbfiles == iter->usekbfiles)   break;   }     Winstat64 stat; - std::string path = hgroot + "\\.hg\\dirstate"; + std::string path = hgroot + (usekbfiles ? "\\.hg\\kilnbfiles\\dirstate" + : "\\.hg\\dirstate");     unsigned tc = GetTickCount();   bool new_stat = false; @@ -71,6 +73,7 @@
    E e;   e.hgroot = hgroot; + e.usekbfiles = usekbfiles;   cache().push_front(e);   iter = cache().begin();   iter->tickcount = tc; @@ -159,7 +162,7 @@
 }     -void Dirstatecache::invalidate(const std::string& hgroot) +void Dirstatecache::invalidate(const std::string& hgroot, bool usekbfiles)  {   typedef std::list<E>::iterator Iter;   @@ -168,7 +171,7 @@
    for (Iter i = cache().begin(); i != cache().end(); ++i)   { - if (hgroot == i->hgroot) + if (hgroot == i->hgroot && usekbfiles == i->usekbfiles)   {   delete i->dstate;   i->dstate = 0;
 
34
35
36
 
37
38
39
40
41
42
43
 
 
44
45
46
 
48
49
50
51
52
 
 
 
53
54
55
 
34
35
36
37
38
39
40
41
42
43
 
44
45
46
47
48
 
50
51
52
 
 
53
54
55
56
57
58
@@ -34,13 +34,15 @@
  std::string hgroot;   unsigned tickcount;   bool unset; + bool usekbfiles;     E():   dstate(0),   dstate_mtime(0),   dstate_size(0),   tickcount(0), - unset(false) + unset(false), + usekbfiles(false)   {}   };   @@ -48,8 +50,9 @@
   public:   static Dirstate* get( - const std::string& hgroot, const std::string& cwd, bool& unset); - static void invalidate(const std::string& hgroot); + const std::string& hgroot, const std::string& cwd, bool& unset, + bool usekbfiles = false); + static void invalidate(const std::string& hgroot, bool usekbfiles = false);  };    #endif
 
312
313
314
315
 
316
317
318
319
 
 
 
 
 
 
 
 
 
 
 
320
321
322
 
312
313
314
 
315
316
317
 
 
318
319
320
321
322
323
324
325
326
327
328
329
330
331
@@ -312,11 +312,20 @@
  return 1;   }   - const Direntry* const e = pds->root().get(relpath); + const Direntry* e = pds->root().get(relpath);   if (!e)   { - last = cur; - return 0; + // attempt to get status from kbfiles + pds = Dirstatecache::get(cur.hgroot, cur.basedir, unset, true); + if (pds) + { + e = pds->root().get(relpath); + } + if (!e) + { + last = cur; + return 0; + }   }     outStatus = e->status(stat);