[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: Jim Blandy <jimb_at_red-bean.com>
Date: 2005-11-10 08:54:37 CET

On 11/9/05, Julian Foad <julianfoad@btopenworld.com> wrote:
> * If dest is already a dir, move src into it?
> -> No. (It is unreasonable for a caller not to know where it wants the
> destination to go. The only reason such an ambiguous command is usable at
> the
> command line is because users have out-of-band knowledge of whether the
> destination directory already exists.)
> (Differs from existing API.)

I think this is a great change. The way mv's behavior changes depending on
whether the destination exists and what type it has if it does has always
bugged me when I'm writing shell scripts where the destination isn't
something I created. You can end up doing very weird things when what you
really wanted was an error.

Using separate functions for "move into a dir" and "give this a new name,
possibly in a new directory" also lets you reflect the fact that the first
function of the pair can reasonably operate on many sources, whereas the
second doesn't, in the argument types: the first one takes an array of
sources, and the second one takes a single source.
Received on Thu Nov 10 08:55:30 2005

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