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

shellext: provide cwd on update when thgstatus missing

This ensures that the correct directory gets
a shell notify, if we are inside a repo

Changeset 7c19bdf206aa

Parent 8267630ace5a

by Adrian Buehlmann

Changes to 3 files · Browse files at 7c19bdf206aa Showing diff from parent 8267630ace5a Diff from another changeset...

 
55
56
57
58
 
59
60
61
 
65
66
67
68
 
 
69
70
71
 
114
115
116
117
 
 
118
119
120
 
123
124
125
126
 
127
128
129
 
55
56
57
 
58
59
60
61
 
65
66
67
 
68
69
70
71
72
 
115
116
117
 
118
119
120
121
122
 
125
126
127
 
128
129
130
131
@@ -55,7 +55,7 @@
 }     -int DirectoryStatus::read(const std::string& hgroot) +int DirectoryStatus::read(const std::string& hgroot, const std::string& cwd)  {   v_.clear();   @@ -65,7 +65,8 @@
  if (!f)   {   TDEBUG_TRACE("DirectoryStatus::read: can't open '" << p << "'"); - Thgstatus::update(hgroot); + std::string p = (cwd.size() < hgroot.size() ? hgroot : cwd); + Thgstatus::update(p);   return 0;   }   @@ -114,7 +115,8 @@
 };     -DirectoryStatus* DirectoryStatus::get(const std::string& hgroot) +DirectoryStatus* DirectoryStatus::get( + const std::string& hgroot, const std::string& cwd)  {   static CacheEntry ce;   @@ -123,7 +125,7 @@
  if (ce.hgroot_ != hgroot || (tc - ce.tickcount_) > 2000)   {   ce.hgroot_.clear(); - ce.readfailed_ = (ce.ds_.read(hgroot) == 0); + ce.readfailed_ = (ce.ds_.read(hgroot, cwd) == 0);   ce.hgroot_ = hgroot;   ce.tickcount_ = GetTickCount();   }
 
32
33
34
35
 
 
36
37
38
39
 
40
 
32
33
34
 
35
36
37
38
39
 
40
41
@@ -32,9 +32,10 @@
  V v_;    public: - static DirectoryStatus* get(const std::string& hgroot); + static DirectoryStatus* get( + const std::string& hgroot, const std::string& cwd);   char status(const std::string& relpath) const;    private: - int read(const std::string& hgroot); + int read(const std::string& hgroot, const std::string& cwd);  };
 
184
185
186
187
 
188
189
190
 
220
221
222
223
 
 
224
225
226
 
184
185
186
 
187
188
189
190
 
220
221
222
 
223
224
225
226
227
@@ -184,7 +184,7 @@
  return 0; // unknown dir -> no icon   }   - DirectoryStatus* pds = DirectoryStatus::get(cur.hgroot); + DirectoryStatus* pds = DirectoryStatus::get(cur.hgroot, cur.basedir);   outStatus = (pds ? pds->status(relpath) : '?');   }   else @@ -220,7 +220,8 @@
    if (outStatus == 'M')   { - DirectoryStatus* dirsst = DirectoryStatus::get(cur.hgroot); + DirectoryStatus* dirsst = + DirectoryStatus::get(cur.hgroot, cur.basedir);   if (dirsst)   {   std::string relbase;