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

"Mergeinfo for '...' maps to an empty revision range" due to sparse merging

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 1.5.x
    • 1.5.5
    • libsvn_subr

    Description

      A sequence of merges into depth=sparse directories can interfere with merges
      into other directories in the tree, causing them to report "Mergeinfo for '...'
      maps to an empty revision range".  A test case that constructs a repository from
      scratch follows (or see attachment posted to the dev list, in the archive link
      above.)  The failure breaks merging and also "log -g".
      
      Given that the steps used are reasonable (I know of two independent sites that
      have stumbled upon it now) there are two possibilities:
        * the mergeinfo being constructed *is* inconsistent, and the
      mergeinfo construction side needs to change
          (note that this also leads to a "so how do we repair existing
      repositories" question...)
        * the mergeinfo is fine, but the svn_mergeinfo_inheritable is wrong
      as I theorized in my earlier post (with patch) and it's really enough
      to discard the non-relevant mergeinfo entirely, instead of only
      collapsing the rangelist. 
      
      hyrum_wright kindly confirmed that the testcase failed on trunk as well, and
      recommended marking it "1.6-consider".
      
      
      #!/bin/sh
      
      
      WORK=$(mktemp -d)
      REPO=$WORK/repo
      WC=$WORK/wc
      MWC=$WORK/mwc
      RURI=file:////$REPO
      
      trap "echo rm -rf $WORK" EXIT
      
      # set up generic repository
      svnadmin create $REPO
      svn -q mkdir -m 'init trunk' $RURI/trunk
      svn -q mkdir -m 'init branches' $RURI/branches
      svn -q mkdir -m 'init tags' $RURI/tags
      
      # set up some content
      
      svn -q mkdir -m 'init content' $RURI/trunk/product
      svn -q mkdir -m 'init content' $RURI/trunk/product/thing
      (mkdir $WC
       cd $WC
       svn -q co $RURI/trunk/product/thing
       cd thing
       touch code.py
       svn -q add code.py
       svn commit -m 'init file' code.py
       rm -rf $WC
      )
      
      # try making these *early*
      
      svn copy -m 'another branch' $RURI/trunk $RURI/branches/release
      svn copy -m 'tag it' $RURI/branches/release $RURI/tags/release-1
      
      # branch it
      
      svn copy -m 'working branch' $RURI/trunk $RURI/branches/troublemaker1
      
      (mkdir $WC
       cd $WC
       svn -q co $RURI/branches/troublemaker1
       cd troublemaker1
       touch unrelated
       svn -q add unrelated
       svn commit -m 'init file' unrelated
       # another one so we have a range
       echo A > unrelated
       svn commit -m 'change file' unrelated
       rm -rf $WC
      )
      # merge it back
      
      (mkdir $MWC
       cd $MWC
       svn -q co $RURI/trunk
       cd trunk
       svn merge $RURI/branches/troublemaker1
       svn commit -m 'bring it back'
       rm -rf $MWC
      )
      
      # branch it again
      
      svn copy -m 'working branch' $RURI/trunk $RURI/branches/troublemaker2
      
      (mkdir $WC
       cd $WC
       svn -q co $RURI/branches/troublemaker2
       cd troublemaker2
       echo B > unrelated
       svn commit -m 'init file' unrelated
       # another one so we have a range
       echo C > unrelated
       svn commit -m 'change file' unrelated
       rm -rf $WC
      )
      # merge it back
      
      (mkdir $MWC
       cd $MWC
       svn -q co $RURI/trunk
       cd trunk
       # try record-only? # svn merge $RURI/branches/troublemaker2
       svn merge --record-only $RURI/branches/troublemaker2
       svn commit -m 'bring it back'
       rm -rf $MWC
      )
      
      svn proplist -vR $RURI/trunk
      
      # new late branch
      
      svn copy -m 'branch it again' $RURI/tags/release-1 $RURI/branches/release-2
      
      svn log -v -g $RURI/branches/release-2/product/thing/code.py
      
      # change trunk, pull it down...
      (mkdir $WC
       cd $WC
       svn -q co $RURI/trunk/product/thing
       cd thing
       date > code.py; sleep 1
       svn commit -m 'change file on trunk' code.py
       rm -rf $WC
      )
      
      CHNO=$(svnlook youngest $REPO)
      
      # # try it with ignore/record...
      # (mkdir $WC
      #  cd $WC
      #  svn -q co $RURI/branches/release-2/product
      #  cd product
      #  svn merge -c $CHNO $RURI/trunk/product
      #  svn commit -m 'merge something from trunk' .
      # #  svn merge --ignore-ancestry -c $CHNO $RURI/trunk/product
      # #  svn commit -m 'merge something from trunk' .
      # #  svn up # Directory '/branches/release-2/product' is out of date
      # #  svn merge --record-only -c $CHNO $RURI/trunk/product
      # #  svn commit -m 'flag the merge from trunk' .
      #   rm -rf $WC
      # )
      
      # try a shallow/deep merge to get inheritable mergeinfo
      
      echo "===== co/up/up/merge ===="
      (mkdir $WC
       cd $WC
       set -x
       svn co --depth=empty $RURI/branches/release-2/product/thing
       svn update --depth=empty thing
       cd thing
       svn update --depth=immediates code.py
       svn merge --depth=infinity  -c $CHNO $RURI/trunk/product/thing .
       svn diff
       svn commit -m 'pull down using depth' code.py
       rm -rf $WC
      )
      
      # svn proplist -vR $RURI
      svn pg -R svn:mergeinfo $RURI
      svn log -v -g $RURI/branches/release-2/product/thing/code.py
      

      http://svn.haxx.se/dev/archive-2008-10/1170.shtml

      Original issue reported by eichin

      Attachments

        1. 1_testcase2.txt
          3 kB
          Subversion Importer
        2. 2_append_to_merged_froms.patch
          0.7 kB
          Subversion Importer
        3. 3_svn_inheritable_rangelist.patch
          0.7 kB
          Subversion Importer

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: