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

Bug: JavaHL does not transmie post-commit error messages to caller (was: Fwd: Re: JavaHL bindings - post-commit error messages)

From: Martin Kutter <martin.kutter_at_fen-net.de>
Date: Mon, 22 Aug 2011 10:33:37 +0200

Hi,

I think there's a bug in JavaHL, which ignores post-commit error messages
and does not transmit it to the caller (neither directly, nor, via the
notify2 API).

Shall I file a bug report?

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
(v 1.6.18).
>
>It also looks like JavaHL (1.6.17) does not transmit post-commit error
>messages not even in notify callbacks.

Description:

There's no way for JavaHL clients to access a post-commit error message.
The post-commit error message is neither returned directly, nor via the
notify2 API.

Steps to reproduce:

1. Create svn repo with failing post-commit hook and output on stderr

  svnadmin create test/postcommiterror

  # create a post-commit hook like this in the new repository's hook
directory:
  post-commit.bat

  echo "Output to STDERR" 2>&1
  exit 1

2. Test with svn command line client, checkout, perform some change,
commit.

  svn co test/postcommiterror .
  cd postcommiterror
  mkdir test
  svn add test
  svn commit -m 'test postcommit error' .

Expected output is like this:

Committed revision 19.

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

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

 svn del test

 Run JUnit test from workbench (like eclipse)

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

Expected output would contain the error message as ErrMsg (and pass, as
the collection of ErrMsg would not be empty).

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());
        }
}

The described error has been reproduced on the following environments:

Clients:
OS: Windows XP, Windows Vista
Subversion Command Line: 1.6.17, binaries from CollabNet
Subclipse: 1.6.18
JavaHL: provided by Subclipse

Server:
- same as client
- Subversion 1.6.9 on AIX 5.2

Repository access:
- file://
- https://

Martin
Received on 2011-08-22 10:43:05 CEST

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

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