Methods Summary |
---|
protected com.starbase.starteam.View | createSnapshotView(com.starbase.starteam.View raw)Override of base-class abstract function creates an
appropriately configured view. For checkins this is
always the current or "tip" view.
return new View(raw, ViewConfiguration.createTip());
|
private java.lang.String | describeCheckin(com.starbase.starteam.File remotefile)provides a string showing from and to full paths for logging
StringBuffer sb = new StringBuffer();
sb.append(remotefile.getFullName())
.append(" --> ")
.append(getFullRepositoryPath(remotefile));
return sb.toString();
|
public java.lang.String | getComment()Get the comment attribute for this operation
return this.comment;
|
public boolean | isAddUncontrolled()Get the value of addUncontrolled.
return this.addUncontrolled;
|
protected void | logOperationDescription(com.starbase.starteam.Folder starteamrootFolder, java.io.File targetrootFolder)Implements base-class abstract function to emit to the log an
entry describing the parameters that will be used by this operation.
log((this.isRecursive() ? "Recursive" : "Non-recursive")
+ " Checkin from"
+ (null == getRootLocalFolder() ? " (default): " : ": ")
+ targetrootFolder.getAbsolutePath());
log("Checking in to: " + starteamrootFolder.getFolderHierarchy());
logIncludes();
logExcludes();
if (this.lockStatus == Item.LockType.UNLOCKED) {
log(" Items will be checked in unlocked.");
} else {
log(" Items will be checked in with no change in lock status.");
}
if (this.isForced()) {
log(" Items will be checked in in accordance with repository "
+ "status and regardless of lock status.");
} else {
log(" Items will be checked in regardless of repository status "
+ "only if locked.");
}
|
private void | processFile(com.starbase.starteam.File eachFile)Processes (checks-out) stFiles files from StarTeam folder.
String filename = eachFile.getName();
// If the file doesn't pass the include/exclude tests, skip it.
if (!shouldProcess(filename)) {
log("Excluding " + getFullRepositoryPath(eachFile));
return;
}
boolean checkin = true;
int fileStatus = (eachFile.getStatus());
// We try to update the status once to give StarTeam
// another chance.
if (fileStatus == Status.MERGE || fileStatus == Status.UNKNOWN) {
eachFile.updateStatus(true, true);
fileStatus = (eachFile.getStatus());
}
if (fileStatus == Status.MODIFIED) {
log("Checking in: " + describeCheckin(eachFile));
} else if (fileStatus == Status.MISSING) {
log("Local file missing: " + describeCheckin(eachFile));
checkin = false;
} else {
if (isForced()) {
log("Forced checkin of " + describeCheckin(eachFile)
+ " over status " + Status.name(fileStatus));
} else {
log("Skipping: " + getFullRepositoryPath(eachFile)
+ " - status: " + Status.name(fileStatus));
checkin = false;
}
}
if (checkin) {
eachFile.checkin(this.comment, this.lockStatus,
this.isForced(), true, true);
}
|
public void | setAddUncontrolled(boolean addUncontrolled)if true, any files or folders NOT in StarTeam will be
added to the repository. Defaults to "false".
this.addUncontrolled = addUncontrolled;
|
public void | setComment(java.lang.String comment)Optional checkin comment to be saved with the file.
this.comment = comment;
|
public void | setCreateFolders(boolean argCreateFolders)Sets the value of createFolders
this.createFolders = argCreateFolders;
|
public void | setUnlocked(boolean v)Set to do an unlocked checkout; optional, default is false;
If true, file will be unlocked so that other users may
change it. If false, lock status will not change.
if (v) {
this.lockStatus = Item.LockType.UNLOCKED;
} else {
this.lockStatus = Item.LockType.UNCHANGED;
}
|
protected void | testPreconditions()Implements base-class abstract function to define tests for
any preconditons required by the task.
|
protected void | visit(com.starbase.starteam.Folder starteamFolder, java.io.File targetFolder)Implements base-class abstract function to perform the checkout
operation on the files in each folder of the tree.
try {
if (null != getRootLocalFolder()) {
starteamFolder.setAlternatePathFragment(
targetFolder.getAbsolutePath());
}
Folder[] foldersList = starteamFolder.getSubFolders();
Item[] stFiles = starteamFolder.getItems(getTypeNames().FILE);
// note, it's important to scan the items BEFORE we make the
// UnmatchedFileMap because that creates a bunch of NEW
// folders and files (unattached to repository) and we
// don't want to include those in our traversal.
UnmatchedFileMap ufm =
new CheckinMap().init(
targetFolder.getAbsoluteFile(), starteamFolder);
for (int i = 0, size = foldersList.length; i < size; i++) {
Folder stFolder = foldersList[i];
java.io.File subfolder =
new java.io.File(targetFolder, stFolder.getName());
ufm.removeControlledItem(subfolder);
if (isRecursive()) {
visit(stFolder, subfolder);
}
}
for (int i = 0, size = stFiles.length; i < size; i++) {
com.starbase.starteam.File stFile =
(com.starbase.starteam.File) stFiles[i];
processFile(stFile);
ufm.removeControlledItem(
new java.io.File(targetFolder, stFile.getName()));
}
if (this.addUncontrolled) {
ufm.processUncontrolledItems();
}
} catch (IOException e) {
throw new BuildException(e);
}
|