[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: Gary Wilson Jr <gdub_at_ece.utexas.edu>
Date: 2005-05-24 22:53:17 CEST

Julian Foad wrote:
> 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.

Yes, I agree that is how it should work.

>>> 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.

Yes, I think the main issues here are what the --force flag should force OR
should more than one flag be introduced.

Here are some options:

1) --force
    new files and directories are written and become part of working copy
    overwrite existing files, which become part of working copy
    other already-existing files stay unversioned
    existing directories become become part of working copy
        other already-existing subdirectories and files stay unversioned
        error if directory is already a working copy

Notes: inconsistent with export's --force flag which will overwrite files and
use existing directories (working copy or not).

2) --force
    same as 1) but no error if directory is already a working copy

Notes: consistent with export's --force. Granted, with export it would be
harder to ruin a working copy, but it would be possible (overwriting local
modifications or metadata for example). On the other hand, a checkout
implemented this way would necessarily destroy any existing working copy,
turning it into a working copy of the new checkout.

3) --force does 1)
   --force-all does 2)

Notes: introduces two flags instead of one. Should export's flags change also
for consistency (so that export --force does not export to directories that
are working copies, but a --force-all would)?

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue May 24 22:55:21 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.