tags:

views:

219

answers:

1

I'd like to determine the last time a specific line was changed in an SVN-versioned file. Does SVN (or TortoiseSVN) have a command to do this?

I could write a script that would svn diff each successive revision backwards from HEAD, and check if the line at a given line number was different. But this simplistic approach will not work if, say, lines were inserted before the desired line, but the text of the line itself didn't change. I'm no expert on merge theory/diffing, so I don't know how this could be done. Any ideas?

+9  A: 

Yes, the function you're looking for is called Blame, it's available both through the subversion command line interface and the TortoiseSVN interface.

Lasse V. Karlsen
thanks, was looking for that too :)
Peter Perháč
That'll do it, thanks!
Is there also a command which can show me the history of a line, similar to the log command but down on line level?
0xA3
Unfortunately, not directly, but you can use the blame function for that as well, you just need to ask it to blame the revision before the one you're currently look at, and then step by step walk backwards.
Lasse V. Karlsen