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

Re: Remove items from source control without deleting them

From: Stefan Sperling <stsp_at_elego.de>
Date: Wed, 15 Jul 2009 19:11:43 +0100

On Wed, Jul 15, 2009 at 09:45:23AM -0700, Christopher Clarke wrote:
> Hello,
>
> This topic has been discussed before and shot down:
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=864575
>
> I would like to bring it up again, because I think it's a feature that
> is commonly needed and important for any complete versioning system to
> include.
>
> There are occasions when an item (file or directory) must be removed
> from source control. An example: A Wordpress plugin that formerly
> needed to be updated manually but now has an automatic update feature
> that makes changes to files. This plugin needs to be removed from
> source control because updating the files externally may prevent the
> upgrade from running, and other upgrade actions (e.g. change database
> structure) will not happen.
>
> I know that it is possible to do this for *my* working copy: export
> item, svn delete, commit, rename exported item, ignore, commit.

In Subversion 1.5 and above, 'svn remove' has a --keep-local parameter
which should make this sequence of operations a bit easier.
Just do:
        svn rm --keep-local item
        svn pe svn:ignore . # add an entry for item
        svn commit

> The
> problem is that the item to be deleted from everyone else's working
> copies, unless every peer follows the same procedure before updating.
> Since peers have different levels of technical ability and are using
> different svn clients, I can't expect them all to do this properly.

I'm afraid I'm not following.

To recap:
If you commit revision rX which deletes an item and also adds it to
the svn:ignore list, other clients will also delete the item and add
it to the svn:ignore list when updating to rX, without keeping a
local copy of the item on disk.
That's what the behaviour is and should be.

My understanding is that you'd like all other clients updating to rX
to remove the item from version control and add it to the ignore list,
but to also keep a copy of the item on disk for some reason.

However, I don't understand what you would gain by preventing other
clients from the deleting the item from disk. Because if they aren't
allowed to delete the item, what happens if someone checks out a fresh
working copy as of rX? They will not get the item from version control.
But will they need the item to get your project to build? If so, why
isn't the item being generated as part of the build in the first place?

You can't rely on an item's existence, and then delete and ignore
it at the same time. That just doesn't make sense.
An item should either be required and versioned, or not versioned
and easily reproducible by anyone who gets a fresh working copy
or updates an existing working copy.

Given this, I guess either you are trying to solve the wrong problem,
or I'm not understanding your request correctly.

Stefan
Received on 2009-07-15 20:13:00 CEST

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