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

cmdline client adapter incorrectly treats stderr as hard error

From: Daniel Rall <dlr_at_finemaltcoding.com>
Date: 2005-10-12 20:32:38 CEST

This first SvnAnt test failure is caused by svnClientAdapter (for <add>).

Add.java attempts to get status for the file it plans to add, to assure that
the file isn't already a versioned resource:

            if (SVNStatusUtils.isManaged(svnClient.getSingleStatus(file)))
                return;

CmdLineClientAdapter.java calls info() and status() in succession:

        try {
            String cmdLineInfoStrings = _cmd.info(paths); <=== EXCEPTION
            String cmdLineStatusStrings = _cmd.status(paths, false, true, false);
            ...
        } catch (CmdLineException e) {
            throw SVNClientException.wrapException(e);
        }

info() triggers an exception when called on an unversioned resource, because
it writes the warning "filename: (Not a versioned resource)" to stderr with
Subversion 1.4-dev (trunk). This is caused by CommandLine.execString(). I
believe the same behavior exists in the upcoming Subversion 1.3.

I've attached a patch which supresses this exception in SvnAnt's Add.java.
However, this is not the Right approach to fixing this problem -- it should
be handled in svnClientAdapter, which can either 1) not treat any output to
stderr as a fatal error, instead acting on return code (my preference, but
could have significant side effects), or 2) examine the exception's log
message to see exactly what went wrong (a non-starter in a non-English
environment).

Thoughts?

- Dan

On Wed, 12 Oct 2005, Daniel Rall wrote:

> Testsuite: org.tigris.subversion.svnant.SvnCmdLineTest
> Tests run: 26, Failures: 0, Errors: 5, Time elapsed: 83.684 sec
> ------------- Standard Output ---------------
...
> Testcase: testAddCommit took 1.259 sec
> Caused an ERROR
> Cannot get status of file or directory
> /home/dlr/src/subclipse/svnant/test/svn/build.xml:102: Cannot get status of file or directory
> at org.tigris.subversion.svnant.Add.svnAddFileWithDirs(Add.java:232)
> at org.tigris.subversion.svnant.Add.svnAddFileSet(Add.java:281)
> at org.tigris.subversion.svnant.Add.execute(Add.java:112)
> at org.tigris.subversion.svnant.SvnTask.execute(SvnTask.java:312)
> at org.tigris.subversion.svnant.SvnCmdLineTest.executeTarget(SvnCmdLineTest.java:46)
> at org.tigris.subversion.svnant.SvnTest.testAddCommit(SvnTest.java:102)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> Caused by: org.tigris.subversion.svnclientadapter.SVNClientException: org.tigris.subversion.svnclientadapter.commandline.CmdLineException: /home/dlr/src/subclipse/svnant/test/svn/workingcopy/addCommitTest/file1.add: (Not a versioned resource)
>
>
> at org.tigris.subversion.svnclientadapter.SVNClientException.wrapException(Unknown Source)
> at org.tigris.subversion.svnclientadapter.commandline.CmdLineClientAdapter.getStatus(Unknown Source)
> at org.tigris.subversion.svnclientadapter.commandline.CmdLineClientAdapter.getSingleStatus(Unknown Source)
> at org.tigris.subversion.svnant.Add.svnAddFileWithDirs(Add.java:221)
> ... 26 more
> Caused by: org.tigris.subversion.svnclientadapter.commandline.CmdLineException: /home/dlr/src/subclipse/svnant/test/svn/workingcopy/addCommitTest/file1.add: (Not a versioned resource)
>
>
> at org.tigris.subversion.svnclientadapter.commandline.CommandLine.execString(Unknown Source)
> at org.tigris.subversion.svnclientadapter.commandline.SvnCommandLine.info(Unknown Source)
> ... 29 more
> --- Nested Exception ---
> org.tigris.subversion.svnclientadapter.SVNClientException: org.tigris.subversion.svnclientadapter.commandline.CmdLineException: /home/dlr/src/subclipse/svnant/test/svn/workingcopy/addCommitTest/file1.add: (Not a versioned resource)
>
>
> at org.tigris.subversion.svnclientadapter.SVNClientException.wrapException(Unknown Source)
> at org.tigris.subversion.svnclientadapter.commandline.CmdLineClientAdapter.getStatus(Unknown Source)
> at org.tigris.subversion.svnclientadapter.commandline.CmdLineClientAdapter.getSingleStatus(Unknown Source)
> at org.tigris.subversion.svnant.Add.svnAddFileWithDirs(Add.java:221)
> at org.tigris.subversion.svnant.Add.svnAddFileSet(Add.java:281)
> at org.tigris.subversion.svnant.Add.execute(Add.java:112)
> at org.tigris.subversion.svnant.SvnTask.execute(SvnTask.java:312)
> at org.tigris.subversion.svnant.SvnCmdLineTest.executeTarget(SvnCmdLineTest.java:46)
> at org.tigris.subversion.svnant.SvnTest.testAddCommit(SvnTest.java:102)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> Caused by: org.tigris.subversion.svnclientadapter.commandline.CmdLineException: /home/dlr/src/subclipse/svnant/test/svn/workingcopy/addCommitTest/file1.add: (Not a versioned resource)
>
>
> at org.tigris.subversion.svnclientadapter.commandline.CommandLine.execString(Unknown Source)
> at org.tigris.subversion.svnclientadapter.commandline.SvnCommandLine.info(Unknown Source)
> ... 29 more

  • text/plain attachment: patch
Received on Thu Oct 13 04:32:38 2005

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

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