private static String getActionString(SVNTreeConflictDescription treeConflict) { SVNConflictAction action = treeConflict.getConflictAction(); if (action == SVNConflictAction.ADD) { return "add"; } else if (action == SVNConflictAction.EDIT) { return "edit"; } else if (action == SVNConflictAction.DELETE) { return "delete"; } return null; }
private static String getActionString(SVNTreeConflictDescription treeConflict) { SVNConflictAction action = treeConflict.getConflictAction(); if (action == SVNConflictAction.ADD) { return "add"; } else if (action == SVNConflictAction.EDIT) { return "edit"; } else if (action == SVNConflictAction.DELETE) { return "delete"; } return null; }
private static String getActionString(SVNNodeKind incomingKind, SVNTreeConflictDescription treeConflict) { if (incomingKind == SVNNodeKind.FILE) { SVNConflictAction action = treeConflict.getConflictAction(); if (action == SVNConflictAction.ADD) { return "file add"; SVNConflictAction action = treeConflict.getConflictAction(); if (action == SVNConflictAction.ADD) { return "dir add"; SVNConflictAction action = treeConflict.getConflictAction(); if (action == SVNConflictAction.ADD) { return "add";
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; }
private void treeConflictOnAdd(File path, SVNNodeKind kind, SVNConflictAction action, SVNConflictReason reason) throws SVNException { if (isRecordOnly() || isDryRun()) { return; } SVNTreeConflictDescription tc = makeTreeConflict(path, kind, action, reason); SVNTreeConflictDescription existingTc = getContext().getTreeConflict(path); if (existingTc == null) { getContext().getDb().opSetTreeConflict(path, tc); if (conflictedPaths == null) { conflictedPaths = new HashSet<File>(); } conflictedPaths.add(path); } else if (existingTc.getConflictAction() == SVNConflictAction.DELETE && tc.getConflictAction() == SVNConflictAction.ADD) { existingTc.setConflictAction(SVNConflictAction.REPLACE); getContext().getDb().opSetTreeConflict(path, existingTc); } }
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); }
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 SVNSkel treeConflictDescriptionToSkel(ISVNWCDb db, File wriAbsPath, SVNTreeConflictDescription conflictDescription) throws SVNException { SVNSkel skel = createConflictSkel(); addTreeConflict(skel, db, wriAbsPath, conflictDescription.getConflictReason(), conflictDescription.getConflictAction(), null); if (conflictDescription.getOperation() != null) { if (conflictDescription.getOperation() == SVNOperation.UPDATE) { SvnWcDbConflicts.conflictSkelOpUpdate(skel, conflictDescription.getSourceLeftVersion(), conflictDescription.getSourceRightVersion()); } else if (conflictDescription.getOperation() == SVNOperation.SWITCH) { SvnWcDbConflicts.conflictSkelOpSwitch(skel, conflictDescription.getSourceLeftVersion(), conflictDescription.getSourceRightVersion()); } else if (conflictDescription.getOperation() == SVNOperation.MERGE) { SvnWcDbConflicts.conflictSkelOpMerge(skel, conflictDescription.getSourceLeftVersion(), conflictDescription.getSourceRightVersion()); } } return skel; }
conflictSkel.addChild(SVNSkel.createAtom(conflict.getConflictAction().toString())); conflictSkel.addChild(SVNSkel.createAtom(conflict.getOperation().toString()));
conflictSkel.addChild(SVNSkel.createAtom(conflict.getConflictAction().toString())); conflictSkel.addChild(SVNSkel.createAtom(conflict.getOperation().toString()));
attributes.put("kind", tc.getNodeKind().toString()); attributes.put("operation", tc.getOperation().getName()); if (tc.getConflictAction() == SVNConflictAction.EDIT) { attributes.put("action", "edit"); } else if (tc.getConflictAction() == SVNConflictAction.ADD) { attributes.put("action", "add"); } else if (tc.getConflictAction() == SVNConflictAction.DELETE) { attributes.put("action", "delete");
public void resolveDeleteRaiseMovedAway(File localAbsPath, ISVNEventHandler eventHandler) throws SVNException { DirParsedInfo parsed = parseDir(localAbsPath, Mode.ReadOnly); SVNWCDbDir pdh = parsed.wcDbDir; File localRelPath = parsed.localRelPath; verifyDirUsable(pdh); TcInfo tcInfo = getTcInfo(localAbsPath); SVNTreeConflictDescription treeConflictDescription = tcInfo.treeConflictDescription; SVNOperation operation = treeConflictDescription.getOperation(); SVNConflictReason reason = treeConflictDescription.getConflictReason(); SVNConflictAction action = treeConflictDescription.getConflictAction(); SVNConflictVersion oldVersion = treeConflictDescription.getSourceLeftVersion(); SVNConflictVersion newVersion = treeConflictDescription.getSourceRightVersion(); ResolveDeleteRaiseMovedAway resolveDeleteRaiseMovedAway = new ResolveDeleteRaiseMovedAway(); resolveDeleteRaiseMovedAway.pdh = pdh; resolveDeleteRaiseMovedAway.localRelPath = localRelPath; resolveDeleteRaiseMovedAway.operation = operation; resolveDeleteRaiseMovedAway.action = action; resolveDeleteRaiseMovedAway.oldVersion = oldVersion; resolveDeleteRaiseMovedAway.newVersion = newVersion; pdh.getWCRoot().getSDb().runTransaction(resolveDeleteRaiseMovedAway); updateMoveListNotify(pdh.getWCRoot(), oldVersion.getPegRevision(), newVersion != null ? newVersion.getPegRevision() : SVNRepository.INVALID_REVISION, eventHandler); }
if (treeConflict != null && treeConflict.getConflictAction() == SVNConflictAction.EDIT) {
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; }
final SVNTreeConflictDescription tcDesc = SVNTreeConflictUtil.readSingleTreeConflict(tcSkel, localAbsPath); addTreeConflict(conflictData, db, wcRootAbsPath, tcDesc.getConflictReason(), tcDesc.getConflictAction(), null); if (tcDesc.getOperation() != null && tcDesc.getOperation() != SVNOperation.NONE) { setConflictOperation(conflictData, tcDesc.getOperation(), tcDesc.getSourceLeftVersion(), tcDesc.getSourceRightVersion());
conflictDescription.setAction(tcDesc.getConflictAction()); conflictDescription.setReason(tcDesc.getConflictReason()); if (tcDesc.getMergeFiles() != null) {
public static SVNSkel convertToConflictSkel(String conflictOld, String conflictWorking, String conflictNew, String propReject, byte[] treeConflictData) throws SVNException { SVNSkel conflictData = null; if (conflictOld != null || conflictNew != null || conflictWorking != null) { conflictData = createConflictSkel(); addTextConflict(conflictData, conflictWorking, conflictOld, conflictNew); } if (propReject != null) { if (conflictData == null) { conflictData = createConflictSkel(); } addPropConflict(conflictData, propReject); } if (treeConflictData != null) { if (conflictData == null) { conflictData = createConflictSkel(); } final SVNSkel tcSkel = SVNSkel.parse(treeConflictData); final File fakePath = SVNFileUtil.createFilePath(""); final SVNTreeConflictDescription tcDesc = SVNTreeConflictUtil.readSingleTreeConflict(tcSkel, fakePath); addTreeConflict(conflictData, tcDesc.getConflictReason(), tcDesc.getConflictAction()); if (tcDesc.getOperation() != null && tcDesc.getOperation() != SVNOperation.NONE) { setConflictOperation(conflictData, tcDesc.getOperation(), tcDesc.getSourceLeftVersion(), tcDesc.getSourceRightVersion()); } } else if (conflictData != null) { setConflictOperation(conflictData, SVNOperation.UPDATE, null, null); } return conflictData; }
addTreeConflict(conflictData, db, wriAbsPath, treeConflictDescription.getConflictReason(), treeConflictDescription.getConflictAction(), null);
updateMovedAwayConflictVictim.victimRelPath = localRelPath; updateMovedAwayConflictVictim.localChange = conflictDescription.getConflictReason(); updateMovedAwayConflictVictim.incomingChange = conflictDescription.getConflictAction(); updateMovedAwayConflictVictim.moveSrcOpRootRelPath = moveSrcOpRootRelPath; updateMovedAwayConflictVictim.oldVersion = conflictDescription.getSourceLeftVersion();
SVNURL theirURL = SVNURL.parseURIEncoded(info.URL); treeConflict = checkTreeConflict(fullPath, entry, adminArea, log, SVNConflictAction.EDIT, SVNNodeKind.FILE, theirURL); if (treeConflict != null && treeConflict.getConflictAction() == SVNConflictAction.EDIT) {