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

Re: API proposal - issue 2188 - svn_client_copy/move

From: Max Bowsher <maxb_at_ukf.net>
Date: 2005-04-01 19:49:27 CEST

Philip Martin wrote:
> "Max Bowsher" <maxb@ukf.net> writes:
>> svn_client_move has been revved to svn_client_move2 in 1.2, which
>> makes it an attractive idea to get some further planned changes to
>> this API out of the way now too.
> There is another enhancement that has been requested: allow multiple
> source URLs to be moved or copied into a single destination URL,
> i.e. make the source argument into an APR array.

Does it have an issue? What are the intended semantics for
existant/non-existant destinations?

>> See issue 2188 for details, but the short version is:
>> Clients of our API want to be able to disable the implicit behaviour
>> of "if copy destination exists and is a directory, append basename of
>> the source to the destination" that we have now. This behaviour makes
>> sense in some circumstances, but can prove a great annoyance in others.
>> So, the initial obvious solution is trivial - a new boolean parameter.
> Another trivial solution is to move the logic out of libsvn_client
> altogether and put it in the application.

No, because the current API must remain compatible, so such code must remain
in libsvn_client, so we might as well make the convenience available to
client writers.

>> HOWEVER, I think there is a better API change:
>> Add a new tri-state enum parameter:
>> enum {
>> svn_copymove_collision_error,
>> svn_copymove_collision_make_child,
>> svn_copymove_collision_replace
>> };
>> To illustrate, file:///repos/A and file:///repos/B are two directories
>> that exist:
>> svn_copymove_collision_error:
>> svn cp file:///repos/A file:///repos/B
>> - causes error.
>> svn_copymove_collision_make_child:
>> svn cp file:///repos/A file:///repos/B
>> - copies A to file:///repos/B/A
>> svn_copymove_collision_replace:
>> svn cp file:///repos/A file:///repos/B
>> - is equivalent to:
>> svn rm file:///repos/B
>> svn cp file:///repos/A file:///repos/B
>> except that it uses only 1 revision number.
>> I am particularly interested in this, because I have seen emails from
>> quite a few disappointed users wanting to "move a tag" in just 1
>> revision, instead of the 2-stage process which is the only workaround
>> now (rm, cp).
> I wanted to something like that earlier this year, I wrote a program
> to do it. My program bypasses libsvn_client and drives an RA commit
> editor directly to combine multiple mv, cp and rm commands on URLs
> into a single commit.

Indeed, but most people won't be so ingenious.


To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Apr 1 19:56:33 2005

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