2008-04-01 21:40 glasser_at_tigris.org <glasser_at_tigris.org> napisaĆ(a):
> Author: glasser
> Date: Tue Apr 1 12:40:22 2008
> New Revision: 30161
It probably should be backported to the 1.5.x branch.
> Log:
> Fix bug in ra_neon with copy-on-update: Neon thinks it knows what a
> legal editor sequence looks like, which includes not having "remove
> prop" inside "add file" and "add dir". Of course, when the add is
> with history, this is perfectly legal, so Neon was throwing invalid
> XML error. This fixes that and adds a test.
>
> I suspect there are further issues here: for example, deleting or
> opening entries inside an add-with-history directory. (But the
> current implementation doesn't do add-dir-with-history anyway.)
>
> * subversion/libsvn_ra_neon/fetch.c
> (validate_element): Allow remove-prop inside add-directory/file.
>
> * subversion/tests/cmdline/update_tests.py
> (update_copied_and_deleted_prop): New.
> (test_list): Adjust.
>
> Patch by: cmpilato
> me
>
> Modified:
> trunk/subversion/libsvn_ra_neon/fetch.c
> trunk/subversion/tests/cmdline/update_tests.py
>
> Modified: trunk/subversion/libsvn_ra_neon/fetch.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_ra_neon/fetch.c?pathrev=30161&r1=30160&r2=30161
> ==============================================================================
> --- trunk/subversion/libsvn_ra_neon/fetch.c Tue Apr 1 12:12:22 2008 (r30160)
> +++ trunk/subversion/libsvn_ra_neon/fetch.c Tue Apr 1 12:40:22 2008 (r30161)
> @@ -1307,6 +1307,7 @@ static int validate_element(svn_ra_neon_
> || child == ELEM_add_directory
> || child == ELEM_absent_file
> || child == ELEM_add_file
> + || child == ELEM_remove_prop
> || child == ELEM_set_prop
> || child == ELEM_SVN_prop
> || child == ELEM_checked_in)
> @@ -1330,6 +1331,7 @@ static int validate_element(svn_ra_neon_
> if (child == ELEM_checked_in
> || child == ELEM_txdelta
> || child == ELEM_set_prop
> + || child == ELEM_remove_prop
> || child == ELEM_SVN_prop)
> return child;
> else
>
> Modified: trunk/subversion/tests/cmdline/update_tests.py
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/tests/cmdline/update_tests.py?pathrev=30161&r1=30160&r2=30161
> ==============================================================================
> --- trunk/subversion/tests/cmdline/update_tests.py Tue Apr 1 12:12:22 2008 (r30160)
> +++ trunk/subversion/tests/cmdline/update_tests.py Tue Apr 1 12:40:22 2008 (r30161)
> @@ -3453,6 +3453,83 @@ def update_copied_from_replaced_and_chan
> None, None, None, None, 0,
> wc_dir)
>
> +#----------------------------------------------------------------------
> +# Regression test: ra_neon assumes that you never delete a property on
> +# a newly-added file, which is wrong if it's add-with-history.
> +def update_copied_and_deleted_prop(sbox):
> + "updating a copied file with a deleted property"
> +
> + sbox.build()
> + wc_dir = sbox.wc_dir
> + iota_path = os.path.join(wc_dir, 'iota')
> + iota2_path = os.path.join(wc_dir, 'iota2')
> +
> + # Add a property on iota
> + svntest.actions.run_and_verify_svn(None, None, [],
> + 'propset', 'foo', 'bar', iota_path)
> + # Commit that change, creating r2.
> + expected_output = svntest.wc.State(wc_dir, {
> + 'iota' : Item(verb='Sending'),
> + })
> + expected_status_mixed = svntest.actions.get_virginal_state(wc_dir, 1)
> + expected_status_mixed.tweak('iota', wc_rev=2)
> + svntest.actions.run_and_verify_commit(wc_dir, expected_output,
> + expected_status_mixed, None, wc_dir)
> +
> + # Copy iota to iota2 and delete the property on it.
> + svntest.actions.run_and_verify_svn(None, None, [],
> + 'copy', iota_path, iota2_path)
> + svntest.actions.run_and_verify_svn(None, None, [],
> + 'propdel', 'foo', iota2_path)
> +
> + # Commit that change, creating r3.
> + expected_output = svntest.wc.State(wc_dir, {
> + 'iota2' : Item(verb='Adding'),
> + })
> + expected_status_mixed.add({
> + 'iota2' : Item(status=' ', wc_rev=3),
> + })
> + svntest.actions.run_and_verify_commit(wc_dir, expected_output,
> + expected_status_mixed, None, wc_dir)
> +
> + # Update the whole wc, verifying disk as well.
> + expected_output = svntest.wc.State(wc_dir, { })
> + expected_disk_r3 = svntest.main.greek_state.copy()
> + expected_disk_r3.add({
> + 'iota2' : Item("This is the file 'iota'.\n",
> + props={SVN_PROP_MERGEINFO: ''}),
> + })
> + expected_disk_r3.tweak('iota', props={'foo':'bar'})
> + expected_status_r3 = expected_status_mixed.copy()
> + expected_status_r3.tweak(wc_rev=3)
> + svntest.actions.run_and_verify_update(wc_dir,
> + expected_output,
> + expected_disk_r3,
> + expected_status_r3,
> + check_props=True)
> +
> + # Now go back to r2.
> + expected_output = svntest.wc.State(wc_dir, {'iota2': Item(status='D ')})
> + expected_disk_r2 = expected_disk_r3.copy()
> + expected_disk_r2.remove('iota2')
> + expected_status_r2 = expected_status_r3.copy()
> + expected_status_r2.tweak(wc_rev=2)
> + expected_status_r2.remove('iota2')
> + svntest.actions.run_and_verify_update(wc_dir,
> + expected_output,
> + expected_disk_r2,
> + expected_status_r2,
> + None, None, None, None, None,
> + True,
> + "-r2", wc_dir)
> +
> + # And finally, back to r3, getting an add-with-history-and-property-deleted
> + expected_output = svntest.wc.State(wc_dir, {'iota2': Item(status='A ')})
> + svntest.actions.run_and_verify_update(wc_dir,
> + expected_output,
> + expected_disk_r3,
> + expected_status_r3,
> + check_props=True)
>
> #----------------------------------------------------------------------
>
> @@ -3789,6 +3866,7 @@ test_list = [ None,
> SkipUnless(update_handles_copyfrom_with_txdeltas,
> server_sends_copyfrom_on_update),
> update_copied_from_replaced_and_changed,
> + update_copied_and_deleted_prop,
> update_accept_conflicts,
> eof_in_interactive_conflict_resolver,
> ]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe_at_subversion.tigris.org
> For additional commands, e-mail: svn-help_at_subversion.tigris.org
>
>
Received on 2008-04-02 20:09:16 CEST