Index: subversion/include/svn_client.h
===================================================================
--- subversion/include/svn_client.h	(revision 15882)
+++ subversion/include/svn_client.h	(working copy)
@@ -334,12 +334,15 @@
   /** commit URL for this item */
   const char *url;
 
-  /** revision (copyfrom-rev if _IS_COPY) */
+  /** revision */
   svn_revnum_t revision;
 
   /** copyfrom-url */
   const char *copyfrom_url;
 
+  /** copyfrom-rev */
+  svn_revnum_t copyfrom_rev;
+
   /** state flags */
   apr_byte_t state_flags;
 
Index: subversion/libsvn_wc/copy.c
===================================================================
--- subversion/libsvn_wc/copy.c	(revision 15882)
+++ subversion/libsvn_wc/copy.c	(working copy)
@@ -240,6 +240,9 @@
                                      dst_parent, FALSE, pool));
 
     /* Copy the text-base over unconditionally. */
+    if (replace)
+      SVN_ERR (svn_wc__prep_file_for_replacement (dst_txtb, TRUE, pool));
+
     SVN_ERR (svn_io_copy_file (src_txtb, dst_txtb, TRUE, pool));
 
     /* Copy the props over if they exist. */
Index: subversion/libsvn_wc/adm_ops.c
===================================================================
--- subversion/libsvn_wc/adm_ops.c	(revision 15882)
+++ subversion/libsvn_wc/adm_ops.c	(working copy)
@@ -317,8 +317,11 @@
 
       /* If the revert file exists it needs to be deleted when the file
        * is committed. */
-      revert_file = svn_wc__text_revert_path (path, FALSE, pool);
-      SVN_ERR (svn_io_check_path (revert_file, &kind, pool));
+      revert_file = svn_wc__text_revert_path (base_name, FALSE, pool);
+
+      SVN_ERR (svn_io_check_path (svn_path_join (svn_wc_adm_access_path (adm_access),
+                                                 revert_file, pool),
+                                  &kind, pool));
       if (kind == svn_node_file)
         {
           svn_xml_make_open_tag (&logtags, pool, svn_xml_self_closing,
@@ -1430,6 +1433,7 @@
         SVN_ERR (svn_io_check_path (revert_thing, &disk_kind, pool));
         if (disk_kind == svn_node_file)
           {
+            SVN_ERR (svn_wc__prep_file_for_replacement (base_thing, TRUE, pool));
             SVN_ERR (svn_io_file_rename (revert_thing, base_thing, pool));
           }          
       }     
Index: subversion/libsvn_client/commit_util.c
===================================================================
--- subversion/libsvn_client/commit_util.c	(revision 15882)
+++ subversion/libsvn_client/commit_util.c	(working copy)
@@ -55,6 +55,7 @@
                  const char *url,
                  svn_revnum_t revision,
                  const char *copyfrom_url,
+                 svn_revnum_t copyfrom_rev,
                  apr_byte_t state_flags)
 {
   apr_pool_t *pool = apr_hash_pool_get (committables);
@@ -87,6 +88,7 @@
   new_item->revision       = revision;
   new_item->copyfrom_url   = copyfrom_url 
                              ? apr_pstrdup (pool, copyfrom_url) : NULL;
+  new_item->copyfrom_rev   = copyfrom_rev;
   new_item->state_flags    = state_flags;
   new_item->wcprop_changes = apr_array_make (pool, 1, sizeof (svn_prop_t *));
    
@@ -475,9 +477,8 @@
   if (state_flags)
     {
       /* Finally, add the committable item. */
-      add_committable (committables, path, entry->kind, url,
-                       cf_url ? cf_rev : entry->revision, 
-                       cf_url, state_flags);
+      add_committable (committables, path, entry->kind, url, entry->revision,
+                       cf_url, cf_rev, state_flags);
       if (lock_tokens && entry->lock_token)
         apr_hash_set (lock_tokens, apr_pstrdup (token_pool, url),
                       APR_HASH_KEY_STRING,
@@ -562,6 +563,7 @@
                                            this_entry->kind, used_url,
                                            SVN_INVALID_REVNUM, 
                                            NULL,
+                                           SVN_INVALID_REVNUM,
                                            SVN_CLIENT_COMMIT_ITEM_DELETE);
                           svn_error_clear (lockerr);
                           continue; /* don't recurse! */
@@ -1094,7 +1096,7 @@
           assert (parent_baton);
           SVN_ERR (editor->add_file 
                    (path, parent_baton, copyfrom_url, 
-                    copyfrom_url ? item->revision : SVN_INVALID_REVNUM,
+                    item->copyfrom_rev,
                     file_pool, &file_baton));
         }
       else
@@ -1102,7 +1104,7 @@
           assert (parent_baton);
           SVN_ERR (editor->add_directory
                    (path, parent_baton, copyfrom_url,
-                    copyfrom_url ? item->revision : SVN_INVALID_REVNUM,
+                    item->copyfrom_rev,
                     pool, dir_baton));
         }
     }
