Changeset 9767c36b5bfd…
Parent 380652f787c7…
by
Changes to one file · Browse files at 9767c36b5bfd Showing diff from parent 380652f787c7 Diff from another changeset...
@@ -23,6 +23,7 @@ #include "Dirstatecache.h"
#include "Winstat.h"
#include "TortoiseUtils.h"
+#include "Thgstatus.h"
#include <shlwapi.h>
@@ -100,6 +101,29 @@}
+int get_relpath(
+ const std::string& hgroot,
+ const std::string& path,
+ std::string& res
+)
+{
+ size_t offset = hgroot.size();
+ if (offset == 0)
+ return 0;
+
+ if (offset > path.size())
+ return 0;
+
+ if (path[offset] == '\\')
+ offset++;
+
+ const char* relpathptr = path.c_str() + offset;
+
+ res = relpathptr;
+ return 1;
+}
+
+
int HgQueryDirstate(
const std::string& path, const char& filterStatus, char& outStatus)
{
@@ -194,6 +218,29 @@ }
outStatus = e->status(stat);
+
+ if (outStatus == 'M')
+ {
+ DirectoryStatus* dirsst = DirectoryStatus::get(cur.hgroot);
+ if (dirsst)
+ {
+ std::string relbase;
+ if (get_relpath(cur.hgroot, cur.basedir, relbase))
+ {
+ TDEBUG_TRACE("HgQueryDirstate: relbase = '"
+ << relbase << "'");
+
+ char basedir_status = dirsst->status(relbase);
+ TDEBUG_TRACE("HgQueryDirstate: basedir_status = "
+ << basedir_status);
+
+ if (basedir_status != 'M')
+ {
+ Thgstatus::update(cur.hgroot);
+ }
+ }
+ }
+ }
}
cur.status = outStatus;
|
Loading...