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

Question: svn_ra_do_update() and editor->set_path()

From: Ph. Marek <philipp.marek_at_bmlv.gv.at>
Date: 2006-05-31 09:02:28 CEST

Hello everybody!

I seem to have a misunderstanding regarding the use svn_ra_do_update().

For an update operation I've got a local destination directory, an URL and a
target revision.

Currently I just give this URL to svn_ra_open(), and do svn_do_update on the
path "", giving set_path() my locally stored last revision number - which
updates the complete directory. Works fine.

If this is a new destination, ie. I don't have an old revision number, I gave
the revision 0. This works fine for the root directory in the repository, as
that always exists; but if the URL points to some subdirectory in the
repository I get an error "invalid path", as the given path doesn't exist in
revision 0.

What's the best way to get around that?

1) I could ask the ra layer for all entries in or below this directory, and do
a ->delete_path() or ->set_path() as appropriate - but that possibly means
querying the *full* hierarchy below my starting point, which may be huge.
(On a checkout (ie. an empty local directory) it's bit easier; I just need to
ask for the entries of this directory, and do a ->delete_path() for all of
them. If I tried that regardless of local state, I'd have to read the full
structure, though - so I'd have to special-case that.)

2) Is there a way to say "I'm starting at directory X, but it's empty"? The
first occurence (of this entry) in the repository may already include
sub-entries ... so there's no single revision number I can use.

3) I could check if it's the root directory; if it is, I just get an update
against 0 (like now), otherwise I could say "I'm at HEAD, but with this entry
removed" - then I'd get all entries below and just had to cut the beginning
of the path off.

Is there a better solution?

Thank you for all ideas!



PS: I found the function svn_ra_reparent, which is not mentioned in the public
headers. Shouldn't it be?

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed May 31 09:02:41 2006

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