forked from qt-creator/qt-creator
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 <orgads@gmail.com>
This commit is contained in:
@@ -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;
|
||||||
|
++total;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
args << files;
|
args << files;
|
||||||
} else {
|
} else {
|
||||||
foreach (const QString &file, files)
|
foreach (const QString &file, files) {
|
||||||
m_plugin->setStatus(topLevelDir.relativeFilePath(file), FileStatus::Unknown, false);
|
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");
|
args << QLatin1String("-recurse");
|
||||||
|
|
||||||
QStringList vobs;
|
QStringList vobs;
|
||||||
|
Reference in New Issue
Block a user