Clear case check in method c#
Within my program I have a method that checks out a file but I need to be able to check it back in again,
ClearCase.ClearTool CCTool = new ClearCase.ClearTool();
ClearCase.Application m_CC = new ClearCase.Application();
ClearCase.CCCheckedOutFile file = null;
void GetVersions(string sourcefile, string destinationP开发者_如何学Goath)
{
ClearCase.CCElement element = m_CC.get_Element(sourcefile);
if (element != null)
{
ClearCase.CCVersion latestVersion = null;
FileInfo fi = new FileInfo(sourcefile);
latestVersion = element.get_Version("\\main\\LATEST");
if (latestVersion != null)
{
ClearCase.CCBranch branch = latestVersion.Branch;
ClearCase.CCCheckedOutFile file = latestVersion.CheckOut(ClearCase.CCReservedState.ccReserved, "", false, ClearCase.CCVersionToCheckOut.ccVersion_SpecificVersion, true, false);
string path = file.ExtendedPath;
}
}
}
What this will do is check out the latest version and create it on your own branch, would there be a way of checking it back in so you are putting it on the main with a new version.
Thanks, Berbies
Once you have CCCheckoutFile objects, you can call the checkin method on them to check them in:
Function CheckIn([ Comment As String = "" ],
[ EvenIfIdentical As Boolean = False ],
[ FromPath As String = "" ],
[ KeepState As CCKeepState = ccKeep ]) As CCVersion
If you don't have those objects, you need to get them first, like in this CCCheckedOutFileQuery
for instance.
Or, for just one given file, you can determine if a file is checked-out to a particular view.
精彩评论