We use ClearCase where I work, and we leverage labels to create views
of code at that have that particular label. So, when a developer
works and is finally finished with his completed task he/she will
apply a already created label to all of the source code. Then we have
a config spec filter it's view to only see code files with that
particular label and build off of that. I modified the code to
leverage a new Element that can be used within the Sourcecontrol for
ClearCase. The new element is "readSourceLabel" and you specify to
label to filter for. Also, the config spec needs to have this filter
also.
The change I made was to:
Source\project\core\sourcecontrol\ClearCase.cs
--------------------------------------------------------------------------- ----------------------
// New property to use ClearCase labels
[ReflectorProperty("readSourceLabel", Required = false)]
public string ReadSourceLabel;
private string CreateHistoryArguments(string fromDate)
{
//added if; else was original code
ProcessArgumentBuilder builder = new
ProcessArgumentBuilder();
if (ReadSourceLabel != null && ReadSourceLabel.Length > 0)
{
builder.AppendArgument("find {0}", ViewPath);
builder.AppendArgument(" -ver \"{{lbtype({0}) ",
ReadSourceLabel.Trim());
builder.AppendArgument("&& created_since({0})}}\" -
exec \"", fromDate);
builder.AppendArgument("cleartool lshist -r -nco");
builder.AppendIf(Branch != null, "-branch \"{0}\"",
Branch);
builder.AppendArgument("-since {0}", fromDate);
builder.AppendArgument("-fmt
%u{0}%Vd{0}%En{0}%Vn{0}%o{0}!%l{0}!%a{0}%Nc",
ClearCaseHistoryParser.DELIMITER);
builder.Append(ClearCaseHistoryParser.END_OF_LINE_DELIMITER + "\\n");
builder.Append(" %CLEARCASE_XPN%\"");
}
else
{
builder.AppendArgument("lshist -r -nco");
builder.AppendIf(Branch != null, "-branch \"{0}\"",
Branch);
builder.AppendArgument("-since {0}", fromDate);
builder.AppendArgument("-fmt
\"%u{0}%Vd{0}%En{0}%Vn{0}%o{0}!%l{0}!%a{0}%Nc",
ClearCaseHistoryParser.DELIMITER);
builder.Append(ClearCaseHistoryParser.END_OF_LINE_DELIMITER + "\\n
\"");
builder.AppendArgument("\"{0}\"", ViewPath);
}
return builder.ToString();
}
P.S. I've added another new feature that allows ForceBuilds from
outside the webdashboard and cruisecontrol, comes from a custom nant
task.
P.S.S. I've also added an enhancement to get the identity of the user
doing the force builds.
I can post these code changes also, but they are more extensive.