[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: JavaHL bindings - post-commit error messages

From: Martin Kutter <martin.kutter_at_fen-net.de>
Date: Fri, 19 Aug 2011 08:59:34 +0200

On Wed, 17 Aug 2011 19:56:13 +0200, Martin Kutter
<martin.kutter_at_fen-net.de> wrote:
> Hi,
>
> Am Dienstag, den 16.08.2011, 11:14 -0400 schrieb Mark Phippard:
>> On Tue, Aug 16, 2011 at 11:09 AM, Martin Kutter
>> <martin.kutter_at_fen-net.de>wrote:
>> > is there a way to receive get post-commit error messages on
performing
>> > a
>> > commit with the JavaHL bindings?
>>
>> Subclipse uses JavaHL and I believe it shows these messages. Have you
>> registered a call back to receive the Notifications?
>>
>>
http://subversion.apache.org/docs/javahl/1.6/org/tigris/subversion/javahl/Notify2.html
>>

Subclipse does not show post-commit error messages (at least not ).

It also looks like JavaHL (1.6.17) does not transmit post-commit error
messages not even in notify callbacks.

Is this a bug?

Steps to reproduce:

1. Create svn repo with failing post-commit hook and output on stderr
2. Test with svn command line client, checkout, perform some change,
commit.
Expected output is like this:
D:\Martin\workspace\test>svn commit -m 'test'
Adding site

Committed revision 19.

Warning: post-commit hook failed (exit code 1) with output:
"Ausgabe auf STDERR"

3. make some change to the wc, and run the JUnit test below (with paths
changed to match your system)

Test fails, output is

1.6.17 (r1128011)
Acttion: 17
ChangelistName: null
ContentState: 1
ErrMsg: null
Kind: 2
LockState: 1
MimeType: null
Path: D:/Martin/workspace/test/site
PathPrefix: D:/Martin/workspace
PropState: 1
Revision: -1
Lock: null
MergeRange: null
Source: D:/Martin/workspace/test/site
Commited revision: 18

Here's the test code:

package org.tigris.subversion.javahl;

import static org.junit.Assert.*;

import java.util.ArrayList;
import java.util.List;
import org.junit.Test;

public class SVNClientTest {

        private List<NotifyInformation> notifications = new
ArrayList<NotifyInformation>();
        
        @Test
        public void testCommit() {
                SVNClientInterface client = new SVNClient();
                System.out.println(client.getVersion());
                Notify2 notify = new Notify2() {
                        
                        @Override
                        public void onNotify(NotifyInformation info) {
                                System.out.println("Acttion: " + info.getAction());
                                System.out.println("ChangelistName: " + info.getChangelistName());
                                System.out.println("ContentState: " + info.getContentState());
                                System.out.println("ErrMsg: " + info.getErrMsg());
                                System.out.println("Kind: " + info.getKind());
                                System.out.println("LockState: " + info.getLockState());
                                System.out.println("MimeType: " + info.getMimeType());
                                System.out.println("Path: " + info.getPath());
                                System.out.println("PathPrefix: " + info.getPathPrefix());
                                System.out.println("PropState: " + info.getPropState());
                                System.out.println("Revision: " + info.getRevision());
                                System.out.println("Lock: " + info.getLock());
                                System.out.println("MergeRange: " + info.getMergeRange());
                                System.out.println("Source: " + info.getSource());
                
                                notifications.add(info);
                        }
                };
                
                client.notification2(notify);
                
                String[] paths = new String[] { "D:/Martin/workspace/test" };
                String[] changeLists = new String[] {};
                try {
                        long result = client.commit(paths, "test", Depth.infinity, false,
false, null, null);
                        if (result > 0) {
                                System.out.println("Commited revision: " + result);
                        }
                } catch (ClientException e) {
                        e.printStackTrace();
                }
                                
                List<String> errors = new ArrayList<String>();
                for (NotifyInformation info : notifications) {
                        if (info.getErrMsg() != null)
                                errors.add(info.getErrMsg());
                }
                assertNotSame(0, errors.size());
        }
}

Martin
Received on 2011-08-19 09:00:19 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.