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

Reflective merges are faulty

    XMLWordPrintableJSON

Details

    Description

      While studying merge.c to fix issue 2821, I came across the following snippet of
      code which suggested a bug to me.
      
      <snip from calculate_requested_merges>
        if (added_mergeinfo)
          {
            const char *src_rel_path;
            SVN_ERR(svn_client__path_relative_to_root(&src_rel_path, entry->url,
                                                      entry->repos, ra_session,
                                                      adm_access, pool));
            src_rangelist_for_tgt = apr_hash_get(added_mergeinfo, src_rel_path,
                                                 APR_HASH_KEY_STRING);
          }
      </snip>
      
      The above logic is wrong, take the following usecase,
      1)We branched /trunk as /fb at r51.(Now /fb has a mergeinfo of /trunk: 1-50)
      2)We did changes to /fb at r52 and r53
      3)Synched up the changes from /trunk to /fb via a merge and committed the merge
      at r60(Now /fb has a mergeinfo of /trunk: 1-59)
      4)Did some changes to /fb at r61, r62
      5)Merge -r51:62 $URL_to/fb to $WC_of_trunk
      Now our above reflective logic code removes '51:59' from '51:62' and hence just
      merges '60:62' and hence does a bogus possible conflict and never merges the
      commits '/fb' prior to synch up from the '/trunk' to '/fb'.
      
      Attaching simple shell script to prove the problem.
      

      Original issue reported by kameshj

      Attachments

        1. 1_merge-test-reflective_merges_bug.sh
          1 kB
          Subversion Importer
        2. 10_test.sh
          1.0 kB
          Subversion Importer
        3. 2_2897.patch.v2
          8 kB
          Subversion Importer
        4. 3_2897.revert_partial_impl.patch
          7 kB
          Subversion Importer
        5. 4_2897_new.patch.v5
          9 kB
          Subversion Importer
        6. 5_2897_new.patch.v6
          9 kB
          Subversion Importer
        7. 6_2897_new.patch.v9
          27 kB
          Subversion Importer
        8. 7_2897_new.patch.v11
          41 kB
          Subversion Importer
        9. 8_2897_new.patch.v15
          72 kB
          Subversion Importer
        10. 9_2897_new.patch.v17
          72 kB
          Subversion Importer

        Activity

          People

            Unassigned Unassigned
            subversion-importer Subversion Importer
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: