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: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent 75691393
......@@ -67,23 +67,36 @@ void ClearCaseSync::run(QFutureInterface<void> &future, const QString &topLevel,
return;
QDir topLevelDir(topLevel);
const bool isDynamic = m_plugin->isDynamic();
QStringList args(QLatin1String("ls"));
if (hot) {
// find all files whose permissions changed OR hijacked files
// (might have become checked out)
const StatusMap::Iterator send = m_statusMap->end();
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) {
files.append(it.key());
it.value().status = FileStatus::Unknown;
++total;
} else if (isDynamic && !fi.isWritable()) { // assume a read only file is checked in
it.value().status = FileStatus::CheckedIn;
++total;
}
}
args << files;
} 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);
}
}
args << QLatin1String("-recurse");
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