private long validateRevisionNumber() throws VcsException { long revision = myCommandListener.getCommittedRevision(); if (revision < 0) { throw new VcsException("Wrong committed revision number: " + revision); } return revision; }
public long commit( File[] paths, String message, @Nullable SVNDepth depth, boolean noUnlock, boolean keepChangelist, Collection<String> changelists, Map revpropTable) throws VcsException { if (paths.length == 0) return INVALID_REVISION_NUMBER; final List<String> parameters = new ArrayList<String>(); CommandUtil.put(parameters, depth); CommandUtil.put(parameters, noUnlock, "--no-unlock"); CommandUtil.put(parameters, keepChangelist, "--keep-changelists"); CommandUtil.putChangeLists(parameters, changelists); if (revpropTable != null && !revpropTable.isEmpty()) { final Set<Map.Entry<Object, Object>> set = revpropTable.entrySet(); for (Map.Entry<Object, Object> entry : set) { parameters.add("--with-revprop"); parameters.add(entry.getKey() + "=" + entry.getValue()); } } parameters.add("-m"); parameters.add(message); // TODO: seems that sort is not necessary here Arrays.sort(paths); CommandUtil.put(parameters, paths); myCommandListener.setBaseDirectory(CommandUtil.correctUpToExistingParent(paths[0])); CommandUtil.execute( myVcs, SvnTarget.fromFile(paths[0]), SvnCommandName.ci, parameters, myCommandListener); myCommandListener.throwExceptionIfOccurred(); return validateRevisionNumber(); }