forked from qt-creator/qt-creator
ClearCase: Trust lsactivity ordering for rebase/deliver activities
lsactivity outputs activities sorted by creation time. Latest rebase/deliver will be last in this output, so no need to compare it to previous values. Also place rebase and deliver activities last in the activities list. Change-Id: I4c90d4210751101a5f53b6d85ff3d0e86bb28d08 Reviewed-by: Knut Petter Svendsen <knutpett@pvv.org> Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
committed by
Tobias Hunger
parent
250b8e4934
commit
03ddd0e540
@@ -1542,31 +1542,31 @@ QList<QStringPair> ClearCasePlugin::ccGetActivities() const
|
||||
// Maintain latest deliver and rebase activities only
|
||||
QStringPair rebaseAct;
|
||||
QStringPair deliverAct;
|
||||
QStringList args(QLatin1String("lsactivity"));
|
||||
// Retrieve all activities
|
||||
QStringList args(QLatin1String("lsactivity"));
|
||||
args << QLatin1String("-fmt") << QLatin1String("%n\\t%[headline]p\\n");
|
||||
const QString response = runCleartoolSync(currentState().topLevel(), args);
|
||||
QStringList acts = response.split(QLatin1Char('\n'), QString::SkipEmptyParts);
|
||||
foreach (QString activity, acts) {
|
||||
QStringList act = activity.split(QLatin1Char('\t'));
|
||||
// exclude deliver/rebase activities (and include only the latest ones)
|
||||
QRegExp deliverRebase(QLatin1String("deliver\\.|rebase\\."));
|
||||
if (act.size() >= 2)
|
||||
{
|
||||
QString actName = act.at(0);
|
||||
if (actName.indexOf(deliverRebase) == -1)
|
||||
result.append(QStringPair(actName, act.at(1).trimmed()));
|
||||
else if ((actName.at(0) == QLatin1Char('r')) && (actName > rebaseAct.first))
|
||||
// include only latest deliver/rebase activities. Activities are sorted
|
||||
// by creation time
|
||||
if (actName.startsWith(QLatin1String("rebase.")))
|
||||
rebaseAct = QStringPair(actName, act.at(1));
|
||||
else if ((actName.at(0) == QLatin1Char('d')) && (actName > deliverAct.first))
|
||||
else if (actName.startsWith(QLatin1String("deliver.")))
|
||||
deliverAct = QStringPair(actName, act.at(1));
|
||||
else
|
||||
result.append(QStringPair(actName, act.at(1).trimmed()));
|
||||
}
|
||||
}
|
||||
qSort(result);
|
||||
if (!rebaseAct.first.isEmpty())
|
||||
result.append(rebaseAct);
|
||||
if (!deliverAct.first.isEmpty())
|
||||
result.append(deliverAct);
|
||||
qSort(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user