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

stable shellext: don't update thgstatus on sticky unset dirstates (issue 480)

Changeset cc54fcf69e20

Parent 12e5e2d8650d

by Adrian Buehlmann

Changes to 3 files · Browse files at cc54fcf69e20 Showing diff from parent 12e5e2d8650d Diff from another changeset...

 
31
32
33
34
 
35
 
 
36
37
38
 
92
93
94
 
 
95
96
97
 
108
109
110
111
 
112
113
114
115
 
 
116
117
118
 
 
 
 
 
 
 
 
 
 
119
 
120
121
122
 
129
130
131
132
 
 
 
 
 
 
 
 
 
133
134
135
 
31
32
33
 
34
35
36
37
38
39
40
 
94
95
96
97
98
99
100
101
 
112
113
114
 
115
116
117
118
119
120
121
122
123
 
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
 
145
146
147
 
148
149
150
151
152
153
154
155
156
157
158
159
@@ -31,8 +31,10 @@
     Dirstate* Dirstatecache::get( - const std::string& hgroot, const std::string& cwd) + const std::string& hgroot, const std::string& cwd, bool& unset)  { + unset = false; +   typedef std::list<E>::iterator Iter;     Iter iter = cache().begin(); @@ -92,6 +94,8 @@
    if (iter->dstate)   { + unset = iter->unset; +   if (!new_stat)   return iter->dstate;   @@ -108,15 +112,27 @@
  TDEBUG_TRACE("Dirstatecache::get: reading " << hgroot);   }   - bool unset = false; + unset = false;   unsigned tc0 = GetTickCount();   std::auto_ptr<Dirstate> ds = Dirstate::read(path, unset);   unsigned tc1 = GetTickCount();   + bool request_thgstatus_update = true; +   if (unset)   { - TDEBUG_TRACE("Dirstatecache::get: has unset entries"); + if (iter->unset) + { + TDEBUG_TRACE( + "Dirstatecache::get: **** old and new have unset entries"); + request_thgstatus_update = false; + } + else + { + TDEBUG_TRACE("Dirstatecache::get: new has unset entries"); + }   } +   iter->unset = unset;     delete iter->dstate; @@ -129,7 +145,15 @@
  iter->dstate_mtime = stat.mtime;   iter->dstate_size = stat.size;   - Thgstatus::update(cwd); + if (request_thgstatus_update) + { + TDEBUG_TRACE("Dirstatecache::get: calling Thgstatus::update"); + Thgstatus::update(cwd); + } + else + { + TDEBUG_TRACE("Dirstatecache::get: omitting Thgstatus::update"); + }     return iter->dstate;  }
 
47
48
49
50
 
 
51
52
53
 
47
48
49
 
50
51
52
53
54
@@ -47,7 +47,8 @@
  static std::list<E>& cache();    public: - static Dirstate* get(const std::string& hgroot, const std::string& cwd); + static Dirstate* get( + const std::string& hgroot, const std::string& cwd, bool& unset);   static void invalidate(const std::string& hgroot);  };  
 
182
183
184
 
 
185
186
187
188
189
 
190
191
192
 
198
199
200
201
 
202
203
204
 
245
246
247
248
 
 
 
 
 
 
 
 
 
 
 
249
250
251
 
182
183
184
185
186
187
188
189
190
 
191
192
193
194
 
200
201
202
 
203
204
205
206
 
247
248
249
 
250
251
252
253
254
255
256
257
258
259
260
261
262
263
@@ -182,11 +182,13 @@
  return 0;   }   + bool unset = false; +   if (cur.isdir)   {   if (!relpath.empty())   { - Dirstate* pds2 = Dirstatecache::get(cur.hgroot, cur.basedir); + Dirstate* pds2 = Dirstatecache::get(cur.hgroot, cur.basedir, unset);   if (pds2 && !pds2->root().getdir(relpath))   {   last = cur; @@ -198,7 +200,7 @@
  }   else   { - Dirstate* pds = Dirstatecache::get(cur.hgroot, cur.basedir); + Dirstate* pds = Dirstatecache::get(cur.hgroot, cur.basedir, unset);   if (!pds)   {   TDEBUG_TRACE("HgQueryDirstate: Dirstatecache::get(" @@ -245,7 +247,17 @@
    if (basedir_status != 'M')   { - Thgstatus::update(cur.hgroot); + if (unset) + { + TDEBUG_TRACE( + "HgQueryDirstate: omitting Thgstatus::update"); + } + else + { + TDEBUG_TRACE( + "HgQueryDirstate: calling Thgstatus::update"); + Thgstatus::update(cur.hgroot); + }   }   }   }