sud03r
sud03r

Reputation: 19779

svn: delete a file in repository

I am quite new to version control and i am using svn as the project i am working on is hosted on svn.
In my local working copy i added a temporary file and deleted it without using svn delete (as i was unaware).
Now that file was still under version control so when I did commit my final changes to my private branch, that file was written to the repository and the commit succeeded but reported errors post-commit:

svn: Error processing command 'committed' in '.'
svn: Error replacing text-base of 'tmp_file'
svn: Can't change perms of file 'tmp_file': No such file or directory
run svn cleanup

svn cleanup also gives similar results.
I dont want the tmp_file in my branch in the repository.

Can anyone suggest some way to do this?

Thanks in advance

Upvotes: 2

Views: 2860

Answers (2)

Dan McGrath
Dan McGrath

Reputation: 42048

Look up svn revert.

"svn help revert"

I don't have svn handy on this machine here, but try something along the lines of:

svn revert tmp_file
svn delete tmp_file
svn update
svn commit -m "Correctly deleted the temp file"

This basically undo's the file system level delete you performed, does the svn delete, makes sure your working copy is up to date then commits the changes.

EDIT: Okay, so if you run "svn --version" does it tell you your version is 1.4. something?

If so, you have broken your working copy and it cannot be fixed. See the Bug Report here

If your working copy contains no changes you need to commit, apart from the tmp_file, you will simply need to check out a new working copy to a different directory and delete the broken one. You can confirm there are no other changes by running "svn status"

Then, in the new working copy, follow the commands above from "svn delete" onwards to correctly delete the file.

Upvotes: 4

twon33
twon33

Reputation: 533

This may have been fixed in a more recent svn. I tried to reproduce things this way:

$ svnadmin create test_repos
$ svn co file:///.../test_repos test_co
Checked out revision 0.
$ cd test_co
$ touch tmp_file
$ svn add tmp_file
A         tmp_file
$ rm tmp_file
$ svn ci -m ""
svn: '/.../tmp_file' is scheduled for addition, but is missing

In other words, my commit didn't succeed at all. I'm using 1.6.2 (r37639).

Upvotes: 2

Related Questions