[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] allow unversioned parent for copy src again (was: Re: Functionality regression from 1.4->1.5 in svn copy due to --use-merge-history changes)

From: Karl Fogel <kfogel_at_red-bean.com>
Date: Wed, 09 Jan 2008 10:14:57 -0800

Chris Rose <chris.rose_at_messagingdirect.com> writes:
> I'm sorry to prod on this, but I'm quite concerned about the change in
> functionality, and would like to find out if this will remain in place
> for 1.5, or if I should register it as a bug with the client?
>
> Can somebody weigh in either way, please?

It sounds like a bug to me. I've filed an issue for it, and written a
tentative patch. Here's the issue:

   http://subversion.tigris.org/issues/show_bug.cgi?id=3068

The patch is below. I'd love some other eyes on it before I commit,
though, from people more familiar with wc mergeinfo propagation.

Thanks for the reproduction script, btw, that helped a lot.

Here's the patch:

[[[
Fix issue #3068: wc->wc copy should work when src parent is unversioned.

* subversion/libsvn_client/copy.c
  (do_wc_to_wc_copies): Propagate mergeinfo from parent only if possible.

* subversion/libsvn_wc/lock.c
  (do_open): Document an error return that callers depend on.
]]]

Index: subversion/libsvn_client/copy.c
===================================================================
--- subversion/libsvn_client/copy.c (revision 28822)
+++ subversion/libsvn_client/copy.c (working copy)
@@ -347,10 +347,18 @@
         }
       else
         {
- SVN_ERR(svn_wc_adm_open3(&src_access, NULL, src_parent, FALSE,
- pair->src_kind == svn_node_dir ? -1 : 0,
- ctx->cancel_func, ctx->cancel_baton,
- iterpool));
+ err = svn_wc_adm_open3(&src_access, NULL, src_parent, FALSE,
+ pair->src_kind == svn_node_dir ? -1 : 0,
+ ctx->cancel_func, ctx->cancel_baton,
+ iterpool);
+ /* The parent of a copy src might not be versioned at all. */
+ if (err && err->apr_err == SVN_ERR_WC_NOT_DIRECTORY)
+ {
+ src_access = NULL;
+ svn_error_clear(err);
+ err = NULL;
+ }
+ SVN_ERR(err);
         }
 
       /* Perform the copy */
@@ -365,12 +373,13 @@
       if (err)
         break;
 
- err = propagate_mergeinfo_within_wc(pair, src_access, dst_access,
- ctx, pool);
+ if (src_access)
+ err = propagate_mergeinfo_within_wc(pair, src_access, dst_access,
+ ctx, pool);
       if (err)
         break;
 
- if (src_access != dst_access)
+ if (src_access && src_access != dst_access)
         SVN_ERR(svn_wc_adm_close(src_access));
     }
 
Index: subversion/libsvn_wc/lock.c
===================================================================
--- subversion/libsvn_wc/lock.c (revision 28822)
+++ subversion/libsvn_wc/lock.c (working copy)
@@ -542,6 +542,9 @@
 /* This is essentially the guts of svn_wc_adm_open3, with the additional
  * parameter UNDER_CONSTRUCTION that gets set TRUE only when locking the
  * admin directory during initial creation.
+ *
+ * If the working copy is already locked, return SVN_ERR_WC_LOCKED; if
+ * it is not a versioned directory, return SVN_ERR_WC_NOT_DIRECTORY.
  */
 static svn_error_t *
 do_open(svn_wc_adm_access_t **adm_access,

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-01-09 16:15:11 CET

This is an archived mail posted to the Subversion Dev mailing list.