public static Map readTreeConflicts(File dirPath, byte[] conflictData) throws SVNException { Map conflicts = new SVNHashMap(); if (conflictData == null) { return conflicts; } SVNSkel skel = SVNSkel.parse(conflictData); if (skel == null || skel.isAtom()) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Error parsing tree conflict skel"); SVNErrorManager.error(error, SVNLogType.WC); } for (Iterator iterator = skel.getList().iterator(); iterator.hasNext();) { SVNSkel conflictSkel = (SVNSkel) iterator.next(); SVNTreeConflictDescription conflict = readSingleTreeConflict(conflictSkel, dirPath); if (conflict != null) { conflicts.put(conflict.getPath(), conflict); } } return conflicts; }
protected void recordTreeConflictOnAdd(File victim, SVNAdminArea adminArea, SVNNodeKind kind, SVNConflictAction action, SVNConflictReason reason) throws SVNException { if (myIsRecordOnly || myIsDryRun) { return; } SVNTreeConflictDescription conflict = makeTreeConflict(victim, kind, action, reason); SVNTreeConflictDescription existingConflict = myWCAccess.getTreeConflict(conflict.getPath()); if (existingConflict != null && existingConflict.getConflictAction() == SVNConflictAction.DELETE && conflict.getConflictAction() == SVNConflictAction.ADD) { adminArea.deleteTreeConflict(conflict.getPath().getName()); conflict = new SVNTreeConflictDescription(conflict.getPath(), conflict.getNodeKind(), SVNConflictAction.DELETE, existingConflict.getConflictReason(), conflict.getOperation(), existingConflict.getSourceLeftVersion(), conflict.getSourceRightVersion()); } adminArea.addTreeConflict(conflict); }
public static Map readTreeConflicts(File dirPath, byte[] conflictData) throws SVNException { Map conflicts = new SVNHashMap(); if (conflictData == null) { return conflicts; } SVNSkel skel = SVNSkel.parse(conflictData); if (skel == null || skel.isAtom()) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Error parsing tree conflict skel"); SVNErrorManager.error(error, SVNLogType.WC); } for (Iterator iterator = skel.getList().iterator(); iterator.hasNext();) { SVNSkel conflictSkel = (SVNSkel) iterator.next(); SVNTreeConflictDescription conflict = readSingleTreeConflict(conflictSkel, dirPath); if (conflict != null) { conflicts.put(conflict.getPath(), conflict); } } return conflicts; }
public static Map readTreeConflicts(File dirPath, byte[] conflictData) throws SVNException { Map conflicts = new SVNHashMap(); if (conflictData == null) { return conflicts; } SVNSkel skel = SVNSkel.parse(conflictData); if (skel == null || skel.isAtom()) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Error parsing tree conflict skel"); SVNErrorManager.error(error, SVNLogType.WC); } for (Iterator iterator = skel.getList().iterator(); iterator.hasNext();) { SVNSkel conflictSkel = (SVNSkel) iterator.next(); SVNTreeConflictDescription conflict = readSingleTreeConflict(conflictSkel, dirPath); if (conflict != null) { conflicts.put(conflict.getPath(), conflict); } } return conflicts; }
private static void bailOnTreeConflictedChildren(SVNWCContext context, File localAbsPath, SVNNodeKind kind, SVNDepth depth, Collection<String> changelistsSet) throws SVNException { if ((depth == SVNDepth.EMPTY) || (kind != SVNNodeKind.DIR)) { return; } Map<String, SVNTreeConflictDescription> conflicts = context.getDb().opReadAllTreeConflicts(localAbsPath); if (conflicts == null || conflicts.isEmpty()) { return; } for (SVNTreeConflictDescription conflict : conflicts.values()) { if ((conflict.getNodeKind() == SVNNodeKind.DIR) && (depth == SVNDepth.FILES)) { continue; } if (!context.isChangelistMatch(localAbsPath, changelistsSet)) { continue; } SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.WC_FOUND_CONFLICT, "Aborting commit: ''{0}'' remains in conflict", conflict.getPath()); SVNErrorManager.error(err, SVNLogType.WC); } }
protected void recordTreeConflictOnAdd(File victim, SVNAdminArea adminArea, SVNNodeKind kind, SVNConflictAction action, SVNConflictReason reason) throws SVNException { if (myIsRecordOnly || myIsDryRun) { return; } SVNTreeConflictDescription conflict = makeTreeConflict(victim, kind, action, reason); SVNTreeConflictDescription existingConflict = myWCAccess.getTreeConflict(conflict.getPath()); if (existingConflict != null && existingConflict.getConflictAction() == SVNConflictAction.DELETE && conflict.getConflictAction() == SVNConflictAction.ADD) { adminArea.deleteTreeConflict(conflict.getPath().getName()); conflict = new SVNTreeConflictDescription(conflict.getPath(), conflict.getNodeKind(), SVNConflictAction.DELETE, existingConflict.getConflictReason(), conflict.getOperation(), existingConflict.getSourceLeftVersion(), conflict.getSourceRightVersion()); } adminArea.addTreeConflict(conflict); }
public void addTreeConflict(SVNTreeConflictDescription conflict) throws SVNException { SVNTreeConflictDescription existingDescription = getTreeConflict(conflict.getPath().getName()); if (existingDescription != null) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Attempt to add tree conflict that already exists at ''{0}''", conflict.getPath()); SVNErrorManager.error(error, SVNLogType.WC); } Map conflicts = new SVNHashMap(); conflicts.put(conflict.getPath(), conflict); String conflictData = SVNTreeConflictUtil.getTreeConflictData(conflicts); SVNProperties command = new SVNProperties(); command.put(SVNLog.NAME_ATTR, getThisDirName()); command.put(SVNLog.DATA_ATTR, conflictData); SVNLog log = getLog(); log.addCommand(SVNLog.ADD_TREE_CONFLICT, command, false); log.save(); runLogs(); }
private SVNProperties getTreeConflictCreationAttributes(SVNAdminArea adminArea, SVNTreeConflictDescription treeConflict) throws SVNException { Map conflicts = new SVNHashMap(); conflicts.put(treeConflict.getPath(), treeConflict); String conflictData = SVNTreeConflictUtil.getTreeConflictData(conflicts); SVNProperties command = new SVNProperties(); command.put(SVNLog.NAME_ATTR, adminArea.getThisDirName()); command.put(SVNLog.DATA_ATTR, conflictData); return command; }
public void addTreeConflict(SVNTreeConflictDescription conflict) throws SVNException { SVNTreeConflictDescription existingDescription = getTreeConflict(conflict.getPath().getName()); if (existingDescription != null) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Attempt to add tree conflict that already exists at ''{0}''", conflict.getPath()); SVNErrorManager.error(error, SVNLogType.WC); } Map conflicts = new SVNHashMap(); conflicts.put(conflict.getPath(), conflict); String conflictData = SVNTreeConflictUtil.getTreeConflictData(conflicts); SVNProperties command = new SVNProperties(); command.put(SVNLog.NAME_ATTR, getThisDirName()); command.put(SVNLog.DATA_ATTR, conflictData); SVNLog log = getLog(); log.addCommand(SVNLog.ADD_TREE_CONFLICT, command, false); log.save(); runLogs(); }
public void addTreeConflict(SVNTreeConflictDescription conflict) throws SVNException { SVNTreeConflictDescription existingDescription = getTreeConflict(conflict.getPath().getName()); if (existingDescription != null) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT, "Attempt to add tree conflict that already exists at ''{0}''", conflict.getPath()); SVNErrorManager.error(error, SVNLogType.WC); } Map conflicts = new SVNHashMap(); conflicts.put(conflict.getPath(), conflict); String conflictData = SVNTreeConflictUtil.getTreeConflictData(conflicts); SVNProperties command = new SVNProperties(); command.put(SVNLog.NAME_ATTR, getThisDirName()); command.put(SVNLog.DATA_ATTR, conflictData); SVNLog log = getLog(); log.addCommand(SVNLog.ADD_TREE_CONFLICT, command, false); log.save(); runLogs(); }
String path = conflict.getPath().getName(); if (path.length() == 0) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT,
String path = conflict.getPath().getName(); if (path.length() == 0) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.WC_CORRUPT,
SVNTreeConflictDescription tc = info.getTreeConflict(); Map attributes = new SVNHashMap(); attributes.put("victim", tc.getPath().getName()); attributes.put("kind", tc.getNodeKind().toString()); attributes.put("operation", tc.getOperation().getName());
SVNTreeConflictDescription tc = info.getTreeConflict(); Map attributes = new SVNHashMap(); attributes.put("victim", tc.getPath().getName()); attributes.put("kind", tc.getNodeKind().toString()); attributes.put("operation", tc.getOperation().getName());
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; }
conflicts.put(treeConflict.getPath(), treeConflict); String conflictData = SVNTreeConflictUtil.getTreeConflictData(conflicts); SVNProperties command = new SVNProperties();
conflicts.put(treeConflict.getPath(), treeConflict); String conflictData = SVNTreeConflictUtil.getTreeConflictData(conflicts); SVNProperties command = new SVNProperties();