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

Re: [PATCH] Be more helpful when read_entries dies.

From: Kevin Pilch-Bisson <kevin_at_pilch-bisson.net>
Date: 2001-12-12 15:30:25 CET

Thanks Justin. A couple of nits below.

On Wed, Dec 12, 2001 at 12:59:23AM -0800, Justin Erenkrantz wrote:
> Due to the pool corruption (who knows if this is related to
> Sander's new pool code in APR or how SVN uses pools - Sander's
> looking into it now), I had a corruption in one of my
> ..svn/entries files. This patch proved quite helpful in isolating
> which .svn/entries file was corrupted. -- justin
>
Can you provide a log message stating the changed file/function as described
in HACKING, and exampled in the commit logs.
>
> Index: subversion/libsvn_wc/entries.c
> ===================================================================
> --- subversion/libsvn_wc/.svn/text-base/entries.c.svn-base Mon Dec 10 01:50:05 2001
> +++ subversion/libsvn_wc/entries.c Wed Dec 12 00:51:36 2001
> @@ -665,9 +665,9 @@
> err = svn_xml_parse (svn_parser, buf, bytes_read,
> APR_STATUS_IS_EOF(apr_err));
> if (err)
> - return svn_error_quick_wrap
> - (err,
> - "read_entries: xml parser failed.");
> + return svn_error_createf(apr_err, 0, err, pool,
> + "read_entries: xml parser failed (%s).",
> + path->data);

I don't think apr_err is the error we want specify here. This will be 0 most
of the time meaning we would get a message like:

svn_error: #0 : <No Error>
  read_entries: xml parser failed (filename).

Except when we reach the end of file. Then we would describe an error due to
an end of file, which would probably be a red-herring.

Instead, I would do something like svn_error_createf (err->apr_err, 0, err, ...

Also note that the style of entries.c has spaces between the function name and
parenthesis.
> } while (!APR_STATUS_IS_EOF(apr_err));
>
> /* Close the entries file. */
>

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Pilch-Bisson                    http://www.pilch-bisson.net
     "Historically speaking, the presences of wheels in Unix
     has never precluded their reinvention." - Larry Wall
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • application/pgp-signature attachment: stored
Received on Sat Oct 21 14:36:52 2006

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.