Commit 91fe5f84 authored by Knut Petter Svendsen's avatar Knut Petter Svendsen
Browse files

ClearCase: Fix: Status actions was not correct for unix

A set view on unix will get / as topLevel. The output of
"cleartool -ls" with / as topLevel listed files with absolute path,
while with relative path for the the other cases (working directory
view and on windows). Root as topLevel is not 100% correct and should
be fixed in another patch. However, this patch fixes an annoying bug
for unix. (Before this patch multiple entries for the same file was
inserted in the status map - one with relative path and one with
absolute. Resulting in wrong lookup in updateStatusActions and thus
wrong status on the active file.

Change-Id: I178bafd21d712a445aca8e60ae3346549b55faaf
Reviewed-by: default avatarOrgad Shaneh <>
parent f1728185
......@@ -114,21 +114,21 @@ void ClearCaseSync::run(QFutureInterface<void> &future, const QString &topLevel,
if (atatpos != -1) { // probably managed file
// find first whitespace. anything before that is not interesting
int wspos = buffer.indexOf(QRegExp(QLatin1String("\\s")));
const QString file = QDir::fromNativeSeparators(buffer.left(atatpos));
const QString relFile = topLevelDir.relativeFilePath(QDir::fromNativeSeparators(buffer.left(atatpos)));
QString ccState;
QRegExp reState(QLatin1String("^\\s*\\[[^\\]]*\\]")); // [hijacked]; [loaded but missing]
if (reState.indexIn(buffer, wspos + 1, QRegExp::CaretAtOffset) != -1) {
ccState = reState.cap();
if (ccState.indexOf(QLatin1String("hijacked")) != -1)
m_plugin->setStatus(file, FileStatus::Hijacked, true);
m_plugin->setStatus(relFile, FileStatus::Hijacked, true);
else if (ccState.indexOf(QLatin1String("loaded but missing")) != -1)
m_plugin->setStatus(file, FileStatus::Missing, false);
m_plugin->setStatus(relFile, FileStatus::Missing, false);
else if (buffer.lastIndexOf(QLatin1String("CHECKEDOUT"), wspos) != -1)
m_plugin->setStatus(file, FileStatus::CheckedOut, true);
m_plugin->setStatus(relFile, FileStatus::CheckedOut, true);
// don't care about checked-in files not listed in project
else if (m_statusMap->contains(file))
m_plugin->setStatus(file, FileStatus::CheckedIn, true);
else if (m_statusMap->contains(relFile))
m_plugin->setStatus(relFile, FileStatus::CheckedIn, true);
future.setProgressValue(qMin(total, ++processed));
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment