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

Re: Fixing issue 1950

From: Max Bowsher <maxb_at_ukf.net>
Date: 2005-01-09 16:43:30 CET

Max Bowsher wrote:
> I'd appreciate comments on the below proposed patch to fix issue 1950.
>
> It contains a small API change and a small "svn log" output change
> regarding
> revision 0, which want to give people a chance to comment on before I
> commit.

Ooops. That patch didn't even compile.

In my excitement of noticing that svn_client_log2 hadn't been released yet,
so was mutable, I'd overlooked that in moving the special case into a
seperate subroutine, it no longer has access to the ra_lib and session
variables.

Still, the problem is easily rectified. Here's the code section in question:

> + if (err && (err->apr_err == SVN_ERR_FS_NO_SUCH_REVISION)
> + && (start->kind == svn_opt_revision_head)
> + && ((end->kind == svn_opt_revision_number)
> + && (end->value.number == 1)))
> + {
> + svn_revnum_t youngest_rev;
> +
> + SVN_ERR (ra_lib->get_latest_revnum (session, &youngest_rev, pool));
> + if (youngest_rev == 0)
> + {
...

If the two revisions are HEAD and 1, and the error is "no such revision",
then it must be referring to 1, since HEAD must exist. And if 1 does not
exist, then the latest revnum of the repository is most definitely 0, and
need not even bother with calling get_latest_revnum at all!

Max.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Jan 9 16:44:54 2005

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.