[[[
Fix copy_tests #48: copy added uncommitted paths with props.

* subversion/libsvn_wc/copy.c
  (copy_props): New function.
  (copy_added_file_administratively):
    Add 'src_access' parameter.
    Copy src's properties to target.
  (copy_added_dir_administratively):
    Copy src's properties to target.
  (copy_added_dir_administratively, svn_wc_copy2):
    Pass 'src_access' to copy_added_file_administratively().

* subversion/tests/cmdline/copy_tests.py
  (copy_added_paths_with_props):
    Expect empty mergeinfo on copy targets.
  (test_list):
    Remove XFail from copy_added_paths_with_props().
]]]

Index: subversion/libsvn_wc/copy.c
===================================================================
--- subversion/libsvn_wc/copy.c	(revision 29095)
+++ subversion/libsvn_wc/copy.c	(working copy)
@@ -39,10 +39,43 @@
 
 /*** Code. ***/
 
+/* Copy all properties of SRC_PATH to DST_PATH. */
+static svn_error_t *
+copy_props(const char *src_path,
+           const char *dst_path,
+           svn_wc_adm_access_t *src_access,
+           svn_wc_adm_access_t *dst_access,
+           apr_pool_t *pool)
+{
+  apr_hash_t *props;
+  apr_hash_index_t *hi;
+
+  SVN_ERR(svn_wc_prop_list(&props, src_path, src_access, pool));
+  for (hi = apr_hash_first(pool, props); hi; hi = apr_hash_next(hi))
+    {
+      const char *propname;
+      svn_string_t *propval;
+      const void *key;
+      void *val;
+
+      apr_hash_this(hi, &key, NULL, &val);
+      propname = key;
+      propval = val;
+
+      SVN_ERR(svn_wc_prop_set2(propname, propval,
+                               dst_path, dst_access,
+                               FALSE /* skip_checks */,
+                               pool));
+    }
+
+  return SVN_NO_ERROR;
+}
+
+
 /* Helper function for svn_wc_copy2() which handles WC->WC copying of
    files which are scheduled for addition or unversioned.
 
-   Copy file SRC_PATH to DST_BASENAME in DST_PARENT_ACCESS.
+   Copy file SRC_PATH in SRC_ACCESS to DST_BASENAME in DST_PARENT_ACCESS.
 
    DST_PARENT_ACCESS is a 0 depth locked access for a versioned directory
    in the same WC as SRC_PATH.
@@ -58,6 +91,7 @@
 static svn_error_t *
 copy_added_file_administratively(const char *src_path,
                                  svn_boolean_t src_is_added,
+                                 svn_wc_adm_access_t *src_access,
                                  svn_wc_adm_access_t *dst_parent_access,
                                  const char *dst_basename,
                                  svn_cancel_func_t cancel_func,
@@ -79,6 +113,10 @@ copy_added_file_administratively(const char *src_p
                           SVN_INVALID_REVNUM, cancel_func,
                           cancel_baton, notify_func,
                           notify_baton, pool));
+
+      SVN_ERR(copy_props(src_path, dst_path,
+                         src_access, dst_parent_access,
+                         pool));
     }
 
   return SVN_NO_ERROR;
@@ -154,6 +192,11 @@ copy_added_dir_administratively(const char *src_pa
                           SVN_INVALID_REVNUM, cancel_func, cancel_baton,
                           notify_func, notify_baton, pool));
 
+      /* Copy properties. */
+      SVN_ERR(copy_props(src_path, dst_path,
+                         src_access, dst_parent_access,
+                         pool));
+
       /* Get the accesses for the newly added dir and its source, we'll
          need both to process any of SRC_PATHS's children below. */
       SVN_ERR(svn_wc_adm_retrieve(&dst_child_dir_access, dst_parent_access,
@@ -241,6 +284,7 @@ copy_added_dir_administratively(const char *src_pa
             {
               SVN_ERR(copy_added_file_administratively(src_fullpath,
                                                        entry ? TRUE : FALSE,
+                                                       src_child_dir_access,
                                                        dst_child_dir_access,
                                                        this_entry.name,
                                                        cancel_func,
@@ -816,6 +860,7 @@ svn_wc_copy2(const char *src_path,
           && (! src_entry->copied))
         {
           SVN_ERR(copy_added_file_administratively(src_path, TRUE,
+                                                   adm_access,
                                                    dst_parent, dst_basename,
                                                    cancel_func, cancel_baton,
                                                    notify_func, notify_baton,
Index: subversion/tests/cmdline/copy_tests.py
===================================================================
--- subversion/tests/cmdline/copy_tests.py	(revision 29095)
+++ subversion/tests/cmdline/copy_tests.py	(working copy)
@@ -2604,9 +2604,11 @@ def copy_added_paths_with_props(sbox):
 
   # Tweak expected disk tree
   expected_disk.add({
-    'A/C/upsilon' : Item(props={'foo' : 'bar'},
+    'A/C/upsilon' : Item(props={ 'foo' : 'bar',
+                                 SVN_PROP_MERGEINFO : '' },
                          contents="This is the file 'upsilon'\n"),
-    'A/C/I'       : Item(props={'foo' : 'bar'}),
+    'A/C/I'       : Item(props={ 'foo' : 'bar',
+                                 SVN_PROP_MERGEINFO : '' }),
     })
 
   svntest.actions.run_and_verify_commit(wc_dir,
@@ -3774,7 +3776,7 @@ test_list = [ None,
               move_file_back_and_forth,
               move_dir_back_and_forth,
               copy_move_added_paths,
-              XFail(copy_added_paths_with_props),
+              copy_added_paths_with_props,
               copy_added_paths_to_URL,
               move_to_relative_paths,
               move_from_relative_paths,
