[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r31159 - in trunk/subversion: libsvn_wc tests/cmdline

From: Daniel Shahaf <d.s_at_daniel.shahaf.co.il>
Date: Wed, 14 May 2008 20:38:55 +0300 (Jerusalem Daylight Time)

kfogel_at_tigris.org wrote on Tue, 13 May 2008 at 12:53 -0700:
> Author: kfogel
> Date: Tue May 13 12:53:12 2008
> New Revision: 31159
>
> Log:
> Fix "file not found" error when a merge target is a broken symbolic link.
>
> Patch by: David O'Shea <david.oshea-K2D8ygZuxnlBDgjK7y7TUQ_at_public.gmane.org>
>
> * subversion/libsvn_wc/merge.c
> (svn_wc__merge_internal): Diff against detranslated file if the
> target is "special".
>
> * subversion/tests/cmdlink/merge_tests.py
> (merge_broken_link): New test function.
> (test_list): Call the new test function.
>
> Modified:
> trunk/subversion/libsvn_wc/merge.c
> trunk/subversion/tests/cmdline/merge_tests.py
>
> Modified: trunk/subversion/libsvn_wc/merge.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/merge.c?pathrev=31159&r1=31158&r2=31159
> ==============================================================================
> --- trunk/subversion/libsvn_wc/merge.c Tue May 13 12:20:56 2008 (r31158)
> +++ trunk/subversion/libsvn_wc/merge.c Tue May 13 12:53:12 2008 (r31159)
> @@ -674,9 +674,18 @@ svn_wc__merge_internal(svn_stringbuf_t *
> }
> else
> {
> - svn_boolean_t same;
> + svn_boolean_t same, special;
> + /* If 'special', then use the detranslated form of the
> + target file. This is so we don't try to follow symlinks,
> + but the same treatment is probably also appropriate for
> + whatever special file types we may invent in the future. */
> + SVN_ERR(svn_wc__get_special(&special, merge_target,
> + adm_access, pool));
> SVN_ERR(svn_io_files_contents_same_p(&same, result_target,
> - merge_target, pool));
> + (special ?
> + tmp_target :
> + merge_target),
> + pool));
>
> *merge_outcome = same ? svn_wc_merge_unchanged : svn_wc_merge_merged;
> }
>
> Modified: trunk/subversion/tests/cmdline/merge_tests.py
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/tests/cmdline/merge_tests.py?pathrev=31159&r1=31158&r2=31159
> ==============================================================================
> --- trunk/subversion/tests/cmdline/merge_tests.py Tue May 13 12:20:56 2008 (r31158)
> +++ trunk/subversion/tests/cmdline/merge_tests.py Tue May 13 12:53:12 2008 (r31159)
> @@ -11258,6 +11258,7 @@ def merge_chokes_on_renamed_subtrees(sbo
> expected_status.tweak('H_COPY/psi_moved', status='MM')
> svntest.actions.run_and_verify_status(wc_dir, expected_status)
>
> +
> #----------------------------------------------------------------------
> # Issue #3157
> def dont_explicitly_record_implicit_mergeinfo(sbox):
> @@ -11375,6 +11376,32 @@ def dont_explicitly_record_implicit_merg
> None, None, None, None, None, 1)
> os.chdir(saved_cwd)
>
> +# Test for issue where merging a change to a broken link fails
> +def merge_broken_link(sbox):
> + "merge with broken symlinks in target"
> +
> + # Create our good 'ole greek tree.
> + sbox.build()
> + wc_dir = sbox.wc_dir
> + src_path = os.path.join(wc_dir, 'A', 'B', 'E')
> + copy_path = os.path.join(wc_dir, 'A', 'B', 'E_COPY')
> + link_path = os.path.join(src_path, 'beta_link')
> +
> + os.symlink('beta_broken', link_path)

This breaks the Windows builtbod:

        AttributeError: 'module' object has no attribute 'symlink'
        FAIL: merge_tests.py 96: merge with broken symlinks in target

> + svntest.main.run_svn(None, 'add', link_path)
> + svntest.main.run_svn(None, 'commit', '-m', 'Create a broken link', link_path)
> + svntest.main.run_svn(None, 'copy', src_path, copy_path)
> + svntest.main.run_svn(None, 'commit', '-m', 'Copy the tree with the broken link',
> + copy_path)
> + os.unlink(link_path)
> + os.symlink('beta', link_path)
> + svntest.main.run_svn(None, 'commit', '-m', 'Fix a broken link', link_path)
> + svntest.actions.run_and_verify_svn(
> + None,
> + expected_merge_output([[4]], 'U ' + copy_path + '/beta_link\n'),
> + [], 'merge', '-c4', src_path, copy_path)
> +
> +
> ########################################################################
> # Run the tests
>
> @@ -11541,6 +11568,7 @@ test_list = [ None,
> server_has_mergeinfo)),
> SkipUnless(dont_explicitly_record_implicit_mergeinfo,
> server_has_mergeinfo),
> + merge_broken_link,
> ]
>
> if __name__ == '__main__':

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-05-14 19:39:25 CEST

This is an archived mail posted to the Subversion Dev mailing list.