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

Merge can record mergeinfo from natural history gaps

    XMLWordPrintableJSON

    Details

      Description

      Resurrected branches can cause gaps in natural history.  In the past this has
      broken the merge editor during merge-tracking aware merges, see
      http://svn.haxx.se/dev/archive-2008-11/0618.shtml.  That problem was fixed in
      r34393 (and backported to 1.5.5).  However there is still a problem in this
      space: Merges can record mergeinfo describing gaps in the natural history of the
      merge source.
      
      For example, say we have this repos:
      
      WC>s
      ------------------------------------------------------------------------
      r1 | jrandom | 2009-06-22 12:52:43 -0400 (Mon, 22 Jun 2009) | 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.
      ------------------------------------------------------------------------
      r2 | jrandom | 2009-06-22 12:52:45 -0400 (Mon, 22 Jun 2009) | 1 line
      Changed paths:
         M /A/D/H/psi
      
      log msg
      ------------------------------------------------------------------------
      r3 | jrandom | 2009-06-22 12:52:45 -0400 (Mon, 22 Jun 2009) | 1 line
      Changed paths:
         M /A/D/G/rho
      
      log msg
      ------------------------------------------------------------------------
      r4 | jrandom | 2009-06-22 12:52:46 -0400 (Mon, 22 Jun 2009) | 1 line
      Changed paths:
         M /A/B/E/beta
      
      log msg
      ------------------------------------------------------------------------
      r5 | jrandom | 2009-06-22 12:52:46 -0400 (Mon, 22 Jun 2009) | 1 line
      Changed paths:
         M /A/D/H/omega
      
      log msg
      ------------------------------------------------------------------------
      r6 | jrandom | 2009-06-22 12:52:46 -0400 (Mon, 22 Jun 2009) | 1 line
      Changed paths:
         D /A
      
      Delete A
      ------------------------------------------------------------------------
      r7 | jrandom | 2009-06-22 12:52:47 -0400 (Mon, 22 Jun 2009) | 1 line
      Changed paths:
         A /A (from /A:2)
      
      Resurrect A from A@2
      ------------------------------------------------------------------------
      r8 | jrandom | 2009-06-22 12:52:47 -0400 (Mon, 22 Jun 2009) | 1 line
      Changed paths:
         A /A_COPY (from /A:7)
      
      Copy A to A_COPY
      ------------------------------------------------------------------------
      r9 | jrandom | 2009-06-22 12:52:48 -0400 (Mon, 22 Jun 2009) | 1 line
      Changed paths:
         M /A/D/gamma
      
      log msg
      ------------------------------------------------------------------------
      
      
      In other words we have a branch 'A@9' which has gaps in its natural history:
      
       r1--------r2--------r3--------r4--------r5--------r6
        Add 'A'  edit      edit      edit      edit      Delete A
                 psi       rho       beta      omega
                 |                    
                 V                    
                 r7-----------------r9         
                 Resurrect 'A'      edit       
                 |                  gamma      
                 |                    
                 V                    
                 r8--------------------------->
                 Copy 'A@7' to
                 'A_COPY'
      
      Now if we merge r4 from A@4 we get the expected results:
      
        WC>svn merge ^^/A@4   A_COPY -c4
        --- Merging r4 into 'A_COPY':
        U    A_COPY\B\E\beta
      
        WC>svn st
         M      A_COPY
        M       A_COPY\B\E\beta
      
        WC>svn pl -vR
        Properties on 'A_COPY':
          svn:mergeinfo
            /A:4
      
      But then if we reverse merge from the "other" A, the one that was resurrected
      from A@2, the merge removes the mergeinfo set by the first merge:
      
        WC>svn merge ^^/A@HEAD A_COPY -r9:2
      
      The no-op merge is correct, but...
      
        WC>svn pl -vR
        
        WC>
      
      ...The mergeinfo from the first merge is gone!  But the text change made by the
      first merge is still present:
      
        WC>svn st
        M       A_COPY\B\E\beta
      
        WC>svn diff
        Index: A_COPY/B/E/beta
        ===================================================================
        --- A_COPY/B/E/beta     (revision 9)
        +++ A_COPY/B/E/beta     (working copy)
        @@ -1 +1 @@
        -This is the file 'beta'.
        +New content
        \ No newline at end of file
      

        Attachments

        1. 1_Reimplement.r34393.diff
          11 kB
          Paul Burba

          Activity

            People

            • Assignee:
              pburba Paul Burba
              Reporter:
              pburba Paul Burba
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: