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

Re: crash when merging

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Mon, 3 Jun 2013 23:12:53 +0100 (BST)

I (Julian Foad) wrote:

> Stefan Küng <tortoisesvn_at_gmail.com> wrote:
>> SVN_ERR_W(svn_cl__check_related_source_and_target(
>>           sourcepath1, &peg_revision1,
>>           targetpath, &unspecified_revision, ctx, scratch_pool),
>>     _("Source and target must be different but related branches"));
>>
>> To reproduce the crash with the CL client, simply remove that check and do
>> the merge.
>
> Thanks, Stefan.  Confirmed.  We need a check just before reaching line 12345
> (yes, really) of merge.c.

(Oops, that pretty line number was in a locally modified version of merge.c.  It's line 12311 in the current head version.)

This is the patch needed, modeled on the existing 'reintegrate' code (that's where the slightly strange error code comes from):

[[[
Index: subversion/libsvn_client/merge.c
===================================================================
--- subversion/libsvn_client/merge.c    (revision 1489184)
+++ subversion/libsvn_client/merge.c    (working copy)
@@ -12307,6 +12307,12 @@
   SVN_ERR(svn_client__get_youngest_common_ancestor(
             &s_t->yca, s_t->source, &s_t->target->loc, s_t->source_ra_session,
             ctx, result_pool, result_pool));
+  if (! s_t->yca)
+    return svn_error_createf(SVN_ERR_CLIENT_NOT_READY_TO_MERGE, NULL,
+                             _("'%s@%ld' must be ancestrally related to "
+                               "'%s@%ld'"),
+                             s_t->source->url, s_t->source->rev,
+                             s_t->target->loc.url, s_t->target->loc.rev);
 
   /* Find the latest revision of A synced to B and the latest
    * revision of B synced to A.
]]]

Committed in r1489203.

- Julian
Received on 2013-06-04 00:13:48 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.