public static String getHumanReadableConflictVersion(SVNConflictVersion version) { if (version == null) { return "(none)"; } String url = version.getRepositoryRoot() != null ? version.getRepositoryRoot().toString() : null; if (url != null && version.getPath() != null) { url = url + "/" + version.getPath(); } else if (url != null) { url = url + "/..."; } else if (version.getPath() != null) { url = version.getPath(); } else { url = "..."; } return "(" + getNodeKindString(version.getKind()) + ") " + url + "@" + version.getPegRevision(); }
public static String getHumanReadableConflictVersion(SVNConflictVersion version) { String url = version.getRepositoryRoot() != null ? version.getRepositoryRoot().toString() : null; if (url != null && version.getPath() != null) { url = url + "/" + version.getPath(); } else if (url != null) { url = url + "/..."; } else if (version.getPath() != null) { url = version.getPath(); } else { url = "..."; } return "(" + getNodeKindString(version.getKind()) + ") " + url + "@" + version.getPegRevision(); }
public static String getHumanReadableConflictVersion(SVNConflictVersion version) { String url = version.getRepositoryRoot() != null ? version.getRepositoryRoot().toString() : null; if (url != null && version.getPath() != null) { url = url + "/" + version.getPath(); } else if (url != null) { url = url + "/..."; } else if (version.getPath() != null) { url = version.getPath(); } else { url = "..."; } return "(" + getNodeKindString(version.getKind()) + ") " + url + "@" + version.getPegRevision(); }
public static String getHumanReadableConflictDescription(SVNTreeConflictDescription treeConflict) { SVNNodeKind incomingKind = SVNNodeKind.UNKNOWN; if (treeConflict.getConflictAction() == SVNConflictAction.EDIT || treeConflict.getConflictAction() == SVNConflictAction.DELETE) { if (treeConflict.getSourceLeftVersion() != null) { incomingKind = treeConflict.getSourceLeftVersion().getKind(); } } else if (treeConflict.getConflictAction() == SVNConflictAction.ADD || treeConflict.getConflictAction() == SVNConflictAction.REPLACE) { if (treeConflict.getSourceRightVersion() != null) { incomingKind = treeConflict.getSourceRightVersion().getKind(); } } final String reasonStr = getReasonString(treeConflict); final String actionStr = getActionString(incomingKind, treeConflict); final String operationStr = treeConflict.getOperation().getName(); String kindWithSpaceStr = getNodeKindString(treeConflict.getNodeKind()); if (kindWithSpaceStr.length() > 0) { kindWithSpaceStr = kindWithSpaceStr + " "; } final String description = String.format("local %s%s, incoming %s upon %s", kindWithSpaceStr, reasonStr, actionStr, operationStr); return description; }
SVNErrorManager.error(error, SVNLogType.WC); conflictSkel.addChild(SVNSkel.createAtom(getNodeKindString(conflict.getNodeKind())));
SVNErrorManager.error(error, SVNLogType.WC); conflictSkel.addChild(SVNSkel.createAtom(getNodeKindString(conflict.getNodeKind())));
private static SVNSkel prependVersionInfo(SVNSkel parent, SVNConflictVersion versionInfo) throws SVNException { parent = parent == null ? SVNSkel.createEmptyList() : parent; SVNSkel skel = SVNSkel.createEmptyList(); skel.addChild(SVNSkel.createAtom(getNodeKindString(versionInfo.getKind()))); String path = versionInfo.getPath() == null ? "" : versionInfo.getPath(); skel.addChild(SVNSkel.createAtom(path)); skel.addChild(SVNSkel.createAtom(String.valueOf(versionInfo.getPegRevision()))); String repoURLString = versionInfo.getRepositoryRoot() == null ? "" : versionInfo.getRepositoryRoot().toString(); skel.addChild(SVNSkel.createAtom(repoURLString)); skel.addChild(SVNSkel.createAtom("version")); if (!isValidVersionInfo(skel)) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Failed to create valid conflict version skel: ''{0}''", skel.toString()); SVNErrorManager.error(error, SVNLogType.WC); } parent.addChild(skel); return parent; }
private static SVNSkel prependVersionInfo(SVNSkel parent, SVNConflictVersion versionInfo) throws SVNException { parent = parent == null ? SVNSkel.createEmptyList() : parent; SVNSkel skel = SVNSkel.createEmptyList(); skel.prepend(SVNSkel.createAtom(getNodeKindString(versionInfo.getKind()))); String path = versionInfo.getPath() == null ? "" : versionInfo.getPath(); skel.prepend(SVNSkel.createAtom(path)); skel.prepend(SVNSkel.createAtom(String.valueOf(versionInfo.getPegRevision()))); String repoURLString = versionInfo.getRepositoryRoot() == null ? "" : versionInfo.getRepositoryRoot().toString(); skel.prepend(SVNSkel.createAtom(repoURLString)); skel.prepend(SVNSkel.createAtom("version")); if (!isValidVersionInfo(skel)) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Failed to create valid conflict version skel: ''{0}''", skel.toString()); SVNErrorManager.error(error, SVNLogType.WC); } parent.prepend(skel); return parent; }
private static SVNSkel prependVersionInfo(SVNSkel parent, SVNConflictVersion versionInfo) throws SVNException { parent = parent == null ? SVNSkel.createEmptyList() : parent; SVNSkel skel = SVNSkel.createEmptyList(); skel.addChild(SVNSkel.createAtom(getNodeKindString(versionInfo.getKind()))); String path = versionInfo.getPath() == null ? "" : versionInfo.getPath(); skel.addChild(SVNSkel.createAtom(path)); skel.addChild(SVNSkel.createAtom(String.valueOf(versionInfo.getPegRevision()))); String repoURLString = versionInfo.getRepositoryRoot() == null ? "" : versionInfo.getRepositoryRoot().toString(); skel.addChild(SVNSkel.createAtom(repoURLString)); skel.addChild(SVNSkel.createAtom("version")); if (!isValidVersionInfo(skel)) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Failed to create valid conflict version skel: ''{0}''", skel.toString()); SVNErrorManager.error(error, SVNLogType.WC); } parent.addChild(skel); return parent; }
public static SVNSkel getConflictSkel(SVNConflictVersion nullVersion, SVNTreeConflictDescription conflict) throws SVNException { SVNSkel conflictSkel = SVNSkel.createEmptyList(); SVNConflictVersion sourceRightVersion = conflict.getSourceRightVersion(); sourceRightVersion = sourceRightVersion == null ? nullVersion : sourceRightVersion; prependVersionInfo(conflictSkel, sourceRightVersion); SVNConflictVersion sourceLeftVersion = conflict.getSourceLeftVersion(); sourceLeftVersion = sourceLeftVersion == null ? nullVersion : sourceLeftVersion; prependVersionInfo(conflictSkel, sourceLeftVersion); conflictSkel.prepend(SVNSkel.createAtom(conflict.getConflictReason().toString())); conflictSkel.prepend(SVNSkel.createAtom(conflict.getConflictAction().toString())); conflictSkel.prepend(SVNSkel.createAtom(conflict.getOperation().toString())); if (conflict.getNodeKind() != SVNNodeKind.DIR && conflict.getNodeKind() != SVNNodeKind.FILE) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Invalid \'node_kind\' field in tree conflict description"); SVNErrorManager.error(error, SVNLogType.WC); } conflictSkel.prepend(SVNSkel.createAtom(getNodeKindString(conflict.getNodeKind()))); String path = conflict.getPath().getName(); if (path.length() == 0) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Empty path basename in tree conflict description"); SVNErrorManager.error(error, SVNLogType.WC); } conflictSkel.prepend(SVNSkel.createAtom(path)); conflictSkel.prepend(SVNSkel.createAtom("conflict")); return conflictSkel; }