Line
Link Here
|
0 |
-- subversion/include/svn_error_codes.h |
0 |
++ subversion/include/svn_error_codes.h |
Lines 774-779
Link Here
|
774 |
SVN_ERR_RA_DAV_CATEGORY_START + 6, |
774 |
SVN_ERR_RA_DAV_CATEGORY_START + 6, |
775 |
"Invalid configuration value") |
775 |
"Invalid configuration value") |
776 |
|
776 |
|
|
|
777 |
/** @deprecated To improve consistency between ra layers, this error code |
778 |
is replaced in ra_{neon|serf} by SVN_ERR_FS_NOT_FOUND. |
779 |
Slated for removal in the next major release. */ |
777 |
SVN_ERRDEF(SVN_ERR_RA_DAV_PATH_NOT_FOUND, |
780 |
SVN_ERRDEF(SVN_ERR_RA_DAV_PATH_NOT_FOUND, |
778 |
SVN_ERR_RA_DAV_CATEGORY_START + 7, |
781 |
SVN_ERR_RA_DAV_CATEGORY_START + 7, |
779 |
"HTTP Path Not Found") |
782 |
"HTTP Path Not Found") |
780 |
-- subversion/libsvn_client/merge.c |
783 |
++ subversion/libsvn_client/merge.c |
Lines 450-456
Link Here
|
450 |
if (err) |
450 |
if (err) |
451 |
{ |
451 |
{ |
452 |
if (err->apr_err == SVN_ERR_CLIENT_UNRELATED_RESOURCES |
452 |
if (err->apr_err == SVN_ERR_CLIENT_UNRELATED_RESOURCES |
453 |
|| err->apr_err == SVN_ERR_RA_DAV_PATH_NOT_FOUND |
|
|
454 |
|| err->apr_err == SVN_ERR_FS_NOT_FOUND) |
453 |
|| err->apr_err == SVN_ERR_FS_NOT_FOUND) |
455 |
{ |
454 |
{ |
456 |
/* PATH@TARGET_ENTRY->REVISION didn't exist at |
455 |
/* PATH@TARGET_ENTRY->REVISION didn't exist at |
Lines 2142-2148
Link Here
|
2142 |
if (err) |
2141 |
if (err) |
2143 |
{ |
2142 |
{ |
2144 |
if (err->apr_err == SVN_ERR_FS_NOT_FOUND |
2143 |
if (err->apr_err == SVN_ERR_FS_NOT_FOUND |
2145 |
|| err->apr_err == SVN_ERR_RA_DAV_PATH_NOT_FOUND |
|
|
2146 |
|| err->apr_err == SVN_ERR_CLIENT_UNRELATED_RESOURCES) |
2144 |
|| err->apr_err == SVN_ERR_CLIENT_UNRELATED_RESOURCES) |
2147 |
svn_error_clear(err); |
2145 |
svn_error_clear(err); |
2148 |
else |
2146 |
else |
Lines 3413-3419
Link Here
|
3413 |
### consistent in the error it returns(?) |
3411 |
### consistent in the error it returns(?) |
3414 |
*/ |
3412 |
*/ |
3415 |
if (err->apr_err == SVN_ERR_FS_NOT_FOUND |
3413 |
if (err->apr_err == SVN_ERR_FS_NOT_FOUND |
3416 |
|| err->apr_err == SVN_ERR_RA_DAV_PATH_NOT_FOUND |
|
|
3417 |
|| err->apr_err == SVN_ERR_CLIENT_UNRELATED_RESOURCES) |
3414 |
|| err->apr_err == SVN_ERR_CLIENT_UNRELATED_RESOURCES) |
3418 |
svn_error_clear(err); |
3415 |
svn_error_clear(err); |
3419 |
else |
3416 |
else |
3420 |
-- subversion/libsvn_ra_neon/commit.c |
3417 |
++ subversion/libsvn_ra_neon/commit.c |
Lines 1045-1051
Link Here
|
1045 |
_("File '%s' already exists"), |
1045 |
_("File '%s' already exists"), |
1046 |
file->rsrc->url); |
1046 |
file->rsrc->url); |
1047 |
} |
1047 |
} |
1048 |
else if (err->apr_err == SVN_ERR_RA_DAV_PATH_NOT_FOUND) |
1048 |
else if (err->apr_err == SVN_ERR_FS_NOT_FOUND) |
1049 |
{ |
1049 |
{ |
1050 |
svn_error_clear(err); |
1050 |
svn_error_clear(err); |
1051 |
} |
1051 |
} |
1052 |
-- subversion/libsvn_ra_neon/get_locks.c |
1052 |
++ subversion/libsvn_ra_neon/get_locks.c |
Lines 370-376
Link Here
|
370 |
|
370 |
|
371 |
svn_pool_destroy(baton.scratchpool); |
371 |
svn_pool_destroy(baton.scratchpool); |
372 |
|
372 |
|
373 |
if (err && err->apr_err == SVN_ERR_RA_DAV_PATH_NOT_FOUND) |
373 |
if (err && err->apr_err == SVN_ERR_FS_NOT_FOUND) |
374 |
{ |
374 |
{ |
375 |
svn_error_clear(err); |
375 |
svn_error_clear(err); |
376 |
*locks = baton.lock_hash; |
376 |
*locks = baton.lock_hash; |
377 |
-- subversion/libsvn_ra_neon/props.c |
377 |
++ subversion/libsvn_ra_neon/props.c |
Lines 623-629
Link Here
|
623 |
if (value == NULL) |
623 |
if (value == NULL) |
624 |
{ |
624 |
{ |
625 |
/* ### need an SVN_ERR here */ |
625 |
/* ### need an SVN_ERR here */ |
626 |
return svn_error_createf(SVN_ERR_RA_DAV_PROPS_NOT_FOUND, NULL, |
626 |
return svn_error_createf(SVN_ERR_FS_NOT_FOUND, NULL, |
627 |
_("'%s' was not present on the resource"), |
627 |
_("'%s' was not present on the resource"), |
628 |
name); |
628 |
name); |
629 |
} |
629 |
} |
Lines 710-716
Link Here
|
710 |
if (! err) |
710 |
if (! err) |
711 |
break; /* found an existing parent! */ |
711 |
break; /* found an existing parent! */ |
712 |
|
712 |
|
713 |
if (err->apr_err != SVN_ERR_RA_DAV_PATH_NOT_FOUND) |
713 |
if (err->apr_err != SVN_ERR_FS_NOT_FOUND) |
714 |
return err; /* found a _real_ error */ |
714 |
return err; /* found a _real_ error */ |
715 |
|
715 |
|
716 |
/* else... lop off the basename and try again. */ |
716 |
/* else... lop off the basename and try again. */ |
Lines 1211-1217
Link Here
|
1211 |
else |
1211 |
else |
1212 |
*kind = svn_node_file; |
1212 |
*kind = svn_node_file; |
1213 |
} |
1213 |
} |
1214 |
else if (err->apr_err == SVN_ERR_RA_DAV_PATH_NOT_FOUND) |
1214 |
else if (err->apr_err == SVN_ERR_FS_NOT_FOUND) |
1215 |
{ |
1215 |
{ |
1216 |
|
1216 |
|
1217 |
svn_error_clear(err); |
1217 |
svn_error_clear(err); |
Lines 1256-1262
Link Here
|
1256 |
url, revision, pool); |
1256 |
url, revision, pool); |
1257 |
if (err) |
1257 |
if (err) |
1258 |
{ |
1258 |
{ |
1259 |
if (err->apr_err == SVN_ERR_RA_DAV_PATH_NOT_FOUND) |
1259 |
if (err->apr_err == SVN_ERR_FS_NOT_FOUND) |
1260 |
{ |
1260 |
{ |
1261 |
/* easy out: */ |
1261 |
/* easy out: */ |
1262 |
svn_error_clear(err); |
1262 |
svn_error_clear(err); |
Lines 1277-1283
Link Here
|
1277 |
NULL, NULL /* all props */, pool); |
1277 |
NULL, NULL /* all props */, pool); |
1278 |
if (err) |
1278 |
if (err) |
1279 |
{ |
1279 |
{ |
1280 |
if (err->apr_err == SVN_ERR_RA_DAV_PATH_NOT_FOUND) |
1280 |
if (err->apr_err == SVN_ERR_FS_NOT_FOUND) |
1281 |
{ |
1281 |
{ |
1282 |
/* easy out: */ |
1282 |
/* easy out: */ |
1283 |
svn_error_clear(err); |
1283 |
svn_error_clear(err); |
1284 |
-- subversion/libsvn_ra_neon/session.c |
1284 |
++ subversion/libsvn_ra_neon/session.c |
Lines 878-885
Link Here
|
878 |
svn_error_clear(err); |
878 |
svn_error_clear(err); |
879 |
cap_result = capability_no; |
879 |
cap_result = capability_no; |
880 |
} |
880 |
} |
881 |
else if (err->apr_err == SVN_ERR_FS_NOT_FOUND |
881 |
else if (err->apr_err == SVN_ERR_FS_NOT_FOUND) |
882 |
|| err->apr_err == SVN_ERR_RA_DAV_PATH_NOT_FOUND) |
|
|
883 |
{ |
882 |
{ |
884 |
/* Mergeinfo requests use relative paths, and |
883 |
/* Mergeinfo requests use relative paths, and |
885 |
anyway we're in r0, so this is a likely error, |
884 |
anyway we're in r0, so this is a likely error, |
886 |
-- subversion/libsvn_ra_neon/util.c |
885 |
++ subversion/libsvn_ra_neon/util.c |
Lines 540-546
Link Here
|
540 |
switch (req->code) |
540 |
switch (req->code) |
541 |
{ |
541 |
{ |
542 |
case 404: |
542 |
case 404: |
543 |
return svn_error_create(SVN_ERR_RA_DAV_PATH_NOT_FOUND, NULL, |
543 |
return svn_error_create(SVN_ERR_FS_NOT_FOUND, NULL, |
544 |
apr_psprintf(pool, _("'%s' path not found"), |
544 |
apr_psprintf(pool, _("'%s' path not found"), |
545 |
req->url)); |
545 |
req->url)); |
546 |
|
546 |
|
547 |
-- subversion/libsvn_ra_serf/blame.c |
547 |
++ subversion/libsvn_ra_serf/blame.c |
Lines 391-398
Link Here
|
391 |
svn_ra_serf__handler_t *handler; |
391 |
svn_ra_serf__handler_t *handler; |
392 |
svn_ra_serf__xml_parser_t *parser_ctx; |
392 |
svn_ra_serf__xml_parser_t *parser_ctx; |
393 |
serf_bucket_t *buckets, *tmp; |
393 |
serf_bucket_t *buckets, *tmp; |
394 |
apr_hash_t *props; |
|
|
395 |
const char *lopped_path, *remaining_path; |
396 |
const char *vcc_url, *relative_url, *baseline_url, *basecoll_url, *req_url; |
394 |
const char *vcc_url, *relative_url, *baseline_url, *basecoll_url, *req_url; |
397 |
int status_code; |
395 |
int status_code; |
398 |
svn_error_t *err; |
396 |
svn_error_t *err; |
Lines 447-487
Link Here
|
447 |
session->bkt_alloc); |
445 |
session->bkt_alloc); |
448 |
serf_bucket_aggregate_append(buckets, tmp); |
446 |
serf_bucket_aggregate_append(buckets, tmp); |
449 |
|
447 |
|
450 |
props = apr_hash_make(pool); |
|
|
451 |
|
452 |
/* Get the VCC from file url, or if the file doesn't exist in HEAD, from |
448 |
/* Get the VCC from file url, or if the file doesn't exist in HEAD, from |
453 |
its closest existing parent. */ |
449 |
its closest existing parent. */ |
454 |
SVN_ERR(svn_ra_serf__search_for_base_props(props, &remaining_path, |
450 |
SVN_ERR(svn_ra_serf__discover_root(&vcc_url, |
455 |
&lopped_path, |
451 |
&relative_url, |
456 |
session, session->conns[0], |
452 |
session, session->conns[0], |
457 |
session->repos_url.path, pool)); |
453 |
session->repos_url.path, pool)); |
458 |
vcc_url = svn_ra_serf__get_prop(props, remaining_path, |
|
|
459 |
"DAV:", "version-controlled-configuration"); |
460 |
|
461 |
if (!vcc_url) |
462 |
{ |
463 |
return svn_error_create(SVN_ERR_RA_DAV_OPTIONS_REQ_FAILED, NULL, |
464 |
_("The OPTIONS response did not include the " |
465 |
"requested version-controlled-configuration " |
466 |
"value")); |
467 |
} |
468 |
|
469 |
/* Send the request to the baseline URL */ |
470 |
relative_url = svn_ra_serf__get_prop(props, remaining_path, |
471 |
SVN_DAV_PROP_NS_DAV, |
472 |
"baseline-relative-path"); |
473 |
if (!relative_url) |
474 |
{ |
475 |
return svn_error_create(SVN_ERR_RA_DAV_OPTIONS_REQ_FAILED, NULL, |
476 |
_("The OPTIONS response did not include the " |
477 |
"requested baseline-relative-path value")); |
478 |
} |
479 |
relative_url = svn_path_join(relative_url, |
480 |
svn_path_uri_decode(lopped_path, pool), |
481 |
pool); |
482 |
|
454 |
|
483 |
if (end == SVN_INVALID_REVNUM) |
455 |
if (end == SVN_INVALID_REVNUM) |
484 |
{ |
456 |
{ |
|
|
457 |
apr_hash_t *props = apr_hash_make(pool); |
458 |
|
485 |
/* Use the "checked-in" property to determine the baseline url of the HEAD |
459 |
/* Use the "checked-in" property to determine the baseline url of the HEAD |
486 |
revision. */ |
460 |
revision. */ |
487 |
SVN_ERR(svn_ra_serf__retrieve_props(props, session, session->conns[0], |
461 |
SVN_ERR(svn_ra_serf__retrieve_props(props, session, session->conns[0], |
Lines 506-511
Link Here
|
506 |
} |
480 |
} |
507 |
else |
481 |
else |
508 |
{ |
482 |
{ |
|
|
483 |
apr_hash_t *props = apr_hash_make(pool); |
484 |
|
509 |
/* We're asking for a specific revision. No need to use "checked-in" |
485 |
/* We're asking for a specific revision. No need to use "checked-in" |
510 |
here, request the baseline-collection property with the specified |
486 |
here, request the baseline-collection property with the specified |
511 |
revision in the 'Label' header (added in svn_ra_serf__retrieve_props). |
487 |
revision in the 'Label' header (added in svn_ra_serf__retrieve_props). |
Lines 559-569
Link Here
|
559 |
SVN_ERR(parser_ctx->error); |
535 |
SVN_ERR(parser_ctx->error); |
560 |
} |
536 |
} |
561 |
|
537 |
|
562 |
if (status_code == 404) |
538 |
SVN_ERR(svn_ra_serf__error_on_status(status_code, handler->path)); |
563 |
{ |
539 |
|
564 |
return svn_error_createf(SVN_ERR_RA_DAV_PATH_NOT_FOUND, NULL, |
|
|
565 |
"'%s' path not found", |
566 |
handler->path); |
567 |
} |
568 |
return err; |
540 |
return err; |
569 |
} |
541 |
} |
570 |
-- subversion/libsvn_ra_serf/commit.c |
542 |
++ subversion/libsvn_ra_serf/commit.c |
Lines 413-428
Link Here
|
413 |
|
413 |
|
414 |
if (checkout_ctx->progress.status != 201) |
414 |
if (checkout_ctx->progress.status != 201) |
415 |
{ |
415 |
{ |
416 |
if (checkout_ctx->progress.status == 404) |
416 |
SVN_ERR(svn_ra_serf__error_on_status(checkout_ctx->progress.status, |
417 |
{ |
417 |
dir->name)); |
418 |
return svn_error_createf(SVN_ERR_RA_DAV_PATH_NOT_FOUND, |
|
|
419 |
return_response_err(handler, |
420 |
&checkout_ctx->progress), |
421 |
_("Path '%s' not present"), |
422 |
dir->name); |
423 |
} |
424 |
|
418 |
|
425 |
return svn_error_createf(SVN_ERR_RA_DAV_PATH_NOT_FOUND, |
419 |
return svn_error_createf(SVN_ERR_FS_CONFLICT, |
426 |
return_response_err(handler, |
420 |
return_response_err(handler, |
427 |
&checkout_ctx->progress), |
421 |
&checkout_ctx->progress), |
428 |
_("Directory '%s' is out of date; try updating"), |
422 |
_("Directory '%s' is out of date; try updating"), |
Lines 495-506
Link Here
|
495 |
|
489 |
|
496 |
SVN_ERR(svn_ra_serf__wait_for_props(propfind_ctx, session, pool)); |
490 |
SVN_ERR(svn_ra_serf__wait_for_props(propfind_ctx, session, pool)); |
497 |
|
491 |
|
|
|
492 |
/* We wouldn't get here if the url wasn't found (404), so the checked-in |
493 |
property should have been set. */ |
498 |
root_checkout = |
494 |
root_checkout = |
499 |
svn_ra_serf__get_ver_prop(props, session->repos_url.path, |
495 |
svn_ra_serf__get_ver_prop(props, session->repos_url.path, |
500 |
base_revision, "DAV:", "checked-in"); |
496 |
base_revision, "DAV:", "checked-in"); |
501 |
|
497 |
|
502 |
if (!root_checkout) |
498 |
if (!root_checkout) |
503 |
return svn_error_createf(SVN_ERR_RA_DAV_PATH_NOT_FOUND, NULL, |
499 |
return svn_error_createf(SVN_ERR_RA_DAV_REQUEST_FAILED, NULL, |
504 |
_("Path '%s' not present"), |
500 |
_("Path '%s' not present"), |
505 |
session->repos_url.path); |
501 |
session->repos_url.path); |
506 |
} |
502 |
} |
Lines 594-609
Link Here
|
594 |
|
590 |
|
595 |
if (file->checkout->progress.status != 201) |
591 |
if (file->checkout->progress.status != 201) |
596 |
{ |
592 |
{ |
597 |
if (file->checkout->progress.status == 404) |
593 |
SVN_ERR(svn_ra_serf__error_on_status(file->checkout->progress.status, |
598 |
{ |
594 |
file->name)); |
599 |
return svn_error_createf(SVN_ERR_RA_DAV_PATH_NOT_FOUND, |
|
|
600 |
return_response_err(handler, |
601 |
&file->checkout->progress), |
602 |
_("Path '%s' not present"), |
603 |
file->name); |
604 |
} |
605 |
|
595 |
|
606 |
return svn_error_createf(SVN_ERR_RA_DAV_PATH_NOT_FOUND, |
596 |
return svn_error_createf(SVN_ERR_FS_CONFLICT, |
607 |
return_response_err(handler, |
597 |
return_response_err(handler, |
608 |
&file->checkout->progress), |
598 |
&file->checkout->progress), |
609 |
_("File '%s' is out of date; try updating"), |
599 |
_("File '%s' is out of date; try updating"), |
610 |
-- subversion/libsvn_ra_serf/getlocations.c |
600 |
++ subversion/libsvn_ra_serf/getlocations.c |
Lines 274-285
Link Here
|
274 |
SVN_ERR(parser_ctx->error); |
274 |
SVN_ERR(parser_ctx->error); |
275 |
} |
275 |
} |
276 |
|
276 |
|
277 |
if (loc_ctx->status_code == 404) |
277 |
SVN_ERR(svn_ra_serf__error_on_status(loc_ctx->status_code, req_url)); |
278 |
{ |
|
|
279 |
return svn_error_create(SVN_ERR_RA_DAV_PATH_NOT_FOUND, NULL, |
280 |
apr_psprintf(pool, _("'%s' path not found"), |
281 |
req_url)); |
282 |
} |
283 |
|
278 |
|
284 |
return err; |
279 |
return err; |
285 |
} |
280 |
} |
286 |
-- subversion/libsvn_ra_serf/getlocationsegments.c |
281 |
++ subversion/libsvn_ra_serf/getlocationsegments.c |
Lines 225-240
Link Here
|
225 |
} |
225 |
} |
226 |
|
226 |
|
227 |
if (gls_ctx->inside_report) |
227 |
if (gls_ctx->inside_report) |
|
|
228 |
|
228 |
err = svn_error_createf(SVN_ERR_RA_DAV_REQUEST_FAILED, NULL, |
229 |
err = svn_error_createf(SVN_ERR_RA_DAV_REQUEST_FAILED, NULL, |
229 |
_("Location segment report failed on '%s'@'%ld'"), |
230 |
_("Location segment report failed on '%s'@'%ld'"), |
230 |
path, peg_revision); |
231 |
path, peg_revision); |
231 |
|
232 |
|
232 |
if (gls_ctx->status_code == 404) |
233 |
SVN_ERR(svn_ra_serf__error_on_status(gls_ctx->status_code, handler->path)); |
233 |
{ |
234 |
|
234 |
return svn_error_create(SVN_ERR_RA_DAV_PATH_NOT_FOUND, NULL, |
|
|
235 |
apr_psprintf(pool, _("'%s' path not found"), |
236 |
req_url)); |
237 |
} |
238 |
|
235 |
|
239 |
svn_pool_destroy(gls_ctx->subpool); |
236 |
svn_pool_destroy(gls_ctx->subpool); |
240 |
|
237 |
|
241 |
-- subversion/libsvn_ra_serf/mergeinfo.c |
238 |
++ subversion/libsvn_ra_serf/mergeinfo.c |
Lines 232-238
Link Here
|
232 |
svn_boolean_t include_descendants, |
232 |
svn_boolean_t include_descendants, |
233 |
apr_pool_t *pool) |
233 |
apr_pool_t *pool) |
234 |
{ |
234 |
{ |
235 |
svn_error_t *err; |
235 |
svn_error_t *err, *err2; |
236 |
int status_code; |
236 |
int status_code; |
237 |
|
237 |
|
238 |
mergeinfo_context_t *mergeinfo_ctx; |
238 |
mergeinfo_context_t *mergeinfo_ctx; |
Lines 285-296
Link Here
|
285 |
|
285 |
|
286 |
err = svn_ra_serf__context_run_wait(&mergeinfo_ctx->done, session, pool); |
286 |
err = svn_ra_serf__context_run_wait(&mergeinfo_ctx->done, session, pool); |
287 |
|
287 |
|
288 |
if (status_code == 404) |
288 |
err2 = svn_ra_serf__error_on_status(status_code, handler->path); |
|
|
289 |
|
290 |
if (err2) |
289 |
{ |
291 |
{ |
290 |
svn_error_clear(err); |
292 |
svn_error_clear(err); |
291 |
return svn_error_createf(SVN_ERR_RA_DAV_PATH_NOT_FOUND, NULL, |
293 |
SVN_ERR(err2); |
292 |
_("'%s' path not found"), handler->path); |
294 |
} |
293 |
} |
|
|
294 |
|
295 |
|
295 |
if (parser_ctx->error) |
296 |
if (parser_ctx->error) |
296 |
{ |
297 |
{ |
Lines 300-311
Link Here
|
300 |
else |
301 |
else |
301 |
SVN_ERR(err); |
302 |
SVN_ERR(err); |
302 |
|
303 |
|
303 |
if (status_code == 404) |
|
|
304 |
{ |
305 |
return svn_error_createf(SVN_ERR_RA_DAV_PATH_NOT_FOUND, NULL, |
306 |
_("'%s' path not found"), handler->path); |
307 |
} |
308 |
|
309 |
if (mergeinfo_ctx->done) |
304 |
if (mergeinfo_ctx->done) |
310 |
*catalog = mergeinfo_ctx->result_catalog; |
305 |
*catalog = mergeinfo_ctx->result_catalog; |
311 |
|
306 |
|
312 |
-- subversion/libsvn_ra_serf/property.c |
307 |
++ subversion/libsvn_ra_serf/property.c |
Lines 612-617
Link Here
|
612 |
svn_error_clear(err); |
612 |
svn_error_clear(err); |
613 |
SVN_ERR(prop_ctx->parser_ctx->error); |
613 |
SVN_ERR(prop_ctx->parser_ctx->error); |
614 |
} |
614 |
} |
|
|
615 |
|
616 |
SVN_ERR(svn_ra_serf__error_on_status(prop_ctx->status_code, prop_ctx->path)); |
617 |
|
615 |
return err; |
618 |
return err; |
616 |
} |
619 |
} |
617 |
|
620 |
|
Lines 640-692
Link Here
|
640 |
return SVN_NO_ERROR; |
643 |
return SVN_NO_ERROR; |
641 |
} |
644 |
} |
642 |
|
645 |
|
643 |
svn_error_t * |
|
|
644 |
svn_ra_serf__search_for_base_props(apr_hash_t *props, |
645 |
const char **remaining_path, |
646 |
const char **missing_path, |
647 |
svn_ra_serf__session_t *session, |
648 |
svn_ra_serf__connection_t *conn, |
649 |
const char *url, |
650 |
apr_pool_t *pool) |
651 |
{ |
652 |
const char *path = url, *present_path = ""; |
653 |
const char *vcc_url; |
654 |
|
655 |
do |
656 |
{ |
657 |
SVN_ERR(svn_ra_serf__retrieve_props(props, session, conn, |
658 |
path, SVN_INVALID_REVNUM, |
659 |
"0", base_props, pool)); |
660 |
vcc_url = |
661 |
svn_ra_serf__get_ver_prop(props, path, |
662 |
SVN_INVALID_REVNUM, |
663 |
"DAV:", |
664 |
"version-controlled-configuration"); |
665 |
if (vcc_url) |
666 |
break; |
667 |
|
668 |
/* This happens when the file is missing in HEAD. */ |
669 |
|
670 |
/* Okay, strip off. */ |
671 |
present_path = svn_path_join(svn_path_basename(path, pool), |
672 |
present_path, pool); |
673 |
path = svn_path_dirname(path, pool); |
674 |
} |
675 |
while (!svn_path_is_empty(path)); |
676 |
|
677 |
/* Error out if entire URL was bogus (not a single part of it exists |
678 |
in the repository!) */ |
679 |
if (svn_path_is_empty(path)) |
680 |
return svn_error_createf(SVN_ERR_RA_ILLEGAL_URL, NULL, |
681 |
_("No part of path '%s' was found in " |
682 |
"repository HEAD"), url); |
683 |
|
684 |
*missing_path = present_path; |
685 |
*remaining_path = path; |
686 |
|
687 |
return SVN_NO_ERROR; |
688 |
} |
689 |
|
690 |
void |
646 |
void |
691 |
svn_ra_serf__walk_all_props(apr_hash_t *props, |
647 |
svn_ra_serf__walk_all_props(apr_hash_t *props, |
692 |
const char *name, |
648 |
const char *name, |
693 |
-- subversion/libsvn_ra_serf/ra_serf.h |
649 |
++ subversion/libsvn_ra_serf/ra_serf.h |
Lines 195-200
Link Here
|
195 |
/* SSL server certificates */ |
195 |
/* SSL server certificates */ |
196 |
svn_boolean_t trust_default_ca; |
196 |
svn_boolean_t trust_default_ca; |
197 |
const char *ssl_authorities; |
197 |
const char *ssl_authorities; |
|
|
198 |
|
199 |
/* Repository UUID */ |
200 |
const char *uuid; |
198 |
}; |
201 |
}; |
199 |
|
202 |
|
200 |
/* |
203 |
/* |
Lines 798-824
Link Here
|
798 |
svn_ra_serf__session_t *sess, |
801 |
svn_ra_serf__session_t *sess, |
799 |
apr_pool_t *pool); |
802 |
apr_pool_t *pool); |
800 |
|
803 |
|
801 |
/* Shared helper func: given a public URL which may not exist in HEAD, |
|
|
802 |
use SESSION to search up parent directories until we can retrieve a |
803 |
*PROPS (allocated in POOL) containing a standard set of base props: |
804 |
{VCC, resourcetype, baseline-relative-path}. |
805 |
|
806 |
Also return: |
807 |
*MISSING_PATH (allocated in POOL), which is the trailing portion of |
808 |
the URL that did not exist. If an error occurs, *MISSING_PATH isn't |
809 |
changed. |
810 |
*REMAINING_PATH (allocated in POOL), which is the parent path on which |
811 |
we found the PROPS. |
812 |
*/ |
813 |
svn_error_t * |
814 |
svn_ra_serf__search_for_base_props(apr_hash_t *props, |
815 |
const char **remaining_path, |
816 |
const char **missing_path, |
817 |
svn_ra_serf__session_t *session, |
818 |
svn_ra_serf__connection_t *conn, |
819 |
const char *url, |
820 |
apr_pool_t *pool); |
821 |
|
822 |
/* |
804 |
/* |
823 |
* This is a blocking version of deliver_props. |
805 |
* This is a blocking version of deliver_props. |
824 |
*/ |
806 |
*/ |
Lines 987-999
Link Here
|
987 |
const char *path, |
969 |
const char *path, |
988 |
apr_pool_t *pool); |
970 |
apr_pool_t *pool); |
989 |
|
971 |
|
990 |
/* Try to discover our current root @a vcc_url and the resultant @a rel_path |
972 |
/* Try to discover our current root @a VCC_URL and the resultant @a REL_PATH |
991 |
* based on @a orig_path for the @a session on @a conn. |
973 |
* based on @a ORIG_PATH for the @a SESSION on @a CONN. |
|
|
974 |
* REL_PATH will be URI decoded. |
992 |
* |
975 |
* |
993 |
* @a rel_path may be NULL if the caller is not interested in the relative |
976 |
* @a REL_PATH may be NULL if the caller is not interested in the relative |
994 |
* path. |
977 |
* path. |
995 |
* |
978 |
* |
996 |
* All temporary allocations will be made in @a pool. |
979 |
* All temporary allocations will be made in @a POOL. |
997 |
*/ |
980 |
*/ |
998 |
svn_error_t * |
981 |
svn_error_t * |
999 |
svn_ra_serf__discover_root(const char **vcc_url, |
982 |
svn_ra_serf__discover_root(const char **vcc_url, |
Lines 1005-1010
Link Here
|
1005 |
|
988 |
|
1006 |
/* Set *BC_URL to the baseline collection url, and set *BC_RELATIVE to |
989 |
/* Set *BC_URL to the baseline collection url, and set *BC_RELATIVE to |
1007 |
* the path relative to that url for URL in REVISION using SESSION. |
990 |
* the path relative to that url for URL in REVISION using SESSION. |
|
|
991 |
* BC_RELATIVE will be URI decoded. |
992 |
* |
1008 |
* REVISION may be SVN_INVALID_REVNUM (to mean "the current HEAD |
993 |
* REVISION may be SVN_INVALID_REVNUM (to mean "the current HEAD |
1009 |
* revision"). If URL is NULL, use SESSION's session url. |
994 |
* revision"). If URL is NULL, use SESSION's session url. |
1010 |
* Use POOL for all allocations. |
995 |
* Use POOL for all allocations. |
Lines 1207-1213
Link Here
|
1207 |
const char *capability, |
1192 |
const char *capability, |
1208 |
apr_pool_t *pool); |
1193 |
apr_pool_t *pool); |
1209 |
|
1194 |
|
1210 |
|
|
|
1211 |
/*** Authentication handler declarations ***/ |
1195 |
/*** Authentication handler declarations ***/ |
1212 |
|
1196 |
|
1213 |
/** |
1197 |
/** |
Lines 1293-1296
Link Here
|
1293 |
apr_size_t data_len, |
1277 |
apr_size_t data_len, |
1294 |
apr_pool_t *pool); |
1278 |
apr_pool_t *pool); |
1295 |
|
1279 |
|
|
|
1280 |
|
1281 |
/*** General utility functions ***/ |
1282 |
|
1283 |
/** |
1284 |
* Convert an HTTP status code resulting from a WebDAV request to the relevant |
1285 |
* error code. |
1286 |
*/ |
1287 |
svn_error_t * |
1288 |
svn_ra_serf__error_on_status(int status_code, const char *path); |
1289 |
|
1290 |
|
1296 |
#endif /* SVN_LIBSVN_RA_SERF_RA_SERF_H */ |
1291 |
#endif /* SVN_LIBSVN_RA_SERF_RA_SERF_H */ |
1297 |
-- subversion/libsvn_ra_serf/serf.c |
1292 |
++ subversion/libsvn_ra_serf/serf.c |
Lines 257-264
Link Here
|
257 |
svn_error_clear(err); |
257 |
svn_error_clear(err); |
258 |
cap_result = capability_no; |
258 |
cap_result = capability_no; |
259 |
} |
259 |
} |
260 |
else if (err->apr_err == SVN_ERR_FS_NOT_FOUND |
260 |
else if (err->apr_err == SVN_ERR_FS_NOT_FOUND) |
261 |
|| err->apr_err == SVN_ERR_RA_DAV_PATH_NOT_FOUND) |
|
|
262 |
{ |
261 |
{ |
263 |
/* Mergeinfo requests use relative paths, and |
262 |
/* Mergeinfo requests use relative paths, and |
264 |
anyway we're in r0, so this is a likely error, |
263 |
anyway we're in r0, so this is a likely error, |
Lines 839-854
Link Here
|
839 |
const char *path, *res_type; |
838 |
const char *path, *res_type; |
840 |
svn_revnum_t fetched_rev; |
839 |
svn_revnum_t fetched_rev; |
841 |
|
840 |
|
842 |
SVN_ERR(fetch_path_props(&prop_ctx, &props, &path, &fetched_rev, |
841 |
svn_error_t *err = fetch_path_props(&prop_ctx, &props, &path, &fetched_rev, |
843 |
session, rel_path, |
842 |
session, rel_path, |
844 |
revision, check_path_props, pool)); |
843 |
revision, check_path_props, pool); |
845 |
|
844 |
|
846 |
if (prop_ctx && (svn_ra_serf__propfind_status_code(prop_ctx) == 404)) |
845 |
if (err && err->apr_err == SVN_ERR_FS_NOT_FOUND) |
847 |
{ |
846 |
{ |
|
|
847 |
svn_error_clear(err); |
848 |
*kind = svn_node_none; |
848 |
*kind = svn_node_none; |
849 |
} |
849 |
} |
850 |
else |
850 |
else |
851 |
{ |
851 |
{ |
|
|
852 |
/* Any other error, raise to caller. */ |
853 |
if (err) |
854 |
return err; |
855 |
|
852 |
res_type = svn_ra_serf__get_ver_prop(props, path, fetched_rev, |
856 |
res_type = svn_ra_serf__get_ver_prop(props, path, fetched_rev, |
853 |
"DAV:", "resourcetype"); |
857 |
"DAV:", "resourcetype"); |
854 |
if (!res_type) |
858 |
if (!res_type) |
Lines 976-984
Link Here
|
976 |
const char *path; |
980 |
const char *path; |
977 |
svn_revnum_t fetched_rev; |
981 |
svn_revnum_t fetched_rev; |
978 |
svn_dirent_t *entry; |
982 |
svn_dirent_t *entry; |
|
|
983 |
svn_error_t *err; |
979 |
|
984 |
|
980 |
SVN_ERR(fetch_path_props(&prop_ctx, &props, &path, &fetched_rev, |
985 |
err = fetch_path_props(&prop_ctx, &props, &path, &fetched_rev, |
981 |
session, rel_path, revision, all_props, pool)); |
986 |
session, rel_path, revision, all_props, pool); |
|
|
987 |
if (err) |
988 |
{ |
989 |
if (err->apr_err == SVN_ERR_FS_NOT_FOUND) |
990 |
{ |
991 |
svn_error_clear(err); |
992 |
*dirent = NULL; |
993 |
return SVN_NO_ERROR; |
994 |
} |
995 |
else |
996 |
return err; |
997 |
} |
982 |
|
998 |
|
983 |
entry = apr_pcalloc(pool, sizeof(*entry)); |
999 |
entry = apr_pcalloc(pool, sizeof(*entry)); |
984 |
|
1000 |
|
Lines 1006-1012
Link Here
|
1006 |
|
1022 |
|
1007 |
path = session->repos_url.path; |
1023 |
path = session->repos_url.path; |
1008 |
|
1024 |
|
1009 |
/* If we have a relative path, append it. */ |
1025 |
/* If we have a relative path, URI encode and append it. */ |
1010 |
if (rel_path) |
1026 |
if (rel_path) |
1011 |
{ |
1027 |
{ |
1012 |
path = svn_path_url_add_component(path, rel_path, pool); |
1028 |
path = svn_path_url_add_component(path, rel_path, pool); |
Lines 1117-1122
Link Here
|
1117 |
return SVN_NO_ERROR; |
1133 |
return SVN_NO_ERROR; |
1118 |
} |
1134 |
} |
1119 |
|
1135 |
|
|
|
1136 |
/* TODO: to fetch the uuid from the repository, we need: |
1137 |
1. a path that exists in HEAD |
1138 |
2. a path that's readable |
1139 |
|
1140 |
get_uuid handles the case where a path doesn't exist in HEAD and also the |
1141 |
case where the root of the repository is not readable. |
1142 |
However, it does not handle the case where we're fetching path not existing |
1143 |
in HEAD of a repository with unreadable root directory. |
1144 |
*/ |
1120 |
static svn_error_t * |
1145 |
static svn_error_t * |
1121 |
svn_ra_serf__get_uuid(svn_ra_session_t *ra_session, |
1146 |
svn_ra_serf__get_uuid(svn_ra_session_t *ra_session, |
1122 |
const char **uuid, |
1147 |
const char **uuid, |
Lines 1127-1145
Link Here
|
1127 |
|
1152 |
|
1128 |
props = apr_hash_make(pool); |
1153 |
props = apr_hash_make(pool); |
1129 |
|
1154 |
|
1130 |
SVN_ERR(svn_ra_serf__retrieve_props(props, session, session->conns[0], |
1155 |
if (!session->uuid) |
1131 |
session->repos_url_str, |
1156 |
{ |
1132 |
SVN_INVALID_REVNUM, "0", uuid_props, |
1157 |
const char *vcc_url, *relative_url; |
1133 |
pool)); |
1158 |
|
1134 |
*uuid = svn_ra_serf__get_prop(props, session->repos_url_str, |
1159 |
/* We're not interested in vcc_url and relative_url, but this call also |
1135 |
SVN_DAV_PROP_NS_DAV, "repository-uuid"); |
1160 |
stores the repository's uuid in the session. */ |
1136 |
|
1161 |
SVN_ERR(svn_ra_serf__discover_root(&vcc_url, |
1137 |
if (!*uuid) |
1162 |
&relative_url, |
1138 |
{ |
1163 |
session, session->conns[0], |
1139 |
return svn_error_create(APR_EGENERAL, NULL, |
1164 |
session->repos_url.path, pool)); |
1140 |
_("The UUID property was not found on the " |
1165 |
if (!session->uuid) |
1141 |
"resource or any of its parents")); |
1166 |
{ |
|
|
1167 |
return svn_error_create(APR_EGENERAL, NULL, |
1168 |
_("The UUID property was not found on the " |
1169 |
"resource or any of its parents")); |
1170 |
} |
1142 |
} |
1171 |
} |
|
|
1172 |
|
1173 |
*uuid = session->uuid; |
1143 |
|
1174 |
|
1144 |
return SVN_NO_ERROR; |
1175 |
return SVN_NO_ERROR; |
1145 |
} |
1176 |
} |
1146 |
-- subversion/libsvn_ra_serf/update.c |
1177 |
++ subversion/libsvn_ra_serf/update.c |
Lines 971-982
Link Here
|
971 |
serf_bucket_response_status(response, &sl); |
971 |
serf_bucket_response_status(response, &sl); |
972 |
|
972 |
|
973 |
/* Woo-hoo. Nothing here to see. */ |
973 |
/* Woo-hoo. Nothing here to see. */ |
974 |
if (sl.code == 404) |
974 |
fetch_ctx->err = svn_ra_serf__error_on_status(sl.code, fetch_ctx->info->name); |
|
|
975 |
if (fetch_ctx->err) |
975 |
{ |
976 |
{ |
976 |
fetch_ctx->done = TRUE; |
977 |
fetch_ctx->done = TRUE; |
977 |
fetch_ctx->err = svn_error_createf(SVN_ERR_RA_DAV_PATH_NOT_FOUND, NULL, |
978 |
|
978 |
"'%s' path not found", |
|
|
979 |
fetch_ctx->info->name); |
980 |
return svn_ra_serf__handle_discard_body(request, response, NULL, pool); |
979 |
return svn_ra_serf__handle_discard_body(request, response, NULL, pool); |
981 |
} |
980 |
} |
982 |
|
981 |
|
983 |
-- subversion/libsvn_ra_serf/util.c |
982 |
++ subversion/libsvn_ra_serf/util.c |
Lines 1344-1350
Link Here
|
1344 |
apr_pool_t *pool) |
1344 |
apr_pool_t *pool) |
1345 |
{ |
1345 |
{ |
1346 |
apr_hash_t *props; |
1346 |
apr_hash_t *props; |
1347 |
const char *path, *relative_path, *present_path = ""; |
1347 |
const char *path, *relative_path, *present_path = "", *uuid; |
1348 |
|
1348 |
|
1349 |
/* If we're only interested in our VCC, just return it. */ |
1349 |
/* If we're only interested in our VCC, just return it. */ |
1350 |
if (session->vcc_url && !rel_path) |
1350 |
if (session->vcc_url && !rel_path) |
Lines 1356-1388
Link Here
|
1356 |
props = apr_hash_make(pool); |
1356 |
props = apr_hash_make(pool); |
1357 |
path = orig_path; |
1357 |
path = orig_path; |
1358 |
*vcc_url = NULL; |
1358 |
*vcc_url = NULL; |
|
|
1359 |
uuid = NULL; |
1359 |
|
1360 |
|
1360 |
do |
1361 |
do |
1361 |
{ |
1362 |
{ |
1362 |
SVN_ERR(svn_ra_serf__retrieve_props(props, session, conn, |
1363 |
svn_error_t *err = svn_ra_serf__retrieve_props(props, session, conn, |
1363 |
path, SVN_INVALID_REVNUM, |
1364 |
path, SVN_INVALID_REVNUM, |
1364 |
"0", base_props, pool)); |
1365 |
"0", base_props, pool); |
1365 |
*vcc_url = |
1366 |
if (! err) |
1366 |
svn_ra_serf__get_ver_prop(props, path, |
|
|
1367 |
SVN_INVALID_REVNUM, |
1368 |
"DAV:", |
1369 |
"version-controlled-configuration"); |
1370 |
|
1371 |
if (*vcc_url) |
1372 |
{ |
1367 |
{ |
|
|
1368 |
*vcc_url = |
1369 |
svn_ra_serf__get_ver_prop(props, path, |
1370 |
SVN_INVALID_REVNUM, |
1371 |
"DAV:", |
1372 |
"version-controlled-configuration"); |
1373 |
|
1373 |
relative_path = svn_ra_serf__get_ver_prop(props, path, |
1374 |
relative_path = svn_ra_serf__get_ver_prop(props, path, |
1374 |
SVN_INVALID_REVNUM, |
1375 |
SVN_INVALID_REVNUM, |
1375 |
SVN_DAV_PROP_NS_DAV, |
1376 |
SVN_DAV_PROP_NS_DAV, |
1376 |
"baseline-relative-path"); |
1377 |
"baseline-relative-path"); |
|
|
1378 |
|
1379 |
uuid = svn_ra_serf__get_ver_prop(props, path, |
1380 |
SVN_INVALID_REVNUM, |
1381 |
SVN_DAV_PROP_NS_DAV, |
1382 |
"repository-uuid"); |
1377 |
break; |
1383 |
break; |
1378 |
} |
1384 |
} |
1379 |
|
1385 |
else |
1380 |
/* This happens when the file is missing in HEAD. */ |
1386 |
{ |
1381 |
|
1387 |
if (err->apr_err != SVN_ERR_FS_NOT_FOUND) |
1382 |
/* Okay, strip off. */ |
1388 |
{ |
1383 |
present_path = svn_path_join(svn_path_basename(path, pool), |
1389 |
return err; /* found a _real_ error */ |
1384 |
present_path, pool); |
1390 |
} |
1385 |
path = svn_path_dirname(path, pool); |
1391 |
else |
|
|
1392 |
{ |
1393 |
/* This happens when the file is missing in HEAD. */ |
1394 |
svn_error_clear(err); |
1395 |
|
1396 |
/* Okay, strip off. */ |
1397 |
present_path = svn_path_join(svn_path_basename(path, pool), |
1398 |
present_path, pool); |
1399 |
path = svn_path_dirname(path, pool); |
1400 |
} |
1401 |
} |
1386 |
} |
1402 |
} |
1387 |
while (!svn_path_is_empty(path)); |
1403 |
while (!svn_path_is_empty(path)); |
1388 |
|
1404 |
|
Lines 1419-1430
Link Here
|
1419 |
session->pool); |
1435 |
session->pool); |
1420 |
} |
1436 |
} |
1421 |
|
1437 |
|
|
|
1438 |
/* Store the repository UUID in the cache. */ |
1439 |
if (!session->uuid) |
1440 |
{ |
1441 |
session->uuid = apr_pstrdup(session->pool, uuid); |
1442 |
} |
1443 |
|
1422 |
if (rel_path) |
1444 |
if (rel_path) |
1423 |
{ |
1445 |
{ |
1424 |
if (present_path[0] != '\0') |
1446 |
if (present_path[0] != '\0') |
1425 |
{ |
1447 |
{ |
1426 |
*rel_path = svn_path_url_add_component(relative_path, |
1448 |
/* The relative path is supposed to be URI decoded, so decode |
1427 |
present_path, pool); |
1449 |
present_path before joining both together. */ |
|
|
1450 |
*rel_path = svn_path_join(relative_path, |
1451 |
svn_path_uri_decode(present_path, pool), |
1452 |
pool); |
1428 |
} |
1453 |
} |
1429 |
else |
1454 |
else |
1430 |
{ |
1455 |
{ |
Lines 1434-1436
Link Here
|
1434 |
|
1459 |
|
1435 |
return SVN_NO_ERROR; |
1460 |
return SVN_NO_ERROR; |
1436 |
} |
1461 |
} |
1437 |
-- subversion/svn/mkdir-cmd.c |
1462 |
|
|
|
1463 |
svn_error_t * |
1464 |
svn_ra_serf__error_on_status(int status_code, const char *path) |
1465 |
{ |
1466 |
switch(status_code) |
1467 |
{ |
1468 |
case 404: |
1469 |
return svn_error_createf(SVN_ERR_FS_NOT_FOUND, NULL, |
1470 |
_("'%s' path not found"), path); |
1471 |
} |
1472 |
|
1473 |
return SVN_NO_ERROR; |
1474 |
} |
|
|
1475 |
++ subversion/svn/mkdir-cmd.c |
Lines 87-94
Link Here
|
87 |
else if (!(opt_state->parents) && |
87 |
else if (!(opt_state->parents) && |
88 |
(APR_STATUS_IS_ENOENT(err->apr_err) || /* in wc */ |
88 |
(APR_STATUS_IS_ENOENT(err->apr_err) || /* in wc */ |
89 |
err->apr_err == SVN_ERR_FS_NOT_DIRECTORY || |
89 |
err->apr_err == SVN_ERR_FS_NOT_DIRECTORY || |
90 |
err->apr_err == SVN_ERR_FS_NOT_FOUND || /* ra_local and ra_svn */ |
90 |
err->apr_err == SVN_ERR_FS_NOT_FOUND /* all ra layers */)) |
91 |
err->apr_err == SVN_ERR_RA_DAV_PATH_NOT_FOUND /* ra_neon */)) |
|
|
92 |
return svn_error_quick_wrap |
91 |
return svn_error_quick_wrap |
93 |
(err, _("Try 'svn mkdir --parents' instead?")); |
92 |
(err, _("Try 'svn mkdir --parents' instead?")); |
94 |
else |
93 |
else |