Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

History of changes to a particular line of code in Subversion

Tags:

svn

Is it possible to see the history of changes to a particular line of code in a Subversion repository?

I'd like, for instance, to be able to see when a particular statement was added or when that statement was changed, even if its line number is not the same any more.

like image 881
lindelof Avatar asked Sep 10 '08 08:09

lindelof


People also ask

How do I find my svn revision 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.

Where is svn history stored?

They are stored in the svn:log property. You can add the --revprop flag to the various property commands to view & edit this property.

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.

How do I view svn history in eclipse?

Window -> Preferences -> Team -> SVN -> Default number of log messages. Or you can press the ">|" button to see the complete history.


2 Answers

I don't know a method for tracking statements through time in Subversion.

It is simple however to see when any particular line in a file was last changed using svn blame. Check the SVNBook: svn blame reference:

Synopsis

svn blame TARGET[@REV]... 

Description

Show author and revision information in-line for the specified files or URLs. Each line of text is annotated at the beginning with the author (username) and the revision number for the last change to that line.

like image 166
morechilli Avatar answered Sep 30 '22 02:09

morechilli


In the TortoiseSVN client there is a very nice feature that lets you:

  • blame a file, displaying the last change for each line (this is standard)
  • "blame previous revision", after clicking on a particular line in the above view (this is the good one)

The second feature does what it says - it shows the annotated revision preceding the last modification to the line. By using this feature iteratively, you can trace back through the history of a particular line.

like image 24
Rafał Dowgird Avatar answered Sep 30 '22 03:09

Rafał Dowgird