You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Ed Price <ed...@gmail.com> on 2006/10/11 18:52:00 UTC

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

On 10/11/06, Ed Price <ed...@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!

Thanks,
-Ed

[[[

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...@gmail.com>

]]]

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

Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
Ed Price wrote:
> On 10/11/06, Ed Price <ed...@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...@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__':



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

Posted by Ed Price <ed...@gmail.com>.
> > Looks great to me, applied in r22051.  Will propose for backport to
> > 1.4.x once I've confirmed that it works there.  Thanks!
>
> Thanks!  Unfortunately it looks like the testcases are failing
> on windows (only) according to buildbot.  Looking at the logs:
[...]

I can't test on windows so I'm not sure this is it, but I suspect
it's actually because I didn't properly regexp-escape the expected
output, and windows paths have backslashes...  Patch attached!

-Ed

[[[

Properly regexp-escape expected output in revert tests added in
r22051.  Fixes spurious test failures on windows.

Patch by: Ed Price <ed...@gmail.com>

 * subversion/tests/cmdline/revert_tests.py
   (revert_propset__dir): Regexp-escape expected output.
   (revert_propset__file): Same.
   (revert_propdel__dir): Same.
   (revert_propdel__file): Same.

]]]

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

Posted by Ed Price <ed...@gmail.com>.
> > Please find the fix (including new testcases) attached.
[...]
> Looks great to me, applied in r22051.  Will propose for backport to
> 1.4.x once I've confirmed that it works there.  Thanks!

Thanks!  Unfortunately it looks like the testcases are failing
on windows (only) according to buildbot.  Looking at the logs:

EXPECTED STDOUT (regexp):
Reverted 'svn-test-work\working_copies\revert_tests-12\iota'
ACTUAL STDOUT:
Reverted 'svn-test-work\working_copies\revert_tests-12\iota'
EXCEPTION: SVNLineUnequal

Weird...  They look equal -- and apparently *are* equal on
platforms other than windows.  Some kind of newline issue??
I don't know but I'll look into it.

-Ed

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

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

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 10/11/06, Ed Price <ed...@gmail.com> wrote:
> On 10/11/06, Ed Price <ed...@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!

Looks great to me, applied in r22051.  Will propose for backport to
1.4.x once I've confirmed that it works there.  Thanks!

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org