tags:

views:

489

answers:

7

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 anymore.

A: 

svn blame shows you which checkin modified any line in a file the last time.

This works on old revisions too.

Maximilian
A: 

The command you're looking for is "svn blame".

http://svnbook.red-bean.com/en/1.0/re02.html

Brad Wilson
A: 

A start is the command svn blame (or annotate,praise). It will show you when a line of code was last modified and by whom it was modified. e.g.:

  4564    wiemann # $Id$
  4564    wiemann # Author: David Goodger <[email protected]>
   778    goodger # Copyright: This module has been placed in the public domain.
   217    goodger
Peter Hoffmann
A: 
svn annotate

The aka SVN Blame from Tortoise SVN

Marcio Aguiar
+1  A: 

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.

From: http://svnbook.red-bean.com/en/1.0/re02.html

Synopsis

svn blame TARGET...

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.

morechilli
+2  A: 

In 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.

Rafał Dowgird
A: 

What blame doesn't tell you is when a particular line was deleted. I haven't found a way to do that unfortunately.