Changeset 319ba8067626…
Parent 222c5af4beea…
by
Changes to 3 files · Browse files at 319ba8067626 Showing diff from parent 222c5af4beea Diff from another changeset...
@@ -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,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,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);
|
Loading...