public void handleEntry(File path, SVNEntry entry) throws SVNException { myDelegate.handleEntry(path, entry); if (!entry.isDirectory() || entry.isHidden()) { return; } boolean checkChildren = false; if (myDepth == SVNDepth.IMMEDIATES || myDepth == SVNDepth.FILES) { checkChildren = path.equals(myTargetPath); } else if (myDepth == SVNDepth.INFINITY || myDepth == SVNDepth.EXCLUDE || myDepth == SVNDepth.UNKNOWN) { checkChildren = true; } else { return; } if (!checkChildren) { return; } Map tcs = entry.getTreeConflicts(); for(Iterator paths = tcs.keySet().iterator(); paths.hasNext();) { File p = (File) paths.next(); SVNTreeConflictDescription tc = (SVNTreeConflictDescription) tcs.get(p); if (tc.getNodeKind() == SVNNodeKind.DIR && myDepth == SVNDepth.FILES) { continue; } SVNEntry conflictEntry = myWCAccess.getEntry(p, true); if (conflictEntry == null || conflictEntry.isDeleted()) { myDelegate.handleEntry(p, null); } } }
public void handleEntry(File path, SVNEntry entry) throws SVNException { myDelegate.handleEntry(path, entry); if (entry == null || !entry.isDirectory() || entry.isHidden()) { return; } boolean checkChildren = false; if (myDepth == SVNDepth.IMMEDIATES || myDepth == SVNDepth.FILES) { checkChildren = path.equals(myTargetPath); } else if (myDepth == SVNDepth.INFINITY || myDepth == SVNDepth.EXCLUDE || myDepth == SVNDepth.UNKNOWN) { checkChildren = true; } else { return; } if (!checkChildren) { return; } Map tcs = entry.getTreeConflicts(); for(Iterator paths = tcs.keySet().iterator(); paths.hasNext();) { File p = (File) paths.next(); SVNTreeConflictDescription tc = (SVNTreeConflictDescription) tcs.get(p); if (tc.getNodeKind() == SVNNodeKind.DIR && myDepth == SVNDepth.FILES) { continue; } SVNEntry conflictEntry = myWCAccess.getEntry(p, true); if (conflictEntry == null || conflictEntry.isDeleted()) { myDelegate.handleEntry(p, null); } } }
public void handleEntry(File path, SVNEntry entry) throws SVNException { myDelegate.handleEntry(path, entry); if (entry == null || !entry.isDirectory() || entry.isHidden()) { return; } boolean checkChildren = false; if (myDepth == SVNDepth.IMMEDIATES || myDepth == SVNDepth.FILES) { checkChildren = path.equals(myTargetPath); } else if (myDepth == SVNDepth.INFINITY || myDepth == SVNDepth.EXCLUDE || myDepth == SVNDepth.UNKNOWN) { checkChildren = true; } else { return; } if (!checkChildren) { return; } Map tcs = entry.getTreeConflicts(); for(Iterator paths = tcs.keySet().iterator(); paths.hasNext();) { File p = (File) paths.next(); SVNTreeConflictDescription tc = (SVNTreeConflictDescription) tcs.get(p); if (tc.getNodeKind() == SVNNodeKind.DIR && myDepth == SVNDepth.FILES) { continue; } SVNEntry conflictEntry = myWCAccess.getEntry(p, true); if (conflictEntry == null || conflictEntry.isDeleted()) { myDelegate.handleEntry(p, null); } } }
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); } }
kind = tc.getNodeKind(); resolved = true;
kind = tc.getNodeKind(); resolved = true;
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; }
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 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; }
conflictSkel.addChild(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.addChild(SVNSkel.createAtom(getNodeKindString(conflict.getNodeKind())));
conflictSkel.addChild(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.addChild(SVNSkel.createAtom(getNodeKindString(conflict.getNodeKind())));
if (isDepthIncludes(getFirstTarget(), depth, target, treeConflict.getNodeKind())) { SvnInfo unversionedInfo = buildUnversionedInfo(target); Collection<SVNConflictDescription> conflicts = new ArrayList<SVNConflictDescription>(1);
Map attributes = new SVNHashMap(); attributes.put("victim", tc.getPath().getName()); attributes.put("kind", tc.getNodeKind().toString()); attributes.put("operation", tc.getOperation().getName()); if (tc.getConflictAction() == SVNConflictAction.EDIT) {
Map attributes = new SVNHashMap(); attributes.put("victim", tc.getPath().getName()); attributes.put("kind", tc.getNodeKind().toString()); attributes.put("operation", tc.getOperation().getName()); if (tc.getConflictAction() == SVNConflictAction.EDIT) {
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());
File entryPath = (File) keys.next(); SVNTreeConflictDescription tc = (SVNTreeConflictDescription) tcs.get(entryPath); if (tc.getNodeKind() == SVNNodeKind.DIR && depth == SVNDepth.FILES) { continue; if (tc.getNodeKind() == SVNNodeKind.DIR) {
File entryPath = (File) keys.next(); SVNTreeConflictDescription tc = (SVNTreeConflictDescription) tcs.get(entryPath); if (tc.getNodeKind() == SVNNodeKind.DIR && depth == SVNDepth.FILES) { continue; if (tc.getNodeKind() == SVNNodeKind.DIR) {
File entryPath = (File) keys.next(); SVNTreeConflictDescription tc = (SVNTreeConflictDescription) tcs.get(entryPath); if (tc.getNodeKind() == SVNNodeKind.DIR && depth == SVNDepth.FILES) { continue; if (tc.getNodeKind() == SVNNodeKind.DIR) {