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

RE: Re: [Fwd: Re: How to remove a versioned file from version control without deleting it.]

From: Gale, David <David.Gale_at_Hypertherm.com>
Date: 2005-11-28 14:29:43 CET

Hendrik Maryns wrote:
> Fabian Cenedese schreef:
>>>> I thought Id follow Marks advice below and throw the question in
>>>> here: Why oh why is it impossible to remove a file from version
>>>> control without deleting it in the working copy?
>>>>
>>>> I know one can always regenerate it from a previous revision, it
>>>> would just be a nice feature.
>>>
>>> No need to regenerate from a previous revision:
>>>
>>> $ cp -p foo foo.keep
>>> $ svn rm foo
>>> $ svn propset svn:ignore foo .
>>> $ mv foo.keep foo
>>>
>>> $ svn ci -m "Removing foo from version control"
>>>
>>> You could certainly wrap the first four steps into a shell script if
>>> it's something you expect to want to do often.
>>>
>>> If it were added to the Subversion client, what would the command be
>>> called?
>>
>>
>> cvs is the other way round, default is to keep the file and only rm
>> it from the filesystem with the parameter --force. To not break
>> existing svn behaviour we could add a parameter to keep the file
>> upon rm, so like
>>
>> $ svn --keeplocal (or -k or something more general) delete foo $ svn
>> commit ...
>>
>> ...and foo is still available.
>
> Seems a nice solution to me. Actually, what I was thinking about, was
> to be able to add a file which is currently under version control to
> svn:ignore, so that in the next commit, it would get deleted from the
> rep, but not from the working copy.
>
> H.

Actually, that's probably what most people want--if you're deleting something from the repository, but keeping a local copy, you probably want to ignore the local copy from here out, so that should be the default behavior of --keeplocal. For those rare instances where you *don't* want it added to the ignore list, add another flag, along the lines of '--dontignore'.

(I'm having trouble imagining when this would be useful, myself--why would you want to remove a file from version control, keep the file, and then have the svn client bugging you about it?)

-David

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Nov 28 14:33:10 2005

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