private static boolean isValidConflict(SVNSkel skel) throws SVNException { if (skel.getListSize() != 8 || !skel.getChild(0).contentEquals("conflict")) { return false; } for (int i = 1; i < 6; i++) { SVNSkel element = skel.getChild(i); if (!element.isAtom()) { return false; } } return isValidVersionInfo(skel.getChild(6)) && isValidVersionInfo(skel.getChild(7)); }
private static boolean isValidConflict(SVNSkel skel) throws SVNException { if (skel.getListSize() != 8 || !skel.getChild(0).contentEquals("conflict")) { return false; } for (int i = 1; i < 6; i++) { SVNSkel element = skel.getChild(i); if (!element.isAtom()) { return false; } } return isValidVersionInfo(skel.getChild(6)) && isValidVersionInfo(skel.getChild(7)); }
private static boolean isValidConflict(SVNSkel skel) throws SVNException { if (skel == null) { return false; } if (skel.getListSize() != 8 || !skel.getChild(0).contentEquals("conflict")) { return false; } for (int i = 1; i < 6; i++) { SVNSkel element = skel.getChild(i); if (!element.isAtom()) { return false; } } return isValidVersionInfo(skel.getChild(6)) && isValidVersionInfo(skel.getChild(7)); }
private static SVNConflictVersion readConflictVersion(SVNSkel skel) throws SVNException { if (!isValidVersionInfo(skel)) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Invalid version info in tree conflict description"); SVNErrorManager.error(error, SVNLogType.WC); } String repoURLString = skel.getChild(1).getValue(); SVNURL repoURL = repoURLString.length() == 0 ? null : SVNURL.parseURIEncoded(repoURLString); long pegRevision = Long.parseLong(skel.getChild(2).getValue()); String path = skel.getChild(3).getValue(); path = path.length() == 0 ? null : path; SVNNodeKind kind = getNodeKind(skel.getChild(4).getValue()); return new SVNConflictVersion(repoURL, path, pegRevision, kind); }
private static SVNConflictVersion readConflictVersion(SVNSkel skel) throws SVNException { if (!isValidVersionInfo(skel)) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Invalid version info in tree conflict description"); SVNErrorManager.error(error, SVNLogType.WC); } String repoURLString = skel.getChild(1).getValue(); SVNURL repoURL = repoURLString.length() == 0 ? null : SVNURL.parseURIEncoded(repoURLString); long pegRevision = Long.parseLong(skel.getChild(2).getValue()); String path = skel.getChild(3).getValue(); path = path.length() == 0 ? null : path; SVNNodeKind kind = getNodeKind(skel.getChild(4).getValue()); return new SVNConflictVersion(repoURL, path, pegRevision, kind); }
private static SVNConflictVersion readConflictVersion(SVNSkel skel) throws SVNException { if (!isValidVersionInfo(skel)) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Invalid version info in tree conflict description"); SVNErrorManager.error(error, SVNLogType.WC); } String repoURLString = skel.getChild(1).getValue(); SVNURL repoURL = repoURLString.length() == 0 ? null : SVNURL.parseURIEncoded(repoURLString); if (repoURL == null) { return null; } long pegRevision = Long.parseLong(skel.getChild(2).getValue()); String path = skel.getChild(3).getValue(); path = path.length() == 0 ? null : path; SVNNodeKind kind = getNodeKind(skel.getChild(4).getValue()); return new SVNConflictVersion(repoURL, path, pegRevision, kind); }
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; }