151
151
const svn_opt_revision_t *revision,
152
152
const char *defining_abspath,
153
153
svn_boolean_t *timestamp_sleep,
154
svn_ra_session_t *ra_session,
154
155
svn_client_ctx_t *ctx,
155
156
apr_pool_t *pool)
170
171
if (revision->kind == svn_opt_revision_number)
171
172
external_rev = revision->value.number;
174
175
* The code below assumes existing versioned paths are *not* part of
175
176
* the external's defining working copy.
176
177
* The working copy library does not support registering externals
186
187
&repos_root_url, &repos_uuid,
187
188
NULL, ctx->wc_ctx, local_abspath,
188
189
TRUE, /* ignore_enoent */
189
TRUE, /* show hidden */
191
191
if (kind != svn_node_unknown)
236
236
externals definition, perform an update. */
237
237
if (strcmp(node_url, url) == 0)
239
SVN_ERR(svn_client__update_internal(NULL, local_abspath,
239
SVN_ERR(svn_client__update_internal(NULL, timestamp_sleep,
240
241
revision, svn_depth_unknown,
241
242
FALSE, FALSE, FALSE, TRUE,
244
ra_session, ctx, subpool));
246
246
/* We just decided that this existing directory is an external,
247
247
so update the external registry with this information, like
374
374
/* ... Hello, new hotness. */
375
SVN_ERR(svn_client__checkout_internal(NULL, url, local_abspath, peg_revision,
375
SVN_ERR(svn_client__checkout_internal(NULL, timestamp_sleep,
376
url, local_abspath, peg_revision,
376
377
revision, svn_depth_infinity,
377
FALSE, FALSE, timestamp_sleep,
380
382
SVN_ERR(svn_wc__node_get_repos_info(NULL, NULL,
401
403
return SVN_NO_ERROR;
404
/* Try to update a file external at LOCAL_ABSPATH to URL at REVISION using a
405
access baton that has a write lock. Use SCRATCH_POOL for temporary
406
/* Try to update a file external at LOCAL_ABSPATH to SWITCH_LOC. This function
407
assumes caller has a write lock in CTX. Use SCRATCH_POOL for temporary
406
408
allocations, and use the client context CTX. */
407
409
static svn_error_t *
408
410
switch_file_external(const char *local_abspath,
410
const svn_opt_revision_t *peg_revision,
411
const svn_opt_revision_t *revision,
411
const svn_client__pathrev_t *switch_loc,
412
const char *record_url,
413
const svn_opt_revision_t *record_peg_revision,
414
const svn_opt_revision_t *record_revision,
412
415
const char *def_dir_abspath,
413
416
svn_ra_session_t *ra_session,
414
417
svn_client_ctx_t *ctx,
485
488
SVN_ERR_CLIENT_FILE_EXTERNAL_OVERWRITE_VERSIONED, 0,
486
489
_("The file external from '%s' cannot overwrite the existing "
487
490
"versioned item at '%s'"),
488
url, svn_dirent_local_style(local_abspath, scratch_pool));
492
svn_dirent_local_style(local_abspath, scratch_pool));
507
511
void *report_baton;
508
512
const svn_delta_editor_t *switch_editor;
509
513
void *switch_baton;
510
svn_client__pathrev_t *switch_loc;
511
514
svn_revnum_t revnum;
512
515
apr_array_header_t *inherited_props;
513
const char *dir_abspath;
516
svn_dirent_split(&dir_abspath, &target, local_abspath, scratch_pool);
518
/* ### Why do we open a new session? RA_SESSION is a valid
519
### session -- the caller used it to call svn_ra_check_path on
520
### this very URL, the caller also did the resolving and
521
### reparenting that is repeated here. */
522
SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &switch_loc,
524
peg_revision, revision,
516
const char *target = svn_dirent_basename(local_abspath, scratch_pool);
526
518
/* Get the external file's iprops. */
527
519
SVN_ERR(svn_ra_get_inherited_props(ra_session, &inherited_props, "",
529
521
scratch_pool, scratch_pool));
531
SVN_ERR(svn_ra_reparent(ra_session, svn_uri_dirname(url, scratch_pool),
523
SVN_ERR(svn_ra_reparent(ra_session,
524
svn_uri_dirname(switch_loc->url, scratch_pool),
534
527
SVN_ERR(svn_wc__get_file_external_editor(&switch_editor, &switch_baton,
578
571
= svn_wc_notify_state_inapplicable;
579
572
notify->lock_state = svn_wc_notify_lock_state_inapplicable;
580
573
notify->revision = revnum;
581
(*ctx->notify_func2)(ctx->notify_baton2, notify, scratch_pool);
574
ctx->notify_func2(ctx->notify_baton2, notify, scratch_pool);
691
684
notify->kind = kind;
692
685
notify->err = err;
694
(ctx->notify_func2)(ctx->notify_baton2, notify, scratch_pool);
687
ctx->notify_func2(ctx->notify_baton2, notify, scratch_pool);
696
689
if (err && err->apr_err == SVN_ERR_WC_LEFT_LOCAL_MOD)
701
694
notify->kind = svn_node_dir;
702
695
notify->err = err;
704
(ctx->notify_func2)(ctx->notify_baton2, notify, scratch_pool);
697
ctx->notify_func2(ctx->notify_baton2, notify, scratch_pool);
722
715
const char *local_abspath,
723
716
const char *old_defining_abspath,
724
717
const svn_wc_external_item2_t *new_item,
718
svn_ra_session_t *ra_session,
725
719
svn_boolean_t *timestamp_sleep,
726
720
apr_pool_t *scratch_pool)
728
svn_ra_session_t *ra_session;
729
722
svn_client__pathrev_t *new_loc;
730
723
const char *new_url;
731
724
svn_node_kind_t ext_kind;
746
739
scratch_pool, scratch_pool));
748
741
/* Determine if the external is a file or directory. */
749
/* Get the RA connection. */
750
SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &new_loc,
752
&(new_item->peg_revision),
753
&(new_item->revision), ctx,
742
/* Get the RA connection, if needed. */
745
svn_error_t *err = svn_ra_reparent(ra_session, new_url, scratch_pool);
749
if (err->apr_err == SVN_ERR_RA_ILLEGAL_URL)
751
svn_error_clear(err);
755
return svn_error_trace(err);
759
SVN_ERR(svn_client__resolve_rev_and_url(&new_loc,
761
&(new_item->peg_revision),
762
&(new_item->revision), ctx,
765
SVN_ERR(svn_ra_reparent(ra_session, new_loc->url, scratch_pool));
770
SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &new_loc,
772
&(new_item->peg_revision),
773
&(new_item->revision), ctx,
756
776
SVN_ERR(svn_ra_check_path(ra_session, "", new_loc->rev, &ext_kind,
908
929
apr_hash_t *old_externals,
909
930
svn_depth_t ambient_depth,
910
931
svn_depth_t requested_depth,
932
svn_ra_session_t *ra_session,
911
933
apr_pool_t *scratch_pool)
913
935
apr_array_header_t *new_desc;
999
1021
const char *target_abspath,
1000
1022
svn_depth_t requested_depth,
1001
1023
svn_boolean_t *timestamp_sleep,
1024
svn_ra_session_t *ra_session,
1002
1025
svn_client_ctx_t *ctx,
1003
1026
apr_pool_t *scratch_pool)
1019
1042
hi = apr_hash_next(hi))
1021
const char *local_abspath = svn__apr_hash_index_key(hi);
1022
const char *desc_text = svn__apr_hash_index_val(hi);
1044
const char *local_abspath = apr_hash_this_key(hi);
1045
const char *desc_text = apr_hash_this_val(hi);
1023
1046
svn_depth_t ambient_depth = svn_depth_infinity;
1025
1048
svn_pool_clear(iterpool);
1029
1052
const char *ambient_depth_w;
1031
1054
ambient_depth_w = apr_hash_get(ambient_depths, local_abspath,
1032
svn__apr_hash_index_klen(hi));
1055
apr_hash_this_key_len(hi));
1034
1057
if (ambient_depth_w == NULL)
1049
1072
desc_text, old_external_defs,
1050
1073
ambient_depth, requested_depth,
1074
ra_session, iterpool));
1054
1077
/* Remove the remaining externals */
1057
1080
hi = apr_hash_next(hi))
1059
const char *item_abspath = svn__apr_hash_index_key(hi);
1060
const char *defining_abspath = svn__apr_hash_index_val(hi);
1082
const char *item_abspath = apr_hash_this_key(hi);
1083
const char *defining_abspath = apr_hash_this_val(hi);
1061
1084
const char *parent_abspath;
1063
1086
svn_pool_clear(iterpool);
1132
1155
hi = apr_hash_next(hi))
1134
const char *local_abspath = svn__apr_hash_index_key(hi);
1135
const char *desc_text = svn__apr_hash_index_val(hi);
1157
const char *local_abspath = apr_hash_this_key(hi);
1158
const char *desc_text = apr_hash_this_val(hi);
1136
1159
const char *local_relpath;
1137
1160
const char *dir_url;
1138
1161
apr_array_header_t *items;
1189
1212
sub_iterpool));
1214
/* First notify that we're about to handle an external. */
1215
if (ctx->notify_func2)
1219
svn_wc_create_notify(item_abspath,
1220
svn_wc_notify_update_external,
1191
1225
SVN_ERR(wrap_external_error(
1192
1226
ctx, item_abspath,
1193
1227
svn_client_export5(NULL, new_url, item_abspath,