Commit 03ddd0e5 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Tobias Hunger
Browse files

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: default avatarKnut Petter Svendsen <knutpett@pvv.org>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent 250b8e49
......@@ -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;
}
......
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