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

Re: svnmucc --revision 0 no longer works when creating a file

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Thu, 23 Jul 2020 00:17:46 +0000

sebb wrote on Wed, 22 Jul 2020 22:34 +0100:
> On Wed, 22 Jul 2020 at 17:46, Nathan Hartman <hartman.nathan_at_gmail.com> wrote:
> >
> > On Wed, Jul 22, 2020 at 12:10 PM sebb <sebbaz_at_gmail.com> wrote:
> > > > Use the machine-parseable E000042 error codes. That's exactly what
> > > > they're for. (which-error.py and svn_error_symbolic_name() can be used
> > > > to convert numbers to symbolic names.)
> > >
> > > Where are these error codes defined?
> > > I could not find any reference to them in the documentation.
> >
> > If you mean where in the source code:
> >
> > subversion/include/svn_error_codes.h
> > which is included by subversion/include/svn_error.h, which is further
> > included by subversion/svnmucc/svnmucc.c.
> >
> > Hope that helps,
>
> Thanks, but not really.
>
> If the error codes are intended to be machine-parseable then the
> programmer needs to have documentation of the values and their
> meanings.
> There needs to be at least a mention in the documentation that such
> codes exist and where to find the values. If there is such a mention,
> I could not find it.

Doxygen docs of svn_error_t::apr_err.

> Also, I had a look at the file and it does not show the numeric
> values,

I refer you again to which-error.py.

> and whilst there is a text string associated with each one it
> does not detail when it might be used.
> Nor indeed do the strings agree with the actual messages generated by
> SVN as far as I can tell.

No, they don't. The strings in that file are defaults, only used when
the line of code that raised an error didn't provide a more specific
string.

> e.g. svn list reports the following:
>
> svn: warning: W160013: Path '/x' not found
> svn: E200009: Could not list all targets because some targets don't exist

Great. Run which-error.py on this and you'll find that the former code
is SVN_ERR_FS_NOT_FOUND. That's basically the svn API equivalent of
ENOENT, i.e., "There's no node by that name in the versioned
filesystem". Therefore, you'll want to write your script to handle
E160013 errors by ignoring them and continuing.

The complication here is that `svn list` supports multiple target
arguments, and has to handle the case that some but not all of them are
invalid. It does so by reporting the errors from individual targets as
W* codes rather than E* codes and adding a generic E200009 error at the
end. You can either parse stderr despite this complication, or use the
API directly, in which case you'll sidestep this complication entirely
(you'll get just one integer, rather than two).

Daniel
Received on 2020-07-23 02:18:08 CEST

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