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

Re: [PATCH] fix for revert notification bug (1.4.0 regression)

From: Hyrum K. Wright <hyrum_wright_at_mail.utexas.edu>
Date: 2006-10-19 17:26:55 CEST

Ed Price wrote:
> On 10/11/06, Ed Price <ed.price@gmail.com> wrote:
>> 1. Please see thread here:
>>
>> http://svn.haxx.se/users/archive-2006-10/0540.shtml
>>
>> I expect my patch broke it, so I'll try to fix it! :)
>> Please confirm that I may file an issue.
>
> Please find the fix (including new testcases) attached.
>
> I suggest applying to trunk and nominating for 1.4.x backport,
> as it does fix a regression in 1.4.0 and seems quite safe.
>
> I'm happy to rev the patch if there are any issues with it.
> Please let me know!

Ping...

Has any of the committers had a chance to take a look at Ed's patch? If
nothing happens in the next few days, I'll file an issue.

-Hyrum

> [[[
>
> Notify properly on property-only revert. Fixes a bug introduced
> by the fix for issue #2517 (r18842).
>
> * subversion/libsvn_wc/adm_ops.c
> (revert_admin_things): Set '*reverted' when reinstalling
> properties.
>
> * subversion/tests/cmdline/revert_tests.py
> (revert_propset__dir): New test.
> (revert_propset__file): New test.
> (revert_propdel__dir): New test.
> (revert_propdel__file): New test.
> (test_list): Add new tests.
>
> Patch by: Ed Price <ed.price@gmail.com>
>
> ]]]
>
>
> ------------------------------------------------------------------------
>
> Index: subversion/libsvn_wc/adm_ops.c
> ===================================================================
> --- subversion/libsvn_wc/adm_ops.c (revision 21887)
> +++ subversion/libsvn_wc/adm_ops.c (working copy)
> @@ -1702,10 +1702,13 @@
> /* Reinstall props if we need to. Only rewrite the baseprops,
> if we're reverting a replacement. This is just an optimization. */
> if (baseprops)
> - SVN_ERR(svn_wc__install_props(&log_accum, adm_access, name, baseprops,
> - baseprops,
> - entry->schedule == svn_wc_schedule_replace,
> - pool));
> + {
> + SVN_ERR(svn_wc__install_props(&log_accum, adm_access, name, baseprops,
> + baseprops,
> + entry->schedule == svn_wc_schedule_replace,
> + pool));
> + *reverted = TRUE;
> + }
>
> /* Clean up the copied state if this is a replacement. */
> if (entry->schedule == svn_wc_schedule_replace
> Index: subversion/tests/cmdline/revert_tests.py
> ===================================================================
> --- subversion/tests/cmdline/revert_tests.py (revision 21887)
> +++ subversion/tests/cmdline/revert_tests.py (working copy)
> @@ -583,7 +583,55 @@
> svntest.actions.run_and_verify_svn(None, [], [], "diff", wc_dir_2)
> svntest.actions.run_and_verify_svn(None, [], [], "revert", "-R", wc_dir_2)
>
> +def revert_propset__dir(sbox):
> + "revert a simple propset on a dir"
>
> + sbox.build()
> + wc_dir = sbox.wc_dir
> + a_path = os.path.join(wc_dir, 'A')
> + svntest.main.run_svn(None, 'propset', 'foo', 'x', a_path)
> + expected_output = "Reverted '" + a_path + "'"
> + svntest.actions.run_and_verify_svn(None, expected_output, [], "revert",
> + a_path)
> +
> +def revert_propset__file(sbox):
> + "revert a simple propset on a file"
> +
> + sbox.build()
> + wc_dir = sbox.wc_dir
> + iota_path = os.path.join(wc_dir, 'iota')
> + svntest.main.run_svn(None, 'propset', 'foo', 'x', iota_path)
> + expected_output = "Reverted '" + iota_path + "'"
> + svntest.actions.run_and_verify_svn(None, expected_output, [], "revert",
> + iota_path)
> +
> +def revert_propdel__dir(sbox):
> + "revert a simple propdel on a dir"
> +
> + sbox.build()
> + wc_dir = sbox.wc_dir
> + a_path = os.path.join(wc_dir, 'A')
> + svntest.main.run_svn(None, 'propset', 'foo', 'x', a_path)
> + svntest.main.run_svn(None, 'commit', '-m', 'ps', a_path)
> + svntest.main.run_svn(None, 'propdel', 'foo', a_path)
> + expected_output = "Reverted '" + a_path + "'"
> + svntest.actions.run_and_verify_svn(None, expected_output, [], "revert",
> + a_path)
> +
> +def revert_propdel__file(sbox):
> + "revert a simple propdel on a file"
> +
> + sbox.build()
> + wc_dir = sbox.wc_dir
> + iota_path = os.path.join(wc_dir, 'iota')
> + svntest.main.run_svn(None, 'propset', 'foo', 'x', iota_path)
> + svntest.main.run_svn(None, 'commit', '-m', 'ps', iota_path)
> + svntest.main.run_svn(None, 'propdel', 'foo', iota_path)
> + expected_output = "Reverted '" + iota_path + "'"
> + svntest.actions.run_and_verify_svn(None, expected_output, [], "revert",
> + iota_path)
> +
> +
> ########################################################################
> # Run the tests
>
> @@ -600,6 +648,10 @@
> revert_after_second_replace,
> revert_after_manual_conflict_resolution__text,
> revert_after_manual_conflict_resolution__prop,
> + revert_propset__dir,
> + revert_propset__file,
> + revert_propdel__dir,
> + revert_propdel__file,
> ]
>
> if __name__ == '__main__':

Received on Thu Oct 19 17:27:32 2006

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.