You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2010/05/12 20:18:04 UTC

svn commit: r943609 - in /subversion/trunk/subversion: libsvn_wc/props.c tests/cmdline/special_tests.py

Author: danielsh
Date: Wed May 12 18:18:03 2010
New Revision: 943609

URL: http://svn.apache.org/viewvc?rev=943609&view=rev
Log:
Fix special_tests 15: normalize "svn:special"'s value.

* subversion/libsvn_wc/props.c
  (svn_wc_canonicalize_svn_prop):
    Normalize SVN_PROP_SPECIAL along with the other boolean svn:* properties.

* subversion/tests/cmdline/special_tests.py
  (test_list):  Expect propvalue_normalized() to pass.
  (propvalue_normalized):  Tweak expected output so it's interpreted as
    a string match rather than a regex match.

Modified:
    subversion/trunk/subversion/libsvn_wc/props.c
    subversion/trunk/subversion/tests/cmdline/special_tests.py

Modified: subversion/trunk/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=943609&r1=943608&r2=943609&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.c (original)
+++ subversion/trunk/subversion/libsvn_wc/props.c Wed May 12 18:18:03 2010
@@ -2571,9 +2571,9 @@ svn_wc_canonicalize_svn_prop(const svn_s
       new_value = svn_stringbuf_create_from_string(propval, pool);
       svn_stringbuf_strip_whitespace(new_value);
     }
-  else if (strcmp(propname, SVN_PROP_EXECUTABLE) == 0
-        || strcmp(propname, SVN_PROP_NEEDS_LOCK) == 0)
+  else if (svn_prop_is_boolean(propname))
     {
+      /* SVN_PROP_EXECUTABLE, SVN_PROP_NEEDS_LOCK, SVN_PROP_SPECIAL */
       new_value = svn_stringbuf_create_from_string(&boolean_value, pool);
     }
   else if (strcmp(propname, SVN_PROP_MERGEINFO) == 0)

Modified: subversion/trunk/subversion/tests/cmdline/special_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/special_tests.py?rev=943609&r1=943608&r2=943609&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/special_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/special_tests.py Wed May 12 18:18:03 2010
@@ -641,7 +641,8 @@ def propvalue_normalized(sbox):
   svntest.main.run_svn(None, 'propset', 'svn:special', 'yes', iota2_path)
 
   # Property value should be SVN_PROP_BOOLEAN_TRUE
-  svntest.actions.run_and_verify_svn(None, '*', [],
+  expected_propval = ['*']
+  svntest.actions.run_and_verify_svn(None, expected_propval, [],
                                      'propget', '--strict', 'svn:special',
                                      iota2_path)
 
@@ -658,7 +659,7 @@ def propvalue_normalized(sbox):
                                         wc_dir)
 
   svntest.main.run_svn(None, 'update')
-  svntest.actions.run_and_verify_svn(None, '*', [],
+  svntest.actions.run_and_verify_svn(None, expected_propval, [],
                                      'propget', '--strict', 'svn:special',
                                      iota2_path)
 
@@ -685,7 +686,7 @@ test_list = [ None,
               replace_symlink_with_dir,
               SkipUnless(update_obstructing_symlink, svntest.main.is_posix_os),
               warn_on_reserved_name,
-              Skip(XFail(propvalue_normalized), svntest.main.is_posix_os),
+              Skip(propvalue_normalized, svntest.main.is_posix_os),
              ]
 
 if __name__ == '__main__':



Re: svn commit: r943609 - in /subversion/trunk/subversion: libsvn_wc/props.c tests/cmdline/special_tests.py

Posted by Greg Stein <gs...@gmail.com>.
On Wed, May 12, 2010 at 16:34, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> Daniel Shahaf wrote on Wed, 12 May 2010 at 23:19 +0300:
>> It only affects symlinks being added on Windows
>
> And even then, what exactly is the effect?  What code exactly is going to
> bother noticing that the property's value is not "*", given that we
> promise it to always be "*" whenever the property is present?  :-)
>
> Daniel
> (I've always wondered why symlinks are represented as
>
>    metadata = { 'svn:special' : '*' }
>    data = "link $target"
>
> rather than as
>
>    metadata = { 'svn:special' : 'link' }
>    data = "$target"

Don't get me started. It should have been svn:symlink = $target

Re: svn commit: r943609 - in /subversion/trunk/subversion: libsvn_wc/props.c tests/cmdline/special_tests.py

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Daniel Shahaf wrote on Wed, 12 May 2010 at 23:19 +0300:
> It only affects symlinks being added on Windows

And even then, what exactly is the effect?  What code exactly is going to 
bother noticing that the property's value is not "*", given that we 
promise it to always be "*" whenever the property is present?  :-)

