bawkstoo
bawkstoo

Reputation: 315

commiting only deleted files to subversion

Say I have a large working directory and I am in the process of cleaning out sections of code that are no longer used. Part of this process is flat out svn deleteing a lot of files. But what if I want to make sure those files are not being used anywhere anymore... if I do svn commit it will commit all of my other code changes which I don't wish to test at the moment, and if I try to svn commit <deleted file list> it says those files are not under version control (I already did svn delete on them).

How can I commit changes to only svn deleted files?

Upvotes: 7

Views: 20227

Answers (3)

Vitalii Lebediev
Vitalii Lebediev

Reputation: 662

You also could use changelists http://svnbook.red-bean.com/en/1.5/svn.advanced.changelists.html

First, delete files:

$ svn rm path/to/file1
$ svn rm path/to/file2

Then, add this files to changelist:

$ svn changelist <listname> path/to/file1 path/to/file2

or

$ svn changelist <listname> path/to/file1
$ svn changelist <listname> path/to/file2

And then you can commit only changelist

$ svn commit --changelist <listname> -m "Comment goes here"

BTW, this way you can commit other files in parts

Upvotes: 12

blahdiblah
blahdiblah

Reputation: 33991

Cannot reproduce.

svn commit <list of svn delete'd files> works fine.

You will get svn: <file> is not under version control error if you try to commit changes to a file that has already been svn delete'd and committed. Is there an errant file in your list?

Upvotes: 15

Justin ᚅᚔᚈᚄᚒᚔ
Justin ᚅᚔᚈᚄᚒᚔ

Reputation: 15369

You can "shelve" your changes in subversion, commit, and then take your changes back off the shelf into your working directory.

See http://markphip.blogspot.com/2007/01/shelves-in-subversion.html for details.

Be sure to read the entire post and understand what's going on (pay special attention to the "better method" section). Shelving isn't a "feature" of Subversion, but it's still possible.

Upvotes: 0

Related Questions