You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Hudson <gh...@MIT.EDU> on 2003/08/23 03:30:16 UTC
Re: [PATCH] Unifying and fixing the error handling for ra_local
and svnserve
I'm not sure whether I like the approach of having one bit of code to
test whether a directory looks like a repository root, and another bit
to open it. But it does make certain things simpler. (I tried fixing
the problem without taking that approach, and ran into trouble,
certainly.)
You really shouldn't leave behind variables named "candidate" in the two
functions you gutted. "Candidate" suggests it's in competition with
other possible candidates, but that's not the case any more; it's the
only path we're going to try.
If we're not going to look at repositories which don't have format
files, then check_repos_version() shouldn't try to handle that case. (I
don't think that code ever had any effect, actually; I think by the time
it was introduced, SVN_REPOS__VERSION was already non-zero.)
Your diff against serve.c looks like it's against a slightly old version
of that file.
+ err = svn_io_check_path (svn_path_join (path, SVN_REPOS__FORMAT, pool),
+ &kind, pool);
The second line should line up with the svn_path_join. (There are other
examples of this problem.)
+ if (err)
+ {
+ return svn_error_createf(SVN_ERR_RA_SVN_REPOS_NOT_FOUND, err,
+ "No repository found in '%s'", url);
+ }
Some source files choose to wrap single-statement, multi-line bodies in
braces. serve.c chooses not to. Please do not change that in a
piece-by-piece manner.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Unifying and fixing the error handling for ra_local and
svnserve
Posted by Tobias Ringström <to...@ringstrom.mine.nu>.
Greg Hudson wrote:
> Whoops, that was my MUA using a proportional font. Sorry for the
> mix-up; these fancy new mail programs frighten and confuse me. (There
> really was some bad second-line indentation in an older rev of serve.c,
> which I thought might have misled you, and it was fixed by one of the
> other developers in a recent checkin. But in fact, that had no bearing
> on what I was seeing.)
Ah - that explains it. I see that you are using Ximian Evolution. I
wonder why it changes spaces into tabs in the subject line. Seems like a
scary MUA indeed... :-)
> The revised patch looks good. If no one else gets to it (and they
> should feel free), I will try to apply it, sanity-check it, and check it
> in today or tomorrow.
Thanks a lot!
/Tobias
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Unifying and fixing the error handling for ra_local
and svnserve
Posted by Greg Hudson <gh...@MIT.EDU>.
On Sat, 2003-08-23 at 14:34, Tobias Ringström wrote:
> False alarm. It turned out to be your change to config_file.c in r6839
> that caused the failures. ;-) Updating to r6840 makes all tests pass again.
Oof. That's what I get for not runing "make check" because "it's just a
doc fix." Thanks for fixing that, David.
Your patch is committed.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Unifying and fixing the error handling for ra_local and
svnserve
Posted by Tobias Ringström <to...@ringstrom.mine.nu>.
Tobias Ringström wrote:
> Greg Hudson wrote:
>
>> The revised patch looks good. If no one else gets to it (and they
>> should feel free), I will try to apply it, sanity-check it, and check it
>> in today or tomorrow.
>
> Whops. I got failures when running "make check" with the revised patch.
> I'll investigate and get back ASAP.
False alarm. It turned out to be your change to config_file.c in r6839
that caused the failures. ;-) Updating to r6840 makes all tests pass again.
/Tobias
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Unifying and fixing the error handling for ra_local and
svnserve
Posted by Tobias Ringström <to...@ringstrom.mine.nu>.
Greg Hudson wrote:
> The revised patch looks good. If no one else gets to it (and they
> should feel free), I will try to apply it, sanity-check it, and check it
> in today or tomorrow.
Whops. I got failures when running "make check" with the revised patch.
I'll investigate and get back ASAP.
/Tobias
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Unifying and fixing the error handling for
ra_local and svnserve
Posted by Greg Hudson <gh...@MIT.EDU>.
On Sat, 2003-08-23 at 05:49, Tobias Ringström wrote:
> > Your diff against serve.c looks like it's against a slightly old version
> > of that file.
> > The second line should line up with the svn_path_join. (There are other
> > examples of this problem.)
Whoops, that was my MUA using a proportional font. Sorry for the
mix-up; these fancy new mail programs frighten and confuse me. (There
really was some bad second-line indentation in an older rev of serve.c,
which I thought might have misled you, and it was fixed by one of the
other developers in a recent checkin. But in fact, that had no bearing
on what I was seeing.)
The revised patch looks good. If no one else gets to it (and they
should feel free), I will try to apply it, sanity-check it, and check it
in today or tomorrow.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Unifying and fixing the error handling for ra_local and
svnserve
Posted by Tobias Ringström <to...@ringstrom.mine.nu>.
Hi Greg, and thanks a lot for reviewing the patch!
Greg Hudson wrote:
> I'm not sure whether I like the approach of having one bit of code to
> test whether a directory looks like a repository root, and another bit
> to open it. But it does make certain things simpler. (I tried fixing
> the problem without taking that approach, and ran into trouble,
> certainly.)
I think it does make the overall code cleaner. The open_repos loops were
not pretty.
> You really shouldn't leave behind variables named "candidate" in the two
> functions you gutted. "Candidate" suggests it's in competition with
> other possible candidates, but that's not the case any more; it's the
> only path we're going to try.
Your are right. I've changed it to repos_root instead. Fixed.
> If we're not going to look at repositories which don't have format
> files, then check_repos_version() shouldn't try to handle that case. (I
> don't think that code ever had any effect, actually; I think by the time
> it was introduced, SVN_REPOS__VERSION was already non-zero.)
I saw that code, but I did not want to make the patch larger and harder
to review by changing that too, but I guess I should have. :-) Fixed!
> Your diff against serve.c looks like it's against a slightly old version
> of that file.
That's odd. The base revision is from trunk revision 6838. I did an
update from trunk minutes before I sent the email. Are you sure I'm the
one with the slightly old version? ;-)
> + err = svn_io_check_path (svn_path_join (path, SVN_REPOS__FORMAT, pool),
> + &kind, pool);
>
> The second line should line up with the svn_path_join. (There are other
> examples of this problem.)
What do you mean? It looks lined up to me, and it looks just like other
functions in that file. If you show me how you want it to look I'm sure
I'll understand.
> + if (err)
> + {
> + return svn_error_createf(SVN_ERR_RA_SVN_REPOS_NOT_FOUND, err,
> + "No repository found in '%s'", url);
> + }
>
> Some source files choose to wrap single-statement, multi-line bodies in
> braces. serve.c chooses not to. Please do not change that in a
> piece-by-piece manner.
My apologies. I've fixed that one, and ones in repos.c and split_url.c
as well.
Thanks again for reviewing the patch! I've attached the updated patch.
The md5sum is a2175e22d8e91eba0fedfdb9e6980bad, and I sure hope that
it's a coincident that the sum end with "bad". :-)
/Tobias
------------------ log message ----------------------
The methods used by ra_local and svnserve to find the repository of an
URL were different. This was causing different behaviour in case of
errors. Fix the error handling to make sure that the error codes are
propagated to the user.
* subversion/include/svn_repos.h
(svn_repos_find_root_path): New
* libsvn_repos/repos.c
(check_repos_path): New
(check_repos_version): Require an existing format file.
(svn_repos_find_root_path): New
* libsvn_ra_local/split_url.c
(svn_ra_local__split_URL): Use the new svn_repos_find_root_path
function instead of looping and calling svn_repos_open. Renamed
candidate_url to candidate since it is not an URL. Propagate the
error from svn_repos_open if it fails so the user can get a clue.
* svnserve/serve.c
(find_repos): Use the new svn_repos_find_root_path function instead
of looping and calling svn_repos_open. Propagate the error from
svn_repos_open if it fails so the user can get a clue.