Uploaded image for project: 'Subversion'
  1. Subversion
  2. SVN-3862

'svn blame -g' algorithm is flawed for merged revisions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • trunk
    • unscheduled
    • libsvn_repos
    • None

    Description

      blame -g isn't properly accounting for changes from empty mergeinfo to non-empty
      mergeinfo when calculating merge sources.
      
      For example, a file at r5 has empty mergeinfo and in r6 has non-empty mergeinfo:
      
        >svn pg -v svn:mergeinfo ^^/A_COPY/D/H/psi@5
        Properties on
      'file:///C:/SVN/src-trunk/Debug/subversion/tests/cmdline/svn-test-work/repositories/blame_tests-15/A_COPY/D/H/psi':
          svn:mergeinfo
      
        >svn pg -v svn:mergeinfo ^^/A_COPY/D/H/psi@6
        Properties on
      'file:///C:/SVN/src-trunk/Debug/subversion/tests/cmdline/svn-test-work/repositories/blame_tests-15/A_COPY/D/H/psi':
          svn:mergeinfo
            /A/D/H/psi:2-5
      
      From the change in mergeinfo there's no surprise that a sync merge was done from
      A/D/H/psi to A_COPY/D/H/psi in r6:
      
        >svn log -v -r6
        ------------------------------------------------------------------------
        r6 | jrandom | 2011-04-20 13:13:45 -0400 (Wed, 20 Apr 2011) | 1 line
        Changed paths:
           M /A_COPY/D/H/psi
      
        Sync merge A/D/H/psi to A_COPY/D/H/psi
        ------------------------------------------------------------------------
      
      Let's check the log for the incoming changes in that merge:
      
        >svn log -v -r1:HEAD A\D\H\psi
        ------------------------------------------------------------------------
        r1 | jrandom | 2011-04-20 13:13:43 -0400 (Wed, 20 Apr 2011) | 1 line
        Changed paths:
           A /A
           A /A/B
           A /A/B/E
           A /A/B/E/alpha
           A /A/B/E/beta
           A /A/B/F
           A /A/B/lambda
           A /A/C
           A /A/D
           A /A/D/G
           A /A/D/G/pi
           A /A/D/G/rho
           A /A/D/G/tau
           A /A/D/H
           A /A/D/H/chi
           A /A/D/H/omega
           A /A/D/H/psi
           A /A/D/gamma
           A /A/mu
           A /iota
      
        Log message for revision 1.
        ------------------------------------------------------------------------
        r3 | jrandom | 2011-04-20 13:13:44 -0400 (Wed, 20 Apr 2011) | 1 line
        Changed paths:
           M /A/D/H/psi
      
        trunk edit
        ------------------------------------------------------------------------
        r5 | jrandom | 2011-04-20 13:13:45 -0400 (Wed, 20 Apr 2011) | 1 line
        Changed paths:
           M /A/D/H/psi
      
        trunk edit
        ------------------------------------------------------------------------
      
        >svn diff -r2:3 A\D\H\psi
        Index: A/D/H/psi
        ===================================================================
        --- A/D/H/psi   (revision 2)
        +++ A/D/H/psi   (revision 3)
        @@ -1 +1,2 @@
         This is the file 'psi'.
        +trunk edit in revision three.
      
        >svn diff -r4:5 A\D\H\psi
        Index: A/D/H/psi
        ===================================================================
        --- A/D/H/psi   (revision 4)
        +++ A/D/H/psi   (revision 5)
        @@ -1,2 +1,3 @@
         This is the file 'psi'.
         trunk edit in revision three.
        +trunk edit in revision five.
      
      Here's where things are broken: blame -g on A_COPY/D/H/psi correctly shows that
      the second line was from r5, when it is actually from r3:
      
        >svn blame -g ^^/A_COPY/D/H/psi@6
               1    jrandom This is the file 'psi'.
        G      5    jrandom trunk edit in revision three.
        G      5    jrandom trunk edit in revision five.
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            pburba Paul Burba
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: