/** * Says whether this object and <code>obj</code> are equal. * * @param obj another object to compare with * @return <span class="javakeyword">true</span> if equal; otherwise <span class="javakeyword">false</span> */ public boolean equals(Object obj) { return compareTo(obj) == 0; }
/** * Says whether this object and <code>obj</code> are equal. * * @param obj another object to compare with * @return <span class="javakeyword">true</span> if equal; otherwise <span class="javakeyword">false</span> */ public boolean equals(Object obj) { return compareTo(obj) == 0; }
/** * Says whether this object and <code>obj</code> are equal. * * @param obj another object to compare with * @return <span class="javakeyword">true</span> if equal; otherwise <span class="javakeyword">false</span> */ public boolean equals(Object obj) { return compareTo(obj) == 0; }
private static boolean getRecurseFromDepth(SVNDepth depth) { return depth == null || depth == SVNDepth.UNKNOWN || depth.compareTo(SVNDepth.FILES) > 0; }
private static boolean getRecurseFromDepth(SVNDepth depth) { return depth == null || depth == SVNDepth.UNKNOWN || depth.compareTo(SVNDepth.FILES) > 0; }
private static boolean getRecurseFromDepth(SVNDepth depth) { return depth == null || depth == SVNDepth.UNKNOWN || depth.compareTo(SVNDepth.FILES) > 0; }
private boolean isDepthUpgrade(SVNDepth wcDepth, SVNDepth requestedDepth, SVNNodeKind kind) { if (requestedDepth == SVNDepth.UNKNOWN || wcDepth == SVNDepth.IMMEDIATES) { return false; } int compareResult = requestedDepth.compareTo(wcDepth); if (compareResult <= 0) { return false; } if (kind == SVNNodeKind.FILE && wcDepth == SVNDepth.FILES) { return false; } if (kind == SVNNodeKind.DIR && wcDepth == SVNDepth.EMPTY && requestedDepth == SVNDepth.FILES) { return false; } return true; }
private boolean isDepthUpgrade(SVNDepth wcDepth, SVNDepth requestedDepth, SVNNodeKind kind) { if (requestedDepth == SVNDepth.UNKNOWN || wcDepth == SVNDepth.IMMEDIATES) { return false; } int compareResult = requestedDepth.compareTo(wcDepth); if (compareResult <= 0) { return false; } if (kind == SVNNodeKind.FILE && wcDepth == SVNDepth.FILES) { return false; } if (kind == SVNNodeKind.DIR && wcDepth == SVNDepth.EMPTY && requestedDepth == SVNDepth.FILES) { return false; } return true; }
private boolean isDepthUpgrade(SVNDepth wcDepth, SVNDepth requestedDepth, SVNNodeKind kind) { if (requestedDepth == SVNDepth.UNKNOWN || wcDepth == SVNDepth.IMMEDIATES) { return false; } int compareResult = requestedDepth.compareTo(wcDepth); if (compareResult <= 0) { return false; } if (kind == SVNNodeKind.FILE && wcDepth == SVNDepth.FILES) { return false; } if (kind == SVNNodeKind.DIR && wcDepth == SVNDepth.EMPTY && requestedDepth == SVNDepth.FILES) { return false; } return true; }
public void deleteEntry(String path, long revision) throws SVNException { if (myCurrentDirBaton.myIsAmbientlyExcluded) { return; } if (myCurrentDirBaton.myAmbientDepth.compareTo(SVNDepth.IMMEDIATES) < 0) { File fullPath = new File(myAnchor, path); SVNEntry entry = myWCAccess.getEntry(fullPath, false); if (entry == null) { return; } } myDelegate.deleteEntry(path, revision); }
private void flushEntries(SVNWCDbRoot wcRoot, File localAbsPath, SVNDepth depth) { final Map<String, SVNWCDbDir> cache = wcRoot.getDb().dirData; if (cache.size() == 0) { return; } cache.remove(localAbsPath.getAbsolutePath()); if (depth.compareTo(SVNDepth.EMPTY) > 0) { for (Iterator<Entry<String, SVNWCDbDir>> iterator = cache.entrySet().iterator(); iterator.hasNext(); ) { final Entry<String, SVNWCDbDir> entry = iterator.next(); final String itemAbsPath = entry.getKey(); if (depth == SVNDepth.FILES || depth == SVNDepth.IMMEDIATES) { iterator.remove(); } else if (depth == SVNDepth.INFINITY && SVNPathUtil.isAncestor(localAbsPath.getAbsolutePath(), itemAbsPath)) { iterator.remove(); } } } final File parentAbsPath = SVNFileUtil.getFileDir(localAbsPath); cache.remove(parentAbsPath.getAbsolutePath()); }
public void deleteEntry(String path, long revision) throws SVNException { if (myCurrentDirBaton.myIsAmbientlyExcluded) { return; } if (myCurrentDirBaton.myAmbientDepth.compareTo(SVNDepth.IMMEDIATES) < 0) { File fullPath = new File(myAnchor, path); SVNEntry entry = myWCAccess.getEntry(fullPath, false); if (entry == null) { return; } } myDelegate.deleteEntry(path, revision); }
public void deleteEntry(String path, long revision) throws SVNException { if (myCurrentDirBaton.myIsAmbientlyExcluded) { return; } if (myCurrentDirBaton.myAmbientDepth.compareTo(SVNDepth.IMMEDIATES) < 0) { File fullPath = new File(myAnchor, path); SVNEntry entry = myWCAccess.getEntry(fullPath, false); if (entry == null) { return; } } myDelegate.deleteEntry(path, revision); }
private void handleExternalsChange(SVNURL reposRoot, File externalPath, String externalDefinition, Map<File, File> oldExternals, SVNDepth ambientDepth, SVNDepth requestedDepth) throws SVNException { if ((requestedDepth.compareTo(SVNDepth.INFINITY) < 0 && requestedDepth != SVNDepth.UNKNOWN) || ambientDepth.compareTo(SVNDepth.INFINITY) < 0 && requestedDepth.compareTo(SVNDepth.INFINITY) < 0) { return; } if (externalDefinition != null) { SVNExternal[] externals = SVNExternal.parseExternals(externalPath, externalDefinition); SVNURL url = getWcContext().getNodeUrl(externalPath); for (int i = 0; i < externals.length; i++) { File targetAbsPath = SVNFileUtil.createFilePath(externalPath, externals[i].getPath()); File oldExternalDefiningPath = oldExternals.get(targetAbsPath); try { handleExternalItemChange(reposRoot, externalPath, url, targetAbsPath, oldExternalDefiningPath, externals[i]); } catch (SVNCancelException cancel) { throw cancel; } catch (SVNException e) { handleEvent(SVNEventFactory.createSVNEvent(targetAbsPath, SVNNodeKind.NONE, null, -1, SVNEventAction.FAILED_EXTERNAL, SVNEventAction.UPDATE_EXTERNAL, e.getErrorMessage(), null)); } if (oldExternalDefiningPath != null) { oldExternals.remove(targetAbsPath); } } } }
public void deleteEntry(String path, long revision) throws SVNException { if (myCurrentDirBaton.myIsAmbientlyExcluded) { return; } if (myCurrentDirBaton.myAmbientDepth.compareTo(SVNDepth.IMMEDIATES) < 0) { File abspath = SVNFileUtil.createFilePath(myAnchor, SVNWCUtils.getPathAsChild(myAnchor, SVNFileUtil.createFilePath(path))); AmbientReadInfo aInfo = ambientReadInfo(abspath, myReadBase); if (aInfo.kind == SVNWCDbKind.Unknown || aInfo.hidden) { return; } } myDelegate.deleteEntry(path, revision); }
private void pushDirInfo(SVNRepository repos, SVNRevision rev, String path, SVNURL root, String uuid, SVNURL url, Map locks, SVNDepth depth, ISVNInfoHandler handler) throws SVNException { Collection children = repos.getDir(path, rev.getNumber(), null, SVNDirEntry.DIRENT_KIND | SVNDirEntry.DIRENT_CREATED_REVISION | SVNDirEntry.DIRENT_TIME | SVNDirEntry.DIRENT_LAST_AUTHOR, new ArrayList()); for (Iterator ents = children.iterator(); ents.hasNext();) { checkCancelled(); SVNDirEntry child = (SVNDirEntry) ents.next(); SVNURL childURL = url.appendPath(child.getName(), false); String childPath = SVNPathUtil.append(path, child.getName()); String displayPath = repos.getFullPath(childPath); displayPath = displayPath.substring(repos.getLocation().getPath().length()); if (displayPath.startsWith("/")) { displayPath = displayPath.substring(1); } if ("".equals(displayPath)) { displayPath = path; } SVNLock lock = (SVNLock) locks.get(path); SVNInfo info = SVNInfo.createInfo(displayPath, root, uuid, childURL, rev, child, lock); if (depth.compareTo(SVNDepth.IMMEDIATES) >= 0 || (depth == SVNDepth.FILES && child.getKind() == SVNNodeKind.FILE)) { handler.handleInfo(info); } if (depth == SVNDepth.INFINITY && child.getKind() == SVNNodeKind.DIR) { pushDirInfo(repos, rev, SVNPathUtil.append(path, child.getName()), root, uuid, childURL, locks, depth, handler); } } }
private static void doArbitraryDirsDiff(File localAbsPath1, File localAbsPath2, File rootAbsPath1, File rootAbsPath2, SVNDepth depth, SVNWCContext context, ISvnDiffCallback callback, ISVNCanceller canceller) throws SVNException { SVNNodeKind kind1 = null; try { kind1 = SVNFileType.getNodeKind(SVNFileType.getType(localAbsPath1.getCanonicalFile())); } catch (IOException e) { SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e); SVNErrorManager.error(errorMessage, SVNLogType.WC); } ArbitraryDiffWalker diffWalker = new ArbitraryDiffWalker(); diffWalker.recursingWithinAddedSubtree = (kind1 != SVNNodeKind.DIR); diffWalker.root1AbsPath = rootAbsPath1 != null ? rootAbsPath1 : localAbsPath1; diffWalker.root2AbsPath = rootAbsPath2 != null ? rootAbsPath2 : localAbsPath2; diffWalker.recursingWithinAdmDir = false; if (depth.compareTo(SVNDepth.IMMEDIATES) <= 0) { arbitraryDiffThisDir(diffWalker, localAbsPath1, depth, context, callback, canceller); } else if (depth == SVNDepth.INFINITY) { walkDirectory(diffWalker.recursingWithinAddedSubtree ? localAbsPath2 : localAbsPath1, diffWalker, context, callback, canceller); } }
public void dirOpened(SvnDiffCallbackResult result, File path, long revision) throws SVNException { ObstructionState os = driver.performObstructionCheck(path, SVNNodeKind.UNKNOWN); if (os.obstructionState != SVNStatusType.INAPPLICABLE) { result.skipChildren = true; return; } if (os.kind != SVNNodeKind.DIR || os.deleted) { if (os.kind == SVNNodeKind.NONE) { SVNDepth parentDepth = getContext().getNodeDepth(SVNFileUtil.getParentFile(path)); if (parentDepth != SVNDepth.UNKNOWN && parentDepth.compareTo(SVNDepth.IMMEDIATES) < 0) { result.skipChildren = true; return; } } if (os.kind == SVNNodeKind.FILE) { treeConflict(path, SVNNodeKind.DIR, SVNConflictAction.EDIT, SVNConflictReason.REPLACED); result.treeConflicted = true; } else if (os.deleted || os.kind == SVNNodeKind.NONE) { treeConflict(path, SVNNodeKind.DIR, SVNConflictAction.EDIT, SVNConflictReason.DELETED); result.treeConflicted = true; } } }
private void pushDirInfo(SVNRepository repos, SVNRevision rev, String dir, SVNURL root, String uuid, SVNURL url, Map<String, SVNLock> locks, SVNDepth depth) throws SVNException { Collection<SVNDirEntry> children = repos.getDir(dir, rev.getNumber(), null, SVNDirEntry.DIRENT_SIZE | SVNDirEntry.DIRENT_KIND | SVNDirEntry.DIRENT_CREATED_REVISION | SVNDirEntry.DIRENT_TIME | SVNDirEntry.DIRENT_LAST_AUTHOR, new ArrayList<SVNDirEntry>()); for (SVNDirEntry child : children) { SVNURL childURL = url.appendPath(child.getName(), false); String path = SVNPathUtil.append(dir, child.getName()); String fsPath = "/" + SVNPathUtil.getRelativePath(root.toDecodedString(), childURL.toDecodedString()); SVNLock lock = locks.get(fsPath); if (depth.compareTo(SVNDepth.IMMEDIATES) >= 0 || (depth == SVNDepth.FILES && child.getKind() == SVNNodeKind.FILE)) { SvnInfo info = creatSvnInfoForEntry(root, uuid, child, childURL, rev.getNumber(), lock); getOperation().receive(SvnTarget.fromURL(childURL), info); } if (depth == SVNDepth.INFINITY && child.getKind() == SVNNodeKind.DIR) { pushDirInfo(repos, rev, path, root, uuid, childURL, locks, depth); } } }
private void doGetLocalProperty(SVNEntry entry, SVNAdminArea area, String propName, boolean base, ISVNPropertyHandler handler, SVNDepth depth, Collection changeLists) throws SVNException { if (depth == null || depth == SVNDepth.UNKNOWN) { depth = SVNDepth.EMPTY; } File target = area.getFile(entry.getName()); SVNWCAccess wcAccess = area.getWCAccess(); ISVNEntryHandler propGetHandler = new PropFetchHandler(changeLists, propName, handler, base); if (SVNDepth.FILES.compareTo(depth) <= 0 && entry.isDirectory()) { wcAccess.walkEntries(target, propGetHandler, false, depth); } else if (SVNWCAccess.matchesChangeList(changeLists, entry)) { if (propName == null) { SVNVersionedProperties properties = base ? area.getBaseProperties(entry.getName()) : area.getProperties(entry.getName()); SVNProperties allProps = properties.asMap(); for (Iterator names = allProps.nameSet().iterator(); names.hasNext();) { String name = (String) names.next(); SVNPropertyValue val = allProps.getSVNPropertyValue(name); handler.handleProperty(area.getFile(entry.getName()), new SVNPropertyData(name, val, getOptions())); } } else { propGetHandler.handleEntry(target, entry); } } }