public int compare(Object o1, Object o2) { FSEntry e1 = (FSEntry) o1; FSEntry e2 = (FSEntry) o2; if (srcMap != null) { boolean has1Src = srcMap.containsKey(e1.getName()); boolean has2Src = srcMap.containsKey(e2.getName()); if (has1Src != has2Src) { return has1Src ? 1 : -1; } } return e1.compareTo(e2); } });
private SVNDirEntry buildDirEntry(FSEntry repEntry, SVNURL parentURL, FSRevisionNode entryNode, boolean includeLogs) throws SVNException { entryNode = entryNode == null ? myFSFS.getRevisionNode(repEntry.getId()) : entryNode; long size = 0; if (entryNode.getType() == SVNNodeKind.FILE) { size = entryNode.getFileLength(); } Map props = null; props = entryNode.getProperties(myFSFS); boolean hasProps = (props == null || props.size() == 0) ? false : true; Map revProps = null; revProps = myFSFS.getRevisionProperties(repEntry.getId().getRevision()); String lastAuthor = null; String log = null; Date lastCommitDate = null; if (revProps != null && revProps.size() > 0) { lastAuthor = (String) revProps.get(SVNRevisionProperty.AUTHOR); log = (String) revProps.get(SVNRevisionProperty.LOG); String timeString = (String) revProps.get(SVNRevisionProperty.DATE); lastCommitDate = timeString != null ? SVNTimeUtil.parseDateString(timeString) : null; } SVNURL entryURL = parentURL.appendPath(repEntry.getName(), false); SVNDirEntry dirEntry = new SVNDirEntry(entryURL, repEntry.getName(), repEntry.getType(), size, hasProps, repEntry.getId().getRevision(), lastCommitDate, lastAuthor, includeLogs ? log : null); dirEntry.setRelativePath(repEntry.getName()); return dirEntry; }
String entryName = (String) entryNames.next(); FSEntry entry = (FSEntry) entries.get(entryName); String newPath = SVNPathUtil.append(path, entry.getName()); addSubdirectory(srcRoot, tgtRoot, editor, SVNPathUtil.append(srcPath, entry.getName()), newPath); editor.closeDir(); } else if (entry.getType() == SVNNodeKind.FILE) { editor.addFile(SVNPathUtil.append(path, entry.getName()), null, -1); String newSrcPath = SVNPathUtil.append(srcPath, entry.getName()); FSRevisionNode srcNode = srcRoot.getRevisionNode(newSrcPath);
String targetFullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(tgtPath, tgtEntry.getName())); String editFullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(editPath, tgtEntry.getName())); String sourceFullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(srcPath, tgtEntry.getName())); SVNNodeKind srcKind = srcEntry.getType(); String name = (String) srcEntries.next(); FSEntry entry = (FSEntry) sourceEntries.get(name); String editFullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(editPath, entry.getName())); editor.deleteEntry(editFullPath, -1);
String targetFullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(tgtPath, tgtEntry.getName())); String editFullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(editPath, tgtEntry.getName())); String sourceFullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(srcPath, tgtEntry.getName())); SVNNodeKind srcKind = srcEntry.getType(); String name = (String) srcEntries.next(); FSEntry entry = (FSEntry) sourceEntries.get(name); String editFullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(editPath, entry.getName())); editor.deleteEntry(editFullPath, -1);
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); } } }
String targetFullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(tgtPath, tgtEntry.getName())); String editFullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(editPath, tgtEntry.getName())); String sourceFullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(srcPath, tgtEntry.getName())); SVNNodeKind srcKind = srcEntry.getType(); String name = (String) srcEntries.next(); FSEntry entry = (FSEntry) sourceEntries.get(name); String editFullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(editPath, entry.getName())); editor.deleteEntry(editFullPath, -1);
String targetFullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(tgtPath, tgtEntry.getName())); String editFullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(editPath, tgtEntry.getName())); String sourceFullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(srcPath, tgtEntry.getName())); SVNNodeKind srcKind = srcEntry.getType(); String name = (String) srcEntries.next(); FSEntry srcEntry = (FSEntry) sourceEntries.get(name); String editFullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(editPath, srcEntry.getName())); if (myDepth == SVNDepth.INFINITY || srcEntry.getType() != SVNNodeKind.DIR) { myEditor.deleteEntry(editFullPath, -1);
String targetFullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(tgtPath, tgtEntry.getName())); String editFullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(editPath, tgtEntry.getName())); String sourceFullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(srcPath, tgtEntry.getName())); SVNNodeKind srcKind = srcEntry.getType(); String name = (String) srcEntries.next(); FSEntry srcEntry = (FSEntry) sourceEntries.get(name); String editFullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(editPath, srcEntry.getName())); if (myDepth == SVNDepth.INFINITY || srcEntry.getType() != SVNNodeKind.DIR) { myEditor.deleteEntry(editFullPath, -1);
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); } } }
String entryName = (String) entryNames.next(); FSEntry entry = (FSEntry) entries.get(entryName); String newPath = SVNPathUtil.append(path, entry.getName()); addSubdirectory(srcRoot, tgtRoot, editor, SVNPathUtil.append(srcPath, entry.getName()), newPath); editor.closeDir(); } else if (entry.getType() == SVNNodeKind.FILE) { editor.addFile(SVNPathUtil.append(path, entry.getName()), null, -1); String newSrcPath = SVNPathUtil.append(srcPath, entry.getName()); FSRevisionNode srcNode = srcRoot.getRevisionNode(newSrcPath);
String entryName = (String) entryNames.next(); FSEntry entry = (FSEntry) entries.get(entryName); String newPath = SVNPathUtil.append(path, entry.getName()); addSubdirectory(srcRoot, tgtRoot, editor, SVNPathUtil.append(srcPath, entry.getName()), newPath); editor.closeDir(); } else if (entry.getType() == SVNNodeKind.FILE) { editor.addFile(SVNPathUtil.append(path, entry.getName()), null, -1); String newSrcPath = SVNPathUtil.append(srcPath, entry.getName()); FSRevisionNode srcNode = srcRoot.getRevisionNode(newSrcPath);
private Map crawlDirectoryForMergeInfo(FSRevisionRoot root, String path, FSRevisionNode node, Map result) throws SVNException { FSFS fsfs = root.getOwner(); Map entries = node.getDirEntries(fsfs); for (Iterator entriesIter = entries.values().iterator(); entriesIter.hasNext();) { FSEntry entry = (FSEntry) entriesIter.next(); String kidPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(path, entry.getName())); FSRevisionNode kidNode = root.getRevisionNode(kidPath); if (kidNode.hasMergeInfo()) { SVNProperties propList = kidNode.getProperties(fsfs); String mergeInfoString = propList.getStringValue(SVNProperty.MERGE_INFO); if (mergeInfoString == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Node-revision #''{0}'' claims to have mergeinfo but doesn''t", entry.getId()); SVNErrorManager.error(err, SVNLogType.FSFS); } Map kidMergeInfo = SVNMergeInfoUtil.parseMergeInfo(new StringBuffer(mergeInfoString), null); result.put(kidPath, kidMergeInfo); } if (kidNode.hasDescendantsWithMergeInfo()) { crawlDirectoryForMergeInfo(root, kidPath, kidNode, result); } } return result; }
private Map crawlDirectoryForMergeInfo(FSRevisionRoot root, String path, FSRevisionNode node, Map result) throws SVNException { FSFS fsfs = root.getOwner(); Map entries = node.getDirEntries(fsfs); for (Iterator entriesIter = entries.values().iterator(); entriesIter.hasNext();) { FSEntry entry = (FSEntry) entriesIter.next(); String kidPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(path, entry.getName())); FSRevisionNode kidNode = root.getRevisionNode(kidPath); if (kidNode.hasMergeInfo()) { SVNProperties propList = kidNode.getProperties(fsfs); String mergeInfoString = propList.getStringValue(SVNProperty.MERGE_INFO); if (mergeInfoString == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Node-revision #''{0}'' claims to have mergeinfo but doesn''t", entry.getId()); SVNErrorManager.error(err, SVNLogType.FSFS); } Map kidMergeInfo = SVNMergeInfoUtil.parseMergeInfo(new StringBuffer(mergeInfoString), null); result.put(kidPath, kidMergeInfo); } if (kidNode.hasDescendantsWithMergeInfo()) { crawlDirectoryForMergeInfo(root, kidPath, kidNode, result); } } return result; }
private Map crawlDirectoryForMergeInfo(FSRevisionRoot root, String path, FSRevisionNode node, Map result) throws SVNException { FSFS fsfs = root.getOwner(); Map entries = node.getDirEntries(fsfs); for (Iterator entriesIter = entries.values().iterator(); entriesIter.hasNext();) { FSEntry entry = (FSEntry) entriesIter.next(); String kidPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(path, entry.getName())); FSRevisionNode kidNode = root.getRevisionNode(kidPath); if (kidNode.hasMergeInfo()) { SVNProperties propList = kidNode.getProperties(fsfs); String mergeInfoString = propList.getStringValue(SVNProperty.MERGE_INFO); if (mergeInfoString == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Node-revision #''{0}'' claims to have mergeinfo but doesn''t", entry.getId()); SVNErrorManager.error(err, SVNLogType.FSFS); } Map kidMergeInfo = SVNMergeInfoUtil.parseMergeInfo(new StringBuffer(mergeInfoString), null); result.put(kidPath, kidMergeInfo); } if (kidNode.hasDescendantsWithMergeInfo()) { crawlDirectoryForMergeInfo(root, kidPath, kidNode, result); } } return result; }
String entryName = (String) entryNames.next(); FSEntry entry = (FSEntry) entries.get(entryName); String newPath = SVNPathUtil.append(path, entry.getName()); addSubdirectory(srcRoot, tgtRoot, editor, SVNPathUtil.append(srcPath, entry.getName()), newPath); editor.closeDir(); } else if (entry.getType() == SVNNodeKind.FILE) { editor.addFile(SVNPathUtil.append(path, entry.getName()), null, -1); String newSrcPath = SVNPathUtil.append(srcPath, entry.getName()); FSRevisionNode srcNode = srcRoot.getRevisionNode(newSrcPath);