You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Ben Collins-Sussman <su...@collab.net> on 2005/03/02 21:26:32 UTC
ra_svn_check_path() conundrums, need advice.
I have a patch (just about ready to commit) which makes
svn_ra_check_path() return a full svn_dirent_t, rather than just an
svn_node_kind.
I've had to tweak all three RA layers for this, as well as tweak 17
callers in libsvn_client to use 'dirent->kind' rather than just 'kind'.
The reason for this change is
* it makes svn_ra_check_path() into a real stat-like call, which is
Nice Thing.
* it makes 'svn info URL' (and 'svn ls URL') more efficient. No
need to fetch a thousand sibling dirents just to learn about one
object.
In any case, I've run into several problems. In the case of ra_dav, it
turns out that all we need to do is send a depth-0 PROPFIND request...
it's guaranteed to succeed. In the case of ra_svn, it may or may not
get back an svn_dirent_t from the server. If the server is old, then
we just don't get the thing. What to do in this case?
There are two possible things that could happen:
1. Have ra_svn return a "feature not implemented" error, and then
make 17 libsvn_client callers deal with this possiblity... presumably
by making all of these callers run svn_client_ls(parentURL) to
inefficiently fetch the dirent.
2. Teach ra_svn_check_path() to return the dirent unconditionally, by
falling back on some similar strategy. It would need to call
ra_svn_get_dir() on the parent URL. This is certainly less coding
work.
Both strategies have ugly implications for users. If they use a 1.2
client to talk to a 1.1 svnserve, suddenly a bunch of common commands
are now fetching bunches of dirents under the hood, just to stat a
single URL item. If a directory is large, common commands might be
noticeably slower. :-(
Also, the specific problem with strategy #2 above is that if the RA
session is already opened to a file-URL, there's no way to "re-anchor"
the RA session on the parent URL. It would mean ra_svn_check_path()
would be internally creating a whole new RA session (calling
ra_svn_open()). Pretty icky.
I seem to be in a twisty maze of dead-ends. Can anyone help me find my
way out of here?
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: ra_svn_check_path() conundrums, need advice.
Posted by Ben Collins-Sussman <su...@collab.net>.
On Mar 2, 2005, at 5:05 PM, Julian Foad wrote:
> Ben Collins-Sussman wrote:
>> Well, I suppose there's always one obvious solution:
>> 1. don't change svn_ra_check_path() at all.
> [...]
>
> That sounds likely to be best, unless more than half of the 17 callers
> would make use of the extra information in which case it might be
> worth changing the exisiting function.
>
None of the 17 callers care about getting the entire dirent_t, other
than svn_client_ls() and svn_client_info(). So I'll go with the
"invent a new RA call" solution.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: ra_svn_check_path() conundrums, need advice.
Posted by Julian Foad <ju...@btopenworld.com>.
Ben Collins-Sussman wrote:
> Well, I suppose there's always one obvious solution:
>
> 1. don't change svn_ra_check_path() at all.
[...]
That sounds likely to be best, unless more than half of the 17 callers would
make use of the extra information in which case it might be worth changing the
exisiting function.
- Julian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: ra_svn_check_path() conundrums, need advice.
Posted by Ben Collins-Sussman <su...@collab.net>.
On Mar 2, 2005, at 3:26 PM, Ben Collins-Sussman wrote:
>
> I seem to be in a twisty maze of dead-ends. Can anyone help me find
> my way out of here?
>
Well, I suppose there's always one obvious solution:
1. don't change svn_ra_check_path() at all.
2. invent a new RA API which is almost the same, but returns a
dirent. document that it might return SVN_ERR_UNSUPPORTED_FEATURE.
3. only teach svn_client_ls() and svn_client_info() to use the new
API. Let them privately deal with 'falling back' to inefficient
listings when talking to an older server.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: ra_svn_check_path() conundrums, need advice.
Posted by Greg Hudson <gh...@MIT.EDU>.
On Wed, 2005-03-02 at 16:26, Ben Collins-Sussman wrote:
> Also, the specific problem with strategy #2 above is that if the RA
> session is already opened to a file-URL, there's no way to "re-anchor"
> the RA session on the parent URL.
Incidentally, I would like for there to be a way to re-anchor RA
sessions, because I would like svn to start treating RA sessions as more
heavyweight than it does. (Because for svn+ssh:// with password auth,
an RA session means typing your password.) The re-anchoring function
could be allowed to open a new session when talking to an old server.
However, it seems just as wrong for svn_ra_check_path() to re-anchor an
RA session as it would be to open a new one. So it still seems like
libsvn_client has to be involved in the fallback, ugly as that is.
So this isn't directly related to the ra_svn_check_path() issue, just
something on my wishlist.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org