On Mon, Apr 23, 2012 at 4:21 PM, Bert Huijben <bert_at_qqmail.nl> wrote:
>
>
>> -----Original Message-----
>> From: pburba_at_apache.org [mailto:pburba_at_apache.org]
>> Sent: maandag 23 april 2012 22:13
>> To: commits_at_subversion.apache.org
>> Subject: svn commit: r1329417 - in /subversion/trunk/subversion:
>> libsvn_client/merge.c tests/cmdline/merge_tests.py
>>
>> Author: pburba
>> Date: Mon Apr 23 20:13:19 2012
>> New Revision: 1329417
>>
>> URL: http://svn.apache.org/viewvc?rev=1329417&view=rev
>> Log:
>> Fix issue #4166 'multiple merge editor drives which add then delete a
>> subtree fail'.
>>
>> * subversion/libsvn_client/merge.c
>> (notification_receiver): If we delete a path a previous editor drive added
>> then remove that path from our hash of added paths, since we don't want to
>> attempt to record mergeinfo on that deleted path.
>>
>> * subversion/tests/cmdline/merge_tests.py
>> (merge_adds_then_deletes_subtree): New test.
>> (test_list): Add merge_adds_then_deletes_subtree.
>>
>> Modified:
>> subversion/trunk/subversion/libsvn_client/merge.c
>> subversion/trunk/subversion/tests/cmdline/merge_tests.py
>>
>> Modified: subversion/trunk/subversion/libsvn_client/merge.c
>> URL:
>> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge
>> .c?rev=1329417&r1=1329416&r2=1329417&view=diff
>> =================================================================
>> =============
>> --- subversion/trunk/subversion/libsvn_client/merge.c (original)
>> +++ subversion/trunk/subversion/libsvn_client/merge.c Mon Apr 23 20:13:19
>> 2012
>> @@ -2966,6 +2966,16 @@ notification_receiver(void *baton, const
>> apr_hash_set(notify_b->added_abspaths, added_path,
>> APR_HASH_KEY_STRING, added_path);
>> }
>> +
>> + if (notify->action == svn_wc_notify_update_delete
>> + && notify_b->added_abspaths)
>> + {
>> + /* Issue #4166: If a previous merge added NOTIFY_ABSPATH, but we
>> + are now deleting it, then remove it from the list of added
>> + paths. */
>> + apr_hash_set(notify_b->added_abspaths, notify_abspath,
>> + APR_HASH_KEY_STRING, NULL);
>> + }
>
> This should probably recursively delete all added paths below notify_abspath, instead of just the root to allow additions there.
Hi Bert,
notify_b->added_abspaths only keeps track of the roots of added subtrees[1]:
/* Contains any state collected while receiving path notifications. */
typedef struct notification_receiver_baton_t
{
<snip>
/* A list of the absolute root paths of any added subtrees which might
require their own explicit mergeinfo. Is NULL if
MERGE_B->SOURCES_ANCESTRAL and MERGE_B->REINTEGRATE_MERGE are both
false. */
apr_hash_t *added_abspaths;
[1] Well it *should* only track the roots, but as Julian discovered
and noted in r1205867, *all* added subtrees were being stashed in
added_abspaths. This bug remained hidden for so long because the only
consumer of this hash merge.c:record_mergeinfo_for_added_subtree
ignored all the added paths below the root, except in some very
unusual use cases as discussed in issue #4169. Fixed in r1330444.
Paul
> Bert
Received on 2012-04-25 20:25:16 CEST