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

Re: thoughts about a checkout --force option?

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2005-05-24 18:14:21 CEST

Gary Wilson Jr wrote:
> Gary Wilson Jr wrote:
>>I would like to suggest a --force option for svn checkout. It would do the
>>same as the --force flag for svn export, namely overwrite existing files and
>>don't complain about existing directories.

"checkout" is not as simple as "export" because the directories it creates are
Subversion working copies, not just plain directories. Therefore "Don't
complain about existing directories" is not enough of a specification. What
should it do with an existing plain directory and its contents when checking
out a WC directory at the same path? Turn it into a WC, presumably. What
should it do with an existing WC directory for the same repository and path?
What should it do with an existing directory for a different path or a
different repository?

Let's say that each checked out directory will cause any existing plain
directory of the same name to be converted into a WC, with all its existing
contents kept as unversioned items. And, if a checked out directory has the
same name as an existing WC directory, that is an error and the command aborts
without altering the existing WC directory in any way.

And, to be clear, each file that is checked out should replace any existing
file of the same name (regardless whether the file's content is the same), and
any other files that already exist on disk should just stay there as
unversioned items.

>>
>>A quick search through the users list showed at least 3 instances where this
>>has been mentioned before, but none I saw had any replies. See:
>>http://svn.haxx.se/users/archive-2004-03/1247.shtml
>>http://svn.haxx.se/users/archive-2005-04/0538.shtml
>>http://svn.haxx.se/users/archive-2005-03/0848.shtml
>>
>>Here is my use case for suggesting this option:
>>On machine A, I am keeping several directories under partial svn control, like
>>'/etc' and '/usr/local', using the in-place method as described in the FAQ
>>(http://subversion.tigris.org/faq.html#in-place-import). On machine B, I would
>>like to checkout the files under version control to '/' so that '/' is now a
>>working copy. Currently, this is not possible because the checkout terminates
>>with an error like "svn: Failed to add directory 'etc': object of the same name
>>already exists".

So in this scenario, only plain directories (no Working Copies) exist that
might clash with checked out directories.

>>
>>Several other commands make use of a --force flag, and I believe checkout
>>should be included.

In that sentence you seem to be implying that checkout should have a --force
flag _because_ other commands have it. That's not a valid argument, because
different commands use it for different purposes.

>>
>>Possible issues:
>>When trying to checkout to a directory (or subdirectory) that is already a
>>working copy. It seems like this is checked on checkout already, but should a
>>--force flag also force this? The svn add --force option currently overrides
>>the "already a working copy" warning.

Oh, OK, so you have thought of this, but your use case doesn't have existing
WCs so you don't mind what it does. I wouldn't make "--force" overwrite
existing WCs unless and until someone demonstrated a good use case for doing so.

I think I would be happy to see the version I sketched above (the two
paragraphs from "Let's say") implemented. I can help by reviewing the patch if
someone writes one.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue May 24 18:16:02 2005

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