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; }
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; }
conflictSkelOpUpdate(conflictData, treeConflictDescription.getSourceLeftVersion(), treeConflictDescription.getSourceRightVersion()); } else if (operation == SVNOperation.SWITCH) { conflictSkelOpSwitch(conflictData, treeConflictDescription.getSourceLeftVersion(), treeConflictDescription.getSourceRightVersion()); } else if (operation == SVNOperation.MERGE) { conflictSkelOpMerge(conflictData, treeConflictDescription.getSourceLeftVersion(), treeConflictDescription.getSourceRightVersion()); } else { conflictSkelOpUpdate(conflictData, treeConflictDescription.getSourceLeftVersion(), treeConflictDescription.getSourceRightVersion());
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); }
SVNConflictVersion left = tc.getSourceLeftVersion(); buffer.append(" Source left: " + SVNTreeConflictUtil.getHumanReadableConflictVersion(left) + "\n"); SVNConflictVersion right = tc.getSourceRightVersion(); buffer.append(" Source right: " + SVNTreeConflictUtil.getHumanReadableConflictVersion(right) + "\n");
SVNConflictVersion left = tc.getSourceLeftVersion(); buffer.append(" Source left: " + SVNTreeConflictUtil.getHumanReadableConflictVersion(left) + "\n"); SVNConflictVersion right = tc.getSourceRightVersion(); buffer.append(" Source right: " + SVNTreeConflictUtil.getHumanReadableConflictVersion(right) + "\n");
updateMovedAwayConflictVictim.moveSrcOpRootRelPath = moveSrcOpRootRelPath; updateMovedAwayConflictVictim.oldVersion = conflictDescription.getSourceLeftVersion(); updateMovedAwayConflictVictim.newVersion = conflictDescription.getSourceRightVersion(); updateMovedAwayConflictVictim.operation = conflictDescription.getOperation(); conflictDescription.getSourceLeftVersion().getPegRevision(), conflictDescription.getSourceRightVersion().getPegRevision(), eventHandler); conflictDescription.getSourceRightVersion().getPegRevision(), SVNStatusType.INAPPLICABLE, SVNStatusType.INAPPLICABLE, SVNStatusType.LOCK_UNKNOWN, SVNEventAction.UPDATE_COMPLETED, SVNEventAction.UPDATE_COMPLETED, null, null); eventHandler.handleEvent(event, ISVNEventHandler.UNKNOWN);
SVNSkel conflictSkel = SVNSkel.createEmptyList(); SVNConflictVersion sourceRightVersion = conflict.getSourceRightVersion(); sourceRightVersion = sourceRightVersion == null ? nullVersion : sourceRightVersion; prependVersionInfo(conflictSkel, sourceRightVersion);
SVNSkel conflictSkel = SVNSkel.createEmptyList(); SVNConflictVersion sourceRightVersion = conflict.getSourceRightVersion(); sourceRightVersion = sourceRightVersion == null ? nullVersion : sourceRightVersion; prependVersionInfo(conflictSkel, sourceRightVersion);
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); }
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; }
setConflictOperation(conflictData, tcDesc.getOperation(), tcDesc.getSourceLeftVersion(), tcDesc.getSourceRightVersion());
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; }
final SVNTreeConflictDescription tcDesc = SVNTreeConflictUtil.readSingleTreeConflict(tcSkel, localAbsPath); final SVNWCConflictDescription17 conflictDescription = SVNWCConflictDescription17.createTree(localAbsPath, tcDesc.getNodeKind(), tcDesc.getOperation(), tcDesc.getSourceLeftVersion(), tcDesc.getSourceRightVersion()); conflictDescription.setAction(tcDesc.getConflictAction()); conflictDescription.setReason(tcDesc.getConflictReason());
SVNTreeConflictDescription tc = (SVNTreeConflictDescription) conflictDescription; left = createConflictVersion(tc.getSourceLeftVersion()); right = createConflictVersion(tc.getSourceRightVersion()); op = getConflictOperation(tc.getOperation());
SVNTreeConflictDescription tc = (SVNTreeConflictDescription) conflictDescription; left = createConflictVersion(tc.getSourceLeftVersion()); right = createConflictVersion(tc.getSourceRightVersion()); op = getConflictOperation(tc.getOperation());
SVNTreeConflictDescription tc = (SVNTreeConflictDescription) conflictDescription; left = createConflictVersion(tc.getSourceLeftVersion()); right = createConflictVersion(tc.getSourceRightVersion()); op = getConflictOperation(tc.getOperation());
SVNTreeConflictDescription tc = (SVNTreeConflictDescription) conflictDescription; left = createConflictVersion(tc.getSourceLeftVersion()); right = createConflictVersion(tc.getSourceRightVersion()); op = getConflictOperation(tc.getOperation());
private ConflictDescriptor getConflictDescription(SVNConflictDescription conflictDescription) throws ClientException { ConflictVersion srcLeft = null; ConflictVersion srcRight = null; ConflictDescriptor.Operation operation = Operation.none; if (conflictDescription instanceof SVNTreeConflictDescription) { SVNTreeConflictDescription treeConflictDescription = (SVNTreeConflictDescription) conflictDescription; srcLeft = getConflictVersion(treeConflictDescription.getSourceLeftVersion()); srcRight = getConflictVersion(treeConflictDescription.getSourceRightVersion()); operation = getConflictDescriptorOperation(treeConflictDescription.getOperation()); } return new ConflictDescriptor( getFilePath(conflictDescription.getPath()), getConflictDescriptorKind(conflictDescription), getNodeKind(conflictDescription.getNodeKind()), conflictDescription.getPropertyName(), conflictDescription.getMergeFiles().isBinary(), conflictDescription.getMergeFiles().getMimeType(), getConflictDescriptorAction(conflictDescription.getConflictAction()), getConflictDescriptorReason(conflictDescription.getConflictReason()), operation, getFilePath(conflictDescription.getMergeFiles().getBaseFile()), getFilePath(conflictDescription.getMergeFiles().getRepositoryFile()), getFilePath(conflictDescription.getMergeFiles().getLocalFile()), getFilePath(conflictDescription.getMergeFiles().getResultFile()), srcLeft, srcRight ); }