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.
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.
They are stored in the svn:log property. You can add the --revprop flag to the various property commands to view & edit this property.
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.
Window -> Preferences -> Team -> SVN -> Default number of log messages. Or you can press the ">|" button to see the complete history.
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.
In the TortoiseSVN client there is a very nice feature that lets you:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With