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

shellext: introduce Dirstatecache::invalidate()

Changeset 138a6894a0b2

Parent 2730b8d336aa

by Adrian Buehlmann

Changes to 2 files · Browse files at 138a6894a0b2 Showing diff from parent 2730b8d336aa Diff from another changeset...

 
120
121
122
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
@@ -120,3 +120,24 @@
    return iter->dstate;  } + + +void Dirstatecache::invalidate(const std::string& hgroot) +{ + typedef std::list<E>::iterator Iter; + + if (hgroot.empty()) + return; + + for (Iter i = cache().begin(); i != cache().end(); ++i) + { + if (hgroot == i->hgroot) + { + delete i->dstate; + i->dstate = 0; + cache().erase(i); + TDEBUG_TRACE("Dirstatecache::invalidate(" << hgroot << ")"); + break; + } + } +}
 
41
42
43
 
44
45
46
 
41
42
43
44
45
46
47
@@ -41,6 +41,7 @@
   public:   static Dirstate* get(const std::string& hgroot); + static void invalidate(const std::string& hgroot);  };    #endif