You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "McHenry, Matt" <mm...@carnegielearning.com> on 2008/06/25 20:00:21 UTC

'annotate -g' confused about source of some merged changes

	I've written a small script (attached) to try to explore some of
the differences between merge tracking in 1.5 and svnmerge.py.  In the
course of playing around with it, I've found an odd behaviour of the
'annotate' command's '-g' switch.  (Nothing to do w/ svnmerge.py,
though.)  The output of the following commands doesn't seem right to me.
Please let me know if I'm missing something, or if this sounds like a
bug that you'd like me to file in your issue tracker.

	Please reply directly as I'm not subscribed to the list.
Thanks!

$ svn --version
svn, version 1.5.0 (r31699)
   compiled Jun 25 2008, 09:40:45
...

#get things set up
$ ./create-repos.sh
$ cd wc
$ sn up
$ cd trunk/foo/

#my test file has four lines:
$ cat foo-msg.txt 
b1
b3
b5
b6

#the last two were added in a recent revision, r14:
$ svn annotate foo-msg.txt 
     6   mmchenry b1
    10   mmchenry b3
    14   mmchenry b5
    14   mmchenry b6

#and r14 was a merge of two revisions on a branch:
$ svn log -r 14 -g -v foo-msg.txt
------------------------------------------------------------------------
r14 | mmchenry | 2008-06-25 15:40:06 -0400 (Wed, 25 Jun 2008) | 1 line
Changed paths:
   M /trunk
   M /trunk/foo/foo-msg.txt

merging changes from branches/2007-Q4
------------------------------------------------------------------------
r13 | mmchenry | 2008-06-25 15:40:03 -0400 (Wed, 25 Jun 2008) | 1 line
Changed paths:
   M /branches/2007-Q4/foo/foo-msg.txt
Merged via: r14

branch change 6
------------------------------------------------------------------------
r12 | mmchenry | 2008-06-25 15:40:02 -0400 (Wed, 25 Jun 2008) | 1 line
Changed paths:
   M /branches/2007-Q4/foo/foo-msg.txt
Merged via: r14

branch change 5
------------------------------------------------------------------------

#so those last two lines should be annotated as coming from some
#combination of r12 and r13, but no:
$ svn annotate -g foo-msg.txt 
G      5   mmchenry b1
G      8   mmchenry b3
G     12   mmchenry b5
       2   mmchenry b6

#what happened in r2?
$ svn log -vg -r 2 foo-msg.txt 
------------------------------------------------------------------------
r2 | mmchenry | 2008-06-25 15:39:45 -0400 (Wed, 25 Jun 2008) | 1 line
Changed paths:
   A /trunk/foo
   A /trunk/foo/baz-msg.txt
   A /trunk/foo/foo-msg.txt
   A /trunk/message.txt

adding initial files
------------------------------------------------------------------------

#the file was added, and it was empty at that point, so it couldn't be
the source of the 4th line:
$ svn cat -r 2 foo-msg.txt | wc
       0       0       0

#diff seems to say the right thing:
$ svn diff -c 14 foo-msg.txt 
Index: foo-msg.txt
===================================================================
--- foo-msg.txt (revision 13)
+++ foo-msg.txt (revision 14)
@@ -1,2 +1,4 @@
 b1
 b3
+b5
+b6


Matt McHenry
412-690-2442 x150
Software Developer
Carnegie Learning, Inc.
Learning By Doing (r)
Helping over 500,000 students in 2,600 schools to succeed in math.
http://www.carnegielearning.com

Re: 'annotate -g' confused about source of some merged changes

Posted by Daniel Shahaf <d....@daniel.shahaf.co.il>.
McHenry, Matt wrote on Wed, 25 Jun 2008 at 16:00 -0400:
> $ svn annotate -g foo-msg.txt 
> G      5   mmchenry b1
> G      8   mmchenry b3
> G     12   mmchenry b5
>        2   mmchenry b6
> 
...
> #the file was added, and it was empty at that point, so it couldn't be
> the source of the 4th line:
> $ svn cat -r 2 foo-msg.txt | wc
>        0       0       0
> 

Yes, this looks like a bug.  Could you please file an issue (if there
isn't one already) so we don't forget it?

Thanks,

Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org