Changeset e1399fdac0d0…
Parent aca25c97fc27…
by
Changes to 3 files · Browse files at e1399fdac0d0 Showing diff from parent aca25c97fc27 Diff from another changeset...
@@ -20,6 +20,31 @@ #include "Dirstatecache.h"
#include "dirstate.h"
#include "Winstat64.h"
+#include "TortoiseUtils.h"
+#include "StringUtils.h"
+
+
+void call_thgstatus(const std::string& cwd)
+{
+ std::string dir = GetTHgProgRoot();
+ if (dir.empty())
+ {
+ TDEBUG_TRACE("call_thgstatus: THG root is empty");
+ return;
+ }
+ std::string hgcmd = dir + "\\hgtk.exe";
+
+ WIN32_FIND_DATAA data;
+ HANDLE hfind = FindFirstFileA(hgcmd.c_str(), &data);
+ if (hfind == INVALID_HANDLE_VALUE)
+ hgcmd = dir + "\\hgtk.cmd";
+ else
+ FindClose(hfind);
+
+ hgcmd = Quote(hgcmd) + " thgstatus --notify .";
+
+ LaunchCommand(hgcmd, cwd);
+}
std::list<Dirstatecache::E>& Dirstatecache::cache()
@@ -29,7 +54,8 @@}
-Dirstate* Dirstatecache::get(const std::string& hgroot)
+Dirstate* Dirstatecache::get(
+ const std::string& hgroot, const std::string& cwd)
{
typedef std::list<E>::iterator Iter;
@@ -114,8 +140,14 @@ if (unset)
{
TDEBUG_TRACE("Dirstatecache::get: ignored (unset entries)");
+ if (!iter->unset)
+ {
+ call_thgstatus(cwd);
+ iter->unset = true;
+ }
return iter->dstate;
}
+ iter->unset = false;
delete iter->dstate;
iter->dstate = ds.release();
|
@@ -33,14 +33,21 @@
std::string hgroot;
unsigned tickcount;
+ bool unset;
- E(): dstate(0), dstate_mtime(0), dstate_size(0), tickcount(0) {}
+ E():
+ dstate(0),
+ dstate_mtime(0),
+ dstate_size(0),
+ tickcount(0),
+ unset(false)
+ {}
};
static std::list<E>& cache();
public:
- static Dirstate* get(const std::string& hgroot);
+ static Dirstate* get(const std::string& hgroot, const std::string& cwd);
static void invalidate(const std::string& hgroot);
};
|
@@ -164,7 +164,7 @@ }
else
{
- Dirstate* pds = Dirstatecache::get(cur.hgroot);
+ Dirstate* pds = Dirstatecache::get(cur.hgroot, cur.basedir);
if (!pds)
{
TDEBUG_TRACE("HgQueryDirstate: Dirstatecache::get("
|
Loading...