private void patchResourceProperties(String path, SVNProperties properties) throws SVNException { if (properties != null && properties.size() > 0) { final StringBuffer request = DAVProppatchHandler.generatePropertyRequest(null, properties); try { myConnection.doProppatch(null, path, request, null, null); } catch (SVNException e) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "applying log message to {0}", path); SVNErrorManager.error(err, SVNLogType.NETWORK); } } }
public void closeDir() throws SVNException { DAVResource resource = (DAVResource) myDirsStack.pop(); // do proppatch if there were property changes. if (resource.getProperties() != null) { StringBuffer request = DAVProppatchHandler.generatePropertyRequest(null, resource.getProperties()); myConnection.doProppatch(resource.getURL(), resource.getWorkingURL(), request, null, null); } resource.dispose(); }
public void closeDir() throws SVNException { DAVResource resource = (DAVResource) myDirsStack.pop(); // do proppatch if there were property changes. if (resource.getProperties() != null) { StringBuffer request = DAVProppatchHandler.generatePropertyRequest(null, resource.getProperties()); myConnection.doProppatch(resource.getURL(), resource.getWorkingURL(), request, null, null); } resource.dispose(); }
public void closeDir() throws SVNException { DAVResource resource = (DAVResource) myDirsStack.pop(); // do proppatch if there were property changes. if (resource.getProperties() != null) { StringBuffer request = DAVProppatchHandler.generatePropertyRequest(null, resource.getProperties()); myConnection.doProppatch(resource.getURL(), resource.getWorkingURL(), request, null, null); } resource.dispose(); }
public void closeDir() throws SVNException { DAVResource resource = (DAVResource) myDirsStack.pop(); // do proppatch if there were property changes. if (resource.getProperties() != null) { StringBuffer request = DAVProppatchHandler.generatePropertyRequest(null, resource.getProperties()); String propPatchTarget = myConnection.hasHttpV2Support() ? resource.getCustomURL() : resource.getWorkingURL(); myConnection.doProppatch(resource.getURL(), propPatchTarget, request, null, null); } resource.dispose(); }
public void closeFile(String path, String textChecksum) throws SVNException { // do PUT of delta if there was one (diff window + temp file). // do subsequent PUT of all diff windows... DAVResource currentFile = (DAVResource) myFilesMap.get(path); try { if (myDeltaFile != null) { InputStream combinedData = null; try { combinedData = new HTTPBodyInputStream(myDeltaFile); myConnection.doPutDiff(currentFile.getURL(), currentFile.getWorkingURL(), combinedData, myDeltaFile.length(), myBaseChecksum, textChecksum); } finally { SVNFileUtil.closeFile(combinedData); SVNFileUtil.deleteFile(myDeltaFile); myDeltaFile = null; } } // do proppatch if there were property changes. if (currentFile.getProperties() != null) { StringBuffer request = DAVProppatchHandler.generatePropertyRequest(null, currentFile.getProperties()); myConnection.doProppatch(currentFile.getURL(), currentFile.getWorkingURL(), request, null, null); } } finally { currentFile.dispose(); myCurrentDelta = null; myBaseChecksum = null; myFilesMap.remove(path); } }
public void closeFile(String path, String textChecksum) throws SVNException { // do PUT of delta if there was one (diff window + temp file). // do subsequent PUT of all diff windows... DAVResource currentFile = (DAVResource) myFilesMap.get(path); try { if (myDeltaFile != null) { InputStream combinedData = null; try { combinedData = new HTTPBodyInputStream(myDeltaFile); myConnection.doPutDiff(currentFile.getURL(), currentFile.getWorkingURL(), combinedData, myDeltaFile.length(), myBaseChecksum, textChecksum); } finally { SVNFileUtil.closeFile(combinedData); SVNFileUtil.deleteFile(myDeltaFile); myDeltaFile = null; } } // do proppatch if there were property changes. if (currentFile.getProperties() != null) { StringBuffer request = DAVProppatchHandler.generatePropertyRequest(null, currentFile.getProperties()); myConnection.doProppatch(currentFile.getURL(), currentFile.getWorkingURL(), request, null, null); } } finally { currentFile.dispose(); myCurrentDelta = null; myBaseChecksum = null; myFilesMap.remove(path); } }
public void closeFile(String path, String textChecksum) throws SVNException { // do PUT of delta if there was one (diff window + temp file). // do subsequent PUT of all diff windows... DAVResource currentFile = (DAVResource) myFilesMap.get(path); try { if (myDeltaFile != null) { InputStream combinedData = null; try { combinedData = new HTTPBodyInputStream(myDeltaFile); myConnection.doPutDiff(currentFile.getURL(), currentFile.getWorkingURL(), combinedData, myDeltaFile.length(), myBaseChecksum, textChecksum); } finally { SVNFileUtil.closeFile(combinedData); SVNFileUtil.deleteFile(myDeltaFile); myDeltaFile = null; } } // do proppatch if there were property changes. if (currentFile.getProperties() != null) { StringBuffer request = DAVProppatchHandler.generatePropertyRequest(null, currentFile.getProperties()); myConnection.doProppatch(currentFile.getURL(), currentFile.getWorkingURL(), request, null, null); } } finally { currentFile.dispose(); myCurrentDelta = null; myBaseChecksum = null; myFilesMap.remove(path); } }
public SVNCommitInfo closeEdit() throws SVNException { try { if (!myDirsStack.isEmpty()) { DAVResource resource = (DAVResource) myDirsStack.pop(); // do proppatch if there were property changes. if (resource.getProperties() != null) { StringBuffer request = DAVProppatchHandler.generatePropertyRequest(null, resource.getProperties()); myConnection.doProppatch(resource.getURL(), resource.getWorkingURL(), request, null, null); } resource.dispose(); } DAVMergeHandler handler = new DAVMergeHandler(myCommitMediator, myPathsMap); HTTPStatus status = myConnection.doMerge(myActivity, true, handler); if (status.getError() != null) { // DELETE shouldn't be called anymore if there is an error or MERGE. // calling abortEdit will do nothing on closeEdit failure now. myIsAborted = true; SVNErrorManager.error(status.getError()); } // abort edit will not be run if there was an error on MERGE. abortEdit(); return handler.getCommitInfo(); } finally { // always run close callback to 'unlock' SVNRepository. runCloseCallback(); } }
public SVNCommitInfo closeEdit() throws SVNException { try { if (!myDirsStack.isEmpty()) { DAVResource resource = (DAVResource) myDirsStack.pop(); // do proppatch if there were property changes. if (resource.getProperties() != null) { StringBuffer request = DAVProppatchHandler.generatePropertyRequest(null, resource.getProperties()); myConnection.doProppatch(resource.getURL(), resource.getWorkingURL(), request, null, null); } resource.dispose(); } DAVMergeHandler handler = new DAVMergeHandler(myCommitMediator, myPathsMap); HTTPStatus status = myConnection.doMerge(myActivity, true, handler); if (status.getError() != null) { // DELETE shouldn't be called anymore if there is an error or MERGE. // calling abortEdit will do nothing on closeEdit failure now. myIsAborted = true; SVNErrorManager.error(status.getError(), SVNLogType.NETWORK); } return handler.getCommitInfo(); } finally { // we should run abort edit if exception is thrown // abort edit will not be run if there was an error (from server side) on MERGE. abortEdit(); // always run close callback to 'unlock' SVNRepository. runCloseCallback(); } }
public SVNCommitInfo closeEdit() throws SVNException { try { if (!myDirsStack.isEmpty()) { DAVResource resource = (DAVResource) myDirsStack.pop(); // do proppatch if there were property changes. if (resource.getProperties() != null) { StringBuffer request = DAVProppatchHandler.generatePropertyRequest(null, resource.getProperties()); myConnection.doProppatch(resource.getURL(), resource.getWorkingURL(), request, null, null); } resource.dispose(); } DAVMergeHandler handler = new DAVMergeHandler(myCommitMediator, myPathsMap); HTTPStatus status = myConnection.doMerge(myActivity, true, handler); if (status.getError() != null) { // DELETE shouldn't be called anymore if there is an error or MERGE. // calling abortEdit will do nothing on closeEdit failure now. myIsAborted = true; SVNErrorManager.error(status.getError(), SVNLogType.NETWORK); } return handler.getCommitInfo(); } finally { // we should run abort edit if exception is thrown // abort edit will not be run if there was an error (from server side) on MERGE. abortEdit(); // always run close callback to 'unlock' SVNRepository. runCloseCallback(); } }
public void setRevisionPropertyValue(long revision, String propertyName, String propertyValue) throws SVNException { assertValidRevision(revision); StringBuffer request = DAVProppatchHandler.generatePropertyRequest(null, propertyName, propertyValue); try { openConnection(); // get baseline url and proppatch. DAVBaselineInfo info = DAVUtil.getBaselineInfo(myConnection, this, SVNEncodingUtil.uriEncode(getLocation().getPath()), revision, false, false, null); String path = SVNPathUtil.append(info.baselineBase, info.baselinePath); path = info.baseline; try { myConnection.doProppatch(null, path, request, null, null); } catch (SVNException e) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "DAV request failed; it's possible that the repository's " + "pre-rev-propchange hook either failed or is non-existent"); SVNErrorManager.error(err, e.getErrorMessage()); } } finally { closeConnection(); } }
StringBuffer request = DAVProppatchHandler.generatePropertyRequest(null, resource.getProperties()); String propPatchTarget = myConnection.hasHttpV2Support() ? resource.getCustomURL() : resource.getWorkingURL(); myConnection.doProppatch(resource.getURL(), propPatchTarget, request, null, null);
StringBuffer request = DAVProppatchHandler.generatePropertyRequest(null, currentFile.getProperties()); String propPatchTarget = myConnection.hasHttpV2Support() ? currentFile.getCustomURL() : currentFile.getWorkingURL(); myConnection.doProppatch(currentFile.getURL(), propPatchTarget, request, null, null);
private String createActivity(String logMessage) throws SVNException { String activity = myConnection.doMakeActivity(); // checkout head... String path = SVNEncodingUtil.uriEncode(myLocation.getPath()); String vcc = DAVUtil.getPropertyValue(myConnection, path, null, DAVElement.VERSION_CONTROLLED_CONFIGURATION); // TODO implement retry line in native subversion. String head = DAVUtil.getPropertyValue(myConnection, vcc, null, DAVElement.CHECKED_IN); HTTPStatus status = myConnection.doCheckout(activity, null, head, false); String location = status.getHeader().getFirstHeaderValue(HTTPHeader.LOCATION_HEADER); if (location == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "The CHECKOUT response did not contain a 'Location:' header"); SVNErrorManager.error(err); } // proppatch log message. logMessage = logMessage == null ? "" : logMessage; StringBuffer request = DAVProppatchHandler.generatePropertyRequest(null, SVNRevisionProperty.LOG, logMessage); SVNErrorMessage context = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "applying log message to {0}", path); try { myConnection.doProppatch(null, location, request, null, context); } catch (SVNException e) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "applying log message to {0}", path); SVNErrorManager.error(err); } return activity; }
myConnection.doProppatch(null, location, request, null, context); } catch (SVNException e) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "applying log message to {0}", path);
myConnection.doProppatch(null, location, request, null, context); } catch (SVNException e) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "applying log message to {0}", path);
SVNException e = null; try { connection.doProppatch(null, path, request, handler, null); } catch (SVNException x) { e = x;
SVNErrorMessage requestError = null; try { connection.doProppatch(null, path, request, handler, null); } catch (SVNException e) { requestError = e.getErrorMessage();
SVNErrorMessage requestError = null; try { connection.doProppatch(null, path, request, handler, null); } catch (SVNException e) { requestError = e.getErrorMessage();