private boolean isEquals() { if (myOldExternalURL == myNewExternalURL) { return myOldExternalRevision == myNewExternalRevision; } if (myOldExternalURL == null || myNewExternalURL == null) { return true; } if (myOldExternalURL.equals(myNewExternalURL)) { return myOldExternalRevision == myNewExternalRevision; } return false; }
@Override public boolean equals(Object obj) { SvnRoot root; if (obj instanceof SvnRoot) { root = (SvnRoot) obj; return repository.getLocation().equals(root.repository.getLocation()); } return false; }
@Override public boolean equals(Object obj) { SvnRoot root; if (obj instanceof SvnRoot) { root = (SvnRoot) obj; return repository.getLocation().equals(root.repository.getLocation()); } return false; }
public static String isChild(SVNURL parent, SVNURL child) { if (parent == null || child == null) return null; if (parent.equals(child)) return null; final String parentPath = parent.toDecodedString(); final String childPath = child.toDecodedString(); return isChild(parentPath, childPath); }
protected SVNURL ensureSessionURL(SVNRepository repository, SVNURL url) throws SVNException { SVNURL oldURL = repository.getLocation(); if (url == null) { url = repository.getRepositoryRoot(true); } if (!url.equals(oldURL)) { repository.setLocation(url, false); return oldURL; } return null; }
private void checkIfRepositoryIsAtRoot(SVNRepository repos, SVNURL url) throws SVNException { SVNURL reposRoot = repos.getRepositoryRoot(true); if (!reposRoot.equals(url)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Session is rooted at ''{0}'' but the repos root is ''{1}''", new SVNURL[] { url, reposRoot }); SVNErrorManager.error(err, SVNLogType.FSFS); } }
private void checkIfRepositoryIsAtRoot(SVNRepository repos, SVNURL url) throws SVNException { SVNURL reposRoot = repos.getRepositoryRoot(true); if (!reposRoot.equals(url)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Session is rooted at ''{0}'' but the repos root is ''{1}''", new SVNURL[] { url, reposRoot }); SVNErrorManager.error(err, SVNLogType.FSFS); } }
protected static SVNURL ensureSessionURL(SVNRepository repository, SVNURL url) throws SVNException { SVNURL oldURL = repository.getLocation(); if (url == null) { url = repository.getRepositoryRoot(true); } if (!url.equals(oldURL)) { repository.setLocation(url, false); return oldURL; } return oldURL; }
private void checkIfRepositoryIsAtRoot(SVNRepository repos, SVNURL url) throws SVNException { SVNURL reposRoot = repos.getRepositoryRoot(true); if (!reposRoot.equals(url)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Session is rooted at ''{0}'' but the repos root is ''{1}''", new SVNURL[] { url, reposRoot }); SVNErrorManager.error(err); } }
protected SVNURL ensureSessionURL(SVNRepository repository, SVNURL url) throws SVNException { SVNURL oldURL = repository.getLocation(); if (url == null) { url = repository.getRepositoryRoot(true); } if (!url.equals(oldURL)) { repository.setLocation(url, false); return oldURL; } return null; }
private void checkIfRepositoryIsAtRoot(SVNRepository repos, SVNURL url) throws SVNException { SVNURL reposRoot = repos.getRepositoryRoot(true); if (!reposRoot.equals(url)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Session is rooted at ''{0}'' but the repos root is ''{1}''", new SVNURL[] { url, reposRoot }); SVNErrorManager.error(err, SVNLogType.FSFS); } }
private boolean reparent(SVNURL url) throws SVNException { if (myConnection != null) { if (getLocation().equals(url)) { return true; } try { Object[] buffer = new Object[]{"reparent", url.toString()}; write("(w(s))", buffer); authenticate(); read("", null, false); String newLocation = url.toString(); String rootLocation = myRepositoryRoot.toString(); return newLocation.startsWith(rootLocation) && (newLocation.length() == rootLocation.length() || (newLocation.length() > rootLocation.length() && newLocation.charAt(rootLocation.length()) == '/')); } catch (SVNException e) { if (e instanceof SVNCancelException || e instanceof SVNAuthenticationException) { throw e; } } } return false; }
protected SVNURL ensureSessionURL(SVNRepository repository, SVNURL url) throws SVNException { SVNURL oldURL = repository.getLocation(); if (url == null) { url = repository.getRepositoryRoot(true); } if (!url.equals(oldURL)) { repository.setLocation(url, false); return oldURL; } return null; }
private boolean isExternalRolledOut(CommittableExternalInfo xInfo) { SVNURL reposRootUrl = null; File reposRelPath = null; try { WCDbBaseInfo baseInfo = getDb().getBaseInfo(xInfo.localAbsPath, BaseInfoField.reposRelPath, BaseInfoField.reposRootUrl); reposRootUrl = baseInfo.reposRootUrl; reposRelPath = baseInfo.reposRelPath; } catch (SVNException e) { if (e.getErrorMessage().getErrorCode() == SVNErrorCode.WC_PATH_NOT_FOUND) { return false; } } return xInfo.reposRootUrl.equals(reposRootUrl) && xInfo.reposRelPath.equals(reposRelPath); }
public void handleEntry(File path, SVNEntry entry) throws SVNException { SVNURL entryURL = entry.getSVNURL(); if (entryURL != null && !myTarget.equals(path)) { SVNEntry parentEntry = myWCAccess.getVersionedEntry(path.getParentFile(), false); SVNURL expectedURL = parentEntry.getSVNURL().appendPath(SVNPathUtil.tail(path.getAbsolutePath().replace(File.separatorChar, '/')), false); if (!entryURL.equals(expectedURL)) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.ILLEGAL_TARGET, "''{0}'' is switched entry which is not allowed for this kind of merge", path); SVNErrorManager.error(error, SVNLogType.WC); } } super.handleEntry(path, entry); } }
public boolean compareExternals(SVNURL oldURL, SVNURL newURL) { return oldURL.equals(newURL) && oldExternal.getRevision().equals(newExternal.getRevision()) && oldExternal.getPegRevision().equals(newExternal.getPegRevision()); } }
private static boolean needsCachedIProps(SVNWCContext context, File localAbsPath, SVNRepository repository) throws SVNException { CheckWCRootInfo rootInfo = null; try { rootInfo = context.checkWCRoot(localAbsPath, true); } catch (SVNException e) { if (e.getErrorMessage().getErrorCode() == SVNErrorCode.WC_PATH_NOT_FOUND) { return false; } throw e; } if (rootInfo != null && (rootInfo.switched || rootInfo.wcRoot)) { final SVNURL location = repository.getLocation(); final SVNURL root = repository.getRepositoryRoot(true); return !location.equals(root); } return false; }
public boolean compareExternals(SVNURL oldURL, SVNURL newURL) { return oldURL.equals(newURL) && oldExternal.getRevision().equals(newExternal.getRevision()) && oldExternal.getPegRevision().equals(newExternal.getPegRevision()); } }
public boolean compareExternals(SVNURL oldURL, SVNURL newURL) { return oldURL.equals(newURL) && oldExternal.getRevision().equals(newExternal.getRevision()) && oldExternal.getPegRevision().equals(newExternal.getPegRevision()); } }
protected void close() throws SVNException { SVNDebugLog.getDefaultLog().logFine(SVNLogType.WC, "ext merge: close " + myPath); closeFile(myPath, myCurrentFile.myIsAdded, myWCFile, myFile, myCurrentFile.myPropertyDiff, myCurrentFile.myBaseProperties, myCurrentFile.myBaseFile, null); if (myCopySource == null) { return; } SVNEntry targetEntry = myWCAccess.getEntry(myWCFile, false); if (targetEntry != null) { SVNURL copyFromLocation = targetEntry.getCopyFromSVNURL(); long copyFromRevision = targetEntry.getCopyFromRevision(); SVNURL sourceURL = myCopySource.getURL(); long sourceRevision = myCopySource.getRevision().getNumber(); if (copyFromLocation == null || !copyFromLocation.equals(sourceURL) || copyFromRevision != sourceRevision) { getMergeDriver().copy(myCopySource, myWCFile, true); } } }