[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Fix for blame -g incorrect revisions

From: Alan Wood <Alan.Wood_at_clear.net.nz>
Date: Mon, 20 Apr 2009 21:33:18 +1200

Hi All,
 Here is a patch that hopefully corrects the output from blame -g in
the case where the merged data has an inserted line as the last line
in a chunk and some other cases I saw on the way. I have also
attached a bat file as a simpler example than the original post (
sorry it's windows ).

I have tried this with 1.5.4 and 1.6.0
Also trunk with with existing wc format.

Output from script
--------------------
C:\alan\subversion\test>svn --version
svn, version 1.6.0 (Release Candidate 3)
   compiled Mar 15 2009, 12:54:57

C:\alan\subversion\test>svn blame wc/trunk/a.txt
     1 Alan "line 1"
     1 Alan "line 2"
     6 Alan "line 2.1 branch rev 4"
     6 Alan "line 2.2 branch rev 5"
     1 Alan "line 3"
     3 Alan "line 3.1 trunk rev 3"
     3 Alan "line 3.2 trunk rev 3"
     1 Alan "line 4"
     3 Alan "line 4.1 trunk rev 3"

C:\alan\subversion\test>svn blame -g wc/trunk/a.txt
       1 Alan "line 1"
       1 Alan "line 2"
G 4 Alan "line 2.1 branch rev 4"
       1 Alan "line 2.2 branch rev 5"
G 1 Alan "line 3"
       1 Alan "line 3.1 trunk rev 3"
       1 Alan "line 3.2 trunk rev 3"
G 1 Alan "line 4"
       1 Alan "line 4.1 trunk rev 3"

-----------
after patch applied to trunk and running with the same working copy

C:\alan\subversion\test>svn.exe --version
svn, version 1.7.0 (dev build)
   compiled Apr 20 2009, 17:20:24

C:\alan\subversion\test>svn.exe blame -g wc/trunk/a.txt
       1 Alan "line 1"
       1 Alan "line 2"
G 4 Alan "line 2.1 branch rev 4"
G 5 Alan "line 2.2 branch rev 5"
       1 Alan "line 3"
       3 Alan "line 3.1 trunk rev 3"
       3 Alan "line 3.2 trunk rev 3"
       1 Alan "line 4"
       3 Alan "line 4.1 trunk rev 3"

refer to:
http://subversion.tigris.org/ds/viewMessage.do?dsMessageId=1179481&d
sForumId=462

Possible log message:

[[[
 Fix issue with blame -g showing incorrect revisions when lines
added from branch
 * subversion/svn/blame-cmd.c
   (blame_receiver): Handle revision comparison when revision or
merged revision is not valid (xml output was already ok)

 * subversion/libsvn_client/blame.c
 (normalize_blames): Split chunks correctly don't just extend the
later chunk back ( comments were correct but not code )
 (svn_client_blame5): Allow information from merged line to be sent
to callback even when no valid revision pre-merge.
]]]

Alan Wood

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1821874

Received on 2009-04-20 11:33:42 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.