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

file externals updated before their commit break an 'svn cp'

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • trunk
    • 1.7.0
    • libsvn_wc

    Description

      A file external prop causes this sequence to fail:
       - set external
       - update
       - commit
       - branch
      i.e.
       $ svn ps svn:externals "^/dir/file ext_file" ./otherdir
       $ svn up
       Fetching external item into 'otherdir/ext_file'
       E    otherdir/ext_file
       Updated external to revision 1.
       $ svn ci -m msg
       $ svn cp otherdir somewhereelse
       ...
       Adding         branch/ext_dir/ext_file
       ...
       svn: File not found: revision 1, path '/trunk/ext_dir/ext_file'
      
      
      So, if there is
       - an update *before* committing the externals (which successfully
          fetches the externals) and
       - no update after committing
      then an 'svn cp' wants to *add the external* file for some reason and fails,
      stating that it cannot find something it assumes to exist...
      
      
      reproduction script:
      
      [[[
      #!/bin/bash
      
      ## CONFIGURE THIS:
      ## The next line is the only line you should need to adjust.
      ## (and uncomment all four lines)
      #SVNDIR=/my/svn/trunk
      #alias svn=${SVNDIR}/subversion/svn/svn
      #alias svnserve=${SVNDIR}/subversion/svnserve/svnserve
      #alias svnadmin=${SVNDIR}/subversion/svnadmin/svnadmin
      
      svn --version
      URL=file:///`pwd`/repos
      rm -rf repos wc
      svnadmin create repos
      svn co -q ${URL} wc
      
      set -x
      cd wc
      
      ## ACTUAL TEST
      
      mkdir -p trunk/real
      mkdir trunk/ext_dir
      echo "real file" > trunk/real/file
      
      svn add trunk
      svn ci -m add
      svn up .
      
      svn ps svn:externals "^/trunk/real/file ext_file" trunk/ext_dir
      
      svn up
      svn ci -m 'adding externals definitions'
      
      svn cp trunk branch
      svn ci -m branching 
      ]]]
      
      
      output of above script with trunk r40281:
      [[[
      svn, version 1.7.0 (dev build)
         compiled Oct 29 2009, 16:20:22
      
      Copyright (C) 2009 The Subversion Corporation.
      This software consists of contributions made by many people;
      see the NOTICE file for more information.
      Subversion is open source software, see http://subversion.tigris.org/
      
      The following repository access (RA) modules are available:
      
      * ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
        - handles 'http' scheme
        - handles 'https' scheme
      * ra_svn : Module for accessing a repository using the svn network protocol.
        - handles 'svn' scheme
      * ra_local : Module for accessing a repository on local disk.
        - handles 'file' scheme
      
      + cd wc
      + mkdir -p trunk/real
      + mkdir trunk/ext_dir
      + echo 'real file'
      + svn add trunk
      A         trunk
      A         trunk/real
      A         trunk/real/file
      A         trunk/ext_dir
      + svn ci -m add
      Adding         trunk
      Adding         trunk/ext_dir
      Adding         trunk/real
      Adding         trunk/real/file
      Transmitting file data .
      Committed revision 1.
      + svn up .
      At revision 1.
      + svn ps svn:externals '^/trunk/real/file ext_file' trunk/ext_dir
      property 'svn:externals' set on 'trunk/ext_dir'
      + svn up
      
      Fetching external item into 'trunk/ext_dir/ext_file'
      E    trunk/ext_dir/ext_file
      Updated external to revision 1.
      
      Updated to revision 1.
      + svn ci -m 'adding externals definitions'
      Sending        trunk/ext_dir
      
      Committed revision 2.
      + svn cp trunk branch
      A         branch
      + svn ci -m branching
      Adding         branch
      Adding         branch/ext_dir
      Adding         branch/ext_dir/ext_file
      subversion/svn/commit-cmd.c:142: (apr_err=160013)
      subversion/libsvn_client/commit.c:853: (apr_err=160013)
      svn: Commit failed (details follow):
      subversion/libsvn_client/commit_util.c:1628: (apr_err=160013)
      subversion/libsvn_delta/path_driver.c:254: (apr_err=160013)
      subversion/libsvn_client/commit_util.c:1416: (apr_err=160013)
      subversion/libsvn_repos/commit.c:492: (apr_err=160013)
      subversion/libsvn_fs_fs/tree.c:2020: (apr_err=160013)
      subversion/libsvn_fs_fs/tree.c:827: (apr_err=160013)
      subversion/libsvn_fs_fs/tree.c:669: (apr_err=160013)
      svn: File not found: revision 1, path '/trunk/ext_dir/ext_file'
      ]]]
      

      Original issue reported by neels

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: