📄 client.h
字号:
crawler discovered commit candidates while in the process of committing, it was impossible to harvest this information upfront. As a workaround, svn_wc_statuses() was used to stat the whole working copy for changes before the commit started...and then the commit would again stat the whole tree for changes. Enter the new system. The primary goal of this system is very straightforward: harvest all commit candidate information up front, and cache enough info in the process to use this to drive a URL-sorted commit. *** END-OF-KNOWLEDGE *** The prototypes below are still in development. In general, the idea is that commit-y processes ('svn mkdir URL', 'svn delete URL', 'svn commit', 'svn copy WC_PATH URL', 'svn copy URL1 URL2', 'svn move URL1 URL2', others?) generate the cached commit candidate information, and hand this information off to a consumer which is responsible for driving the RA layer's commit editor in a URL-depth-first fashion and reporting back the post-commit information.*//* ### This is TEMPORARY! Until we can find out the canonical repository URL of a given entry, we'll just use this bogus value in for our single committables hash key. By the time we support multiple repositories we will have to be storing the canonical repository URLs anyway, so this will go away and the real URLs will be the keys of the committables hash. */#define SVN_CLIENT__SINGLE_REPOS_NAME "svn:single-repos"/* Recursively crawl a set of working copy paths (PARENT_DIR + each item in the TARGETS array) looking for commit candidates, locking working copy directories as the crawl progresses. For each candidate found: - create svn_client_commit_item_t for the candidate. - add the structure to an apr_array_header_t array of commit items that are in the same repository, creating a new array if necessary. - add (or update) a reference to this array to the COMMITTABLES hash, keyed on the canonical repository name. ### todo, until multi-repository support actually exists, the single key here will actually be some arbitrary thing to be ignored. - if the candidate has a lock token, add it to the LOCK_TOKENS hash. - if the candidate is a directory scheduled for deletion, crawl the directories children recursively for any lock tokens and add them to the LOCK_TOKENS array. At the successful return of this function, COMMITTABLES will be an apr_hash_t * hash of apr_array_header_t * arrays (of svn_client_commit_item_t * structures), keyed on const char * canonical repository URLs. LOCK_TOKENS will point to a hash table with const char * lock tokens, keyed on const char * URLs. Also, LOCKED_DIRS will be an apr_hash_t * hash of svn_wc_adm_access_t * keyed on const char * working copy path directory names which were locked in the process of this crawl. These will need to be unlocked again post-commit. If NONRECURSIVE is specified, subdirectories of directory targets found in TARGETS will not be crawled for modifications. If JUST_LOCKED is TRUE, treat unmodified items with lock tokens as commit candidates. If CTX->CANCEL_FUNC is non-null, it will be called with CTX->CANCEL_BATON while harvesting to determine if the client has cancelled the operation. */svn_error_t *svn_client__harvest_committables(apr_hash_t **committables, apr_hash_t **lock_tokens, svn_wc_adm_access_t *parent_dir, apr_array_header_t *targets, svn_boolean_t nonrecursive, svn_boolean_t just_locked, svn_client_ctx_t *ctx, apr_pool_t *pool);/* Recursively crawl the working copy path TARGET, harvesting commit_items into a COMMITABLES hash (see the docstring for svn_client__harvest_committables for what that really means, and for the relevance of LOCKED_DIRS) as if every entry at or below TARGET was to be committed as a set of adds (mostly with history) to a new repository URL (NEW_URL). If CTX->CANCEL_FUNC is non-null, it will be called with CTX->CANCEL_BATON while harvesting to determine if the client has cancelled the operation. */svn_error_t *svn_client__get_copy_committables(apr_hash_t **committables, const char *new_url, const char *target, svn_wc_adm_access_t *adm_access, svn_client_ctx_t *ctx, apr_pool_t *pool); /* A qsort()-compatible sort routine for sorting an array of svn_client_commit_item_t's by their URL member. */int svn_client__sort_commit_item_urls(const void *a, const void *b);/* Rewrite the COMMIT_ITEMS array to be sorted by URL. Also, discover a common *BASE_URL for the items in the array, and rewrite those items' URLs to be relative to that *BASE_URL. Afterwards, some of the items in COMMIT_ITEMS may contain data allocated in POOL. */svn_error_t *svn_client__condense_commit_items(const char **base_url, apr_array_header_t *commit_items, apr_pool_t *pool);/* Commit the items in the COMMIT_ITEMS array using EDITOR/EDIT_BATON to describe the committed local mods. Prior to this call, COMMIT_ITEMS should have been run through (and BASE_URL generated by) svn_client__condense_commit_items. CTX->NOTIFY_FUNC/CTX->BATON will be called as the commit progresses, as a way of describing actions to the application layer (if non NULL). NOTIFY_PATH_PREFIX is used to send shorter, relative paths to the notify_func (it's a prefix that will be subtracted from the front of the paths.) If the caller wants to keep track of any outstanding temporary files left after the transmission of text and property mods, *TEMPFILES is the place to look. MD5 checksums, if available, for the new text bases of committed files are stored in *DIGESTS, which maps const char* paths (from the items' paths) to const unsigned char* digests. DIGESTS may be null. */svn_error_t *svn_client__do_commit(const char *base_url, apr_array_header_t *commit_items, svn_wc_adm_access_t *adm_access, const svn_delta_editor_t *editor, void *edit_baton, const char *notify_path_prefix, apr_hash_t **tempfiles, apr_hash_t **digests, svn_client_ctx_t *ctx, apr_pool_t *pool);/*** Externals (Modules) ***//* Handle changes to the svn:externals property in the tree traversed by TRAVERSAL_INFO (obtained from svn_wc_get_checkout_editor, svn_wc_get_update_editor, svn_wc_get_switch_editor, for example). For each changed value of the property, discover the nature of the change and behave appropriately -- either check a new "external" subdir, or call svn_wc_remove_from_revision_control() on an existing one, or both. Pass NOTIFY_FUNC with NOTIFY_BATON along to svn_client_checkout(). ### todo: AUTH_BATON may not be so useful. It's almost like we need access to the original auth-obtaining callbacks that produced auth baton in the first place. Hmmm. ### If UPDATE_UNCHANGED, then run svn_client_update() on any external items that are the same in both the before and after traversal info. *TIMESTAMP_SLEEP will be set TRUE if a sleep is required to ensure timestamp integrity, *TIMESTAMP_SLEEP will be unchanged if no sleep is required. Use POOL for temporary allocation. */svn_error_t *svn_client__handle_externals(svn_wc_traversal_info_t *traversal_info, svn_boolean_t update_unchanged, svn_boolean_t *timestamp_sleep, svn_client_ctx_t *ctx, apr_pool_t *pool);/* Fetch externals definitions described by EXTERNALS, a hash of the form returned by svn_wc_edited_externals() (which see). If IS_EXPORT is set, the external items will be exported instead of checked out -- they will have no administrative subdirectories. *TIMESTAMP_SLEEP will be set TRUE if a sleep is required to ensure timestamp integrity, *TIMESTAMP_SLEEP will be unchanged if no sleep is required. Use POOL for temporary allocation. */svn_error_t *svn_client__fetch_externals(apr_hash_t *externals, svn_boolean_t is_export, svn_boolean_t *timestamp_sleep, svn_client_ctx_t *ctx, apr_pool_t *pool);/* Perform status operations on each external in TRAVERSAL_INFO. All other options are the same as those passed to svn_client_status(). */svn_error_t *svn_client__do_external_status(svn_wc_traversal_info_t *traversal_info, svn_wc_status_func2_t status_func, void *status_baton, svn_boolean_t get_all, svn_boolean_t update, svn_boolean_t no_ignore, svn_client_ctx_t *ctx, apr_pool_t *pool);/* Retrieves log message using *CTX->log_msg_func or * *CTX->log_msg_func2 callbacks. * Other arguments same as svn_client_get_commit_log2_t. */svn_error_t * svn_client__get_log_msg(const char **log_msg, const char **tmp_file, const apr_array_header_t *commit_items, svn_client_ctx_t *ctx, apr_pool_t *pool);#ifdef __cplusplus}#endif /* __cplusplus */#endif /* SVN_LIBSVN_CLIENT_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -