subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1408632 - in /subversion/trunk/subversion: svnmucc/svnmucc.c tests/cmdline/svnmucc_tests.py
Date Tue, 13 Nov 2012 08:09:40 GMT
Author: danielsh
Date: Tue Nov 13 08:09:39 2012
New Revision: 1408632

URL: http://svn.apache.org/viewvc?rev=1408632&view=rev
Log:
Fix the second part of issue #3663, "svnmucc propset and propdel fail on
repository root".

* subversion/tests/cmdline/svnmucc_tests.py
  (propset_root): New test.
  (test_list): Run it.

* subversion/svnmucc/svnmucc.c
  (execute): Initialise a few more members of the root OPERATION struct,
    and call change_dir_props()/change_file_props() on it.
  (main): Compute the anchor differently for propset/propdel operations.

Modified:
    subversion/trunk/subversion/svnmucc/svnmucc.c
    subversion/trunk/subversion/tests/cmdline/svnmucc_tests.py

Modified: subversion/trunk/subversion/svnmucc/svnmucc.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnmucc/svnmucc.c?rev=1408632&r1=1408631&r2=1408632&view=diff
==============================================================================
--- subversion/trunk/subversion/svnmucc/svnmucc.c (original)
+++ subversion/trunk/subversion/svnmucc/svnmucc.c Tue Nov 13 08:09:39 2012
@@ -783,6 +783,9 @@ execute(const apr_array_header_t *action
 
   root.children = apr_hash_make(pool);
   root.operation = OP_OPEN;
+  root.prop_mods = apr_hash_make(pool);
+  root.prop_dels = apr_array_make(pool, 1, sizeof(const char *));
+
   for (i = 0; i < actions->nelts; ++i)
     {
       struct action *action = APR_ARRAY_IDX(actions, i, struct action *);
@@ -845,6 +848,7 @@ execute(const apr_array_header_t *action
                                     commit_callback, NULL, NULL, FALSE, pool));
 
   SVN_ERR(editor->open_root(editor_baton, head, pool, &root.baton));
+  SVN_ERR(change_props(editor, root.baton, &root, pool));
   err = drive(&root, head, editor, pool);
   if (!err)
     err = editor->close_edit(editor_baton, pool);
@@ -1291,9 +1295,12 @@ main(int argc, const char **argv)
           url = sanitize_url(url, pool);
           action->path[j] = url;
 
-          /* The cp source could be the anchor, but the other URLs should be
-             children of the anchor. */
-          if (! (action->action == ACTION_CP && j == 0))
+          /* The first URL arguments to 'cp', 'pd', 'ps' could be the anchor,
+             but the other URLs should be children of the anchor. */
+          if (! (action->action == ACTION_CP && j == 0)
+              && action->action != ACTION_PROPDEL
+              && action->action != ACTION_PROPSET
+              && action->action != ACTION_PROPSETF)
             url = svn_uri_dirname(url, pool);
           if (! anchor)
             anchor = url;

Modified: subversion/trunk/subversion/tests/cmdline/svnmucc_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnmucc_tests.py?rev=1408632&r1=1408631&r2=1408632&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnmucc_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnmucc_tests.py Tue Nov 13 08:09:39 2012
@@ -312,11 +312,36 @@ def basic_svnmucc(sbox):
                 'cp', '17', 'a', 'b')
 
 
+@Issues(3663)
+def propset_root(sbox):
+  "propset/propdel on repos root"
+
+  sbox.build(create_wc=False)
+
+  ## propset on ^/
+  svntest.actions.run_and_verify_svnmucc(None, None, [],
+                                         'propset', 'foo', 'bar',
+                                         sbox.repo_url)
+  svntest.actions.run_and_verify_svn(None, 'bar', [],
+                                     'propget', '--strict', 'foo',
+                                     sbox.repo_url)
+
+  ## propdel on ^/
+  svntest.actions.run_and_verify_svnmucc(None, None, [],
+                                         'propdel', 'foo',
+                                         sbox.repo_url)
+  svntest.actions.run_and_verify_svn(None, [], [],
+                                     'propget', '--strict', 'foo',
+                                     sbox.repo_url)
+
+
+
 ######################################################################
 
 test_list = [ None,
               reject_bogus_mergeinfo,
               basic_svnmucc,
+              propset_root,
             ]
 
 if __name__ == '__main__':



Mime
View raw message