Getting the last version of a deleted folder in subversion

5.2k Views Asked by At

I need to get the content of folder deleted from our repository long time ago

  • I still know the name of the folder
  • I don't know the revision in which it was deleted
  • I don't know the date when it was deleted
  • In the history of the parent directory there is no information (i.e., there is not comment mentioning that the folder is deleted)

svn log doesn't seem to help:

$ svn log deleted_folder
svn: 'deleted_folder' is not under version control

svn co also doesn't help

$ svn co URL/deleted_folder

How can I find out the last revision of the deleted folder?

EDIT: an option would be with brute force to check backwards for every revision but as there are more than 10K of them the option would be just for emergency. And I really feel that there definitely must be a better way.

2

There are 2 best solutions below

1
Michael Burr On BEST ANSWER

You can find the revision that the directory was deleted in by going to the parent directory of the deleted directory and using the following command:

 svn log -v . > somefile

then search somefile in an editor for the revision record contain the delete for the directory name.

1
Jason On

You may find the revision using:

svn log -v | grep "D /deleted_folder" -C 5

Then you should copy the revision to current according to answer of this question:

examining history of deleted file