86
90
const svn_opt_revision_t *revision,
87
91
apr_pool_t *scratch_pool);
89
/* Set *COPYFROM_PATH and *COPYFROM_REV to the path (without initial '/')
90
and revision that served as the source of the copy from which PATH_OR_URL
91
at REVISION was created, or NULL and SVN_INVALID_REVNUM (respectively) if
92
PATH_OR_URL at REVISION was not the result of a copy operation. */
93
svn_error_t *svn_client__get_copy_source(const char *path_or_url,
94
const svn_opt_revision_t *revision,
95
const char **copyfrom_path,
96
svn_revnum_t *copyfrom_rev,
97
svn_client_ctx_t *ctx,
93
/* Set *ORIGINAL_REPOS_RELPATH and *ORIGINAL_REVISION to the original location
94
that served as the source of the copy from which PATH_OR_URL at REVISION was
95
created, or NULL and SVN_INVALID_REVNUM (respectively) if PATH_OR_URL at
96
REVISION was not the result of a copy operation. */
98
svn_client__get_copy_source(const char **original_repos_relpath,
99
svn_revnum_t *original_revision,
100
const char *path_or_url,
101
const svn_opt_revision_t *revision,
102
svn_client_ctx_t *ctx,
103
apr_pool_t *result_pool,
104
apr_pool_t *scratch_pool);
100
106
/* Set *START_URL and *START_REVISION (and maybe *END_URL
101
107
and *END_REVISION) to the revisions and repository URLs of one
165
195
apr_pool_t *pool);
168
/* Set *ANCESTOR_PATH and *ANCESTOR_REVISION to the youngest common
169
ancestor path (a path relative to the root of the repository) and
170
revision, respectively, of the two locations identified as
171
PATH_OR_URL1@REV1 and PATH_OR_URL2@REV1. Use the authentication
172
baton cached in CTX to authenticate against the repository.
173
This function assumes that PATH_OR_URL1@REV1 and PATH_OR_URL2@REV1
174
both refer to the same repository. Use POOL for all allocations. */
198
/* Find the common ancestor of two locations in a repository.
199
Ancestry is determined by the 'copy-from' relationship and the normal
200
successor relationship.
202
Set *ANCESTOR_P to the location of the youngest common ancestor of
203
LOC1 and LOC2. If the locations have no common ancestor (including if
204
they don't have the same repository root URL), set *ANCESTOR_P to NULL.
206
If SESSION is not NULL, use it for retrieving the common ancestor instead
207
of creating a new session.
209
Use the authentication baton cached in CTX to authenticate against
210
the repository. Use POOL for all allocations.
212
See also svn_client__calc_youngest_common_ancestor() to find youngest
213
common ancestor for already fetched history-as-mergeinfo information.
215
See also svn_client__youngest_common_ancestor().
176
svn_client__get_youngest_common_ancestor(const char **ancestor_path,
177
svn_revnum_t *ancestor_revision,
178
const char *path_or_url1,
180
const char *path_or_url2,
218
svn_client__get_youngest_common_ancestor(svn_client__pathrev_t **ancestor_p,
219
const svn_client__pathrev_t *loc1,
220
const svn_client__pathrev_t *loc2,
221
svn_ra_session_t *session,
182
222
svn_client_ctx_t *ctx,
185
/* Given PATH_OR_URL, which contains either a working copy path or an
186
absolute URL, a peg revision PEG_REVISION, and a desired revision
187
REVISION, create an RA connection to that object as it exists in
188
that revision, following copy history if necessary. If REVISION is
189
younger than PEG_REVISION, then PATH_OR_URL will be checked to see
190
that it is the same node in both PEG_REVISION and REVISION. If it
191
is not, then @c SVN_ERR_CLIENT_UNRELATED_RESOURCES is returned.
193
BASE_DIR_ABSPATH is the working copy path the ra_session corresponds to,
194
should only be used if PATH_OR_URL is a url.
196
If PEG_REVISION's kind is svn_opt_revision_unspecified, it is
197
interpreted as "head" for a URL or "working" for a working-copy path.
199
Store the resulting ra_session in *RA_SESSION_P. Store the actual
200
revision number of the object in *REV_P, and the final resulting
203
Use authentication baton cached in CTX to authenticate against the
206
Use POOL for all allocations. */
223
apr_pool_t *result_pool,
224
apr_pool_t *scratch_pool);
226
/* Find the common ancestor of two locations in a repository using already
227
fetched history-as-mergeinfo information.
229
Ancestry is determined by the 'copy-from' relationship and the normal
230
successor relationship.
232
Set *ANCESTOR_P to the location of the youngest common ancestor of
233
LOC1 and LOC2. If the locations have no common ancestor (including if
234
they don't have the same repository root URL), set *ANCESTOR_P to NULL.
236
HISTORY1, HAS_REV_ZERO_HISTORY1, HISTORY2, HAS_REV_ZERO_HISTORY2 are
237
history-as-mergeinfo information as returned by
238
svn_client__get_history_as_mergeinfo() for LOC1 and LOC2 respectively.
240
See also svn_client__get_youngest_common_ancestor().
208
svn_client__ra_session_from_path(svn_ra_session_t **ra_session_p,
211
const char *path_or_url,
212
const char *base_dir_abspath,
213
const svn_opt_revision_t *peg_revision,
214
const svn_opt_revision_t *revision,
215
svn_client_ctx_t *ctx,
244
svn_client__calc_youngest_common_ancestor(svn_client__pathrev_t **ancestor_p,
245
const svn_client__pathrev_t *loc1,
246
apr_hash_t *history1,
247
svn_boolean_t has_rev_zero_history1,
248
const svn_client__pathrev_t *loc2,
249
apr_hash_t *history2,
250
svn_boolean_t has_rev_zero_history2,
251
apr_pool_t *result_pool,
252
apr_pool_t *scratch_pool);
218
254
/* Ensure that RA_SESSION's session URL matches SESSION_URL,
219
reparenting that session if necessary. If reparenting occurs,
220
store the previous session URL in *OLD_SESSION_URL (so that if the
255
reparenting that session if necessary.
256
Store the previous session URL in *OLD_SESSION_URL (so that if the
221
257
reparenting is meant to be temporary, the caller can reparent the
222
session back to where it was); otherwise set *OLD_SESSION_URL to
258
session back to where it was).
225
260
If SESSION_URL is NULL, treat this as a magic value meaning "point
226
the RA session to the root of the repository". */
261
the RA session to the root of the repository".
263
NOTE: The typical usage pattern for this functions is:
265
const char *old_session_url;
266
SVN_ERR(svn_client__ensure_ra_session_url(&old_session_url,
273
SVN_ERR(svn_ra_reparent(ra_session, old_session_url, pool));
228
276
svn_client__ensure_ra_session_url(const char **old_session_url,
229
277
svn_ra_session_t *ra_session,
230
278
const char *session_url,
231
279
apr_pool_t *pool);
233
/* Set REPOS_ROOT, allocated in RESULT_POOL to the URL which represents
234
the root of the repository in with ABSPATH_OR_URL is versioned.
235
Use the authentication baton and working copy context cached in CTX as
238
Use SCRATCH_POOL for temporary allocations. */
240
svn_client__get_repos_root(const char **repos_root,
241
const char *abspath_or_url,
242
svn_client_ctx_t *ctx,
243
apr_pool_t *result_pool,
244
apr_pool_t *scratch_pool);
246
/* Return the path of ABSPATH_OR_URL relative to the repository root
247
(REPOS_ROOT) in REL_PATH (URI-decoded), both allocated in RESULT_POOL.
248
If INCLUDE_LEADING_SLASH is set, the returned result will have a leading
249
slash; otherwise, it will not.
251
The remaining parameters are used to procure the repository root.
252
Either REPOS_ROOT or RA_SESSION -- but not both -- may be NULL.
253
REPOS_ROOT should be passed when available as an optimization (in
254
that order of preference).
256
CAUTION: While having a leading slash on a so-called relative path
257
might work out well for functionality that interacts with
258
mergeinfo, it results in a relative path that cannot be naively
259
svn_path_join()'d with a repository root URL to provide a full URL.
261
Use SCRATCH_POOL for temporary allocations.
264
svn_client__path_relative_to_root(const char **rel_path,
265
svn_wc_context_t *wc_ctx,
266
const char *abspath_or_url,
267
const char *repos_root,
268
svn_boolean_t include_leading_slash,
269
svn_ra_session_t *ra_session,
270
apr_pool_t *result_pool,
271
apr_pool_t *scratch_pool);
273
/* A default error handler for use with svn_wc_walk_entries3(). Returns
276
svn_client__default_walker_error_handler(const char *path,
282
281
/* ---------------------------------------------------------------- */
284
284
/*** RA callbacks ***/
320
323
const char *base_url,
321
324
const char *base_dir_abspath,
322
325
const apr_array_header_t *commit_items,
323
svn_boolean_t use_admin,
324
svn_boolean_t read_only_wc,
325
svn_client_ctx_t *ctx,
330
/* ---------------------------------------------------------------- */
334
/* Verify that the path can be deleted without losing stuff,
335
i.e. ensure that there are no modified or unversioned resources
336
under PATH. This is similar to checking the output of the status
337
command. CTX is used for the client's config options. POOL is
338
used for all temporary allocations. */
339
svn_error_t * svn_client__can_delete(const char *path,
340
svn_client_ctx_t *ctx,
344
/* ---------------------------------------------------------------- */
326
svn_boolean_t write_dav_props,
327
svn_boolean_t read_dav_props,
328
svn_client_ctx_t *ctx,
329
apr_pool_t *result_pool,
330
apr_pool_t *scratch_pool);
334
svn_client__ra_provide_base(svn_stream_t **contents,
335
svn_revnum_t *revision,
337
const char *repos_relpath,
338
apr_pool_t *result_pool,
339
apr_pool_t *scratch_pool);
343
svn_client__ra_provide_props(apr_hash_t **props,
344
svn_revnum_t *revision,
346
const char *repos_relpath,
347
apr_pool_t *result_pool,
348
apr_pool_t *scratch_pool);
352
svn_client__ra_get_copysrc_kind(svn_node_kind_t *kind,
354
const char *repos_relpath,
355
svn_revnum_t src_revision,
356
apr_pool_t *scratch_pool);
360
svn_client__ra_make_cb_baton(svn_wc_context_t *wc_ctx,
361
apr_hash_t *relpath_map,
362
apr_pool_t *result_pool);
364
/* ---------------------------------------------------------------- */
346
367
/*** Add/delete ***/
348
/* Read automatic properties matching PATH from CTX->config.
349
Set *PROPERTIES to a hash containing propname/value pairs
350
(const char * keys mapping to svn_string_t * values), or if
351
auto-props are disabled, set *PROPERTIES to NULL.
352
Set *MIMETYPE to the mimetype, if any, or to NULL.
353
If MAGIC_COOKIE is not NULL and no mime-type can be determined
354
via CTX->config try to detect the mime-type with libmagic.
355
Allocate the hash table, keys, values, and mimetype in POOL. */
356
svn_error_t *svn_client__get_auto_props(apr_hash_t **properties,
357
const char **mimetype,
359
svn_magic__cookie_t *magic_cookie,
360
svn_client_ctx_t *ctx,
369
/* If AUTOPROPS is not null: Then read automatic properties matching PATH
370
from AUTOPROPS. AUTOPROPS is is a hash as per
371
svn_client__get_all_auto_props. Set *PROPERTIES to a hash containing
372
propname/value pairs (const char * keys mapping to svn_string_t * values).
374
If AUTOPROPS is null then set *PROPERTIES to an empty hash.
376
If *MIMETYPE is null or "application/octet-stream" then check AUTOPROPS
377
for a matching svn:mime-type. If AUTOPROPS is null or no match is found
378
and MAGIC_COOKIE is not NULL, then then try to detect the mime-type with
379
libmagic. If a mimetype is found then add it to *PROPERTIES and set
380
*MIMETYPE to the mimetype value or NULL otherwise.
382
Allocate the *PROPERTIES and its contents as well as *MIMETYPE, in
383
RESULT_POOL. Use SCRATCH_POOL for temporary allocations. */
384
svn_error_t *svn_client__get_paths_auto_props(
385
apr_hash_t **properties,
386
const char **mimetype,
388
svn_magic__cookie_t *magic_cookie,
389
apr_hash_t *autoprops,
390
svn_client_ctx_t *ctx,
391
apr_pool_t *result_pool,
392
apr_pool_t *scratch_pool);
394
/* Gather all auto-props from CTX->config (or none if auto-props are
395
disabled) and all svn:auto-props explicitly set on or inherited
398
If PATH_OR_URL is an unversioned WC path then gather the
399
svn:auto-props inherited by PATH_OR_URL's nearest versioned
402
If PATH_OR_URL is a URL ask for the properties @HEAD, if it is a WC
403
path as sfor the working properties.
405
Store both types of auto-props in *AUTOPROPS, a hash mapping const
406
char * file patterns to another hash which maps const char * property
407
names to const char *property values.
409
If a given property name exists for the same pattern in both the config
410
file and in an a svn:auto-props property, the latter overrides the
411
former. If a given property name exists for the same pattern in two
412
different inherited svn:auto-props, then the closer path-wise
413
property overrides the more distant. svn:auto-props explicitly set
414
on PATH_OR_URL have the highest precedence and override inherited props
415
and config file settings.
417
Allocate *AUTOPROPS in RESULT_POOL. Use SCRATCH_POOL for temporary
419
svn_error_t *svn_client__get_all_auto_props(apr_hash_t **autoprops,
420
const char *path_or_url,
421
svn_client_ctx_t *ctx,
422
apr_pool_t *result_pool,
423
apr_pool_t *scratch_pool);
425
/* Get a list of ignore patterns defined by the svn:global-ignores
426
properties set on, or inherited by, PATH_OR_URL. Store the collected
427
patterns as const char * elements in the array *IGNORES. Allocate
428
*IGNORES and its contents in RESULT_POOL. Use SCRATCH_POOL for
429
temporary allocations. */
430
svn_error_t *svn_client__get_inherited_ignores(apr_array_header_t **ignores,
431
const char *path_or_url,
432
svn_client_ctx_t *ctx,
433
apr_pool_t *result_pool,
434
apr_pool_t *scratch_pool);
364
436
/* The main logic for client deletion from a working copy. Deletes PATH
365
437
from CTX->WC_CTX. If PATH (or any item below a directory PATH) is
533
616
apr_pool_t *pool);
535
618
/* ---------------------------------------------------------------- */
621
/*** Inheritable Properties ***/
623
/* Convert any svn_prop_inherited_item_t elements in INHERITED_PROPS which
624
have repository root relative path PATH_OR_URL structure members to URLs
625
using REPOS_ROOT_URL. Changes to the contents of INHERITED_PROPS are
626
allocated in RESULT_POOL. SCRATCH_POOL is used for temporary
629
svn_client__iprop_relpaths_to_urls(apr_array_header_t *inherited_props,
630
const char *repos_root_url,
631
apr_pool_t *result_pool,
632
apr_pool_t *scratch_pool);
634
/* Fetch the inherited properties for the base of LOCAL_ABSPATH as well
635
as any WC roots under LOCAL_ABSPATH (as limited by DEPTH) using
636
RA_SESSION. Store the results in *WCROOT_IPROPS, a hash mapping
637
const char * absolute working copy paths to depth-first ordered arrays
638
of svn_prop_inherited_item_t * structures.
640
Any svn_prop_inherited_item_t->path_or_url members returned in
641
*WCROOT_IPROPS are repository relative paths.
643
If LOCAL_ABSPATH has no base then do nothing.
645
RA_SESSION should be an open RA session pointing at the URL of PATH,
646
or NULL, in which case this function will use its own temporary session.
648
Allocate *WCROOT_IPROPS in RESULT_POOL, use SCRATCH_POOL for temporary
651
If one or more of the paths are not available in the repository at the
652
specified revision, these paths will not be added to the hashtable.
655
svn_client__get_inheritable_props(apr_hash_t **wcroot_iprops,
656
const char *local_abspath,
657
svn_revnum_t revision,
659
svn_ra_session_t *ra_session,
660
svn_client_ctx_t *ctx,
661
apr_pool_t *result_pool,
662
apr_pool_t *scratch_pool);
664
/* ---------------------------------------------------------------- */
537
667
/*** Editor for repository diff ***/
539
669
/* Create an editor for a pure repository comparison, i.e. comparing one
540
670
repository version against the other.
542
TARGET is a working-copy path, the base of the hierarchy to be
543
compared. It corresponds to the URL opened in RA_SESSION below.
545
WC_CTX is a context for the working copy and should be NULL for
546
operations that do not involve a working copy.
548
DIFF_CMD/DIFF_CMD_BATON represent the callback and callback argument that
549
implement the file comparison function
672
DIFF_CALLBACKS/DIFF_CMD_BATON represent the callback that implements
551
675
DEPTH is the depth to recurse.
553
DRY_RUN is set if this is a dry-run merge. It is not relevant for diff.
555
RA_SESSION defines the additional RA session for requesting file
558
REVISION is the start revision in the comparison.
560
If NOTIFY_FUNC is non-null, invoke it with NOTIFY_BATON for each
561
file and directory operated on during the edit.
563
EDITOR/EDIT_BATON return the newly created editor and baton. */
677
RA_SESSION is an RA session through which this editor may fetch
678
properties, file contents and directory listings of the 'old' side of the
679
diff. It is a separate RA session from the one through which this editor
680
is being driven. REVISION is the revision number of the 'old' side of
683
If TEXT_DELTAS is FALSE, then do not expect text deltas from the edit
684
drive, nor send the 'before' and 'after' texts to the diff callbacks;
685
instead, send empty files to the diff callbacks if there was a change.
686
This must be FALSE if the edit producer is not sending text deltas,
687
otherwise the file content checksum comparisons will fail.
689
EDITOR/EDIT_BATON return the newly created editor and baton.
565
svn_client__get_diff_editor(const svn_delta_editor_t **editor,
567
svn_wc_context_t *wc_ctx,
570
svn_ra_session_t *ra_session,
571
svn_revnum_t revision,
572
svn_boolean_t walk_deleted_dirs,
573
svn_boolean_t dry_run,
574
const svn_wc_diff_callbacks4_t *diff_callbacks,
575
void *diff_cmd_baton,
576
svn_cancel_func_t cancel_func,
578
svn_wc_notify_func2_t notify_func,
580
apr_pool_t *result_pool,
581
apr_pool_t *scratch_pool);
694
svn_client__get_diff_editor2(const svn_delta_editor_t **editor,
696
svn_ra_session_t *ra_session,
698
svn_revnum_t revision,
699
svn_boolean_t text_deltas,
700
const svn_diff_tree_processor_t *processor,
701
svn_cancel_func_t cancel_func,
703
apr_pool_t *result_pool);
584
705
/* ---------------------------------------------------------------- */
586
708
/*** Editor for diff summary ***/
588
/* Create an editor for a repository diff summary, i.e. comparing one
589
repository version against the other and only providing information
590
about the changed items without the text deltas.
592
TARGET is the target of the diff, relative to the root of the edit.
594
SUMMARIZE_FUNC is called with SUMMARIZE_BATON as parameter by the
595
created svn_delta_editor_t for each changed item.
597
See svn_client__get_diff_editor() for a description of the other
600
svn_client__get_diff_summarize_editor(const char *target,
601
svn_client_diff_summarize_func_t
603
void *summarize_baton,
604
svn_ra_session_t *ra_session,
605
svn_revnum_t revision,
606
svn_cancel_func_t cancel_func,
608
const svn_delta_editor_t **editor,
612
710
/* Set *CALLBACKS and *CALLBACK_BATON to a set of diff callbacks that will
613
711
report a diff summary, i.e. only providing information about the changed
614
712
items without the text deltas.
940
1052
svn_depth_t requested_depth,
941
1053
const char *native_eol,
942
1054
svn_boolean_t ignore_keywords,
943
svn_boolean_t *timestamp_sleep,
944
1055
svn_client_ctx_t *ctx,
945
1056
apr_pool_t *pool);
948
/* Perform status operations on each external in EXTERNAL_MAP, a const char *
949
local_abspath of all externals mapping to the const char* defining_abspath.
950
All other options are the same as those passed to svn_client_status().
952
If ANCHOR_ABSPATH and ANCHOR-RELPATH are not null, use them to provide
953
properly formatted relative paths
956
svn_client__do_external_status(svn_client_ctx_t *ctx,
957
apr_hash_t *external_map,
959
svn_boolean_t get_all,
960
svn_boolean_t update,
961
svn_boolean_t no_ignore,
962
const char *anchor_abspath,
963
const char *anchor_relpath,
964
svn_client_status_func_t status_func,
966
apr_pool_t *scratch_pool);
968
/* Baton type for svn_wc__external_info_gatherer(). */
969
typedef struct svn_client__external_func_baton_t
971
apr_hash_t *externals_old; /* Hash of old externals property values,
972
or NULL if the caller doesn't care. */
973
apr_hash_t *externals_new; /* Hash of new externals property values,
974
or NULL if the caller doesn't care. */
975
apr_hash_t *ambient_depths; /* Hash of ambient depth values, or NULL
976
if the caller doesn't care. */
977
apr_pool_t *result_pool; /* Pool to use for all stored values. */
979
} svn_client__external_func_baton_t;
982
/* This function gets invoked whenever external changes are encountered.
983
This implements the `svn_wc_external_update_t' interface, and can
984
be used with an svn_client__external_func_baton_t BATON to gather
985
information about changes to externals definitions. */
987
svn_client__external_info_gatherer(void *baton,
988
const char *local_abspath,
989
const svn_string_t *old_val,
990
const svn_string_t *new_val,
992
apr_pool_t *scratch_pool);
994
1058
/* Baton for svn_client__dirent_fetcher */
995
1059
struct svn_client__dirent_fetcher_baton_t