Initial fix for case 1148796
This commit is contained in:
Родитель
1becb7cc86
Коммит
4180a7609f
|
@ -15,6 +15,7 @@ void P4StatusBaseCommand::OutputStat( StrDict *varList )
|
|||
|
||||
const std::string invalidPath = "//...";
|
||||
const std::string notFound = " - no such file(s).";
|
||||
const std::string notInClientView = " - file(s) not in client view.";
|
||||
|
||||
int i;
|
||||
StrRef var, val;
|
||||
|
@ -40,7 +41,7 @@ void P4StatusBaseCommand::OutputStat( StrDict *varList )
|
|||
std::string value(val.Text());
|
||||
// Conn().Log().Debug() << key << " # " << value << Endl;
|
||||
|
||||
if (EndsWith(value, notFound) && !StartsWith(key, invalidPath))
|
||||
if ((EndsWith(value, notInClientView) || EndsWith(value, notFound)) && !StartsWith(key, invalidPath))
|
||||
{
|
||||
if (!AddUnknown(current, value))
|
||||
return; // invalid file
|
||||
|
@ -139,13 +140,14 @@ void P4StatusBaseCommand::HandleError( Error *err )
|
|||
|
||||
const std::string invalidPath = "//...";
|
||||
const std::string notFound = " - no such file(s).";
|
||||
const std::string notInClientView = " - file(s) not in client view.";
|
||||
std::string value(buf.Text());
|
||||
value = TrimEnd(value, '\n');
|
||||
VersionedAsset asset;
|
||||
|
||||
if (EndsWith(value, notFound))
|
||||
if (EndsWith(value, notFound) || EndsWith(value, notInClientView))
|
||||
{
|
||||
if (StartsWith(value, invalidPath) || EndsWith(value.substr(0, value.length() - notFound.length()), "..."))
|
||||
if (StartsWith(value, invalidPath) || EndsWith(value.substr(0, value.length() - notFound.length()), "...") || EndsWith(value.substr(0, value.length() - notInClientView.length()), "..."))
|
||||
{
|
||||
// tried to get status with no files matching wildcard //... which is ok
|
||||
// or
|
||||
|
@ -178,8 +180,13 @@ void P4StatusBaseCommand::HandleError( Error *err )
|
|||
bool P4StatusBaseCommand::AddUnknown(VersionedAsset& current, const std::string& value)
|
||||
{
|
||||
const std::string notFound = " - no such file(s).";
|
||||
const std::string notInClientView = " - file(s) not in client view.";
|
||||
|
||||
if (EndsWith(value, notFound))
|
||||
current.SetPath(WildcardsRemove(value.substr(0, value.length() - notFound.length())));
|
||||
else if (EndsWith(value, notInClientView))
|
||||
current.SetPath(WildcardsRemove(value.substr(0, value.length() - notInClientView.length())));
|
||||
|
||||
current.SetPath(WildcardsRemove(value.substr(0, value.length() - notFound.length())));
|
||||
if (EndsWith(current.GetPath(), "*"))
|
||||
return false; // skip invalid files
|
||||
return true;
|
||||
|
|
|
@ -90,7 +90,9 @@ v1:fstat "./Assets/testfile.txt" "./Assets/excludedfile.txt"
|
|||
v1:<absroot>/Assets/testfile.txt
|
||||
o1:<absroot>/Assets/testfile.txt
|
||||
o1:257
|
||||
<p4pluginlog:./Assets/excludedfile.txt - file(s) not in client view.
|
||||
o1:./Assets/excludedfile.txt
|
||||
o1:0
|
||||
v1:./Assets/excludedfile.txt - file(s) not in client view.
|
||||
d1:end of list
|
||||
r1:end of response
|
||||
--
|
||||
|
@ -102,11 +104,14 @@ c:status recurse
|
|||
0
|
||||
--
|
||||
o1:-1
|
||||
v1:fstat "./Assets/testfile.txt"
|
||||
v1:fstat "./Assets/testfile.txt" "./Assets/excludedfile.txt"
|
||||
==:v1:User vcs_test_user ticket expires in
|
||||
v1:<absroot>/Assets/testfile.txt
|
||||
o1:<absroot>/Assets/testfile.txt
|
||||
o1:257
|
||||
o1:./Assets/excludedfile.txt
|
||||
o1:0
|
||||
v1:./Assets/excludedfile.txt - file(s) not in client view.
|
||||
d1:end of list
|
||||
r1:end of response
|
||||
--
|
||||
|
@ -124,6 +129,8 @@ v1:fstat "./Assets/testfile.txt" "./Assets/excludedfile.txt"
|
|||
v1:<absroot>/Assets/testfile.txt
|
||||
o1:<absroot>/Assets/testfile.txt
|
||||
o1:257
|
||||
<p4pluginlog:./Assets/excludedfile.txt - file(s) not in client view.
|
||||
o1:./Assets/excludedfile.txt
|
||||
o1:0
|
||||
v1:./Assets/excludedfile.txt - file(s) not in client view.
|
||||
d1:end of list
|
||||
r1:end of response
|
Загрузка…
Ссылка в новой задаче