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

Re: [PATCH] Move multiple targets

From: Hyrum K. Wright <hyrum_wright_at_byu.edu>
Date: 2005-11-08 00:59:36 CET

Julian Foad wrote:
> Hyrum K. Wright wrote:
>
>> This patch modifies the move subcommand to accept more than two
>> arguments, similar to the unix mv command. If there are only two
>> arguments, the command continues the current behavior. If there are
>> more than two, it checks to see if the last one is a directory, and if
>> it is, moves the preceding targets into it.
>
>
> Thanks for the patch. I would like this enhancement. I have some
> concerns.
>
> (1) "copy" is very similar to "move", and should be modified in this way
> at the same time.
>
> (2) The current behaviour of "svn move" (with respect to how the
> destination is interpreted) is not documented in its help text. We need
> to decide whether we are happy with it, and document it, first, so that
> we can make sure the multiple-source behaviour is consistent with the
> single-source behaviour.
>
> In the existing two-argument "svn move", I believe that if the target
> already exists and is a directory, the source is copied INTO the
> destination dir, otherwise the source is copied TO the destination.
> This is under discussion at the API level in the thread "API proposal -
> issue 2188 - svn_client_copy/move". Similar arguments apply to the
> command-line interface, but the desired interface may well differ (and,
> in particular, needs to be backward-compatible).
>
>
>> Right now, this change lives in the client, but would it be better to
>> have the multiple move logic live somewhere lower down the stack, such
>> as the wc layer?
>
>
> Yes. At least for the case of a move performed directly on a
> repository, it needs to be done at a lower layer so that the move is
> done in one commit and not N commits.

Thanks for the comments and review. Upon further thought, here's a
proposed plan of attack for implementing this feature for both the copy
and move commands. If there are any fatal flaws in my reasoning, please
point them out.

1) In the command line client, let anything with more than 2 targets get
through to the client layer.

2) In the client layer, rev svn_client_move so that it takes multiple
targets, not just a src_path and dst_path.

3) Actually do determination of multiple moves or copies in the client
layer, making multiple calls to the correct copy handler.

A few questions this brings up are:

Should we allow a heterogeneous list of targets to move, such as:
svn mv alpha file:///path/to/repo/beta gamma dir1
or do all of the targets to move need to be either wc paths or URLs, but
not both?

Relatedly, the current command line documentation seems to imply that
both the SRC and the DST have to be working copy paths or URLs, but the
client layer has functions for copying from the WC to a URL and vice
versa. Should that documentation be updated?

Something else I noticed is that when svn mv is run without arguments,
it prints the command line help, but when something like svn propset is
run, it just errors with 'Too few arguments'. I suspect there are other
commands like this. Should their behavior be changed to be consistent
with move, or should move just error out? Personally, I think that the
former idea a better help for the user.

I'm sure there are other things to consider, but I this is all that
comes to mind. Please let me know what I'm missing.

Thanks,
-Hyrum

Received on Tue Nov 8 01:00:38 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.