Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 354843

Summary: Display post-commit error messages to the user
Product: [Technology] Subversive Reporter: Martin Kutter <martin.kutter>
Component: CoreAssignee: Igor Burilo <igor.burilo>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: shuoink
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Martin Kutter CLA 2011-08-16 10:58:32 EDT
Build Identifier: 0.7.9.I20110724-1700

Subversive does not display post-commit error messages back to the client.

According to the svn book, it should (Chapter 9. Subversion Complete Reference - Repository Hooks - post-commit): If the post-commit hook returns a nonzero exit status, the commit will not be aborted since it has already completed. However,
anything that the hook printed to stderr will be marshalled back to the client, making it easier to diagnose hook failures.

This also requires a change in the SvnKit and JavaHL providers.

SvnKit allows access to the required information in the SVNCommitInfo object returned by SVNCommitClient's doCommit method. The JavaHL-based SVNClientImpl's interface in SvnKit however, does not return the full SVNCommitInfo, but only the revision number.

JavaHL up to 1.6 does not allow access to the post-commit error message - all commit methods only return the revision number on success, or throw an exception on error.  


Reproducible: Always

Steps to Reproduce:
1. Create a subversion repository by clicking "New Repository" in the SVN Repositories view (a local one) and create a new subversion repository.
2. Navigate to the newly created repository, descend into the "hooks" directory and add a post-commit script like this (make it executable if necessary):
 Win: post-commit.bat
 
 echo "Post-Commit Error Message" 1>&2
 exit 1

 Linux/Unix: post-commit
 
 #!/bin/bash
 echo "Post-Commit Error Message" 1>&2
 exit 1

3. Perform a commit on the newly created repository. The SVN client should display the message "Post-Commit Error Message" to the user. Subversive will display no message at all (aside from showing a successful commit).
Comment 1 Martin Kutter CLA 2011-08-19 03:09:02 EDT
This seems to be due to a bug in JavaHL - see discussion on Mailing list at http://svn.haxx.se/users/archive-2011-08/0421.shtml
Comment 2 Martin Kutter CLA 2011-08-26 02:11:35 EDT
Looks like the JavaHL CommitInfo class will contain the post-commit errors from 1.7 on - see http://svn.haxx.se/dev/archive-2011-08/0477.shtml
Comment 3 Martin Kutter CLA 2011-09-12 07:43:02 EDT
The post-commit error message is included from Subversion 1.7.0-rc2 on as postCommitError in the org.apache.subversion.javahl.CommitInfo class.
Comment 4 Alexander Gurov CLA 2011-11-18 03:24:01 EST
(In reply to comment #3)
> The post-commit error message is included from Subversion 1.7.0-rc2 on as
> postCommitError in the org.apache.subversion.javahl.CommitInfo class.
Thank you for you help. SVN 1.7 client is under development now, so I'll be sure to not miss this moment.
Comment 5 Alexander Gurov CLA 2013-02-12 09:42:58 EST
Fixed.

Now it'll work with SVN 1.7.x connectors.