xmlBuffer = SVNXMLUtil.addXMLHeader(xmlBuffer);
if (url.endsWith("/")) {
url = url.substring(0, url.length() - 1);
}
Map attrs = new SVNHashMap();
attrs.put("send-all", Boolean.toString(sendAll));
SVNXMLUtil.openNamespaceDeclarationTag(SVNXMLUtil.SVN_NAMESPACE_PREFIX, "update-report",
SVN_NAMESPACES_LIST, SVNXMLUtil.PREFIX_MAP, attrs, xmlBuffer, true);
SVNXMLUtil.openCDataTag(SVNXMLUtil.SVN_NAMESPACE_PREFIX, "src-path", url, xmlBuffer);
if (targetRevision >= 0) {
SVNXMLUtil.openCDataTag(SVNXMLUtil.SVN_NAMESPACE_PREFIX, "target-revision", String.valueOf(targetRevision), xmlBuffer);
}
if (target != null && !"".equals(target)) {
SVNXMLUtil.openCDataTag(SVNXMLUtil.SVN_NAMESPACE_PREFIX, "update-target", target, xmlBuffer);
}
if (dstPath != null) {
SVNXMLUtil.openCDataTag(SVNXMLUtil.SVN_NAMESPACE_PREFIX, "dst-path", dstPath, xmlBuffer);
}
if (depth == SVNDepth.FILES || depth == SVNDepth.EMPTY) {
SVNXMLUtil.openCDataTag(SVNXMLUtil.SVN_NAMESPACE_PREFIX, "recursive", "no", xmlBuffer);
}
SVNXMLUtil.openCDataTag(SVNXMLUtil.SVN_NAMESPACE_PREFIX, "depth", SVNDepth.asString(depth), xmlBuffer);
if (ignoreAncestry) {
SVNXMLUtil.openCDataTag(SVNXMLUtil.SVN_NAMESPACE_PREFIX, "ignore-ancestry", "yes", xmlBuffer);
}
if (sendCopyFromArgs) {
SVNXMLUtil.openCDataTag(SVNXMLUtil.SVN_NAMESPACE_PREFIX, "send-copyfrom-args", "yes", xmlBuffer);
}
if (resourceWalk) {
SVNXMLUtil.openCDataTag(SVNXMLUtil.SVN_NAMESPACE_PREFIX, "resource-walk", "yes", xmlBuffer);
}
if (sendAll && !fetchContents) {
SVNXMLUtil.openCDataTag(SVNXMLUtil.SVN_NAMESPACE_PREFIX, "text-deltas", "no", xmlBuffer);
}
final StringBuffer report = xmlBuffer;
reporterBaton.report(new ISVNReporter() {
public void setPath(String path, String lockToken, long revision, boolean startEmpty) throws SVNException {
setPath(path, lockToken, revision, SVNDepth.INFINITY, startEmpty);
}
public void deletePath(String path) {
SVNXMLUtil.openCDataTag(SVNXMLUtil.SVN_NAMESPACE_PREFIX, "missing", path, report);
}
public void linkPath(SVNURL url, String path, String lockToken, long revision, boolean startEmpty) throws SVNException {
linkPath(url, path, lockToken, revision, SVNDepth.INFINITY, startEmpty);
}
public void finishReport() {
}
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 void setPath(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());
}
SVNXMLUtil.openCDataTag(SVNXMLUtil.SVN_NAMESPACE_PREFIX, "entry", path, attrs, report);
}
public void abortReport() throws SVNException {