protected void startElement(DAVElement parent, DAVElement element, Attributes attrs) throws SVNException { if (parent == LOCATION_REPORT && element == LOCATION) { String revStr = attrs.getValue("rev"); if (revStr != null) { String path = attrs.getValue("path"); if (path != null && myLocationEntryHandler != null) { myLocationEntryHandler.handleLocationEntry(new SVNLocationEntry(Long.parseLong(revStr), path)); myCount++; } } } } protected void endElement(DAVElement parent, DAVElement element, StringBuffer cdata) throws SVNException {
public FSNodeHistory getNodeHistory(String path) throws SVNException { SVNNodeKind kind = checkNodeKind(path); if (kind == SVNNodeKind.NONE) { SVNErrorManager.error(FSErrors.errorNotFound(this, path), SVNLogType.FSFS); } return new FSNodeHistory(new SVNLocationEntry(getRevision(), SVNPathUtil.canonicalizeAbsolutePath(path)), false, new SVNLocationEntry(SVNRepository.INVALID_REVISION, null), getOwner()); }
public FSNodeHistory getNodeHistory(String path) throws SVNException { SVNNodeKind kind = checkNodeKind(path); if (kind == SVNNodeKind.NONE) { SVNErrorManager.error(FSErrors.errorNotFound(this, path), SVNLogType.FSFS); } return new FSNodeHistory(new SVNLocationEntry(getRevision(), SVNPathUtil.canonicalizeAbsolutePath(path)), false, new SVNLocationEntry(SVNRepository.INVALID_REVISION, null), getOwner()); }
public FSNodeHistory getNodeHistory(String path) throws SVNException { SVNNodeKind kind = checkNodeKind(path); if (kind == SVNNodeKind.NONE) { SVNErrorManager.error(FSErrors.errorNotFound(this, path), SVNLogType.FSFS); } return new FSNodeHistory(new SVNLocationEntry(getRevision(), SVNPathUtil.canonicalizeAbsolutePath(path)), false, new SVNLocationEntry(SVNRepository.INVALID_REVISION, null), getOwner()); }
private SVNLocationEntry findRealBaseLocation(Node node) throws SVNException { if (node.myAction == SVNChangeEntry.TYPE_ADDED && node.myCopyFromPath != null && SVNRevision.isValidRevisionNumber(node.myCopyFromRevision)) { return new SVNLocationEntry(node.myCopyFromRevision, node.myCopyFromPath); } if (node.myParent != null) { SVNLocationEntry location = findRealBaseLocation(node.myParent); return new SVNLocationEntry(location.getRevision(), SVNPathUtil.getAbsolutePath(SVNPathUtil.append(location.getPath(), node.myName))); } return new SVNLocationEntry(-1, "/"); }
private SVNLocationEntry findRealBaseLocation(Node node) throws SVNException { if (node.myAction == SVNChangeEntry.TYPE_ADDED && node.myCopyFromPath != null && SVNRevision.isValidRevisionNumber(node.myCopyFromRevision)) { return new SVNLocationEntry(node.myCopyFromRevision, node.myCopyFromPath); } if (node.myParent != null) { SVNLocationEntry location = findRealBaseLocation(node.myParent); return new SVNLocationEntry(location.getRevision(), SVNPathUtil.getAbsolutePath(SVNPathUtil.append(location.getPath(), node.myName))); } return new SVNLocationEntry(-1, "/"); }
private SVNLocationEntry findRealBaseLocation(Node node) throws SVNException { if (node.myAction == SVNChangeEntry.TYPE_ADDED && node.myCopyFromPath != null && SVNRevision.isValidRevisionNumber(node.myCopyFromRevision)) { return new SVNLocationEntry(node.myCopyFromRevision, node.myCopyFromPath); } if (node.myParent != null) { SVNLocationEntry location = findRealBaseLocation(node.myParent); return new SVNLocationEntry(location.getRevision(), SVNPathUtil.getAbsolutePath(SVNPathUtil.append(location.getPath(), node.myName))); } return new SVNLocationEntry(-1, "/"); }
protected void startElement(DAVElement parent, DAVElement element, Attributes attrs) throws SVNException { if (parent == LOCATION_REPORT && element == LOCATION) { String revStr = attrs.getValue("rev"); if (revStr != null) { String path = attrs.getValue("path"); if (path != null && myLocationEntryHandler != null) { if (!path.startsWith("/")) { path = "/" + path; } try { myLocationEntryHandler.handleLocationEntry(new SVNLocationEntry(Long.parseLong(revStr), path)); } catch (NumberFormatException nfe) { SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.RA_DAV_MALFORMED_DATA, nfe), SVNLogType.NETWORK); } myCount++; } } } }
protected void startElement(DAVElement parent, DAVElement element, Attributes attrs) throws SVNException { if (parent == LOCATION_REPORT && element == LOCATION) { String revStr = attrs.getValue("rev"); if (revStr != null) { String path = attrs.getValue("path"); if (path != null && myLocationEntryHandler != null) { if (!path.startsWith("/")) { path = "/" + path; } try { myLocationEntryHandler.handleLocationEntry(new SVNLocationEntry(Long.parseLong(revStr), path)); } catch (NumberFormatException nfe) { SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.RA_DAV_MALFORMED_DATA, nfe), SVNLogType.NETWORK); } myCount++; } } } }
public static FSNodeHistory getNodeHistory(FSRevisionRoot root, String path) throws SVNException { FSRevisionNode node = null; SVNNodeKind kind = null; try { node = root.openPath(path, true, false).getRevNode(); } catch (SVNException svne) { if (svne.getErrorMessage().getErrorCode() == SVNErrorCode.FS_NOT_FOUND) { kind = SVNNodeKind.NONE; } throw svne; } kind = node.getType(); if (kind == SVNNodeKind.NONE) { SVNErrorManager.error(FSErrors.errorNotFound(root, path)); } return new FSNodeHistory(new SVNLocationEntry(root.getRevision(), path), false, new SVNLocationEntry(FSRepository.SVN_INVALID_REVNUM, null)); }
protected SVNLocationEntry getCopySource(File path, SVNURL url, SVNRevision revision) throws SVNException { long[] pegRev = { SVNRepository.INVALID_REVISION }; SVNRepository repos = createRepository(url, path, null, revision, revision, pegRev); SVNLocationEntry copyFromEntry = null; String targetPath = getPathRelativeToRoot(path, url, null, null, repos); CopyFromReceiver receiver = new CopyFromReceiver(targetPath); try { repos.log(new String[] { "" }, pegRev[0], 1, true, true, 0, false, new String[0], receiver); copyFromEntry = receiver.getCopyFromLocation(); } catch (SVNException e) { SVNErrorCode errCode = e.getErrorMessage().getErrorCode(); if (errCode == SVNErrorCode.FS_NOT_FOUND || errCode == SVNErrorCode.RA_DAV_REQUEST_FAILED) { return new SVNLocationEntry(SVNRepository.INVALID_REVISION, null); } throw e; } return copyFromEntry == null ? new SVNLocationEntry(SVNRepository.INVALID_REVISION, null) : copyFromEntry; }
protected SVNLocationEntry getCopySource(File path, SVNURL url, SVNRevision revision) throws SVNException { long[] pegRev = { SVNRepository.INVALID_REVISION }; SVNRepository repos = createRepository(url, path, null, revision, revision, pegRev); SVNLocationEntry copyFromEntry = null; String targetPath = getPathRelativeToRoot(path, url, null, null, repos); CopyFromReceiver receiver = new CopyFromReceiver(targetPath); try { repos.log(new String[] { "" }, pegRev[0], 1, true, true, 0, false, new String[0], receiver); copyFromEntry = receiver.getCopyFromLocation(); } catch (SVNException e) { SVNErrorCode errCode = e.getErrorMessage().getErrorCode(); if (errCode == SVNErrorCode.FS_NOT_FOUND || errCode == SVNErrorCode.RA_DAV_REQUEST_FAILED) { return new SVNLocationEntry(SVNRepository.INVALID_REVISION, null); } throw e; } return copyFromEntry == null ? new SVNLocationEntry(SVNRepository.INVALID_REVISION, null) : copyFromEntry; }
private SVNLocationEntry determineCopyFromInfo(File src, SVNWCAccess srcAccess, SVNEntry srcEntry, SVNEntry dstEntry) throws SVNException { String url; long rev; if (srcEntry.getCopyFromURL() != null) { url = srcEntry.getCopyFromURL(); rev = srcEntry.getCopyFromRevision(); } else { SVNLocationEntry info = getCopyFromInfoFromParent(src, srcAccess); url = info.getPath(); rev = info.getRevision(); } if (dstEntry != null && rev == dstEntry.getRevision() && url.equals(dstEntry.getCopyFromURL())) { url = null; rev = -1; } return new SVNLocationEntry(rev, url); }
private SVNLocationEntry determineCopyFromInfo(File src, SVNWCAccess srcAccess, SVNEntry srcEntry, SVNEntry dstEntry) throws SVNException { String url; long rev; if (srcEntry.getCopyFromURL() != null) { url = srcEntry.getCopyFromURL(); rev = srcEntry.getCopyFromRevision(); } else { SVNLocationEntry info = getCopyFromInfoFromParent(src, srcAccess); url = info.getPath(); rev = info.getRevision(); } if (dstEntry != null && rev == dstEntry.getRevision() && url.equals(dstEntry.getCopyFromURL())) { url = null; rev = -1; } return new SVNLocationEntry(rev, url); }
private SVNLocationEntry determineCopyFromInfo(File src, SVNWCAccess srcAccess, SVNEntry srcEntry, SVNEntry dstEntry) throws SVNException { String url; long rev; if (srcEntry.getCopyFromURL() != null) { url = srcEntry.getCopyFromURL(); rev = srcEntry.getCopyFromRevision(); } else { SVNLocationEntry info = getCopyFromInfoFromParent(src, srcAccess); url = info.getPath(); rev = info.getRevision(); } if (dstEntry != null && rev == dstEntry.getRevision() && url.equals(dstEntry.getCopyFromURL())) { url = null; rev = -1; } return new SVNLocationEntry(rev, url); }
private SVNLocationEntry addFileSmartly(String editPath, String originalPath) throws SVNException { String copyFromPath = null; long copyFromRevision = SVNRepository.INVALID_REVISION; if (mySendCopyFromArgs) { FSClosestCopy closestCopy = getTargetRoot().getClosestCopy(originalPath); if (closestCopy != null) { FSRevisionRoot closestCopyRoot = closestCopy.getRevisionRoot(); String closestCopyPath = closestCopy.getPath(); if (originalPath.equals(closestCopyPath)) { FSRevisionNode closestCopyFromNode = closestCopyRoot.getRevisionNode( closestCopyPath); copyFromPath = closestCopyFromNode.getCopyFromPath(); copyFromRevision = closestCopyFromNode.getCopyFromRevision(); } } } myEditor.addFile(editPath, copyFromPath, copyFromRevision); return new SVNLocationEntry(copyFromRevision, copyFromPath); }
public static SVNLocationEntry findYoungestCopyroot(File reposRootDir, FSParentPath parPath) throws SVNException { SVNLocationEntry parentEntry = null; if (parPath.getParent() != null) { parentEntry = findYoungestCopyroot(reposRootDir, parPath.getParent()); } SVNLocationEntry myEntry = new SVNLocationEntry(parPath.getRevNode().getCopyRootRevision(), parPath.getRevNode().getCopyRootPath()); if (parentEntry != null) { if (myEntry.getRevision() >= parentEntry.getRevision()) { return myEntry; } return parentEntry; } return myEntry; }
public static SVNLocationEntry findYoungestCopyroot(File reposRootDir, FSParentPath parPath) throws SVNException { SVNLocationEntry parentEntry = null; if (parPath.getParent() != null) { parentEntry = findYoungestCopyroot(reposRootDir, parPath.getParent()); } SVNLocationEntry myEntry = new SVNLocationEntry(parPath.getRevNode().getCopyRootRevision(), parPath.getRevNode().getCopyRootPath()); if (parentEntry != null) { if (myEntry.getRevision() >= parentEntry.getRevision()) { return myEntry; } return parentEntry; } return myEntry; }
public static SVNLocationEntry findYoungestCopyroot(File reposRootDir, FSParentPath parPath) throws SVNException { SVNLocationEntry parentEntry = null; if (parPath.getParent() != null) { parentEntry = findYoungestCopyroot(reposRootDir, parPath.getParent()); } SVNLocationEntry myEntry = new SVNLocationEntry(parPath.getRevNode().getCopyRootRevision(), parPath.getRevNode().getCopyRootPath()); if (parentEntry != null) { if (myEntry.getRevision() >= parentEntry.getRevision()) { return myEntry; } return parentEntry; } return myEntry; }
public static SVNLocationEntry findYoungestCopyroot(File reposRootDir, FSParentPath parPath) throws SVNException { SVNLocationEntry parentEntry = null; if (parPath.getParent() != null) { parentEntry = findYoungestCopyroot(reposRootDir, parPath.getParent()); } SVNLocationEntry myEntry = new SVNLocationEntry(parPath.getRevNode().getCopyRootRevision(), parPath.getRevNode().getCopyRootPath()); if (parentEntry != null) { if (myEntry.getRevision() >= parentEntry.getRevision()) { return myEntry; } return parentEntry; } return myEntry; }