Commit c7cd4c9a authored by Knut Petter Svendsen's avatar Knut Petter Svendsen
Browse files

ClearCase: Assume Read Only file is Checked In for dynamic view

Assume that read only files on dynamic views are checked in files.
That assumption gives a better status until all files are indexed.
Once all files are indexed the correct state will be used (in case
the assumption was wrong).

Change-Id: I7097b89801b6798399560d727566419e72f13b2f
Reviewed-by: default avatarOrgad Shaneh <>
parent 75691393
...@@ -67,23 +67,36 @@ void ClearCaseSync::run(QFutureInterface<void> &future, const QString &topLevel, ...@@ -67,23 +67,36 @@ void ClearCaseSync::run(QFutureInterface<void> &future, const QString &topLevel,
return; return;
QDir topLevelDir(topLevel); QDir topLevelDir(topLevel);
const bool isDynamic = m_plugin->isDynamic();
QStringList args(QLatin1String("ls")); QStringList args(QLatin1String("ls"));
if (hot) { if (hot) {
// find all files whose permissions changed OR hijacked files // find all files whose permissions changed OR hijacked files
// (might have become checked out) // (might have become checked out)
const StatusMap::Iterator send = m_statusMap->end(); const StatusMap::Iterator send = m_statusMap->end();
for (StatusMap::Iterator it = m_statusMap->begin(); it != send; ++it) { for (StatusMap::Iterator it = m_statusMap->begin(); it != send; ++it) {
const bool permChanged = it.value().permissions != QFileInfo(topLevel, it.key()).permissions(); const QFileInfo fi(topLevel, it.key());
const bool permChanged = it.value().permissions != fi.permissions();
if (permChanged || it.value().status == FileStatus::Hijacked) { if (permChanged || it.value().status == FileStatus::Hijacked) {
files.append(it.key()); files.append(it.key());
it.value().status = FileStatus::Unknown; it.value().status = FileStatus::Unknown;
++total; ++total;
} else if (isDynamic && !fi.isWritable()) { // assume a read only file is checked in
it.value().status = FileStatus::CheckedIn;
} }
} }
args << files; args << files;
} else { } else {
foreach (const QString &file, files) foreach (const QString &file, files) {
if (isDynamic) { // assume a read only file is checked in
const QFileInfo fi(topLevelDir, file);
if (!fi.isWritable())
m_plugin->setStatus(topLevelDir.relativeFilePath(file), FileStatus::CheckedIn, false);
} else {
m_plugin->setStatus(topLevelDir.relativeFilePath(file), FileStatus::Unknown, false); m_plugin->setStatus(topLevelDir.relativeFilePath(file), FileStatus::Unknown, false);
args << QLatin1String("-recurse"); args << QLatin1String("-recurse");
QStringList vobs; QStringList vobs;
Markdown is supported
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