Daniel
(I've always wondered why symlinks are represented as

    metadata = { 'svn:special' : '*' }
    data = "link $target"

rather than as

    metadata = { 'svn:special' : 'link' }
    data = "$target"

.)

Re: svn commit: r943609 - in /subversion/trunk/subversion: libsvn_wc/props.c tests/cmdline/special_tests.py

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
It only affects symlinks being added on Windows --- a pretty rare use
case.  If folks think it's important enough a fix to be backported, then
I'm +1 too.

Daniel

Greg Stein wrote on Wed, 12 May 2010 at 14:46 -0400:
> Backport?
> 
> On May 12, 2010 2:18 PM, <da...@apache.org> wrote:
> 
> Author: danielsh
> Date: Wed May 12 18:18:03 2010
> New Revision: 943609
> 
> URL: http://svn.apache.org/viewvc?rev=943609&view=rev
> Log:
> Fix special_tests 15: normalize "svn:special"'s value.
> 
> * subversion/libsvn_wc/props.c
>  (svn_wc_canonicalize_svn_prop):
>    Normalize SVN_PROP_SPECIAL along with the other boolean svn:* properties.
> 
> * subversion/tests/cmdline/special_tests.py
>  (test_list):  Expect propvalue_normalized() to pass.
>  (propvalue_normalized):  Tweak expected output so it's interpreted as
>    a string match rather than a regex match.
> 
> Modified:
>    subversion/trunk/subversion/libsvn_wc/props.c
>    subversion/trunk/subversion/tests/cmdline/special_tests.py
> 
> Modified: subversion/trunk/subversion/libsvn_wc/props.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=943609&r1=943608&r2=943609&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_wc/props.c (original)
> +++ subversion/trunk/subversion/libsvn_wc/props.c Wed May 12 18:18:03 2010
> @@ -2571,9 +2571,9 @@ svn_wc_canonicalize_svn_prop(const svn_s
>       new_value = svn_stringbuf_create_from_string(propval, pool);
>       svn_stringbuf_strip_whitespace(new_value);
>     }
> -  else if (strcmp(propname, SVN_PROP_EXECUTABLE) == 0
> -        || strcmp(propname, SVN_PROP_NEEDS_LOCK) == 0)
> +  else if (svn_prop_is_boolean(propname))
>     {
> +      /* SVN_PROP_EXECUTABLE, SVN_PROP_NEEDS_LOCK, SVN_PROP_SPECIAL */
>       new_value = svn_stringbuf_create_from_string(&boolean_value, pool);
>     }
>   else if (strcmp(propname, SVN_PROP_MERGEINFO) == 0)
> 
> Modified: subversion/trunk/subversion/tests/cmdline/special_tests.py
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/special_tests.py?rev=943609&r1=943608&r2=943609&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/tests/cmdline/special_tests.py (original)
> +++ subversion/trunk/subversion/tests/cmdline/special_tests.py Wed May 12
> 18:18:03 2010
> @@ -641,7 +641,8 @@ def propvalue_normalized(sbox):
>   svntest.main.run_svn(None, 'propset', 'svn:special', 'yes', iota2_path)
> 
>   # Property value should be SVN_PROP_BOOLEAN_TRUE
> -  svntest.actions.run_and_verify_svn(None, '*', [],
> +  expected_propval = ['*']
> +  svntest.actions.run_and_verify_svn(None, expected_propval, [],
>                                      'propget', '--strict', 'svn:special',
>                                      iota2_path)
> 
> @@ -658,7 +659,7 @@ def propvalue_normalized(sbox):
>                                         wc_dir)
> 
>   svntest.main.run_svn(None, 'update')
> -  svntest.actions.run_and_verify_svn(None, '*', [],
> +  svntest.actions.run_and_verify_svn(None, expected_propval, [],
>                                      'propget', '--strict', 'svn:special',
>                                      iota2_path)
> 
> @@ -685,7 +686,7 @@ test_list = [ None,
>               replace_symlink_with_dir,
>               SkipUnless(update_obstructing_symlink,
> svntest.main.is_posix_os),
>               warn_on_reserved_name,
> -              Skip(XFail(propvalue_normalized), svntest.main.is_posix_os),
> +              Skip(propvalue_normalized, svntest.main.is_posix_os),
>              ]
> 
>  if __name__ == '__main__':
> 

Re: svn commit: r943609 - in /subversion/trunk/subversion: libsvn_wc/props.c tests/cmdline/special_tests.py

Posted by Greg Stein <gs...@gmail.com>.
Backport?

On May 12, 2010 2:18 PM, <da...@apache.org> wrote:

Author: danielsh
Date: Wed May 12 18:18:03 2010
New Revision: 943609

URL: http://svn.apache.org/viewvc?rev=943609&view=rev
Log:
Fix special_tests 15: normalize "svn:special"'s value.

* subversion/libsvn_wc/props.c
 (svn_wc_canonicalize_svn_prop):
   Normalize SVN_PROP_SPECIAL along with the other boolean svn:* properties.

* subversion/tests/cmdline/special_tests.py
 (test_list):  Expect propvalue_normalized() to pass.
 (propvalue_normalized):  Tweak expected output so it's interpreted as
   a string match rather than a regex match.

Modified:
   subversion/trunk/subversion/libsvn_wc/props.c
   subversion/trunk/subversion/tests/cmdline/special_tests.py

Modified: subversion/trunk/subversion/libsvn_wc/props.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=943609&r1=943608&r2=943609&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.c (original)
+++ subversion/trunk/subversion/libsvn_wc/props.c Wed May 12 18:18:03 2010
@@ -2571,9 +2571,9 @@ svn_wc_canonicalize_svn_prop(const svn_s
      new_value = svn_stringbuf_create_from_string(propval, pool);
      svn_stringbuf_strip_whitespace(new_value);
    }
-  else if (strcmp(propname, SVN_PROP_EXECUTABLE) == 0
-        || strcmp(propname, SVN_PROP_NEEDS_LOCK) == 0)
+  else if (svn_prop_is_boolean(propname))
    {
+      /* SVN_PROP_EXECUTABLE, SVN_PROP_NEEDS_LOCK, SVN_PROP_SPECIAL */
      new_value = svn_stringbuf_create_from_string(&boolean_value, pool);
    }
  else if (strcmp(propname, SVN_PROP_MERGEINFO) == 0)

Modified: subversion/trunk/subversion/tests/cmdline/special_tests.py
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/special_tests.py?rev=943609&r1=943608&r2=943609&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/special_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/special_tests.py Wed May 12
18:18:03 2010
@@ -641,7 +641,8 @@ def propvalue_normalized(sbox):
  svntest.main.run_svn(None, 'propset', 'svn:special', 'yes', iota2_path)

  # Property value should be SVN_PROP_BOOLEAN_TRUE
-  svntest.actions.run_and_verify_svn(None, '*', [],
+  expected_propval = ['*']
+  svntest.actions.run_and_verify_svn(None, expected_propval, [],
                                     'propget', '--strict', 'svn:special',
                                     iota2_path)

@@ -658,7 +659,7 @@ def propvalue_normalized(sbox):
                                        wc_dir)

  svntest.main.run_svn(None, 'update')
-  svntest.actions.run_and_verify_svn(None, '*', [],
+  svntest.actions.run_and_verify_svn(None, expected_propval, [],
                                     'propget', '--strict', 'svn:special',
                                     iota2_path)

@@ -685,7 +686,7 @@ test_list = [ None,
              replace_symlink_with_dir,
              SkipUnless(update_obstructing_symlink,
svntest.main.is_posix_os),
              warn_on_reserved_name,
-              Skip(XFail(propvalue_normalized), svntest.main.is_posix_os),
+              Skip(propvalue_normalized, svntest.main.is_posix_os),
             ]

 if __name__ == '__main__':