Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Do I Find a File in a Subversion Repository History?

Tags:

repository

svn

Is it possible to look back through the history of a Subversion repository for files of a certain name (even better would be for them to have a wildcard search)?

I want to see if a .bat file has been committed to the repository at some point in the past but has since been removed in later updates. Even a dump of the file history at each revision would work, as I could just grep the output. I have looked through the manual but could not see a good way to do this.

The logs for each commit are descriptive, so I cannot just look through the log messages to see what modifications were done. I presume Subversion does have a way of retrieving this?

like image 491
kaybenleroll Avatar asked Aug 21 '08 12:08

kaybenleroll


People also ask

How do I find my svn file history?

To find information about the history of a file or directory, use the svn log command. svn log will provide you with a record of who made changes to a file or directory, at what revision it changed, the time and date of that revision, and, if it was provided, the log message that accompanied the commit.

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.

Where are svn logs stored?

By default going to be in /var/log/httpd .

How do you find changed files in svn?

The solution here is to either update your working copy or explicitly provide a revision number to svn log by using the --revision ( -r ) option. svn log also takes a --quiet ( -q ) option, which suppresses the body of the log message. When combined with --verbose ( -v ), it gives just the names of the changed files.


1 Answers

TortoiseSVN can search the logs very easily, and on my system I can enter ".plg" in the search box and find all adds, modifies, and deletes for those files.

Without Tortoise, the only way I can think of doing that would be to grep the full logs or parse the logs and do your own searching for 'A' and 'D' indicators on the file you are looking for (use svn log --verbose to get file paths).

 svn log --verbose | grep .bat 
like image 52
crashmstr Avatar answered Sep 27 '22 21:09

crashmstr