private void checkoutResource(DAVResource resource, boolean allow404) throws SVNException { if (resource.getWorkingURL() != null) { return; } HTTPStatus status = myConnection.doCheckout(myActivity, resource.getURL(), resource.getVersionURL(), allow404); if (allow404 && status.getCode() == 404) { resource.fetchVersionURL(true); status = myConnection.doCheckout(myActivity, resource.getURL(), resource.getVersionURL(), 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); } resource.setWorkingURL(location); } }
private void checkoutResource(DAVResource resource, boolean allow404) throws SVNException { if (resource.getWorkingURL() != null) { return; } HTTPStatus status = null; try { status = myConnection.doCheckout(myActivity, resource.getURL(), resource.getVersionURL(), allow404); if (allow404 && status.getCode() == 404) { resource.fetchVersionURL(null, true); status = myConnection.doCheckout(myActivity, resource.getURL(), resource.getVersionURL(), false); } } catch (SVNException e) { if (e.getErrorMessage().getErrorCode() == SVNErrorCode.FS_CONFLICT) { String path = resource.getPath(); if ("".equals(path)) { path = resource.getURL(); } SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CONFLICT, "File or directory ''{0}'' is out of date; try updating", path); SVNErrorManager.error(err, e.getErrorMessage(), SVNLogType.NETWORK); } throw e; } String location = status != null ? status.getHeader().getFirstHeaderValue(HTTPHeader.LOCATION_HEADER) : null; if (location == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "The CHECKOUT response did not contain a 'Location:' header"); SVNErrorManager.error(err, SVNLogType.NETWORK); } resource.setWorkingURL(location); }
private void checkoutResource(DAVResource resource, boolean allow404) throws SVNException { if (resource.getWorkingURL() != null) { return; } HTTPStatus status = null; try { status = myConnection.doCheckout(myActivity, resource.getURL(), resource.getVersionURL(), allow404); if (allow404 && status.getCode() == 404) { resource.fetchVersionURL(null, true); status = myConnection.doCheckout(myActivity, resource.getURL(), resource.getVersionURL(), false); } } catch (SVNException e) { if (e.getErrorMessage().getErrorCode() == SVNErrorCode.FS_CONFLICT) { String path = resource.getPath(); if ("".equals(path)) { path = resource.getURL(); } SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CONFLICT, "File or directory ''{0}'' is out of date; try updating", path); SVNErrorManager.error(err, e.getErrorMessage(), SVNLogType.NETWORK); } throw e; } String location = status != null ? status.getHeader().getFirstHeaderValue(HTTPHeader.LOCATION_HEADER) : null; if (location == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "The CHECKOUT response did not contain a 'Location:' header"); SVNErrorManager.error(err, SVNLogType.NETWORK); } resource.setWorkingURL(location); }
private void checkoutResource(DAVResource resource, boolean allow404) throws SVNException { if (resource.getWorkingURL() != null) { return; } HTTPStatus status = null; try { status = myConnection.doCheckout(myActivity, resource.getURL(), resource.getVersionURL(), allow404); if (allow404 && status.getCode() == 404) { resource.fetchVersionURL(null, true); status = myConnection.doCheckout(myActivity, resource.getURL(), resource.getVersionURL(), false); } } catch (SVNException e) { if (e.getErrorMessage().getErrorCode() == SVNErrorCode.FS_CONFLICT) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CONFLICT, "File or directory ''{0}'' is out of date; try updating", resource.getPath()); SVNErrorManager.error(err, e.getErrorMessage(), SVNLogType.NETWORK); } throw e; } String location = status != null ? status.getHeader().getFirstHeaderValue(HTTPHeader.LOCATION_HEADER) : null; if (location == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "The CHECKOUT response did not contain a 'Location:' header"); SVNErrorManager.error(err, SVNLogType.NETWORK); } resource.setWorkingURL(location); }
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; }
String head = DAVUtil.getPropertyValue(myConnection, vcc, null, DAVElement.CHECKED_IN); try { status = myConnection.doCheckout(activity, null, head, false); break; } catch (SVNException svne) {
String head = DAVUtil.getPropertyValue(myConnection, vcc, null, DAVElement.CHECKED_IN); try { status = myConnection.doCheckout(activity, null, head, false); break; } catch (SVNException svne) {
String head = DAVUtil.getPropertyValue(myConnection, vcc, null, DAVElement.CHECKED_IN); try { status = myConnection.doCheckout(activity, null, head, false); break; } catch (SVNException svne) {