Hi!
make check passed.
[[[
Fix issue #3390, relative externals not updated during switch.
* subversion/libsvn_client/switch.c
(svn_client__switch_internal): Pass in an external_func to
svn_wc_crawl_revision5().
* subversion/libsvn_client/externals.c
(handle_externals_desc_change): Get the url for parent_dir with
svn_wc__node_get_url(). Does not work for export where the
parent_dir has no url. Then we resort to the old way of adding the
parent_dir to the from_url.
* subversion/tests/cmdline/externals_tests.py
(test_list): Remove XFail from switch_relative_external.
Patch by: Daniel Näslund <daniel{_AT_}longitudo.com>
]]]
When running the update_editor all externals that have changed is
recorded. But in a switch we need to change all relative externals. So I
added an external_func to collect those.
The externals are collected in the same hashtables. There won't be any
problems if the same external is inserted a second time. It will only be
replaced as shown below. (The apr function for inserting new values into
a hashtable).
[[[
358 APR_DECLARE(void) apr_hash_set(apr_hash_t *ht,
359 const void *key,
360 apr_ssize_t klen,
361 const void *val)
362 {
363 apr_hash_entry_t **hep;
364 hep = find_entry(ht, key, klen, val);
365 if (*hep) {
366 if (!val) {
367 /* delete entry */
368 apr_hash_entry_t *old = *hep;
369 *hep = (*hep)->next;
370 old->next = ht->free;
371 ht->free = old;
372 --ht->count;
373 }
373 }
374 else {
375 /* replace entry */
376 (*hep)->val = val;
377 /* check that the collision rate isn't too high */
378 if (ht->count > ht->max) {
379 expand_array(ht);
380 }
381 }
382 }
383 /* else key not present and val==NULL */
384 }
]]]
The reason I had to use the svn_wc__node_get_url() instead of
concanating from_url and parent_dir was because we're using the new
abs_paths crawlers and editors in libsvn_client/switch.c but that update
and export does not use those yet. (Disclaimer: I haven't fully grasped
what's going on inside libsvn_client/export.c. The
svn_delta_get_cancellation_editor() call is just mystery to me).
This is a fix for #3390, things will get tidier (more tidy?) once we're
using abspaths all over the place and have removed the adm_access
batons.
You can't believe all the strange places I've been to solve this. And
it was right under my nose the whole time. If it is indeed the solution
:-) ?
Daniel
Received on 2009-12-11 16:55:44 CET