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 <>
Reviewed-by: default avatarTobias Hunger <>
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 =;
if (actName.indexOf(deliverRebase) == -1)
else if (( == 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,;
else if (( == QLatin1Char('d')) && (actName > deliverAct.first))
else if (actName.startsWith(QLatin1String("deliver.")))
deliverAct = QStringPair(actName,;
if (!rebaseAct.first.isEmpty())
if (!deliverAct.first.isEmpty())
return result;
Supports Markdown
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