Hello, 

My implementation of the SVNKit library ISVNEditor.applyTextDelta API is
committing file updates for files that are unchanged.  I was under the
impression that SVN would ignore the commit if I commit the same exact file. 
When I use native SVN through the command line, it does ignore the unchanged
file commit.  Anyone see an issue with my implementation?  

Public class SVNKit{

public void addFiles(Map<String, ByteArrayOutputStream> inputDataMap) throws
Exception {   
    ISVNEditor editor = null;
    SVNRepository repo = null;
    Set<String> filesToAdd = new TreeSet<String>();
    Set<String> filesToUpdate = new TreeSet<String>();
    repo = openSession();
    Map<String, ByteArrayOutputStream> filesWithDirPath = new
HashMap<String, ByteArrayOutputStream>();
    Iterator<Map.Entry&lt;String, ByteArrayOutputStream>> filesIterator =
inputDataMap.entrySet().iterator();

      // add new files
      for (String file : filesToAdd) {
        editor.addFile(file, null, -1);
        handleFile(editor, file, filesWithDirPath);
      }

      // update existing files
      for (String file : filesToUpdate) {
        editor.openFile(file, -1);
        handleFile(editor, file, filesWithDirPathInLowerCase);
      }
      editor.closeEdit();

while (filesIterator.hasNext()) {
   if (nodeKind == SVNNodeKind.FILE) {
          filesToUpdate.add(lowerCaseFilePath);
        } else if (nodeKind == SVNNodeKind.NONE) {
          filesToAdd.add(lowerCaseFilePath);
        } else {
          throw new Exception("Unsupported SVN Node Kind: " + nodeKind);
        }

}

private void handleFile(ISVNEditor editor, String file, Map<String,
ByteArrayOutputStream> data) throws SVNException {
    editor.applyTextDelta(file, null);
    SVNDeltaGenerator gen = new SVNDeltaGenerator();
    String checksum = gen.sendDelta(file, new
ByteArrayInputStream(data.get(file).toByteArray()), editor, true);
    editor.closeFile(file, checksum);
  }
}



--
View this message in context: 
http://subversion.1072662.n5.nabble.com/ISVNEditor-applyTextDelta-Committing-Unchanged-Files-tp187500.html
Sent from the SVNKit - Users mailing list archive at Nabble.com.

Reply via email to