views:

426

answers:

2

Hello All,
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

+4  A: 

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.

Dan McGrath
thanks for your prompt response.. but there is one more problem the working copy is locked and also "svn revert is suggesting to run svn cleanup.. which quits with the same error messages
Neeraj
@Neeraj have you got this sorted out yet? Just wanted to know if you tried running the cleanup command on the parent directory of the affected file. Also, i delete and then commit all the time without a problem. Unless I am misunderstanding the scenario you have described - svn delete should work the same way as delete+svn commit in a given workspace. What version of SVN do you use?
Critical Skill
@Critical. I believe you will find that Neeraj created the file, performed an svn add, did a filesystem delete, followed by a commit. In older versions of subversion, this irrevocably corrupts the working copying. As a side note to Neeraj, I would update your subversion client. All 1.x clients are backward compatible with older subversion server versions.
Dan McGrath
i am using 1.4.6 and have ran into exactly same situation as described above in the edit.. Although i checked out another copy and follow the steps there..it worked then
Neeraj
+1  A: 

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

twon33