*
* @param actionData the ActionData object on behalf of which the update is done
*/
private void update(final ActionData actionData) {
// find the Grouping
Grouping target = repository.getGrouping(actionData.getSourcePath());
if (target == null) {
return;
}
// get prefix change information
final SubversionPropertyBranchMapper.BranchChangeInfo branches = SubversionPropertyBranchMapper.getBranchChangeInformation(actionData);
if (!branches.hasChange()) {
return;
}
logger.debug("changing for " + target.getName() + " branch from " + branches.oldBranch + " to " + branches.newBranch + ", and prefix from " + branches.oldPrefix + " to " + branches.newPrefix);
// change the names of all contained artifacts by replacing the old prefix with the new one
target.visitAllArtifacts(new Grouping.ArtifactVisitListener() {
public void visit(Grouping grouping, ArtifactIdentifier oldId) {
String newName = oldId.getName();
if (oldId.getName().startsWith(branches.oldPrefix)) {
newName = branches.newPrefix + oldId.getName().substring(branches.oldPrefix.length());
}