Refine search
public void writePathInfoToReportFile(String path, String linkPath, String lockToken, long revision, boolean startEmpty) throws SVNException { String anchorRelativePath = SVNPathUtil.append(getReportTarget(), path); String linkPathRep = linkPath != null ? "+" + linkPath.length() + ":" + linkPath : "-"; String revisionRep = FSRepository.isValidRevision(revision) ? "+" + revision + ":" : "-"; String lockTokenRep = lockToken != null ? "+" + lockToken.length() + ":" + lockToken : "-"; String startEmptyRep = startEmpty ? "+" : "-"; String fullRepresentation = "+" + anchorRelativePath.length() + ":" + anchorRelativePath + linkPathRep + revisionRep + startEmptyRep + lockTokenRep; try { OutputStream reportOS = getReportFileForWriting(); reportOS.write(fullRepresentation.getBytes("UTF-8")); } catch (IOException ioe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, ioe.getLocalizedMessage()); SVNErrorManager.error(err, ioe); } }
public void openFile(String path, long revision) throws SVNException { String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); FSRevisionNode revNode = myTxnRoot.getRevisionNode(fullPath); if (FSRepository.isValidRevision(revision) && revision < revNode.getCreatedRevision()) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, SVNNodeKind.FILE), SVNLogType.FSFS); } }
public static String concatToAbs(String f, String s) throws SVNException { f = f == null || "".equals(f) ? "/" : f; s = s == null ? "" : s; if (!isCanonical(f)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_PATH_SYNTAX, "path component ''{0}'' is not canonical", f); SVNErrorManager.error(err); } if (!isCanonical(s)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_PATH_SYNTAX, "path component ''{0}'' is not canonical", s); SVNErrorManager.error(err); } if("/".equals(f)){ if(s.startsWith("/")){ return s; } return "/" + s; } return append(f, s); }
public void openFile(String path, long revision) throws SVNException { String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); FSRevisionNode revNode = myTxnRoot.getRevisionNode(fullPath); if (FSRepository.isValidRevision(revision) && revision < revNode.getCreatedRevision()) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, SVNNodeKind.FILE), SVNLogType.FSFS); } }
public void openDir(String path, long revision) throws SVNException { DirBaton parentBaton = (DirBaton) myDirsStack.peek(); String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); SVNNodeKind kind = myTxnRoot.checkNodeKind(fullPath); if (kind == SVNNodeKind.NONE) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_DIRECTORY, "Path ''{0}'' not present", path); SVNErrorManager.error(err, SVNLogType.FSFS); } DirBaton dirBaton = new DirBaton(revision, fullPath, parentBaton.isCopied()); myDirsStack.push(dirBaton); }
public void openFile(String path, long revision) throws SVNException { String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); FSRevisionNode revNode = myTxnRoot.getRevisionNode(fullPath); if (FSRepository.isValidRevision(revision) && revision < revNode.getCreatedRevision()) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, SVNNodeKind.FILE), SVNLogType.FSFS); } }
public void openDir(String path, long revision) throws SVNException { DirBaton parentBaton = (DirBaton) myDirsStack.peek(); String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); SVNNodeKind kind = myTxnRoot.checkNodeKind(fullPath); if (kind == SVNNodeKind.NONE) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_DIRECTORY, "Path ''{0}'' not present", path); SVNErrorManager.error(err, SVNLogType.FSFS); } DirBaton dirBaton = new DirBaton(revision, fullPath, parentBaton.isCopied()); myDirsStack.push(dirBaton); }
public void deleteEntry(String path, long revision) throws SVNException { String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); SVNNodeKind kind = myTxnRoot.checkNodeKind(fullPath); if (kind == SVNNodeKind.NONE) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, kind), SVNLogType.FSFS); } FSRevisionNode existingNode = myTxnRoot.getRevisionNode(fullPath); long createdRev = existingNode.getCreatedRevision(); if (FSRepository.isValidRevision(revision) && revision < createdRev) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, kind), SVNLogType.FSFS); } myCommitter.deleteNode(fullPath); }
public void openDir(String path, long revision) throws SVNException { DirBaton parentBaton = (DirBaton) myDirsStack.peek(); String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); SVNNodeKind kind = myTxnRoot.checkNodeKind(fullPath); if (kind == SVNNodeKind.NONE) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_DIRECTORY, "Path ''{0}'' not present", path); SVNErrorManager.error(err, SVNLogType.FSFS); } DirBaton dirBaton = new DirBaton(revision, fullPath, parentBaton.isCopied()); myDirsStack.push(dirBaton); }
public void deleteEntry(String path, long revision) throws SVNException { String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); SVNNodeKind kind = myTxnRoot.checkNodeKind(fullPath); if (kind == SVNNodeKind.NONE) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, kind), SVNLogType.FSFS); } FSRevisionNode existingNode = myTxnRoot.getRevisionNode(fullPath); long createdRev = existingNode.getCreatedRevision(); if (FSRepository.isValidRevision(revision) && revision < createdRev) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, kind), SVNLogType.FSFS); } myCommitter.deleteNode(fullPath); }
public void writePathInfoToReportFile(String path, String linkPath, String lockToken, long revision, boolean startEmpty, SVNDepth depth) throws SVNException { if (depth == null || depth == SVNDepth.UNKNOWN) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.REPOS_BAD_ARGS, "Unsupported report depth ''{0}''", depth != null ? depth.getName() : "null"); SVNErrorManager.error(err, SVNLogType.FSFS); } String anchorRelativePath = SVNPathUtil.append(getReportTarget(), path); String revisionRep = FSRepository.isValidRevision(revision) ? "+" + String.valueOf(revision) + ":" : "-"; String depthRep = "-";//infinity by default if (depth == SVNDepth.EXCLUDE || depth == SVNDepth.EMPTY || depth == SVNDepth.FILES || depth == SVNDepth.IMMEDIATES) { depthRep = "+" + getDepthLetter(depth); } try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); writeSingleString(anchorRelativePath, baos); writeSingleString(linkPath, baos); baos.write(revisionRep.getBytes("UTF-8")); baos.write(depthRep.getBytes("UTF-8")); baos.write(startEmpty ? '+' : '-'); writeSingleString(lockToken, baos); OutputStream reportOS = getReportFileForWriting(); reportOS.write(baos.toByteArray()); } catch (IOException ioe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, ioe.getLocalizedMessage()); SVNErrorManager.error(err, ioe, SVNLogType.FSFS); } }
public void deleteEntry(String path, long revision) throws SVNException { String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); SVNNodeKind kind = myTxnRoot.checkNodeKind(fullPath); if (kind == SVNNodeKind.NONE) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, kind), SVNLogType.FSFS); } FSRevisionNode existingNode = myTxnRoot.getRevisionNode(fullPath); long createdRev = existingNode.getCreatedRevision(); if (FSRepository.isValidRevision(revision) && revision < createdRev) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, kind), SVNLogType.FSFS); } myCommitter.deleteNode(fullPath); }
public void writePathInfoToReportFile(String path, String linkPath, String lockToken, long revision, boolean startEmpty, SVNDepth depth) throws SVNException { if (depth == null || depth == SVNDepth.UNKNOWN) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.REPOS_BAD_ARGS, "Unsupported report depth ''{0}''", depth != null ? depth.getName() : "null"); SVNErrorManager.error(err, SVNLogType.FSFS); } String anchorRelativePath = SVNPathUtil.append(getReportTarget(), path); String revisionRep = FSRepository.isValidRevision(revision) ? "+" + String.valueOf(revision) + ":" : "-"; String depthRep = "-";//infinity by default if (depth == SVNDepth.EXCLUDE || depth == SVNDepth.EMPTY || depth == SVNDepth.FILES || depth == SVNDepth.IMMEDIATES) { depthRep = "+" + getDepthLetter(depth); } try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); writeSingleString(anchorRelativePath, baos); writeSingleString(linkPath, baos); baos.write(revisionRep.getBytes("UTF-8")); baos.write(depthRep.getBytes("UTF-8")); baos.write(startEmpty ? '+' : '-'); writeSingleString(lockToken, baos); OutputStream reportOS = getReportFileForWriting(); reportOS.write(baos.toByteArray()); } catch (IOException ioe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, ioe.getLocalizedMessage()); SVNErrorManager.error(err, ioe, SVNLogType.FSFS); } }
try { DAVBaselineInfo info = DAVUtil.getStableURL(connection, this, path, revision, false, true, null); path = SVNPathUtil.append(info.baselineBase, info.baselinePath); } catch (SVNException e) { if (e.getErrorMessage() != null && e.getErrorMessage().getErrorCode() == SVNErrorCode.FS_NOT_FOUND) { return null; SVNErrorManager.error(status.getError(), SVNLogType.NETWORK);
public void writePathInfoToReportFile(String path, String linkPath, String lockToken, long revision, boolean startEmpty, SVNDepth depth) throws SVNException { if (depth == null || depth == SVNDepth.UNKNOWN) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.REPOS_BAD_ARGS, "Unsupported report depth ''{0}''", depth != null ? depth.getName() : "null"); SVNErrorManager.error(err, SVNLogType.FSFS); } String anchorRelativePath = SVNPathUtil.append(getReportTarget(), path); String revisionRep = FSRepository.isValidRevision(revision) ? "+" + String.valueOf(revision) + ":" : "-"; String depthRep = "-";//infinity by default if (depth == SVNDepth.EXCLUDE || depth == SVNDepth.EMPTY || depth == SVNDepth.FILES || depth == SVNDepth.IMMEDIATES) { depthRep = "+" + getDepthLetter(depth); } try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); writeSingleString(anchorRelativePath, baos); writeSingleString(linkPath, baos); baos.write(revisionRep.getBytes("UTF-8")); baos.write(depthRep.getBytes("UTF-8")); baos.write(startEmpty ? '+' : '-'); writeSingleString(lockToken, baos); OutputStream reportOS = getReportFileForWriting(); reportOS.write(baos.toByteArray()); } catch (IOException ioe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, ioe.getLocalizedMessage()); SVNErrorManager.error(err, ioe, SVNLogType.FSFS); } }
try { DAVBaselineInfo info = DAVUtil.getBaselineInfo(connection, this, path, revision, false, true, null); path = SVNPathUtil.append(info.baselineBase, info.baselinePath); } catch (SVNException e) { if (e.getErrorMessage() != null && e.getErrorMessage().getErrorCode() == SVNErrorCode.FS_NOT_FOUND) { return null; SVNErrorManager.error(status.getError(), SVNLogType.NETWORK);
public void closeDir() throws SVNException { if (myIsVerify) { FSRevisionNode node = myRoot.getRevisionNode(myCurrentDirInfo.myFullPath); Map entries = node.getDirEntries(myFSFS); for (Iterator entriesIter = entries.keySet().iterator(); entriesIter.hasNext();) { String entryName = (String) entriesIter.next(); String entryPath = SVNPathUtil.append(myCurrentDirInfo.myFullPath, entryName); SVNNodeKind kind = myRoot.checkNodeKind(entryPath); FSRevisionNode entryNode = myRoot.getRevisionNode(entryPath); if (kind == SVNNodeKind.DIR) { entryNode.getDirEntries(myFSFS); } else if (kind == SVNNodeKind.FILE) { entryNode.getFileLength(); } else { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.NODE_UNEXPECTED_KIND, "Unexpected node kind {0} for ''{1}''", new Object[] { kind, entryPath }); SVNErrorManager.error(err, SVNLogType.FSFS); } } } for (Iterator entries = myCurrentDirInfo.myDeletedEntries.keySet().iterator(); entries.hasNext();) { String path = (String) entries.next(); dumpNode(path, SVNNodeKind.UNKNOWN, SVNAdminHelper.NODE_ACTION_DELETE, false, null, -1); } myCurrentDirInfo = myCurrentDirInfo.myParentInfo; }
public void closeDir() throws SVNException { if (myIsVerify) { FSRevisionNode node = myRoot.getRevisionNode(myCurrentDirInfo.myFullPath); Map entries = node.getDirEntries(myFSFS); for (Iterator entriesIter = entries.keySet().iterator(); entriesIter.hasNext();) { String entryName = (String) entriesIter.next(); String entryPath = SVNPathUtil.append(myCurrentDirInfo.myFullPath, entryName); SVNNodeKind kind = myRoot.checkNodeKind(entryPath); FSRevisionNode entryNode = myRoot.getRevisionNode(entryPath); if (kind == SVNNodeKind.DIR) { entryNode.getDirEntries(myFSFS); } else if (kind == SVNNodeKind.FILE) { entryNode.getFileLength(); } else { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.NODE_UNEXPECTED_KIND, "Unexpected node kind {0} for ''{1}''", new Object[] { kind, entryPath }); SVNErrorManager.error(err, SVNLogType.FSFS); } } } for (Iterator entries = myCurrentDirInfo.myDeletedEntries.keySet().iterator(); entries.hasNext();) { String path = (String) entries.next(); dumpNode(path, SVNNodeKind.UNKNOWN, SVNAdminHelper.NODE_ACTION_DELETE, false, null, -1); } myCurrentDirInfo = myCurrentDirInfo.myParentInfo; }
public void closeDir() throws SVNException { if (myIsVerify) { FSRevisionNode node = myRoot.getRevisionNode(myCurrentDirInfo.myFullPath); Map entries = node.getDirEntries(myFSFS); for (Iterator entriesIter = entries.keySet().iterator(); entriesIter.hasNext();) { String entryName = (String) entriesIter.next(); String entryPath = SVNPathUtil.append(myCurrentDirInfo.myFullPath, entryName); SVNNodeKind kind = myRoot.checkNodeKind(entryPath); FSRevisionNode entryNode = myRoot.getRevisionNode(entryPath); if (kind == SVNNodeKind.DIR) { entryNode.getDirEntries(myFSFS); } else if (kind == SVNNodeKind.FILE) { entryNode.getFileLength(); } else { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.NODE_UNEXPECTED_KIND, "Unexpected node kind {0} for ''{1}''", new Object[] { kind, entryPath }); SVNErrorManager.error(err, SVNLogType.FSFS); } } } for (Iterator entries = myCurrentDirInfo.myDeletedEntries.keySet().iterator(); entries.hasNext();) { String path = (String) entries.next(); dumpNode(path, SVNNodeKind.UNKNOWN, SVNAdminHelper.NODE_ACTION_DELETE, false, null, -1); } myCurrentDirInfo = myCurrentDirInfo.myParentInfo; }
public void closeFile(String path, String textChecksum) throws SVNException { flushPendingProperties(); if (textChecksum != null) { String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); FSRevisionNode revNode = myTxnRoot.getRevisionNode(fullPath); FSRepresentation txtRep = revNode.getTextRepresentation(); if (txtRep != null && !textChecksum.equals(txtRep.getMD5HexDigest())) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CHECKSUM_MISMATCH, "Checksum mismatch for resulting fulltext\n({0}):\n expected checksum: {1}\n actual checksum: {2}\n", new Object[] { fullPath, textChecksum, txtRep.getMD5HexDigest() }); SVNErrorManager.error(err, SVNLogType.FSFS); } } }