DAVConnection connection = getConnection(); if (revision != -2) { DAVBaselineInfo info = DAVUtil.getBaselineInfo(connection, this, path, revision, false, true, null); path = SVNPathUtil.append(info.baselineBase, info.baselinePath); fileRevision = info.revision; DAVProperties props = DAVUtil.getResourceProperties(connection, path, null, null); DAVUtil.filterProperties(props, properties); for (Iterator names = props.getProperties().keySet().iterator(); names.hasNext();) { DAVElement property = (DAVElement) names.next(); DAVUtil.setSpecialWCProperties(properties, property, props.getPropertyValue(property));
public static String getVCCPath(DAVConnection connection, DAVRepository repository, String path) throws SVNException { DAVProperties properties = findStartingProperties(connection, repository, path); String vcc = properties.getPropertyValue(DAVElement.VERSION_CONTROLLED_CONFIGURATION); if (vcc == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "The VCC property was not found on the resource"); SVNErrorManager.error(err); } return vcc; }
public Map getRevisionProperties(long revision, Map properties) throws SVNException { properties = properties == null ? new HashMap() : properties; try { openConnection(); String path = getLocation().getPath(); path = SVNEncodingUtil.uriEncode(path); DAVProperties source = DAVUtil.getBaselineProperties(myConnection, this, path, revision, null); properties = DAVUtil.filterProperties(source, properties); if (revision >= 0) { String commitMessage = (String) properties.get(SVNRevisionProperty.LOG); getOptions().saveCommitMessage(DAVRepository.this, revision, commitMessage); } } finally { closeConnection(); } return properties; }
public void fetchVersionURL(boolean force) throws SVNException { if (!force && getVersionURL() != null) { return; } // now from server. String path = myURL; if (myRevision >= 0) { // get baseline collection url for revision from public url. DAVBaselineInfo info = DAVUtil.getBaselineInfo(myConnection, null, path, myRevision, false, false, null); path = SVNPathUtil.append(info.baselineBase, info.baselinePath); } // get "checked-in" property from baseline collection or from HEAD, this will be vURL. // this shouldn't be called for copied urls. myVURL = DAVUtil.getPropertyValue(myConnection, path, null, DAVElement.CHECKED_IN); }
public static DAVBaselineInfo getStableURL(DAVConnection connection, DAVRepository repos, String path, long revision, boolean includeType, boolean includeRevision, DAVBaselineInfo info) throws SVNException { if (connection.hasHttpV2Support()) { info = info == null ? new DAVBaselineInfo() : info; if (SVNRevision.isValidRevisionNumber(revision)) { info.revision = revision; } else { info.revision = getLatestRevisionHttpV2(connection); } info.baselineBase = SVNPathUtil.append(connection.myRevRootStub, String.valueOf(info.revision)); info.baselinePath = connection.getRelativePath(path); return info; } else { return getBaselineInfo(connection, repos, path, revision, includeType, includeRevision, info); } }
DAVConnection connection = getConnection(); if (revision != -2) { DAVBaselineInfo info = DAVUtil.getStableURL(connection, this, path, revision, false, true, null); path = SVNPathUtil.append(info.baselineBase, info.baselinePath); fileRevision = info.revision; DAVProperties props = DAVUtil.getResourceProperties(connection, path, null, null); DAVUtil.filterProperties(props, properties); for (Iterator names = props.getProperties().keySet().iterator(); names.hasNext();) { DAVElement property = (DAVElement) names.next(); DAVUtil.setSpecialWCProperties(properties, property, props.getPropertyValue(property), false);
public static DAVProperties getBaselineProperties(DAVConnection connection, DAVRepository repos, String path, long revision, DAVElement[] elements) throws SVNException { DAVProperties properties = null; String loppedPath = ""; properties = findStartingProperties(connection, repos, path); String vcc = properties.getPropertyValue(DAVElement.VERSION_CONTROLLED_CONFIGURATION); if (vcc == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "The VCC property was not found on the resource"); SVNErrorManager.error(err); } loppedPath = properties.getLoppedPath(); String baselineRelativePath = properties.getPropertyValue(DAVElement.BASELINE_RELATIVE_PATH); if (baselineRelativePath == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "The relative-path property was not found on the resource"); SVNErrorManager.error(err); } baselineRelativePath = SVNEncodingUtil.uriEncode(baselineRelativePath); baselineRelativePath = SVNPathUtil.append(baselineRelativePath, loppedPath); String label = null; if (revision < 0) { vcc = getPropertyValue(connection, vcc, null, DAVElement.CHECKED_IN); } else { label = Long.toString(revision); } properties = getResourceProperties(connection, vcc, label, elements); properties.setURL(baselineRelativePath); return properties; }
final String fullPath = path; if (revision >= 0) { DAVBaselineInfo info = DAVUtil.getBaselineInfo(myConnection, this, path, revision, false, true, null); path = SVNPathUtil.append(info.baselineBase, info.baselinePath); DAVElement.CREATOR_DISPLAY_NAME, DAVElement.CREATION_DATE}; Map dirEntsMap = new HashMap(); HTTPStatus status = DAVUtil.getProperties(myConnection, path, DAVUtil.DEPTH_ONE, null, dirProperties, dirEntsMap); if (status.getError() != null) { SVNErrorManager.error(status.getError()); } else if (entry.getDate() != null) { final SVNDirEntry currentEntry = entry; String commitMessage = DAVUtil.getPropertyValue(myConnection, vcc, label, logProperty); getOptions().saveCommitMessage(DAVRepository.this, currentEntry.getRevision(), commitMessage); currentEntry.setCommitMessage(commitMessage);
if (httpV2Enabled) { if (revision < 0) { revision = getLatestRevisionHttpV2(connection); return getResourceProperties(connection, propFindPath, String.valueOf(SVNRepository.INVALID_REVISION), elements); } else { DAVProperties properties = null; properties = findStartingProperties(connection, repos, path); SVNPropertyValue vccValue = properties.getPropertyValue(DAVElement.VERSION_CONTROLLED_CONFIGURATION); if (vccValue == null) { String vcc = vccValue.getString(); if (revision < 0) { vcc = getPropertyValue(connection, vcc, null, DAVElement.CHECKED_IN); } else { label = Long.toString(revision); properties = getResourceProperties(connection, vcc, label, elements); properties.setURL(baselineRelativePath); return properties;
path = SVNEncodingUtil.uriEncode(path); if (revision != -2) { DAVBaselineInfo info = DAVUtil.getBaselineInfo(myConnection, this, path, revision, false, true, null); path = SVNPathUtil.append(info.baselineBase, info.baselinePath); fileRevision = info.revision; DAVProperties props = DAVUtil.getResourceProperties(myConnection, path, null, null); DAVUtil.filterProperties(props, properties); for (Iterator names = props.getProperties().keySet().iterator(); names.hasNext();) { DAVElement property = (DAVElement) names.next();
public void linkPath(SVNURL url, String path, String lockToken, long revision, SVNDepth depth, boolean startEmpty) throws SVNException { Map attrs = new SVNHashMap(); attrs.put(REVISION_ATTR, String.valueOf(revision)); attrs.put("depth", SVNDepth.asString(depth)); if (lockToken != null) { if (lockTokens != null) { lockTokens.put(path, lockToken); } attrs.put("lock-token", lockToken); } if (startEmpty) { attrs.put("start-empty", Boolean.TRUE.toString()); } String linkedPath = url.getURIEncodedPath(); DAVBaselineInfo info = DAVUtil.getBaselineInfo(connection, null, linkedPath, revision, false, false, null); linkedPath = SVNEncodingUtil.uriDecode(info.baselinePath); if (!linkedPath.startsWith("/")) { linkedPath = "/" + linkedPath; } attrs.put("linkpath", linkedPath); SVNXMLUtil.openCDataTag(SVNXMLUtil.SVN_NAMESPACE_PREFIX, "entry", path, attrs, report); }
public static DAVBaselineInfo getBaselineInfo(DAVConnection connection, DAVRepository repos, String path, long revision, boolean includeType, boolean includeRevision, DAVBaselineInfo info) throws SVNException { DAVElement[] properties = includeRevision ? DAVElement.BASELINE_PROPERTIES : new DAVElement[] {DAVElement.BASELINE_COLLECTION}; DAVProperties baselineProperties = getBaselineProperties(connection, repos, path, revision, properties); Map propsMap = new HashMap(); path = SVNPathUtil.append(info.baselineBase, info.baselinePath); HTTPStatus status = getProperties(connection, path, 0, null, new DAVElement[] {DAVElement.RESOURCE_TYPE}, propsMap); if (status.getError() != null) { SVNErrorManager.error(status.getError());
if (revision >= 0) { try { DAVBaselineInfo info = DAVUtil.getBaselineInfo(myConnection, this, path, revision, false, true, null); path = SVNPathUtil.append(info.baselineBase, info.baselinePath); } catch (SVNException e) { HTTPStatus status = DAVUtil.getProperties(myConnection, path, 0, null, elements, propsMap); if (status.getError() != null) { if (status.getError().getErrorCode() == SVNErrorCode.RA_DAV_PATH_NOT_FOUND) {
public static DAVProperties getStartingProperties(DAVConnection connection, String path, String label) throws SVNException { return getResourceProperties(connection, path, label, DAVElement.STARTING_PROPERTIES); }
private String getReportTarget(DAVConnection connection) throws SVNException { if (isHttpV2Enabled()) { return connection.getMeResource(); } else { String bcPath = getLocation().getURIEncodedPath(); return DAVUtil.getVCCPath(connection, this, bcPath); } }
if (myMediator != null && DAVUtil.isUseDAVWCURL()) { SVNPropertyValue value = myMediator.getWorkspaceProperty(SVNEncodingUtil.uriDecode(myPath), SVNProperty.WC_URL); myVURL = value == null ? null : value.getString(); if (myRevision >= 0) { DAVBaselineInfo info = DAVUtil.getBaselineInfo(myConnection, null, path, myRevision, false, false, null); path = SVNPathUtil.append(info.baselineBase, info.baselinePath); myVURL = DAVUtil.getPropertyValue(myConnection, path, null, DAVElement.CHECKED_IN); } catch (SVNException e) { if (e.getErrorMessage().getErrorCode() == SVNErrorCode.RA_DAV_PROPS_NOT_FOUND){ SVNPropertyValue urlPropertyValue = DAVUtil.isUseDAVWCURL() ? SVNPropertyValue.create(myVURL) : null; myMediator.setWorkspaceProperty(SVNEncodingUtil.uriDecode(myPath), SVNProperty.WC_URL, urlPropertyValue);
DAVConnection connection = getConnection(); if (revision >= 0) { DAVBaselineInfo info = DAVUtil.getStableURL(connection, this, path, revision, false, true, null); path = SVNPathUtil.append(info.baselineBase, info.baselinePath); DAVElement.CREATOR_DISPLAY_NAME, DAVElement.CREATION_DATE}; Map dirEntsMap = new SVNHashMap(); HTTPStatus status = DAVUtil.getProperties(connection, path, DAVUtil.DEPTH_ONE, null, dirProperties, dirEntsMap); if (status.getError() != null) { SVNErrorManager.error(status.getError(), SVNLogType.NETWORK); String commitMessage = null; try { commitMessage = DAVUtil.getPropertyValue(connection, vcc, label, logProperty); } catch (SVNException e) { if (e.getErrorMessage().getErrorCode() != SVNErrorCode.RA_DAV_PROPS_NOT_FOUND) {
SVNErrorMessage err = null; try { DAVUtil.getResourceProperties(myConnection, filePath, null, DAVElement.STARTING_PROPERTIES); } catch (SVNException e) { if (e.getErrorMessage() == null) { copyPath = myRepository.getFullPath(copyPath); copyPath = SVNEncodingUtil.uriEncode(copyPath); DAVBaselineInfo info = DAVUtil.getBaselineInfo(myConnection, myRepository, copyPath, copyRevision, false, false, null); copyPath = SVNPathUtil.append(info.baselineBase, info.baselinePath);
if (myMediator != null && DAVUtil.isUseDAVWCURL()) { SVNPropertyValue value = myMediator.getWorkspaceProperty(SVNEncodingUtil.uriDecode(myPath), SVNProperty.WC_URL); myVURL = value == null ? null : value.getString(); if (myRevision >= 0) { DAVBaselineInfo info = DAVUtil.getStableURL(myConnection, null, path, myRevision, false, false, null); path = SVNPathUtil.append(info.baselineBase, info.baselinePath); myVURL = DAVUtil.getPropertyValue(myConnection, path, null, DAVElement.CHECKED_IN); } catch (SVNException e) { if (e.getErrorMessage().getErrorCode() == SVNErrorCode.RA_DAV_PROPS_NOT_FOUND){ SVNPropertyValue urlPropertyValue = DAVUtil.isUseDAVWCURL() ? SVNPropertyValue.create(myVURL) : null; myMediator.setWorkspaceProperty(SVNEncodingUtil.uriDecode(myPath), SVNProperty.WC_URL, urlPropertyValue);
public static DAVProperties getResourceProperties(DAVConnection connection, String path, String label, DAVElement[] properties) throws SVNException { Map resultMap = new HashMap(); HTTPStatus status = getProperties(connection, path, DEPTH_ZERO, label, properties, resultMap); if (status.getError() != null) { SVNErrorManager.error(status.getError()); } if (label != null || true) { if (!resultMap.isEmpty()) { return (DAVProperties) resultMap.values().iterator().next(); } } else { if (resultMap.containsKey(path)) { return (DAVProperties) resultMap.get(path); } } label = label == null ? "NULL" : label; SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "Failed to find label ''{0}'' for URL ''{1}''", new Object[] {label, path}); SVNErrorManager.error(err); return null; }