10

Is it possible to generate a file, which includes summary(what, when, by whom ) of all the changes made on a certain file? Used to have such option in VSS(I think it was called "History"), and it was great for going back and tracking who made a certain change and when.

BTW, I'm using tortoisesvn

Thank you in advance

Jack Juiceson
  • 830
  • 4
  • 12
  • 24
  • 1
    In `svn` it is called `svn log`. Try using tortoise svn `Show log` or similar option (I don't remember exactly). There should be some export to file option too. – pajton Apr 11 '11 at 14:04
  • @pajton - Show Log doesn't show me the information I want. It shows in which revisions a change was made to file + 'message'. But I need more detailed info, including all the changes, when they were made and by whom. – Jack Juiceson Apr 11 '11 at 15:18

5 Answers5

15

Right click on file in explorer, then "TortoiseSVN", "Show log".

Uncheck "Hide unrelated changed paths" Uncheck "Stop on copy/rename" Check "Include merged revisions" Click "Show All"

Now, in the top pane you a list of revisions with username, date and log. Click on a revision you're interested in and you can see the full log in the second pane. The third pane shows you every file that was changed in the chosen revision. Double-click on your file in this pane and you can see the changes made in that file.

As remarked previously, Tortoise has a "Blame" functionality which is often very insightful but it can only show the most recent edit on each line of source. And if someone has deleted lines, you don't see their change at all.

Edit:

If you're willing to go to the command-line tool and bash, this question has been answered before: How can I view all historical changes to a file in SVN

On a Windows PC, the best way to get bash and command-line SVN is by installing Cygwin.

Community
  • 1
  • 1
paperjam
  • 8,321
  • 12
  • 53
  • 79
13

Here's a batch file translation of bendin's bash script in How can I view all historical changes to a file in SVN:

@echo off

set file=%1

if [%file%] == [] (
  echo Usage: "%0 <file>"
  exit /b
)

rem first revision as full text
for /F "tokens=1 delims=-r " %%R in ('"svn log -q %file%"') do (
  svn log -r %%R %file%
  svn cat -r %%R %file%
  goto :diffs
)

:diffs

rem remaining revisions as differences to previous revision
for /F "skip=2 tokens=1 delims=-r " %%R in ('"svn log -q %file%"') do (
  echo.
  svn log -r %%R %file%
  svn diff -c %%R %file%
)

Note that this batch file requires a command line SVN client (not TortoiseSVN) to be in your path. I personally use SilkSVN, but there are several.

Community
  • 1
  • 1
ladenedge
  • 13,197
  • 11
  • 60
  • 117
2

As @pajton mentioned, you could use svn log <filename>. The documentation provides the details/limitations.

Musannif Zahir
  • 3,001
  • 1
  • 21
  • 31
  • @Jack Juiceson: Emzy's link to the svn documentation is what you need. I'd steer you towards the -g/--use-merge-history to get information from any branches that were merged back into trunk. You also indicated that you need more information in a comment to your question, try using the -v/--verbose option as well. It should provide more information about who and when. As for what was changed, that'll be a whole new command. Both of these options are in TortoiseSVN as checkboxes. I rarely use Tortoise, so I can not give exact references. – jgifford25 Apr 14 '11 at 13:59
  • @jgifford25 - I'm using TortoiseSVN, I don't see svn.exe in TortoiseSvn bin directory to try -v – Jack Juiceson Apr 17 '11 at 08:37
  • @Jack Juiceson: Tortoise doesn't have a command line client. You can get the command line binaries from a number of vendors. I think the easiest to get and install are at CollabNet: http://www.open.collab.net/downloads/subversion/. Remember, you only need the command line client, not whole suite (server, apache, and other tools that come with Edge). – jgifford25 Apr 18 '11 at 14:00
2

You might find svn blame <filename> to be more useful because it will tell you who/what/when for a specific revision of a file.

adamlamar
  • 4,629
  • 2
  • 27
  • 22
  • 1
    I'm aware of blame, and use it heavily. however sometimes there are cases, where you remember you had piece of code in the file, someone deleted it and you want to find out who it was. In vss days, I'd generate history file and search for piece of code, and then find who deleted it, when and why. – Jack Juiceson Apr 17 '11 at 07:38
  • @Jack You may want to consider enforcing commiters to add appropriate comments to their commits. The log functionality should tell you all then or at least provide a link to Jira/Trac/... tickets describing the changes. – vickirk Apr 20 '11 at 11:41
0

I would just like to add that recent version of tortoise also include command line tools, you just need to select them on installation

Stefano Fenu
  • 179
  • 2
  • 4