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

heaven == hordes of developers

From: Karl Fogel <kfogel_at_newton.ch.collab.net>
Date: 2002-01-21 17:32:00 CET

This Saturday, I was at Jim Blandy's house, and as we were playing
around with Subversion, we noticed that "svn log" could fail silently
under some circumstances. We traced it into svn_client_log() and saw
that the code was just tossing an error instead of propagating it.

So we sent me an email to remind me to fix it when I got home. I got
home, looked at my commit emails, and saw that Philip Martin had
already fixed it in rev 972 -- in fact, from the commit timestamp, it
looks like he was writing the fix at the very same time Jim and I were
discovering the bug. :-)

Yessssssssssssssss.

-K

Jim Blandy <jimb@zwingli.cygnus.com> writes:
> `svn log' failed silently when it couldn't look up the name
> `svn.collab.net'. This was probably because of a name server failure
> at my ISP.
>
> If svn_client__open_ra_session returns an error below, svn_client_log
> doesn't propagate it on to its caller.
>
>
> svn_error_t *
> svn_client_log (svn_client_auth_baton_t *auth_baton,
> const apr_array_header_t *targets,
> svn_revnum_t start,
> svn_revnum_t end,
> svn_boolean_t discover_changed_paths,
> svn_log_message_receiver_t receiver,
> void *receiver_baton,
> apr_pool_t *pool)
> {
> svn_ra_plugin_t *ra_lib;
> void *ra_baton, *session;
> svn_stringbuf_t *URL;
> svn_wc_entry_t *entry;
> svn_stringbuf_t *basename;
> apr_array_header_t *condensed_targets;
>
> SVN_ERR (svn_path_condense_targets (&basename, &condensed_targets,
> targets, pool));
>
> /* Get full URL from the common path, carefully. */
> SVN_ERR (svn_wc_entry (&entry, basename, pool));
> if (! entry)
> return svn_error_createf
> (SVN_ERR_WC_OBSTRUCTED_UPDATE, 0, NULL, pool,
> "svn_client_update: %s is not under revision control", basename->data);
> if (! entry->url)
> return svn_error_createf
> (SVN_ERR_WC_ENTRY_MISSING_URL, 0, NULL, pool,
> "svn_client_update: entry '%s' has no URL", basename->data);
> URL = svn_stringbuf_dup (entry->url, pool);
>
> /* ### huh!? the "log" feature kinda needs to talk to the repos... */
> /* Do RA interaction here to figure out what is out of date with
> respect to the repository. All RA errors are non-fatal!! */
>
> /* Get the RA library that handles URL. */
> SVN_ERR (svn_ra_init_ra_libs (&ra_baton, pool));
> if (svn_ra_get_ra_library (&ra_lib, ra_baton, URL->data, pool) != NULL)
> return SVN_NO_ERROR;
>
> /* Open a repository session to the URL. */
> /* ### why is an error okay in this situation? */
> if (svn_client__open_ra_session (&session, ra_lib, URL, basename,
> TRUE, TRUE, auth_baton, pool) != NULL)
> return SVN_NO_ERROR;
>
> SVN_ERR (ra_lib->get_log (session,
> condensed_targets, /* ### todo: or `targets'? */
> start,
> end,
> discover_changed_paths,
> receiver,
> receiver_baton));
>
> /* We're done with the RA session. */
> (void) ra_lib->close (session);
>
> return SVN_NO_ERROR;
> }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:57 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.