public static byte[] getTreeConflictRawData(Map conflicts) throws SVNException { if (conflicts == null) { return null; } SVNConflictVersion nullVersion = new SVNConflictVersion(null, null, SVNRepository.INVALID_REVISION, SVNNodeKind.UNKNOWN); SVNSkel skel = SVNSkel.createEmptyList(); for (Iterator iterator = conflicts.values().iterator(); iterator.hasNext();) { SVNTreeConflictDescription conflict = (SVNTreeConflictDescription) iterator.next(); SVNSkel conflictSkel = getConflictSkel(nullVersion, conflict); if (!isValidConflict(conflictSkel)) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Failed to create valid conflict description skel: ''{0}''", skel.toString()); SVNErrorManager.error(error, SVNLogType.WC); } skel.prepend(conflictSkel); } return skel.unparse(); }
public static byte[] getSingleTreeConflictRawData(SVNTreeConflictDescription conflict) throws SVNException { SVNConflictVersion nullVersion = new SVNConflictVersion(null, null, SVNRepository.INVALID_REVISION, SVNNodeKind.UNKNOWN); SVNSkel conflictSkel = getConflictSkel(nullVersion, conflict); if (!isValidConflict(conflictSkel)) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Failed to create valid conflict description skel: ''{0}''", conflictSkel.toString()); SVNErrorManager.error(error, SVNLogType.WC); } return conflictSkel.unparse(); }
conflictSkel.addChild(SVNSkel.createAtom("conflict")); if (!isValidConflict(conflictSkel)) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Failed to create valid conflict description skel: ''{0}''", skel.toString());
conflictSkel.addChild(SVNSkel.createAtom("conflict")); if (!isValidConflict(conflictSkel)) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Failed to create valid conflict description skel: ''{0}''", skel.toString());
private static SVNTreeConflictDescription readSingleTreeConflict(SVNSkel skel, File dirPath) throws SVNException { if (!isValidConflict(skel)) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Invalid conflict info in tree conflict description"); SVNErrorManager.error(error, SVNLogType.WC); } if (skel.getChild(1).getData().length == 0) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Empty \'victim\' field in tree conflict description"); SVNErrorManager.error(error, SVNLogType.WC); } String victimBasename = skel.getChild(1).getValue(); SVNNodeKind kind = getNodeKind(skel.getChild(2).getValue()); if (kind != SVNNodeKind.FILE && kind != SVNNodeKind.DIR) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Invalid \'node_kind\' field in tree conflict description"); SVNErrorManager.error(error, SVNLogType.WC); } SVNOperation operation = getOperation(skel.getChild(3).getValue()); SVNConflictAction action = getAction(skel.getChild(4).getValue()); SVNConflictReason reason = getConflictReason(skel.getChild(5).getValue()); SVNConflictVersion srcLeftVersion = readConflictVersion(skel.getChild(6)); SVNConflictVersion srcRightVersion = readConflictVersion(skel.getChild(7)); return new SVNTreeConflictDescription(new File(dirPath, victimBasename), kind, action, reason, operation, srcLeftVersion, srcRightVersion); }
public static SVNTreeConflictDescription readSingleTreeConflict(SVNSkel skel, File dirPath) throws SVNException { if (!isValidConflict(skel)) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Invalid conflict info in tree conflict description"); SVNErrorManager.error(error, SVNLogType.WC); } if (skel.getChild(1).getData().length == 0) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Empty \'victim\' field in tree conflict description"); SVNErrorManager.error(error, SVNLogType.WC); } String victimBasename = skel.getChild(1).getValue(); SVNNodeKind kind = getNodeKind(skel.getChild(2).getValue()); if (kind != SVNNodeKind.FILE && kind != SVNNodeKind.DIR) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Invalid \'node_kind\' field in tree conflict description"); SVNErrorManager.error(error, SVNLogType.WC); } SVNOperation operation = getOperation(skel.getChild(3).getValue()); SVNConflictAction action = getAction(skel.getChild(4).getValue()); SVNConflictReason reason = getConflictReason(skel.getChild(5).getValue()); SVNConflictVersion srcLeftVersion = readConflictVersion(skel.getChild(6)); SVNConflictVersion srcRightVersion = readConflictVersion(skel.getChild(7)); return new SVNTreeConflictDescription(new File(dirPath, victimBasename), kind, action, reason, operation, srcLeftVersion, srcRightVersion); }
private static SVNTreeConflictDescription readSingleTreeConflict(SVNSkel skel, File dirPath) throws SVNException { if (!isValidConflict(skel)) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Invalid conflict info in tree conflict description"); SVNErrorManager.error(error, SVNLogType.WC); } if (skel.getChild(1).getData().length == 0) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Empty \'victim\' field in tree conflict description"); SVNErrorManager.error(error, SVNLogType.WC); } String victimBasename = skel.getChild(1).getValue(); SVNNodeKind kind = getNodeKind(skel.getChild(2).getValue()); if (kind != SVNNodeKind.FILE && kind != SVNNodeKind.DIR) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Invalid \'node_kind\' field in tree conflict description"); SVNErrorManager.error(error, SVNLogType.WC); } SVNOperation operation = getOperation(skel.getChild(3).getValue()); SVNConflictAction action = getAction(skel.getChild(4).getValue()); SVNConflictReason reason = getConflictReason(skel.getChild(5).getValue()); SVNConflictVersion srcLeftVersion = readConflictVersion(skel.getChild(6)); SVNConflictVersion srcRightVersion = readConflictVersion(skel.getChild(7)); return new SVNTreeConflictDescription(new File(dirPath, victimBasename), kind, action, reason, operation, srcLeftVersion, srcRightVersion); }