Author: pburba
Date: Mon Jan  4 21:38:41 2010
New Revision: 895794

URL: http://svn.apache.org/viewvc?rev=895794&view=rev
Log:
Consider non-inheritable mergeinfo on a non-directory as non-canonical.

Wow, that was a lot of "nons".

This prevents us from doing things like using svn propset to set non-
inheritable mergeinfo on a file.  At best this mergeinfo is meaningless 
and confusing, at worst it is a bizarre bug waiting to happen.

* subversion/libsvn_wc/props.c
  (svn_wc_canonicalize_svn_prop): Error out when trying to set
   non-inheritable mergeinfo on anything other than a directory.

* subversion/tests/cmdline/prop_tests.py
  (inappropriate_props): Expand test to cover this use case.

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

Modified: subversion/trunk/subversion/libsvn_wc/props.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=895794&r1=895793&r2=895794&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.c (original)
+++ subversion/trunk/subversion/libsvn_wc/props.c Mon Jan  4 21:38:41 2010
@@ -2444,6 +2444,15 @@
       apr_hash_t *mergeinfo;
       svn_string_t *new_value_str;
 
+
+      /* Non-inheritable mergeinfo is only valid on directories. */
+      if (kind != svn_node_dir
+          && strstr(propval->data, SVN_MERGEINFO_NONINHERITABLE_STR))
+        return svn_error_createf(
+          SVN_ERR_MERGEINFO_PARSE_ERROR, NULL,
+          _("Cannot set non-inheritable mergeinfo on a non-directory ('%s')"),
+          svn_dirent_local_style(path, pool));
+
       SVN_ERR(svn_mergeinfo_parse(&mergeinfo, propval->data, pool));
       SVN_ERR(svn_mergeinfo_to_string(&new_value_str, mergeinfo, pool));
       new_value = svn_stringbuf_create_from_string(new_value_str, pool);

Modified: subversion/trunk/subversion/tests/cmdline/prop_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/prop_tests.py?rev=895794&r1=895793&r2=895794&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/prop_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/prop_tests.py Mon Jan  4 21:38:41 
2010
@@ -716,6 +716,13 @@
                                      'propset', SVN_PROP_MERGEINFO,
                                      '/trunk:', path)
 
+  # ...contain non-inheritable ranges when the target is a file.
+  svntest.actions.run_and_verify_svn('empty ranges', None,
+                                     "svn: Cannot set non-inheritable "
+                                     "mergeinfo on a non-directory*",
+                                     'propset', SVN_PROP_MERGEINFO,
+                                     '/A/D/H/psi:1*', iota_path)
+
 #----------------------------------------------------------------------
 
 # Issue #976.  When copying a file, do not determine svn:executable


Reply via email to