📄 client.h
字号:
/* * client.h : shared stuff internal to the client library. * * ==================================================================== * Copyright (c) 2000-2006 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== */#ifndef SVN_LIBSVN_CLIENT_H#define SVN_LIBSVN_CLIENT_H#include <apr_pools.h>#include "svn_types.h"#include "svn_string.h"#include "svn_error.h"#include "svn_ra.h"#include "svn_client.h"#ifdef __cplusplusextern "C" {#endif /* __cplusplus *//* Set *REVNUM to the revision number identified by REVISION. * * If REVISION->kind is svn_opt_revision_number, just use * REVISION->value.number, ignoring PATH and RA_SESSION. * * Else if REVISION->kind is svn_opt_revision_committed, * svn_opt_revision_previous, or svn_opt_revision_base, or * svn_opt_revision_working, then the revision can be identified * purely based on the working copy's administrative information for * PATH, so RA_SESSION is ignored. If PATH is not under revision * control, return SVN_ERR_UNVERSIONED_RESOURCE, or if PATH is null, * return SVN_ERR_CLIENT_VERSIONED_PATH_REQUIRED. * * Else if REVISION->kind is svn_opt_revision_date or * svn_opt_revision_head, then RA_SESSION is used to retrieve the * revision from the repository (using REVISION->value.date in the * former case), and PATH is ignored. If RA_SESSION is null, * return SVN_ERR_CLIENT_RA_ACCESS_REQUIRED. * * Else if REVISION->kind is svn_opt_revision_unspecified, set * *REVNUM to SVN_INVALID_REVNUM. * * Else return SVN_ERR_CLIENT_BAD_REVISION. * * Use POOL for any temporary allocation. */svn_error_t *svn_client__get_revision_number(svn_revnum_t *revnum, svn_ra_session_t *ra_session, const svn_opt_revision_t *revision, const char *path, apr_pool_t *pool);/* Return true if REVISION1 and REVISION2 would result in the same revision number if interpreted in the context of the same working copy and path and repository, or if both are of kind svn_opt_revision_unspecified. Otherwise, return false. */svn_boolean_tsvn_client__compare_revisions(svn_opt_revision_t *revision1, svn_opt_revision_t *revision2);/* Return true if the revision number for REVISION can be determined from just the working copy, or false if it can be determined from just the repository. NOTE: No other kinds of revisions should be possible; but if one day there are, this will return true for those kinds. */ svn_boolean_t svn_client__revision_is_local(const svn_opt_revision_t *revision);/* Given the CHANGED_PATHS and REVISION from an instance of a svn_log_message_receiver_t function, determine at which location PATH may be expected in the next log message, and set *PREV_PATH_P to that value. KIND is the node kind of PATH. Set *ACTION_P to a character describing the change that caused this revision (as listed in svn_log_changed_path_t) and set *COPYFROM_REV_P to the revision PATH was copied from, or SVN_INVALID_REVNUM if it was not copied. ACTION_P and COPYFROM_REV_P may be NULL, in which case they are not used. Perform all allocations in POOL. This is useful for tracking the various changes in location a particular resource has undergone when performing an RA->get_logs() operation on that resource. */svn_error_t *svn_client__prev_log_path(const char **prev_path_p, char *action_p, svn_revnum_t *copyfrom_rev_p, apr_hash_t *changed_paths, const char *path, svn_node_kind_t kind, svn_revnum_t revision, apr_pool_t *pool);/* Set *START_URL and *START_REVISION (and maybe *END_URL and *END_REVISION) to the revisions and repository URLs of one (or two) points of interest along a particular versioned resource's line of history. PATH as it exists in "peg revision" REVISION identifies that line of history, and START and END specify the point(s) of interest (typically the revisions referred to as the "operative range" for a given operation) along that history. END may be of kind svn_opt_revision_unspecified (in which case END_URL and END_REVISION are not touched by the function); START and REVISION may not. RA_SESSION should be an open RA session pointing at the URL of PATH, or NULL, in which case this function will open its own temporary session. A NOTE ABOUT FUTURE REPORTING: If either START or END are greater than REVISION, then do a sanity check (since we cannot search future history yet): verify that PATH in the future revision(s) is the "same object" as the one pegged by REVISION. In other words, all three objects must be connected by a single line of history which exactly passes through PATH at REVISION. If this sanity check fails, return SVN_ERR_CLIENT_UNRELATED_RESOURCES. If PATH doesn't exist in the future revision, SVN_ERR_FS_NOT_FOUND may also be returned. CTX is the client context baton. Use POOL for all allocations. */svn_error_t *svn_client__repos_locations(const char **start_url, svn_opt_revision_t **start_revision, const char **end_url, svn_opt_revision_t **end_revision, svn_ra_session_t *ra_session, const char *path, const svn_opt_revision_t *revision, const svn_opt_revision_t *start, const svn_opt_revision_t *end, svn_client_ctx_t *ctx, apr_pool_t *pool);/* Given PATH_OR_URL, which contains either a working copy path or an absolute URL, a peg revision PEG_REVISION, and a desired revision REVISION, create an RA connection to that object as it exists in that revision, following copy history if necessary. If REVISION is younger than PEG_REVISION, then PATH_OR_URL will be checked to see that it is the same node in both PEG_REVISION and REVISION. If it is not, then @c SVN_ERR_CLIENT_UNRELATED_RESOURCES is returned. If PEG_REVISION's kind is svn_opt_revision_unspecified, it is interpreted as "head" for a URL or "working" for a working-copy path. Store the resulting ra_session in *RA_SESSION_P. Store the actual revision number of the object in *REV_P, and the final resulting URL in *URL_P. Use authentication baton cached in CTX to authenticate against the repository. Use POOL for all allocations. */svn_error_t *svn_client__ra_session_from_path(svn_ra_session_t **ra_session_p, svn_revnum_t *rev_p, const char **url_p, const char *path_or_url, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *revision, svn_client_ctx_t *ctx, apr_pool_t *pool);/* ---------------------------------------------------------------- *//*** RA callbacks ***//* This is the baton that we pass to RA->open(), and is associated with the callback table we provide to RA. */typedef struct{ /* Holds the directory that corresponds to the REPOS_URL at RA->open() time. When callbacks specify a relative path, they are joined with this base directory. */ const char *base_dir; svn_wc_adm_access_t *base_access; /* When true, makes sure temporary files are created outside the working copy. */ svn_boolean_t read_only_wc; /* An array of svn_client_commit_item2_t * structures, present only during working copy commits. */ apr_array_header_t *commit_items; /* A client context. */ svn_client_ctx_t *ctx; /* The pool to use for session-related items. */ apr_pool_t *pool;} svn_client__callback_baton_t;/* Open an RA session, returning it in *RA_SESSION. The root of the session is specified by BASE_URL and BASE_DIR. BASE_ACCESS is an access baton for BASE_DIR administrative data. Additional control parameters: - COMMIT_ITEMS is an array of svn_client_commit_item_t * structures, present only for working copy commits, NULL otherwise. - USE_ADMIN indicates that the RA layer should create tempfiles in the administrative area instead of in the working copy itself, and read properties from the administrative area. - READ_ONLY_WC indicates that the RA layer should not attempt to modify the WC props directly. BASE_DIR may be NULL if the RA operation does not correspond to a working copy (in which case, USE_ADMIN should be FALSE, and BASE_ACCESS should be null). The calling application's authentication baton is provided in CTX, and allocations related to this session are performed in POOL.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -