in clearcase-common/src/jetbrains/buildServer/vcs/clearcase/CTool.java [156:180]
static VobObjectParser createSnapshotView(@NotNull String tag, @Nullable String stream, @Nullable String globalViewPath, @NotNull String localViewPath, @Nullable String reason) throws IOException, InterruptedException {
//TODO: why here ????
final File parentFile = new File(localViewPath).getParentFile();
if (parentFile != null && !parentFile.exists()) {
parentFile.mkdirs();
}
//fire
final String command;
if (globalViewPath != null) {
if (stream == null) {
command = String.format(CMD_MKVIEW_VWS, getCleartoolExecutable(), tag, globalViewPath, reason, localViewPath);
} else {
command = String.format(CMD_MKVIEW_VWS_UCM, getCleartoolExecutable(), tag, stream, globalViewPath, reason, localViewPath);
}
} else {
if (stream == null) {
command = String.format(CMD_MKVIEW_AUTOLOC, getCleartoolExecutable(), tag, reason, localViewPath);
} else {
command = String.format(CMD_MKVIEW_AUTOLOC_UCM, getCleartoolExecutable(), tag, stream, reason, localViewPath);
}
}
final String[] execAndWait = getCommandExecutor().execAndWait(command);
LOG.debug(String.format("View created: %s", Arrays.toString(execAndWait)));
return new VobObjectParser(execAndWait);
}