Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting the last version of a deleted folder in subversion

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.

like image 529
Matteo Avatar asked Jan 19 '12 08:01

Matteo


People also ask

How do I recover a deleted folder from SVN?

In the Repository Browser, click the button labeled HEAD (at the top-right corner) to show to a revision there your folder still exists, then right-click that folder and select "Copy to..." and enter the path there you want the folder to be re-created (probably the same path that is already in the text box).

Does SVN move preserve history?

If you right-drag the folder and use "SVN move versioned item(s) here", then you keep the history. Even the history of the files within the folder.

How do I view SVN logs?

Examples. You can see the log messages for all the paths that changed in your working copy by running svn log from the top: $ svn log ------------------------------------------------------------------------ r20 | harry | 2003-01-17 22:56:19 -0600 (Fri, 17 Jan 2003) | 1 line Tweak.

What is SVN delete?

Deleting a File or Directory svn delete file… Similarly, to remove a directory and all files that are in it, type: svn delete directory… This schedules the files and directories for removal from the Subversion repository.


1 Answers

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.

like image 166
Michael Burr Avatar answered Oct 20 '22 14:10

Michael Burr