Kenny Ayers edited a comment on Bug JENKINS-14551

All,

I may have found the issue. I'd like the Jenkins devs to take a look, and I've also appended this information to the SVNKit ticket, here: http://issues.tmatesoft.com/issue/SVNKIT-368

In org.tmatesoft.svn.core.internal.wc.SVNUpdateEditor15.java, in function addFileWithHistory (line 867), there's a code block that calls myFileFetcher.fetchFile() twice. Each time this is called, baseTextOS is written to. Upon the second write, the file contents are duplicated. Here's the code:

baseTextOS = SVNFileUtil.openFileForWriting(info.copiedBaseText);
myFileFetcher.fetchFile(copyFromPath, copyFromRevision, baseTextOS, baseProperties);
SVNChecksumOutputStream checksumBaseTextOS = new SVNChecksumOutputStream(baseTextOS, 
SVNChecksumOutputStream.MD5_ALGORITHM, true);
baseTextOS = checksumBaseTextOS;
myFileFetcher.fetchFile(copyFromPath, copyFromRevision, baseTextOS, baseProperties);
info.copiedBaseChecksum = checksumBaseTextOS.getDigest();

I was able to find this by stepping through the code using NetBeans IDE 7.3 attached to a remote debugging session on Jenkins. I've compiled and tested this change inside the context of the subversion-plugin and the file contents are no longer duplicated.

I've forked the svnkit repo used in Jenkins here, and committed this change if anyone would like to download the fix and do some testing:

https://github.com/theotherwhitemeat/svnkit-1/commit/27decb28216ee4fd15b8fcbdb769bf41d81978eb

Here's my patch:

Index: SVNUpdateEditor15.java
===================================================================
--- SVNUpdateEditor15.java	(revision 9722)
+++ SVNUpdateEditor15.java	(working copy)
@@ -864,7 +864,6 @@
             OutputStream baseTextOS = null;
             try {
                 baseTextOS = SVNFileUtil.openFileForWriting(info.copiedBaseText);
-                myFileFetcher.fetchFile(copyFromPath, copyFromRevision, baseTextOS, baseProperties);
                 SVNChecksumOutputStream checksumBaseTextOS = new SVNChecksumOutputStream(baseTextOS, 
                         SVNChecksumOutputStream.MD5_ALGORITHM, true);
                 baseTextOS = checksumBaseTextOS;

Thank you,

Kenny Ayers

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply via email to