Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN: How to know in which revision a file was deleted?

Tags:

Given that I'm using svn command line on Windows, how to find the revision number, in which a file was deleted? On Windows, there are no fancy stuff like grep and I attempting to use command line only, without TortoiseSVN. Thanks in advance!

EDIT:

  • I saw a few posts, like examining history of deleted file but it did not answer my question.
  • Is there any way other than svn log -v url > log.out and search with Notepad?
like image 459
Viet Avatar asked Jul 21 '11 03:07

Viet


People also ask

How do I check svn update 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 find old revision in svn?

Using the latest versions of Subclipse, you can actually view them without using the cmd prompt. On the file, simply right-click => Team => Switch to another branch/tag/revision.

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.


1 Answers

Install Cygwin.

I use this:

svn log -v --limit <nr> -v | grep -E '<fileName>|^r' | grep -B 1 <fileName> 

where

fileName - the name of the file or any pattern which matches it nr - the number of latest revisions in which I want to look for 

This will give you the revisions for all the actions (add, delete, remove, modify) concerning the file, but with a simple tweak with grep you can get the revisions only for deletion.

(Obviously, --limit is optional, however you usually have an overview about how deep you need to search which gains you some performance.)

like image 160
Nesze Avatar answered Sep 19 '22 13:09

Nesze