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

[PATCH] Handle svnrdump errors the svn / svnadmin / svnauthz way

From: Evgeny Kotkov <evgeny.kotkov_at_visualsvn.com>
Date: Sun, 18 Aug 2013 04:27:40 +0400

Hi,

Currently the svnrdump command line tool does something quite different compared
to other programs like svn, svnadmin and svnauthz. By "quite different" I mean
that svnrdump does exactly the following:

- Inconsistently uses (svn_cmdline_handle_exit_error) and SVNRDUMP_ERR,
  which actually is (svn_handle_error2 + svn_error_clear) to handle errors.

- Sometimes destroys the top-level pool and sometimes does not destroy it, e.g.:
  * Running 'svnrdump --non-interactive --force-interactive' explicitly destroys
    the pool.
  * Running 'svnrdump dump INVALID-URL' does not destroy the pool thus leaving
    it to be destroyed during apr_terminate.

- Prefixes every possible exit path with the svn_pool_destroy call instead of
  making that call in a single place.

- Inconsistently uses SVN_INT_ERR instead of SVNRDUMP_ERR in one place:
[[[
    if (subcommand->name[0] == '-')
        SVN_INT_ERR(help_cmd(NULL, NULL, pool));
]]]

We can avoid all these inconsistencies by utilizing the (main / submain /
SVN_INT_ERR / EXIT_ERROR / single svn_pool_destroy call) pattern. That is the
way things are done in in svn / svnadmin and svnauthz.

See the attached patch.

Another thing is worth mentioning here. This patch prevents svnrdump from
crashing in the SSL + error-out case, which I recently reported to serf-dev [1].
That is *just a lucky coincidence*, because the problem is in serf, not in
svnrdump. So, this patch should in no way be considered a workaround for the
serf issue, it is simply about making things more consistent and better in
general.

[1]: https://groups.google.com/d/msg/serf-dev/gOn9HTUN98U/pz0_AqdrmJYJ

Thanks and regards,
Evgeny Kotkov

Received on 2013-08-18 02:28:36 CEST

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