003 File Manager
Current Path:
/usr/src/contrib/subversion/subversion/libsvn_wc
usr
/
src
/
contrib
/
subversion
/
subversion
/
libsvn_wc
/
📁
..
📄
README
(9.5 KB)
📄
adm_crawler.c
(52.36 KB)
📄
adm_files.c
(20.21 KB)
📄
adm_files.h
(5.34 KB)
📄
adm_ops.c
(40.15 KB)
📄
ambient_depth_filter_editor.c
(21.68 KB)
📄
cleanup.c
(7.33 KB)
📄
conflicts.c
(152.54 KB)
📄
conflicts.h
(19.21 KB)
📄
context.c
(3.43 KB)
📄
copy.c
(45.56 KB)
📄
crop.c
(14.47 KB)
📄
delete.c
(19.04 KB)
📄
deprecated.c
(172.72 KB)
📄
diff.h
(7.02 KB)
📄
diff_editor.c
(116.98 KB)
📄
diff_local.c
(21.71 KB)
📄
entries.c
(107.62 KB)
📄
entries.h
(6.75 KB)
📄
externals.c
(64.3 KB)
📄
info.c
(20.66 KB)
📄
libsvn_wc.pc.in
(367 B)
📄
lock.c
(52.27 KB)
📄
lock.h
(3.07 KB)
📄
merge.c
(57.23 KB)
📄
node.c
(42.65 KB)
📄
old-and-busted.c
(42.24 KB)
📄
props.c
(89.9 KB)
📄
props.h
(5.98 KB)
📄
questions.c
(26.96 KB)
📄
relocate.c
(5.91 KB)
📄
revert.c
(37.16 KB)
📄
revision_status.c
(2.75 KB)
📄
status.c
(107.72 KB)
📄
token-map.h
(2.76 KB)
📄
translate.c
(15.68 KB)
📄
translate.h
(7.88 KB)
📄
tree_conflicts.c
(17.78 KB)
📄
tree_conflicts.h
(3.26 KB)
📄
update_editor.c
(214.25 KB)
📄
upgrade.c
(76.76 KB)
📄
util.c
(16.9 KB)
📄
wc-checks.h
(11.68 KB)
📄
wc-checks.sql
(11.67 KB)
📄
wc-metadata.h
(12.09 KB)
📄
wc-metadata.sql
(29.67 KB)
📄
wc-queries.h
(121.6 KB)
📄
wc-queries.sql
(61.37 KB)
📄
wc.h
(29.75 KB)
📄
wc_db.c
(588.65 KB)
📄
wc_db.h
(147.07 KB)
📄
wc_db_pristine.c
(35.13 KB)
📄
wc_db_private.h
(21.98 KB)
📄
wc_db_update_move.c
(175.6 KB)
📄
wc_db_util.c
(5.16 KB)
📄
wc_db_wcroot.c
(35.78 KB)
📄
wcroot_anchor.c
(8.75 KB)
📄
workqueue.c
(59.76 KB)
📄
workqueue.h
(9 KB)
Editing: relocate.c
/* * relocate.c: do wc repos relocation * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * ==================================================================== */ #include "svn_wc.h" #include "svn_error.h" #include "svn_pools.h" #include "svn_dirent_uri.h" #include "svn_path.h" #include "wc.h" #include "props.h" #include "svn_private_config.h" /* If the components of RELPATH exactly match (after being URI-encoded) the final components of URL, return a copy of URL minus those components allocated in RESULT_POOL; otherwise, return NULL. */ static const char * url_remove_final_relpath(const char *url, const char *relpath, apr_pool_t *result_pool, apr_pool_t *scratch_pool) { char *result = apr_pstrdup(result_pool, url); char *result_end; const char *relpath_end; SVN_ERR_ASSERT_NO_RETURN(svn_path_is_url(url)); SVN_ERR_ASSERT_NO_RETURN(svn_relpath_is_canonical(relpath)); if (relpath[0] == 0) return result; relpath = svn_path_uri_encode(relpath, scratch_pool); result_end = result + strlen(result) - 1; relpath_end = relpath + strlen(relpath) - 1; while (relpath_end >= relpath) { if (*result_end != *relpath_end) return NULL; relpath_end--; result_end--; } if (*result_end != '/') return NULL; *result_end = 0; return result; } svn_error_t * svn_wc_relocate4(svn_wc_context_t *wc_ctx, const char *local_abspath, const char *from, const char *to, svn_wc_relocation_validator3_t validator, void *validator_baton, apr_pool_t *scratch_pool) { svn_node_kind_t kind; const char *repos_relpath; const char *old_repos_root, *old_url; const char *new_repos_root, *new_url; size_t from_len; size_t old_url_len; const char *uuid; svn_boolean_t is_wc_root; SVN_ERR(svn_wc__is_wcroot(&is_wc_root, wc_ctx, local_abspath, scratch_pool)); if (! is_wc_root) { const char *wcroot_abspath; svn_error_t *err; err = svn_wc__db_get_wcroot(&wcroot_abspath, wc_ctx->db, local_abspath, scratch_pool, scratch_pool); if (err) { svn_error_clear(err); return svn_error_createf( SVN_ERR_WC_INVALID_OP_ON_CWD, NULL, _("Cannot relocate '%s' as it is not the root of a working copy"), svn_dirent_local_style(local_abspath, scratch_pool)); } else { return svn_error_createf( SVN_ERR_WC_INVALID_OP_ON_CWD, NULL, _("Cannot relocate '%s' as it is not the root of a working copy; " "try relocating '%s' instead"), svn_dirent_local_style(local_abspath, scratch_pool), svn_dirent_local_style(wcroot_abspath, scratch_pool)); } } SVN_ERR(svn_wc__db_read_info(NULL, &kind, NULL, &repos_relpath, &old_repos_root, &uuid, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, wc_ctx->db, local_abspath, scratch_pool, scratch_pool)); if (kind != svn_node_dir) return svn_error_create(SVN_ERR_CLIENT_INVALID_RELOCATION, NULL, _("Cannot relocate a single file")); old_url = svn_path_url_add_component2(old_repos_root, repos_relpath, scratch_pool); old_url_len = strlen(old_url); from_len = strlen(from); if ((from_len > old_url_len) || (strncmp(old_url, from, strlen(from)) != 0)) return svn_error_createf(SVN_ERR_WC_INVALID_RELOCATION, NULL, _("Invalid source URL prefix: '%s' (does not " "overlap target's URL '%s')"), from, old_url); if (old_url_len == from_len) new_url = to; else new_url = apr_pstrcat(scratch_pool, to, old_url + from_len, SVN_VA_NULL); if (! svn_path_is_url(new_url)) return svn_error_createf(SVN_ERR_WC_INVALID_RELOCATION, NULL, _("Invalid relocation destination: '%s' " "(not a URL)"), new_url); new_repos_root = url_remove_final_relpath(new_url, repos_relpath, scratch_pool, scratch_pool); if (!new_repos_root) return svn_error_createf(SVN_ERR_WC_INVALID_RELOCATION, NULL, _("Invalid relocation destination: '%s' " "(does not point to target)" ), new_url); SVN_ERR(validator(validator_baton, uuid, new_url, new_repos_root, scratch_pool)); return svn_error_trace(svn_wc__db_global_relocate(wc_ctx->db, local_abspath, new_repos_root, scratch_pool)); }
Upload File
Create Folder