private void getTree(FSFS fsfs, FSRoot root, String path, SVNNodeKind kind, FSID id, boolean includeIDs, int depth, boolean recursive, ISVNTreeHandler handler) throws SVNException { checkCancelled(); if (handler != null) { handler.handlePath(new SVNAdminPath(path, includeIDs ? id.toString() : null, depth, kind == SVNNodeKind.DIR)); } if (kind != SVNNodeKind.DIR) { return; } if (recursive || depth == 0) { FSRevisionNode node = root.getRevisionNode(path); Map entries = node.getDirEntries(fsfs); for (Iterator names = entries.keySet().iterator(); names.hasNext();) { String name = (String) names.next(); FSEntry entry = (FSEntry) entries.get(name); getTree(fsfs, root, SVNPathUtil.getAbsolutePath(SVNPathUtil.append(path, entry.getName())), entry.getType(), includeIDs ? entry.getId() : null, includeIDs, depth + 1, recursive, handler); } } }
private void getTree(FSFS fsfs, FSRoot root, String path, SVNNodeKind kind, FSID id, boolean includeIDs, int depth, boolean recursive, ISVNTreeHandler handler) throws SVNException { checkCancelled(); if (handler != null) { handler.handlePath(new SVNAdminPath(path, includeIDs ? id.toString() : null, depth, kind == SVNNodeKind.DIR)); } if (kind != SVNNodeKind.DIR) { return; } if (recursive || depth == 0) { FSRevisionNode node = root.getRevisionNode(path); Map entries = node.getDirEntries(fsfs); for (Iterator names = entries.keySet().iterator(); names.hasNext();) { String name = (String) names.next(); FSEntry entry = (FSEntry) entries.get(name); getTree(fsfs, root, SVNPathUtil.getAbsolutePath(SVNPathUtil.append(path, entry.getName())), entry.getType(), includeIDs ? entry.getId() : null, includeIDs, depth + 1, recursive, handler); } } }
private void getTree(FSFS fsfs, FSRoot root, String path, SVNNodeKind kind, FSID id, boolean includeIDs, int depth, boolean recursive, ISVNTreeHandler handler) throws SVNException { checkCancelled(); if (handler != null) { handler.handlePath(new SVNAdminPath(path, includeIDs ? id.toString() : null, depth, kind == SVNNodeKind.DIR)); } if (kind != SVNNodeKind.DIR) { return; } if (recursive || depth == 0) { FSRevisionNode node = root.getRevisionNode(path); Map entries = node.getDirEntries(fsfs); for (Iterator names = entries.keySet().iterator(); names.hasNext();) { String name = (String) names.next(); FSEntry entry = (FSEntry) entries.get(name); getTree(fsfs, root, SVNPathUtil.getAbsolutePath(SVNPathUtil.append(path, entry.getName())), entry.getType(), includeIDs ? entry.getId() : null, includeIDs, depth + 1, recursive, handler); } } }
public void writeChangeEntry(OutputStream changesFile, FSPathChange pathChange) throws SVNException, IOException { FSPathChangeKind changeKind = pathChange.getChangeKind(); if (!(changeKind == FSPathChangeKind.FS_PATH_CHANGE_ADD || changeKind == FSPathChangeKind.FS_PATH_CHANGE_DELETE || changeKind == FSPathChangeKind.FS_PATH_CHANGE_MODIFY || changeKind == FSPathChangeKind.FS_PATH_CHANGE_REPLACE || changeKind == FSPathChangeKind.FS_PATH_CHANGE_RESET)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Invalid change type"); SVNErrorManager.error(err); } String changeString = changeKind.toString(); String idString = null; if (pathChange.getRevNodeId() != null) { idString = pathChange.getRevNodeId().toString(); } else { idString = FSPathChangeKind.ACTION_RESET; } String output = idString + " " + changeString + " " + SVNProperty.toString(pathChange.isTextModified()) + " " + SVNProperty.toString(pathChange.arePropertiesModified()) + " " + pathChange.getPath() + "\n"; changesFile.write(output.getBytes("UTF-8")); String copyfromPath = pathChange.getCopyPath(); long copyfromRevision = pathChange.getCopyRevision(); if (copyfromPath != null && copyfromRevision != FSRepository.SVN_INVALID_REVNUM) { String copyfromLine = copyfromRevision + " " + copyfromPath; changesFile.write(copyfromLine.getBytes("UTF-8")); } changesFile.write("\n".getBytes("UTF-8")); }
public void writeChangeEntry(OutputStream changesFile, FSPathChange pathChange, boolean includeNodeKind) throws SVNException, IOException { FSPathChangeKind changeKind = pathChange.getChangeKind(); if (!(changeKind == FSPathChangeKind.FS_PATH_CHANGE_ADD || changeKind == FSPathChangeKind.FS_PATH_CHANGE_DELETE || changeKind == FSPathChangeKind.FS_PATH_CHANGE_MODIFY || changeKind == FSPathChangeKind.FS_PATH_CHANGE_REPLACE || changeKind == FSPathChangeKind.FS_PATH_CHANGE_RESET)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Invalid change type"); SVNErrorManager.error(err, SVNLogType.FSFS); } String changeString = changeKind.toString(); if (includeNodeKind) { changeString += "-" + pathChange.getKind().toString(); } String idString = null; if (pathChange.getRevNodeId() != null) { idString = pathChange.getRevNodeId().toString(); } else { idString = FSPathChangeKind.ACTION_RESET; } String output = idString + " " + changeString + " " + SVNProperty.toString(pathChange.isTextModified()) + " " + SVNProperty.toString(pathChange.arePropertiesModified()) + " " + pathChange.getPath() + "\n"; changesFile.write(output.getBytes("UTF-8")); String copyfromPath = pathChange.getCopyPath(); long copyfromRevision = pathChange.getCopyRevision(); if (copyfromPath != null && copyfromRevision != SVNRepository.INVALID_REVISION) { String copyfromLine = copyfromRevision + " " + copyfromPath; changesFile.write(copyfromLine.getBytes("UTF-8")); } changesFile.write("\n".getBytes("UTF-8")); }
public void setNodeOrigin(String nodeID, FSID nodeRevisionID) throws SVNException { File nodeOriginsDir = getNodeOriginsDir(); ensureDirExists(nodeOriginsDir, true); SVNProperties nodeOrigins = getNodeOriginsFromFile(nodeID); if (nodeOrigins == null) { nodeOrigins = new SVNProperties(); } String oldNodeRevID = nodeOrigins.getStringValue(nodeID); String nodeRevIDToStore = nodeRevisionID.toString(); if (oldNodeRevID != null && !nodeRevIDToStore.equals(oldNodeRevID)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Node origin for ''{0}'' exists with a different value ({1}) than what we were about " + "to store ({2})", new Object[] { nodeID, oldNodeRevID, nodeRevIDToStore }); SVNErrorManager.error(err, SVNLogType.FSFS); } nodeOrigins.put(nodeID, nodeRevIDToStore); File nodeOriginFile = getNodeOriginFile(nodeID); File tmpFile = SVNFileUtil.createUniqueFile(nodeOriginFile.getParentFile(), nodeOriginFile.getName(), ".tmp", false); SVNWCProperties.setProperties(nodeOrigins, nodeOriginFile, tmpFile, SVNWCProperties.SVN_HASH_TERMINATOR); }
public void setNodeOrigin(String nodeID, FSID nodeRevisionID) throws SVNException { File nodeOriginsDir = getNodeOriginsDir(); ensureDirExists(nodeOriginsDir, true); SVNProperties nodeOrigins = getNodeOriginsFromFile(nodeID); if (nodeOrigins == null) { nodeOrigins = new SVNProperties(); } String oldNodeRevID = nodeOrigins.getStringValue(nodeID); String nodeRevIDToStore = nodeRevisionID.toString(); if (oldNodeRevID != null && !nodeRevIDToStore.equals(oldNodeRevID)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Node origin for ''{0}'' exists with a different value ({1}) than what we were about " + "to store ({2})", new Object[] { nodeID, oldNodeRevID, nodeRevIDToStore }); SVNErrorManager.error(err, SVNLogType.FSFS); } nodeOrigins.put(nodeID, nodeRevIDToStore); File nodeOriginFile = getNodeOriginFile(nodeID); File tmpFile = SVNFileUtil.createUniqueFile(nodeOriginFile.getParentFile(), nodeOriginFile.getName(), ".tmp", false); SVNWCProperties.setProperties(nodeOrigins, nodeOriginFile, tmpFile, SVNWCProperties.SVN_HASH_TERMINATOR); }
public void writeChangeEntry(OutputStream changesFile, FSPathChange pathChange, boolean includeNodeKind) throws SVNException, IOException { FSPathChangeKind changeKind = pathChange.getChangeKind(); if (!(changeKind == FSPathChangeKind.FS_PATH_CHANGE_ADD || changeKind == FSPathChangeKind.FS_PATH_CHANGE_DELETE || changeKind == FSPathChangeKind.FS_PATH_CHANGE_MODIFY || changeKind == FSPathChangeKind.FS_PATH_CHANGE_REPLACE || changeKind == FSPathChangeKind.FS_PATH_CHANGE_RESET)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Invalid change type"); SVNErrorManager.error(err, SVNLogType.FSFS); } String changeString = changeKind.toString(); if (includeNodeKind) { changeString += "-" + pathChange.getKind().toString(); } String idString = null; if (pathChange.getRevNodeId() != null) { idString = pathChange.getRevNodeId().toString(); } else { idString = FSPathChangeKind.ACTION_RESET; } String output = idString + " " + changeString + " " + SVNProperty.toString(pathChange.isTextModified()) + " " + SVNProperty.toString(pathChange.arePropertiesModified()) + " " + pathChange.getPath() + "\n"; changesFile.write(output.getBytes("UTF-8")); String copyfromPath = pathChange.getCopyPath(); long copyfromRevision = pathChange.getCopyRevision(); if (copyfromPath != null && copyfromRevision != SVNRepository.INVALID_REVISION) { String copyfromLine = copyfromRevision + " " + copyfromPath; changesFile.write(copyfromLine.getBytes("UTF-8")); } changesFile.write("\n".getBytes("UTF-8")); }
public void setNodeOrigin(String nodeID, FSID nodeRevisionID) throws SVNException { File nodeOriginsDir = getNodeOriginsDir(); ensureDirExists(nodeOriginsDir, true); SVNProperties nodeOrigins = getNodeOriginsFromFile(nodeID); if (nodeOrigins == null) { nodeOrigins = new SVNProperties(); } String oldNodeRevID = nodeOrigins.getStringValue(nodeID); String nodeRevIDToStore = nodeRevisionID.toString(); if (oldNodeRevID != null && !nodeRevIDToStore.equals(oldNodeRevID)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Node origin for ''{0}'' exists with a different value ({1}) than what we were about " + "to store ({2})", new Object[] { nodeID, oldNodeRevID, nodeRevIDToStore }); SVNErrorManager.error(err, SVNLogType.FSFS); } nodeOrigins.put(nodeID, nodeRevIDToStore); File nodeOriginFile = getNodeOriginFile(nodeID); File tmpFile = SVNFileUtil.createUniqueFile(nodeOriginFile.getParentFile(), nodeOriginFile.getName(), ".tmp", false); SVNWCProperties.setProperties(nodeOrigins, nodeOriginFile, tmpFile, SVNWCProperties.SVN_HASH_TERMINATOR); }
public void writeChangeEntry(OutputStream changesFile, FSPathChange pathChange, boolean includeNodeKind) throws SVNException, IOException { FSPathChangeKind changeKind = pathChange.getChangeKind(); if (!(changeKind == FSPathChangeKind.FS_PATH_CHANGE_ADD || changeKind == FSPathChangeKind.FS_PATH_CHANGE_DELETE || changeKind == FSPathChangeKind.FS_PATH_CHANGE_MODIFY || changeKind == FSPathChangeKind.FS_PATH_CHANGE_REPLACE || changeKind == FSPathChangeKind.FS_PATH_CHANGE_RESET)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Invalid change type"); SVNErrorManager.error(err, SVNLogType.FSFS); } String changeString = changeKind.toString(); if (includeNodeKind) { changeString += "-" + pathChange.getKind().toString(); } String idString = null; if (pathChange.getRevNodeId() != null) { idString = pathChange.getRevNodeId().toString(); } else { idString = FSPathChangeKind.ACTION_RESET; } final boolean includeMergeInfoModifications = getOwner().getDBFormat() >= FSFS.MIN_MERGEINFO_IN_CHANGED_FORMAT; String mergeInfoString = includeMergeInfoModifications ? SVNProperty.toString(pathChange.getMergeInfoModified() == Boolean.TRUE) + " " : ""; String output = idString + " " + changeString + " " + SVNProperty.toString(pathChange.isTextModified()) + " " + SVNProperty.toString(pathChange.arePropertiesModified()) + " " + mergeInfoString + pathChange.getPath() + "\n"; changesFile.write(output.getBytes("UTF-8")); String copyfromPath = pathChange.getCopyPath(); long copyfromRevision = pathChange.getCopyRevision(); if (copyfromPath != null && copyfromRevision != SVNRepository.INVALID_REVISION) { String copyfromLine = copyfromRevision + " " + copyfromPath; changesFile.write(copyfromLine.getBytes("UTF-8")); } changesFile.write("\n".getBytes("UTF-8")); }
FSRevisionRoot revRoot = fsfs.createRevisionRoot(revision); FSRevisionNode node = revRoot.getRevisionNode(history.getHistoryEntry().getPath()); id = node.getId().toString();
FSRevisionRoot revRoot = fsfs.createRevisionRoot(revision); FSRevisionNode node = revRoot.getRevisionNode(history.getHistoryEntry().getPath()); id = node.getId().toString();
FSRevisionRoot revRoot = fsfs.createRevisionRoot(revision); FSRevisionNode node = revRoot.getRevisionNode(history.getHistoryEntry().getPath()); id = node.getId().toString();
SVNProperties.appendProperty(entryName, kind + " " + entryId.toString(), dst); if (dirContents != null) { dirContents.put(entryName, new FSEntry(entryId, kind, entryName));
SVNWCProperties.appendProperty(entryName, SVNPropertyValue.create(kind + " " + entryId.toString()), dst); if (dirContents != null) { dirContents.put(entryName, new FSEntry(entryId, kind, entryName));
SVNWCProperties.appendProperty(entryName, SVNPropertyValue.create(kind + " " + entryId.toString()), dst); if (dirContents != null) { dirContents.put(entryName, new FSEntry(entryId, kind, entryName));
SVNWCProperties.appendProperty(entryName, SVNPropertyValue.create(kind + " " + entryId.toString()), dst); if (dirContents != null) { dirContents.put(entryName, new FSEntry(entryId, kind, entryName));