by
Changes to one file · Browse files at 297f80d564bf Showing diff from parent 63daccd1e59f 9e6c172dbfa8 Diff from another changeset...
@@ -197,9 +197,26 @@
std::string GetHgRepoRoot(const std::string& path)
{
+ TDEBUG_TRACE("GetHgRepoRoot('" << path << "')");
+
+ if (::PathIsUNCServerShare(path.c_str()))
+ {
+ TDEBUG_TRACE("GetHgRepoRoot: path is UNC share '" << path << "'");
+ return "";
+ }
+
std::string p = IsDirectory(path)? path : DirName(path);
- while (!IsDirectory(p + "\\.hg"))
+ for (;;)
{
+ std::string tdir = p + "\\.hg";
+ if (::PathIsUNCServerShare(tdir.c_str()))
+ {
+ TDEBUG_TRACE("GetHgRepoRoot: tdir is UNC share '" << tdir << "'");
+ p.clear();
+ break;
+ }
+ else if (IsDirectory(tdir))
+ break;
std::string oldp = p;
p = DirName(p);
if (p == oldp)
@@ -208,6 +225,8 @@ break;
}
}
+
+ TDEBUG_TRACE("GetHgRepoRoot: returning '" << p << "'");
return p;
}
|
Loading...