public Map detectChanged() throws SVNException { Map changes = getChangedPaths(); if (changes.size() == 0) { return changes; } for (Iterator paths = changes.keySet().iterator(); paths.hasNext();) { String changedPath = (String) paths.next(); FSPathChange change = (FSPathChange) changes.get(changedPath); if (change.getChangeKind() == FSPathChangeKind.FS_PATH_CHANGE_RESET) { paths.remove(); } } return changes; }
public Map detectChanged() throws SVNException { Map changes = getChangedPaths(); if (changes.size() == 0) { return changes; } for (Iterator paths = changes.keySet().iterator(); paths.hasNext();) { String changedPath = (String) paths.next(); FSPathChange change = (FSPathChange) changes.get(changedPath); if (change.getChangeKind() == FSPathChangeKind.FS_PATH_CHANGE_RESET) { paths.remove(); } } return changes; }
public Map detectChanged() throws SVNException { Map changes = getChangedPaths(); if (changes.size() == 0) { return changes; } for (Iterator paths = changes.keySet().iterator(); paths.hasNext();) { String changedPath = (String) paths.next(); FSPathChange change = (FSPathChange) changes.get(changedPath); if (change.getChangeKind() == FSPathChangeKind.FS_PATH_CHANGE_RESET) { paths.remove(); } } return changes; }
public Map detectChanged() throws SVNException { Map changes = getChangedPaths(); if (changes.size() == 0) { return changes; } for (Iterator paths = changes.keySet().iterator(); paths.hasNext();) { String changedPath = (String) paths.next(); FSPathChange change = (FSPathChange) changes.get(changedPath); if (change.getChangeKind() == FSPathChangeKind.FS_PATH_CHANGE_RESET) { paths.remove(); } } return changes; }
protected Map fetchAllChanges(FSFile changesFile, boolean prefolded) throws SVNException { Map changedPaths = new HashMap(); FSPathChange change = readChange(changesFile); while (change != null) { foldChange(changedPaths, change); if ((FSPathChangeKind.FS_PATH_CHANGE_DELETE == change.getChangeKind() || FSPathChangeKind.FS_PATH_CHANGE_REPLACE == change.getChangeKind()) && !prefolded) { for (Iterator curIter = changedPaths.keySet().iterator(); curIter.hasNext();) { String hashKeyPath = (String) curIter.next(); if (change.getPath().equals(hashKeyPath)) { continue; } if (SVNPathUtil.pathIsChild(change.getPath(), hashKeyPath) != null) { curIter.remove(); } } } change = readChange(changesFile); } return changedPaths; }
private void verifyLocks() throws SVNException { Map changes = myTxnRoot.getChangedPaths(); Object[] changedPaths = changes.keySet().toArray(); Arrays.sort(changedPaths); String lastRecursedPath = null; for (int i = 0; i < changedPaths.length; i++) { String changedPath = (String) changedPaths[i]; boolean recurse = true; if (lastRecursedPath != null && SVNPathUtil.getPathAsChild(lastRecursedPath, changedPath) != null) { continue; } FSPathChange change = (FSPathChange) changes.get(changedPath); if (change.getChangeKind() == FSPathChangeKind.FS_PATH_CHANGE_MODIFY) { recurse = false; } allowLockedOperation(myFSFS, changedPath, myAuthor, myLockTokens, recurse, true); if (recurse) { lastRecursedPath = changedPath; } } }
private void verifyLocks() throws SVNException { Map changes = myTxnRoot.getChangedPaths(); Object[] changedPaths = changes.keySet().toArray(); Arrays.sort(changedPaths); String lastRecursedPath = null; for (int i = 0; i < changedPaths.length; i++) { String changedPath = (String) changedPaths[i]; boolean recurse = true; if (lastRecursedPath != null && SVNPathUtil.pathIsChild(lastRecursedPath, changedPath) != null) { continue; } FSPathChange change = (FSPathChange) changes.get(changedPath); if (change.getChangeKind() == FSPathChangeKind.FS_PATH_CHANGE_MODIFY) { recurse = false; } allowLockedOperation(myFSFS, changedPath, myAuthor, myLockTokens, recurse, true); if (recurse) { lastRecursedPath = changedPath; } } }
private void verifyLocks() throws SVNException { Map changes = myTxnRoot.getChangedPaths(); Object[] changedPaths = changes.keySet().toArray(); Arrays.sort(changedPaths); String lastRecursedPath = null; for (int i = 0; i < changedPaths.length; i++) { String changedPath = (String) changedPaths[i]; boolean recurse = true; if (lastRecursedPath != null && SVNPathUtil.getPathAsChild(lastRecursedPath, changedPath) != null) { continue; } FSPathChange change = (FSPathChange) changes.get(changedPath); if (change.getChangeKind() == FSPathChangeKind.FS_PATH_CHANGE_MODIFY) { recurse = false; } allowLockedOperation(myFSFS, changedPath, myAuthor, myLockTokens, recurse, true); if (recurse) { lastRecursedPath = changedPath; } } }
protected Map fetchAllChanges(FSFile changesFile, boolean prefolded) throws SVNException { Map changedPaths = new SVNHashMap(); FSPathChange change = readChange(changesFile); while (change != null) { foldChange(changedPaths, change); if ((FSPathChangeKind.FS_PATH_CHANGE_DELETE == change.getChangeKind() || FSPathChangeKind.FS_PATH_CHANGE_REPLACE == change.getChangeKind()) && !prefolded) { for (Iterator curIter = changedPaths.keySet().iterator(); curIter.hasNext();) { String hashKeyPath = (String) curIter.next(); if (change.getPath().equals(hashKeyPath)) { continue; } if (SVNPathUtil.getPathAsChild(change.getPath(), hashKeyPath) != null) { curIter.remove(); } } } change = readChange(changesFile); } return changedPaths; }
protected Map fetchAllChanges(FSFile changesFile, boolean prefolded) throws SVNException { Map changedPaths = new SVNHashMap(); FSPathChange change = readChange(changesFile); while (change != null) { foldChange(changedPaths, change); if ((FSPathChangeKind.FS_PATH_CHANGE_DELETE == change.getChangeKind() || FSPathChangeKind.FS_PATH_CHANGE_REPLACE == change.getChangeKind()) && !prefolded) { for (Iterator curIter = changedPaths.keySet().iterator(); curIter.hasNext();) { String hashKeyPath = (String) curIter.next(); if (change.getPath().equals(hashKeyPath)) { continue; } if (SVNPathUtil.getPathAsChild(change.getPath(), hashKeyPath) != null) { curIter.remove(); } } } change = readChange(changesFile); } return changedPaths; }
protected Map fetchAllChanges(FSFile changesFile, boolean prefolded) throws SVNException { Map changedPaths = new SVNHashMap(); FSPathChange change = readChange(changesFile); while (change != null) { foldChange(changedPaths, change); if ((FSPathChangeKind.FS_PATH_CHANGE_DELETE == change.getChangeKind() || FSPathChangeKind.FS_PATH_CHANGE_REPLACE == change.getChangeKind()) && !prefolded) { for (Iterator curIter = changedPaths.keySet().iterator(); curIter.hasNext();) { String hashKeyPath = (String) curIter.next(); if (change.getPath().equals(hashKeyPath)) { continue; } if (SVNPathUtil.getPathAsChild(change.getPath(), hashKeyPath) != null) { curIter.remove(); } } } change = readChange(changesFile); } return changedPaths; }
private void verifyLocks() throws SVNException { FSTransactionRoot txnRoot = getTxnRoot(); Map changes = txnRoot.getChangedPaths(); Object[] changedPaths = changes.keySet().toArray(); Arrays.sort(changedPaths); String lastRecursedPath = null; for (int i = 0; i < changedPaths.length; i++) { String changedPath = (String) changedPaths[i]; boolean recurse = true; if (lastRecursedPath != null && SVNPathUtil.getPathAsChild(lastRecursedPath, changedPath) != null) { continue; } FSPathChange change = (FSPathChange) changes.get(changedPath); if (change.getChangeKind() == FSPathChangeKind.FS_PATH_CHANGE_MODIFY) { recurse = false; } allowLockedOperation(myFSFS, changedPath, myAuthor, myLockTokens, recurse, true); if (recurse) { lastRecursedPath = changedPath; } } }
private void writeChanges(CountingOutputStream protoFile, Map changedPaths, boolean includeNodeKind, boolean terminateList) throws SVNException, IOException { for (Iterator paths = changedPaths.keySet().iterator(); paths.hasNext();) { String path = (String) paths.next(); FSPathChange change = (FSPathChange) changedPaths.get(path); FSID id = change.getRevNodeId(); if (change.getChangeKind() != FSPathChangeKind.FS_PATH_CHANGE_DELETE && !id.isTxn()) { FSRevisionNode revNode = getOwner().getRevisionNode(id); change.setRevNodeId(revNode.getId()); } writeChangeEntry(protoFile, change, includeNodeKind); } if (terminateList) { protoFile.write('\n'); } }
public long writeFinalChangedPathInfo(final CountingStream protoFile) throws SVNException, IOException { long offset = protoFile.getPosition(); Map changedPaths = getChangedPaths(); for (Iterator paths = changedPaths.keySet().iterator(); paths.hasNext();) { String path = (String) paths.next(); FSPathChange change = (FSPathChange) changedPaths.get(path); FSID id = change.getRevNodeId(); if (change.getChangeKind() != FSPathChangeKind.FS_PATH_CHANGE_DELETE && !id.isTxn()) { FSRevisionNode revNode = getOwner().getRevisionNode(id); change.setRevNodeId(revNode.getId()); } writeChangeEntry(protoFile, change); } return offset; }
public long writeFinalChangedPathInfo(final CountingOutputStream protoFile) throws SVNException, IOException { long offset = protoFile.getPosition(); Map changedPaths = getChangedPaths(); boolean includeNodeKind = getOwner().getDBFormat() >= FSFS.MIN_KIND_IN_CHANGED_FORMAT; for (Iterator paths = changedPaths.keySet().iterator(); paths.hasNext();) { String path = (String) paths.next(); FSPathChange change = (FSPathChange) changedPaths.get(path); FSID id = change.getRevNodeId(); if (change.getChangeKind() != FSPathChangeKind.FS_PATH_CHANGE_DELETE && !id.isTxn()) { FSRevisionNode revNode = getOwner().getRevisionNode(id); change.setRevNodeId(revNode.getId()); } writeChangeEntry(protoFile, change, includeNodeKind); } return offset; }
public long writeFinalChangedPathInfo(final CountingOutputStream protoFile) throws SVNException, IOException { long offset = protoFile.getPosition(); Map changedPaths = getChangedPaths(); boolean includeNodeKind = getOwner().getDBFormat() >= FSFS.MIN_KIND_IN_CHANGED_FORMAT; for (Iterator paths = changedPaths.keySet().iterator(); paths.hasNext();) { String path = (String) paths.next(); FSPathChange change = (FSPathChange) changedPaths.get(path); FSID id = change.getRevNodeId(); if (change.getChangeKind() != FSPathChangeKind.FS_PATH_CHANGE_DELETE && !id.isTxn()) { FSRevisionNode revNode = getOwner().getRevisionNode(id); change.setRevNodeId(revNode.getId()); } writeChangeEntry(protoFile, change, includeNodeKind); } return offset; }
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 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 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")); }