Bug#448864: svn export doesn't export svn:externals from local copies
Any chance that the patch from upstream could be back-ported to 1.4? I'm building packages and at the moment I have to keep the patches/ directory in sync manually because of this, which is a great pain. Ross -- Ross Burton mail: [EMAIL PROTECTED] jabber: [EMAIL PROTECTED] www: http://www.burtonini.com./ PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#448864: svn export doesn't export svn:externals from local copies
On Thu, 2008-01-17 at 11:45 +, Ross Burton wrote: Any chance that the patch from upstream could be back-ported to 1.4? I'm building packages and at the moment I have to keep the patches/ directory in sync manually because of this, which is a great pain. Attached is a patch, adapted from the upstream bug fix, which should work. Annoyingly it compiles but the swig generation later fails so it is, at present, untested. This is how my svn build fails: In file included from /tmp/buildd/subversion-1.4.4dfsg1/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c:2: /tmp/buildd/subversion-1.4.4dfsg1/subversion/bindings/swig/proxy/swig_ruby_external_runtime.swg:819: error: redefinition of '_mSWIG' /tmp/buildd/subversion-1.4.4dfsg1/subversion/bindings/swig/proxy/rubyhead.swg:107: error: previous definition of '_mSWIG' was here Any ideas? Ross -- Ross Burton mail: [EMAIL PROTECTED] jabber: [EMAIL PROTECTED] www: http://www.burtonini.com./ PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF Index: trunk/subversion/libsvn_client/export.c === --- trunk/subversion/libsvn_client/export.c (revision 25706) +++ trunk/subversion/libsvn_client/export.c (revision 25707) @@ -317,6 +319,53 @@ iterpool)); } } + + /* Handle externals. */ + if (! ignore_externals depth == svn_depth_infinity + entry-depth == svn_depth_infinity) +{ + apr_array_header_t *ext_items; + const svn_string_t *prop_val; + + SVN_ERR(svn_wc_prop_get(prop_val, SVN_PROP_EXTERNALS, + from, adm_access, pool)); + if (prop_val != NULL) +{ + int i; + + SVN_ERR(svn_wc_parse_externals_description3(ext_items, from, + prop_val-data, + pool)); + for (i = 0; i ext_items-nelts; ++i) +{ + svn_wc_external_item2_t *ext_item; + const char *new_from, *new_to; + + svn_pool_clear(iterpool); + + ext_item = APR_ARRAY_IDX(ext_items, i, + svn_wc_external_item2_t *); + new_from = svn_path_join(from, ext_item-target_dir, + iterpool); + new_to = svn_path_join(to, ext_item-target_dir, + iterpool); + + /* The target dir might have multiple components. Guarantee + the path leading down to the last component. */ + if (svn_path_component_count(ext_item-target_dir) 1) +{ + const char *parent = svn_path_dirname(new_to, iterpool); + SVN_ERR(svn_io_make_dir_recursively(parent, iterpool)); +} + + SVN_ERR(copy_versioned_files(new_from, new_to, + revision, force, FALSE, + svn_depth_infinity, native_eol, + ctx, iterpool)); +} +} +} + svn_pool_destroy(iterpool); } else if (entry-kind == svn_node_file) Index: trunk/subversion/tests/cmdline/externals_tests.py === --- trunk/subversion/tests/cmdline/externals_tests.py (revision 25706) +++ trunk/subversion/tests/cmdline/externals_tests.py (revision 25707) @@ -716,6 +716,50 @@ #-- +# Test for issue #2429 +def export_wc_with_externals(sbox): + test exports from working copies with externals + + externals_test_setup(sbox) + + wc_dir = sbox.wc_dir + repo_url = sbox.repo_url + export_target = sbox.add_wc_path('export') + + # Create a working copy. + svntest.actions.run_and_verify_svn(None, None, [], + 'checkout', + '--username', svntest.main.wc_author, + '--password', svntest.main.wc_passwd, + repo_url, wc_dir) + # Export the working copy. + svntest.actions.run_and_verify_svn(None, None, [], + 'export', wc_dir, export_target) + + paths = [ +os.path.join(export_target, A, C, exdir_G), +os.path.join(export_target, A, C, exdir_G, pi), +os.path.join(export_target, A, C, exdir_H), +os.path.join(export_target, A, C, exdir_H, omega), +os.path.join(export_target, A, D, x), +
Bug#448864: svn export doesn't export svn:externals from local copies
On Thu, 2008-01-17 at 14:37 +, Ross Burton wrote: Attached is a patch, adapted from the upstream bug fix, which should work. Annoyingly it compiles but the swig generation later fails so it is, at present, untested. Damnit, wrong patch. :/ Attached is the real patch. Ross -- Ross Burton mail: [EMAIL PROTECTED] jabber: [EMAIL PROTECTED] www: http://www.burtonini.com./ PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF diff -u subversion-1.4.4dfsg1/debian/control subversion-1.4.4dfsg1/debian/control --- subversion-1.4.4dfsg1/debian/control +++ subversion-1.4.4dfsg1/debian/control @@ -4,7 +4,7 @@ Maintainer: Peter Samuelson [EMAIL PROTECTED] Uploaders: Troy Heber [EMAIL PROTECTED], Guilherme de S. Pastore [EMAIL PROTECTED] Build-Depends: debhelper (= 5.0.37.1), libneon26-dev, zlib1g-dev, - libapr1-dev, libaprutil1-dev (= 1.2.7+dfsg-2), libdb4.4-dev, + libapr1-dev, libaprutil1-dev (= 1.2.7+dfsg-2), libdb4.6-dev, apache2-threaded-dev (= 2.2), patch, dpatch, doxygen, autotools-dev, autoconf, libtool, swig, python, python-dev, python-support (= 0.4), diff -u subversion-1.4.4dfsg1/debian/changelog subversion-1.4.4dfsg1/debian/changelog --- subversion-1.4.4dfsg1/debian/changelog +++ subversion-1.4.4dfsg1/debian/changelog @@ -1,3 +1,9 @@ +subversion (1.4.4dfsg1-1.1) unstable; urgency=low + + * Add patch to fix export with externals + + -- Ross Burton [EMAIL PROTECTED] Thu, 17 Jan 2008 11:54:00 + + subversion (1.4.4dfsg1-1) unstable; urgency=low * New upstream version. only in patch2: unchanged: --- subversion-1.4.4dfsg1.orig/subversion/tests/cmdline/externals_tests.py +++ subversion-1.4.4dfsg1/subversion/tests/cmdline/externals_tests.py @@ -750,6 +749,49 @@ raise svntest.Failure(Unexpected contents for rev 1 of + exdir_H_omega_path) +#-- + +# Test for issue #2429 +def export_wc_with_externals(sbox): + test exports from working copies with externals + + externals_test_setup(sbox) + + wc_dir = sbox.wc_dir + repo_url = sbox.repo_url + export_target = sbox.add_wc_path('export') + + # Create a working copy. + svntest.actions.run_and_verify_svn(None, None, [], + 'checkout', + '--username', svntest.main.wc_author, + '--password', svntest.main.wc_passwd, + repo_url, wc_dir) + # Export the working copy. + svntest.actions.run_and_verify_svn(None, None, [], + 'export', wc_dir, export_target) + + paths = [ +os.path.join(export_target, A, C, exdir_G), +os.path.join(export_target, A, C, exdir_G, pi), +os.path.join(export_target, A, C, exdir_H), +os.path.join(export_target, A, C, exdir_H, omega), +os.path.join(export_target, A, D, x), +os.path.join(export_target, A, D, x, y), +os.path.join(export_target, A, D, x, y, z), +os.path.join(export_target, A, D, x, y, z, blah), +os.path.join(export_target, A, D, x, y, z, blah, E, alpha), +os.path.join(export_target, A, D, x, y, z, blah, E, beta), +] + probe_paths_exist(paths) + + svntest.main.safe_rmtree(export_target) + + # Export it again, without externals. + svntest.actions.run_and_verify_svn(None, None, [], + 'export', '--ignore-externals', + wc_dir, export_target) + probe_paths_missing(paths) @@ -767,6 +809,7 @@ modify_and_update_receive_new_external, disallow_dot_or_dotdot_directory_reference, export_with_externals, + export_wc_with_externals, ] if __name__ == '__main__': only in patch2: unchanged: --- subversion-1.4.4dfsg1.orig/subversion/libsvn_client/export.c +++ subversion-1.4.4dfsg1/subversion/libsvn_client/export.c @@ -213,6 +213,7 @@ const char *to, svn_opt_revision_t *revision, svn_boolean_t force, + svn_boolean_t ignore_externals, svn_boolean_t recurse, const char *native_eol, svn_client_ctx_t *ctx, @@ -312,7 +313,7 @@ const char *new_to = svn_path_join(to, item, iterpool); SVN_ERR(copy_versioned_files(new_from, new_to, - revision, force, recurse, + revision, force, ignore_externals, recurse, native_eol, ctx,
Bug#448864: svn export doesn't export svn:externals from local copies
[Ross Burton] Attached is a patch, adapted from the upstream bug fix, which should work. Thanks! I'll take a look (at your updated patch). This is how my svn build fails: In file included from /tmp/buildd/subversion-1.4.4dfsg1/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c:2: /tmp/buildd/subversion-1.4.4dfsg1/subversion/bindings/swig/proxy/swig_ruby_external_runtime.swg:819: error: redefinition of '_mSWIG' /tmp/buildd/subversion-1.4.4dfsg1/subversion/bindings/swig/proxy/rubyhead.swg:107: error: previous definition of '_mSWIG' was here Any ideas? I wish I had any ideas. See Bug #453166. -- Peter Samuelson | org-tld!p12n!peter | http://p12n.org/ signature.asc Description: Digital signature