public void replay(long lowRevision, long highRevision, boolean sendDeltas, ISVNEditor editor) throws SVNException { Object[] buffer = new Object[]{"replay", getRevisionObject(highRevision), getRevisionObject(lowRevision), Boolean.valueOf(sendDeltas)}; try { openConnection(); write("(w(nnw))", buffer); authenticate(); SVNEditModeReader editReader = new SVNEditModeReader(myConnection, editor, true); editReader.driveEditor(); read("", null, false); } catch (SVNException e) { closeSession(); handleUnsupportedCommand(e, "Server doesn't support the replay command"); } finally { closeConnection(); } }
public void driveEditor() throws SVNException { while (!myDone) { SVNErrorMessage error = null; List items = readTuple("wl", false); String commandName = SVNReader.getString(items, 0); String template = (String) COMMANDS_MAP.get(commandName); List parameters = SVNReader.parseTuple(template, (Collection) items.get(1), null); try { processCommand(commandName, parameters); } catch (SVNException e) { error = e.getErrorMessage(); List items = readTuple("wl", false); String command = SVNReader.getString(items, 0); myDone = "abort-edit".equals(command) || "success".equals(command);
myEditor.openRoot(SVNReader.getLong(params, 0)); String token = SVNReader.getString(params, 1); storeToken(token, false); } else if ("delete-entry".equals(commandName)) { lookupToken(SVNReader.getString(params, 2), false); String path = SVNPathUtil.canonicalizePath(SVNReader.getString(params, 0)); myEditor.deleteEntry(path, SVNReader.getLong(params, 1)); } else if ("add-dir".equals(commandName)) { lookupToken(SVNReader.getString(params, 1), false); String path = SVNPathUtil.canonicalizePath(SVNReader.getString(params, 0)); String copyFromPath = SVNReader.getString(params, 3); storeToken(SVNReader.getString(params, 2), false); } else if ("open-dir".equals(commandName)) { lookupToken(SVNReader.getString(params, 1), false); String path = SVNPathUtil.canonicalizePath(SVNReader.getString(params, 0)); myEditor.openDir(path, SVNReader.getLong(params, 3)); storeToken(SVNReader.getString(params, 2), false); } else if ("change-dir-prop".equals(commandName)) { lookupToken(SVNReader.getString(params, 0), false); byte[] bytes = SVNReader.getBytes(params, 2); String propertyName = SVNReader.getString(params, 1); } else if ("close-dir".equals(commandName)) { String token = SVNReader.getString(params, 0); lookupToken(token, false); myEditor.closeDir(); removeToken(token); } else if ("add-file".equals(commandName)) {
} else if (ch == 'e') { if (editorBaton == null) { editorBaton = new SVNEditModeReader(); if (target[targetIndex] instanceof ISVNEditor) { editorBaton .setEditor((ISVNEditor) target[targetIndex]); boolean hasMore = false; try { hasMore = editorBaton.processCommand(commandName, is); } catch (Throwable th) { unconditionalThrow = true;
public void replay(long lowRevision, long highRevision, boolean sendDeltas, ISVNEditor editor) throws SVNException { Object[] buffer = new Object[]{"replay", getRevisionObject(highRevision), getRevisionObject(lowRevision), Boolean.valueOf(sendDeltas)}; try { openConnection(); write("(w(nnw))", buffer); authenticate(); SVNEditModeReader editReader = new SVNEditModeReader(myConnection, editor, true); editReader.driveEditor(); read("", null, false); } catch (SVNException e) { closeSession(); handleUnsupportedCommand(e, "Server doesn't support the replay command"); } finally { closeConnection(); } }
myEditor.openRoot(SVNReader.getLong(params, 0)); String token = SVNReader.getString(params, 1); storeToken(token, false); } else if ("delete-entry".equals(commandName)) { lookupToken(SVNReader.getString(params, 2), false); String path = SVNPathUtil.canonicalizePath(SVNReader.getString(params, 0)); myEditor.deleteEntry(path, SVNReader.getLong(params, 1)); } else if ("add-dir".equals(commandName)) { lookupToken(SVNReader.getString(params, 1), false); String path = SVNPathUtil.canonicalizePath(SVNReader.getString(params, 0)); String copyFromPath = SVNReader.getString(params, 3); storeToken(SVNReader.getString(params, 2), false); } else if ("open-dir".equals(commandName)) { lookupToken(SVNReader.getString(params, 1), false); String path = SVNPathUtil.canonicalizePath(SVNReader.getString(params, 0)); myEditor.openDir(path, SVNReader.getLong(params, 3)); storeToken(SVNReader.getString(params, 2), false); } else if ("change-dir-prop".equals(commandName)) { lookupToken(SVNReader.getString(params, 0), false); byte[] bytes = SVNReader.getBytes(params, 2); String propertyName = SVNReader.getString(params, 1); } else if ("close-dir".equals(commandName)) { String token = SVNReader.getString(params, 0); lookupToken(token, false); myEditor.closeDir(); removeToken(token); } else if ("add-file".equals(commandName)) {
public void driveEditor() throws SVNException { while (!myDone) { SVNErrorMessage error = null; List items = readTuple("wl", false); String commandName = SVNReader.getString(items, 0); String template = (String) COMMANDS_MAP.get(commandName); List parameters = SVNReader.parseTuple(template, (Collection) items.get(1), null); try { processCommand(commandName, parameters); } catch (SVNException e) { error = e.getErrorMessage(); List items = readTuple("wl", false); String command = SVNReader.getString(items, 0); myDone = "abort-edit".equals(command) || "success".equals(command);
public void replay(long lowRevision, long highRevision, boolean sendDeltas, ISVNEditor editor) throws SVNException { Object[] buffer = new Object[]{"replay", getRevisionObject(highRevision), getRevisionObject(lowRevision), Boolean.valueOf(sendDeltas)}; try { openConnection(); write("(w(nnw))", buffer); authenticate(); SVNEditModeReader editReader = new SVNEditModeReader(myConnection, editor, true); editReader.driveEditor(); read("", null, false); } catch (SVNException e) { closeSession(); handleUnsupportedCommand(e, "Server doesn't support the replay command"); } finally { closeConnection(); } }
myEditor.openRoot(SVNReader.getLong(params, 0)); String token = SVNReader.getString(params, 1); storeToken(token, false); } else if ("delete-entry".equals(commandName)) { lookupToken(SVNReader.getString(params, 2), false); String path = SVNPathUtil.canonicalizePath(SVNReader.getString(params, 0)); myEditor.deleteEntry(path, SVNReader.getLong(params, 1)); } else if ("add-dir".equals(commandName)) { lookupToken(SVNReader.getString(params, 1), false); String path = SVNPathUtil.canonicalizePath(SVNReader.getString(params, 0)); String copyFromPath = SVNReader.getString(params, 3); storeToken(SVNReader.getString(params, 2), false); } else if ("open-dir".equals(commandName)) { lookupToken(SVNReader.getString(params, 1), false); String path = SVNPathUtil.canonicalizePath(SVNReader.getString(params, 0)); myEditor.openDir(path, SVNReader.getLong(params, 3)); storeToken(SVNReader.getString(params, 2), false); } else if ("change-dir-prop".equals(commandName)) { lookupToken(SVNReader.getString(params, 0), false); byte[] bytes = SVNReader.getBytes(params, 2); String propertyName = SVNReader.getString(params, 1); } else if ("close-dir".equals(commandName)) { String token = SVNReader.getString(params, 0); lookupToken(token, false); myEditor.closeDir(); removeToken(token); } else if ("add-file".equals(commandName)) {
SVNErrorMessage error = null; Exception errorCause = null; List items = readTuple("wl", false); String commandName = SVNReader.getString(items, 0); String template = (String) COMMANDS_MAP.get(commandName); List parameters = SVNReader.parseTuple(template, (Collection) items.get(1), null); try { processCommand(commandName, parameters); } catch (SVNException e) { error = e.getErrorMessage(); List items = readTuple("wl", false); String command = SVNReader.getString(items, 0); myDone = "abort-edit".equals(command) || "success".equals(command);
public void update(long revision, String target, SVNDepth depth, boolean sendCopyFromArgs, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException { boolean hasTarget = target != null; target = target == null ? "" : target; boolean recursive = getRecurseFromDepth(depth); editor = getDepthFilterEditor(editor, depth, hasTarget); Object[] buffer = new Object[]{"update", getRevisionObject(revision), target, Boolean.valueOf(recursive), SVNDepth.asString(depth), Boolean.valueOf(sendCopyFromArgs)}; try { openConnection(); write("(w((n)swww))", buffer); authenticate(); reporter.report(this); authenticate(); SVNEditModeReader editReader = new SVNEditModeReader(myConnection, editor, false); editReader.driveEditor(); read("", null, false); } catch (SVNException e) { closeSession(); throw e; } finally { closeConnection(); } }
public void update(long revision, String target, SVNDepth depth, boolean sendCopyFromArgs, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException { boolean hasTarget = target != null; target = target == null ? "" : target; boolean recursive = getRecurseFromDepth(depth); editor = getDepthFilterEditor(editor, depth, hasTarget); Object[] buffer = new Object[]{"update", getRevisionObject(revision), target, Boolean.valueOf(recursive), SVNDepth.asString(depth), Boolean.valueOf(sendCopyFromArgs)}; try { openConnection(); write("(w((n)swww))", buffer); authenticate(); reporter.report(this); authenticate(); SVNEditModeReader editReader = new SVNEditModeReader(myConnection, editor, false); editReader.driveEditor(); read("", null, false); } catch (SVNException e) { closeSession(); throw e; } finally { closeConnection(); } }
public void update(long revision, String target, SVNDepth depth, boolean sendCopyFromArgs, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException { boolean hasTarget = target != null; target = target == null ? "" : target; boolean recursive = getRecurseFromDepth(depth); editor = getDepthFilterEditor(editor, depth, hasTarget); Object[] buffer = new Object[]{"update", getRevisionObject(revision), target, Boolean.valueOf(recursive), SVNDepth.asString(depth), Boolean.valueOf(sendCopyFromArgs)}; try { openConnection(); write("(w((n)swww))", buffer); authenticate(); reporter.report(this); authenticate(); SVNEditModeReader editReader = new SVNEditModeReader(myConnection, editor, false); editReader.driveEditor(); read("", null, false); } catch (SVNException e) { closeSession(); throw e; } finally { closeConnection(); } }
public void diff(SVNURL url, long targetRevision, long revision, String target, boolean ignoreAncestry, SVNDepth depth, boolean getContents, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException { boolean recursive = getRecurseFromDepth(depth); boolean hasTarget = target != null; target = target == null ? "" : target; if (url == null) { SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.BAD_URL, "URL can not be NULL"), SVNLogType.NETWORK); } editor = getDepthFilterEditor(editor, depth, hasTarget); Object[] buffer = new Object[]{"diff", getRevisionObject(targetRevision), target, Boolean.valueOf(recursive), Boolean.valueOf(ignoreAncestry), url.toString(), Boolean.valueOf(getContents), SVNDepth.asString(depth)}; try { openConnection(); write("(w((n)swwsww))", buffer); authenticate(); reporter.report(this); authenticate(); SVNEditModeReader editReader = new SVNEditModeReader(myConnection, editor, false); editReader.driveEditor(); read("", null, false); } catch (SVNException e) { closeSession(); throw e; } finally { closeConnection(); } }
public void diff(SVNURL url, long targetRevision, long revision, String target, boolean ignoreAncestry, SVNDepth depth, boolean getContents, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException { boolean recursive = getRecurseFromDepth(depth); boolean hasTarget = target != null; target = target == null ? "" : target; if (url == null) { SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.BAD_URL, "URL can not be NULL"), SVNLogType.NETWORK); } editor = getDepthFilterEditor(editor, depth, hasTarget); Object[] buffer = new Object[]{"diff", getRevisionObject(targetRevision), target, Boolean.valueOf(recursive), Boolean.valueOf(ignoreAncestry), url.toString(), Boolean.valueOf(getContents), SVNDepth.asString(depth)}; try { openConnection(); write("(w((n)swwsww))", buffer); authenticate(); reporter.report(this); authenticate(); SVNEditModeReader editReader = new SVNEditModeReader(myConnection, editor, false); editReader.driveEditor(); read("", null, false); } catch (SVNException e) { closeSession(); throw e; } finally { closeConnection(); } }
public void status(long revision, String target, SVNDepth depth, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException { boolean recursive = getRecurseFromDepth(depth); boolean hasTarget = target != null; target = target == null ? "" : target; editor = getDepthFilterEditor(editor, depth, hasTarget); Object[] buffer = new Object[]{"status", target, Boolean.valueOf(recursive), getRevisionObject(revision), SVNDepth.asString(depth)}; try { openConnection(); write("(w(sw(n)w))", buffer); authenticate(); reporter.report(this); authenticate(); SVNEditModeReader editReader = new SVNEditModeReader(myConnection, editor, false); editReader.driveEditor(); read("", null, false); } catch (SVNException e) { closeSession(); throw e; } finally { closeConnection(); } }
public void status(long revision, String target, SVNDepth depth, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException { boolean recursive = getRecurseFromDepth(depth); boolean hasTarget = target != null; target = target == null ? "" : target; editor = getDepthFilterEditor(editor, depth, hasTarget); Object[] buffer = new Object[]{"status", target, Boolean.valueOf(recursive), getRevisionObject(revision), SVNDepth.asString(depth)}; try { openConnection(); write("(w(sw(n)w))", buffer); authenticate(); reporter.report(this); authenticate(); SVNEditModeReader editReader = new SVNEditModeReader(myConnection, editor, false); editReader.driveEditor(); read("", null, false); } catch (SVNException e) { closeSession(); throw e; } finally { closeConnection(); } }
public void status(long revision, String target, SVNDepth depth, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException { boolean recursive = getRecurseFromDepth(depth); boolean hasTarget = target != null; target = target == null ? "" : target; editor = getDepthFilterEditor(editor, depth, hasTarget); Object[] buffer = new Object[]{"status", target, Boolean.valueOf(recursive), getRevisionObject(revision), SVNDepth.asString(depth)}; try { openConnection(); write("(w(sw(n)w))", buffer); authenticate(); reporter.report(this); authenticate(); SVNEditModeReader editReader = new SVNEditModeReader(myConnection, editor, false); editReader.driveEditor(); read("", null, false); } catch (SVNException e) { closeSession(); throw e; } finally { closeConnection(); } }
public void diff(SVNURL url, long targetRevision, long revision, String target, boolean ignoreAncestry, SVNDepth depth, boolean getContents, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException { boolean recursive = getRecurseFromDepth(depth); boolean hasTarget = target != null; target = target == null ? "" : target; if (url == null) { SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.BAD_URL, "URL can not be NULL"), SVNLogType.NETWORK); } editor = getDepthFilterEditor(editor, depth, hasTarget); Object[] buffer = new Object[]{"diff", getRevisionObject(targetRevision), target, Boolean.valueOf(recursive), Boolean.valueOf(ignoreAncestry), url.toString(), Boolean.valueOf(getContents), SVNDepth.asString(depth)}; try { openConnection(); write("(w((n)swwsww))", buffer); authenticate(); reporter.report(this); authenticate(); SVNEditModeReader editReader = new SVNEditModeReader(myConnection, editor, false); editReader.driveEditor(); read("", null, false); } catch (SVNException e) { closeSession(); throw e; } finally { closeConnection(); } }
public void update(SVNURL url, long revision, String target, SVNDepth depth, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException { boolean recursive = getRecurseFromDepth(depth); boolean hasTarget = target != null; target = target == null ? "" : target; if (url == null) { SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.BAD_URL, "URL can not be NULL"), SVNLogType.NETWORK); } editor = getDepthFilterEditor(editor, depth, hasTarget); Object[] buffer = new Object[]{"switch", getRevisionObject(revision), target, Boolean.valueOf(recursive), url.toString(), SVNDepth.asString(depth)}; try { openConnection(); write("(w((n)swsw))", buffer); authenticate(); reporter.report(this); authenticate(); SVNEditModeReader editReader = new SVNEditModeReader(myConnection, editor, false); editReader.driveEditor(); read("", null, false); } catch (SVNException e) { closeSession(); throw e; } finally { closeConnection(); } }