1 /** 2 * @copyright 3 * ==================================================================== 4 * Licensed to the Apache Software Foundation (ASF) under one 5 * or more contributor license agreements. See the NOTICE file 6 * distributed with this work for additional information 7 * regarding copyright ownership. The ASF licenses this file 8 * to you under the Apache License, Version 2.0 (the 9 * "License"); you may not use this file except in compliance 10 * with the License. You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, 15 * software distributed under the License is distributed on an 16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 * KIND, either express or implied. See the License for the 18 * specific language governing permissions and limitations 19 * under the License. 20 * ==================================================================== 21 * @endcopyright 22 * 23 * @file svn_client.h 24 * @brief Subversion's client library 25 * 26 * Requires: The working copy library and repository access library. 27 * Provides: Broad wrappers around working copy library functionality. 28 * Used By: Client programs. 29 */ 30 31 #ifndef SVN_CLIENT_H 32 #define SVN_CLIENT_H 33 34 #include <apr.h> 35 #include <apr_pools.h> 36 #include <apr_hash.h> 37 #include <apr_tables.h> 38 #include <apr_getopt.h> 39 #include <apr_file_io.h> 40 #include <apr_time.h> 41 42 #include "svn_types.h" 43 #include "svn_string.h" 44 #include "svn_wc.h" 45 #include "svn_opt.h" 46 #include "svn_ra.h" 47 #include "svn_diff.h" 48 #include "svn_auth.h" 49 50 #ifdef __cplusplus 51 extern "C" { 52 #endif /* __cplusplus */ 53 54 55 56 /** 57 * Get libsvn_client version information. 58 * 59 * @since New in 1.1. 60 */ 61 const svn_version_t * 62 svn_client_version(void); 63 64 /** Client supporting functions 65 * 66 * @defgroup clnt_support Client supporting subsystem 67 * 68 * @{ 69 */ 70 71 72 /*** Authentication stuff ***/ 73 74 /** The new authentication system allows the RA layer to "pull" 75 * information as needed from libsvn_client. 76 * 77 * @deprecated Replaced by the svn_auth_* functions. 78 * @see auth_fns 79 * 80 * @defgroup auth_fns_depr (deprecated) AuthZ client subsystem 81 * 82 * @{ 83 */ 84 85 /** Create and return @a *provider, an authentication provider of type 86 * svn_auth_cred_simple_t that gets information by prompting the user 87 * with @a prompt_func and @a prompt_baton. Allocate @a *provider in 88 * @a pool. 89 * 90 * If both #SVN_AUTH_PARAM_DEFAULT_USERNAME and 91 * #SVN_AUTH_PARAM_DEFAULT_PASSWORD are defined as runtime 92 * parameters in the @c auth_baton, then @a *provider will return the 93 * default arguments when svn_auth_first_credentials() is called. If 94 * svn_auth_first_credentials() fails, then @a *provider will 95 * re-prompt @a retry_limit times (via svn_auth_next_credentials()). 96 * For infinite retries, set @a retry_limit to value less than 0. 97 * 98 * @deprecated Provided for backward compatibility with the 1.3 API. 99 * Use svn_auth_get_simple_prompt_provider() instead. 100 */ 101 SVN_DEPRECATED 102 void 103 svn_client_get_simple_prompt_provider( 104 svn_auth_provider_object_t **provider, 105 svn_auth_simple_prompt_func_t prompt_func, 106 void *prompt_baton, 107 int retry_limit, 108 apr_pool_t *pool); 109 110 111 /** Create and return @a *provider, an authentication provider of type 112 * #svn_auth_cred_username_t that gets information by prompting the 113 * user with @a prompt_func and @a prompt_baton. Allocate @a *provider 114 * in @a pool. 115 * 116 * If #SVN_AUTH_PARAM_DEFAULT_USERNAME is defined as a runtime 117 * parameter in the @c auth_baton, then @a *provider will return the 118 * default argument when svn_auth_first_credentials() is called. If 119 * svn_auth_first_credentials() fails, then @a *provider will 120 * re-prompt @a retry_limit times (via svn_auth_next_credentials()). 121 * For infinite retries, set @a retry_limit to value less than 0. 122 * 123 * @deprecated Provided for backward compatibility with the 1.3 API. 124 * Use svn_auth_get_username_prompt_provider() instead. 125 */ 126 SVN_DEPRECATED 127 void 128 svn_client_get_username_prompt_provider( 129 svn_auth_provider_object_t **provider, 130 svn_auth_username_prompt_func_t prompt_func, 131 void *prompt_baton, 132 int retry_limit, 133 apr_pool_t *pool); 134 135 136 /** Create and return @a *provider, an authentication provider of type 137 * #svn_auth_cred_simple_t that gets/sets information from the user's 138 * ~/.subversion configuration directory. Allocate @a *provider in 139 * @a pool. 140 * 141 * If a default username or password is available, @a *provider will 142 * honor them as well, and return them when 143 * svn_auth_first_credentials() is called. (see 144 * #SVN_AUTH_PARAM_DEFAULT_USERNAME and #SVN_AUTH_PARAM_DEFAULT_PASSWORD). 145 * 146 * @deprecated Provided for backward compatibility with the 1.3 API. 147 * Use svn_auth_get_simple_provider2() instead. 148 */ 149 SVN_DEPRECATED 150 void 151 svn_client_get_simple_provider(svn_auth_provider_object_t **provider, 152 apr_pool_t *pool); 153 154 155 #if (defined(WIN32) && !defined(__MINGW32__)) || defined(DOXYGEN) || defined(CTYPESGEN) || defined(SWIG) 156 /** 157 * Create and return @a *provider, an authentication provider of type 158 * #svn_auth_cred_simple_t that gets/sets information from the user's 159 * ~/.subversion configuration directory. Allocate @a *provider in 160 * @a pool. 161 * 162 * This is like svn_client_get_simple_provider(), except that, when 163 * running on Window 2000 or newer (or any other Windows version that 164 * includes the CryptoAPI), the provider encrypts the password before 165 * storing it to disk. On earlier versions of Windows, the provider 166 * does nothing. 167 * 168 * @since New in 1.2. 169 * @note This function is only available on Windows. 170 * 171 * @note An administrative password reset may invalidate the account's 172 * secret key. This function will detect that situation and behave as 173 * if the password were not cached at all. 174 * 175 * @deprecated Provided for backward compatibility with the 1.3 API. 176 * Use svn_auth_get_windows_simple_provider() instead. 177 */ 178 SVN_DEPRECATED 179 void 180 svn_client_get_windows_simple_provider(svn_auth_provider_object_t **provider, 181 apr_pool_t *pool); 182 #endif /* WIN32 && !__MINGW32__ || DOXYGEN || CTYPESGEN || SWIG */ 183 184 /** Create and return @a *provider, an authentication provider of type 185 * #svn_auth_cred_username_t that gets/sets information from a user's 186 * ~/.subversion configuration directory. Allocate @a *provider in 187 * @a pool. 188 * 189 * If a default username is available, @a *provider will honor it, 190 * and return it when svn_auth_first_credentials() is called. (see 191 * #SVN_AUTH_PARAM_DEFAULT_USERNAME). 192 * 193 * @deprecated Provided for backward compatibility with the 1.3 API. 194 * Use svn_auth_get_username_provider() instead. 195 */ 196 SVN_DEPRECATED 197 void 198 svn_client_get_username_provider(svn_auth_provider_object_t **provider, 199 apr_pool_t *pool); 200 201 202 /** Create and return @a *provider, an authentication provider of type 203 * #svn_auth_cred_ssl_server_trust_t, allocated in @a pool. 204 * 205 * @a *provider retrieves its credentials from the configuration 206 * mechanism. The returned credential is used to override SSL 207 * security on an error. 208 * 209 * @deprecated Provided for backward compatibility with the 1.3 API. 210 * Use svn_auth_get_ssl_server_trust_file_provider() instead. 211 */ 212 SVN_DEPRECATED 213 void 214 svn_client_get_ssl_server_trust_file_provider( 215 svn_auth_provider_object_t **provider, 216 apr_pool_t *pool); 217 218 219 /** Create and return @a *provider, an authentication provider of type 220 * #svn_auth_cred_ssl_client_cert_t, allocated in @a pool. 221 * 222 * @a *provider retrieves its credentials from the configuration 223 * mechanism. The returned credential is used to load the appropriate 224 * client certificate for authentication when requested by a server. 225 * 226 * @deprecated Provided for backward compatibility with the 1.3 API. 227 * Use svn_auth_get_ssl_client_cert_file_provider() instead. 228 */ 229 SVN_DEPRECATED 230 void 231 svn_client_get_ssl_client_cert_file_provider( 232 svn_auth_provider_object_t **provider, 233 apr_pool_t *pool); 234 235 236 /** Create and return @a *provider, an authentication provider of type 237 * #svn_auth_cred_ssl_client_cert_pw_t, allocated in @a pool. 238 * 239 * @a *provider retrieves its credentials from the configuration 240 * mechanism. The returned credential is used when a loaded client 241 * certificate is protected by a passphrase. 242 * 243 * @deprecated Provided for backward compatibility with the 1.3 API. 244 * Use svn_auth_get_ssl_client_cert_pw_file_provider2() instead. 245 */ 246 SVN_DEPRECATED 247 void 248 svn_client_get_ssl_client_cert_pw_file_provider( 249 svn_auth_provider_object_t **provider, 250 apr_pool_t *pool); 251 252 253 /** Create and return @a *provider, an authentication provider of type 254 * #svn_auth_cred_ssl_server_trust_t, allocated in @a pool. 255 * 256 * @a *provider retrieves its credentials by using the @a prompt_func 257 * and @a prompt_baton. The returned credential is used to override 258 * SSL security on an error. 259 * 260 * @deprecated Provided for backward compatibility with the 1.3 API. 261 * Use svn_auth_get_ssl_server_trust_prompt_provider() instead. 262 */ 263 SVN_DEPRECATED 264 void 265 svn_client_get_ssl_server_trust_prompt_provider( 266 svn_auth_provider_object_t **provider, 267 svn_auth_ssl_server_trust_prompt_func_t prompt_func, 268 void *prompt_baton, 269 apr_pool_t *pool); 270 271 272 /** Create and return @a *provider, an authentication provider of type 273 * #svn_auth_cred_ssl_client_cert_t, allocated in @a pool. 274 * 275 * @a *provider retrieves its credentials by using the @a prompt_func 276 * and @a prompt_baton. The returned credential is used to load the 277 * appropriate client certificate for authentication when requested by 278 * a server. The prompt will be retried @a retry_limit times. 279 * For infinite retries, set @a retry_limit to value less than 0. 280 * 281 * @deprecated Provided for backward compatibility with the 1.3 API. 282 * Use svn_auth_get_ssl_client_cert_prompt_provider() instead. 283 */ 284 SVN_DEPRECATED 285 void 286 svn_client_get_ssl_client_cert_prompt_provider( 287 svn_auth_provider_object_t **provider, 288 svn_auth_ssl_client_cert_prompt_func_t prompt_func, 289 void *prompt_baton, 290 int retry_limit, 291 apr_pool_t *pool); 292 293 294 /** Create and return @a *provider, an authentication provider of type 295 * #svn_auth_cred_ssl_client_cert_pw_t, allocated in @a pool. 296 * 297 * @a *provider retrieves its credentials by using the @a prompt_func 298 * and @a prompt_baton. The returned credential is used when a loaded 299 * client certificate is protected by a passphrase. The prompt will 300 * be retried @a retry_limit times. For infinite retries, set @a retry_limit 301 * to value less than 0. 302 * 303 * @deprecated Provided for backward compatibility with the 1.3 API. 304 * Use svn_auth_get_ssl_client_cert_pw_prompt_provider() instead. 305 */ 306 SVN_DEPRECATED 307 void 308 svn_client_get_ssl_client_cert_pw_prompt_provider( 309 svn_auth_provider_object_t **provider, 310 svn_auth_ssl_client_cert_pw_prompt_func_t prompt_func, 311 void *prompt_baton, 312 int retry_limit, 313 apr_pool_t *pool); 314 315 /** @} */ 316 317 /** 318 * Revisions and Peg Revisions 319 * 320 * @defgroup clnt_revisions Revisions and Peg Revisions 321 * 322 * A brief word on operative and peg revisions. 323 * 324 * If the kind of the peg revision is #svn_opt_revision_unspecified, then it 325 * defaults to #svn_opt_revision_head for URLs and #svn_opt_revision_working 326 * for local paths. 327 * 328 * For deeper insight, please see the 329 * <a href="http://svnbook.red-bean.com/nightly/en/svn.advanced.pegrevs.html"> 330 * Peg and Operative Revisions</a> section of the Subversion Book. 331 */ 332 333 /** 334 * Commit operations 335 * 336 * @defgroup clnt_commit Client commit subsystem 337 * 338 * @{ 339 */ 340 341 /** This is a structure which stores a filename and a hash of property 342 * names and values. 343 * 344 * @deprecated Provided for backward compatibility with the 1.4 API. 345 */ 346 typedef struct svn_client_proplist_item_t 347 { 348 /** The name of the node on which these properties are set. */ 349 svn_stringbuf_t *node_name; 350 351 /** A hash of (const char *) property names, and (svn_string_t *) property 352 * values. */ 353 apr_hash_t *prop_hash; 354 355 } svn_client_proplist_item_t; 356 357 /** 358 * The callback invoked by svn_client_proplist4(). Each invocation 359 * provides the regular and/or inherited properties of @a path, which is 360 * either a working copy path or a URL. If @a prop_hash is not @c NULL, then 361 * it maps explicit <tt>const char *</tt> property names to 362 * <tt>svn_string_t *</tt> explicit property values. If @a inherited_props 363 * is not @c NULL, then it is a depth-first ordered array of 364 * #svn_prop_inherited_item_t * structures representing the 365 * properties inherited by @a path. Use @a scratch_pool for all temporary 366 * allocations. 367 * 368 * The #svn_prop_inherited_item_t->path_or_url members of the 369 * #svn_prop_inherited_item_t * structures in @a inherited_props are 370 * URLs if @a path is a URL or if @a path is a working copy path but the 371 * property represented by the structure is above the working copy root (i.e. 372 * the inherited property is from the cache). In all other cases the 373 * #svn_prop_inherited_item_t->path_or_url members are absolute working copy 374 * paths. 375 * 376 * @since New in 1.8. 377 */ 378 typedef svn_error_t *(*svn_proplist_receiver2_t)( 379 void *baton, 380 const char *path, 381 apr_hash_t *prop_hash, 382 apr_array_header_t *inherited_props, 383 apr_pool_t *scratch_pool); 384 385 /** 386 * Similar to #svn_proplist_receiver2_t, but doesn't return inherited 387 * properties. 388 * 389 * @deprecated Provided for backward compatibility with the 1.7 API. 390 * 391 * @since New in 1.5. 392 */ 393 typedef svn_error_t *(*svn_proplist_receiver_t)( 394 void *baton, 395 const char *path, 396 apr_hash_t *prop_hash, 397 apr_pool_t *pool); 398 399 /** 400 * Return a duplicate of @a item, allocated in @a pool. No part of the new 401 * structure will be shared with @a item. 402 * 403 * @since New in 1.3. 404 * 405 * @deprecated Provided for backward compatibility with the 1.4 API. 406 */ 407 SVN_DEPRECATED 408 svn_client_proplist_item_t * 409 svn_client_proplist_item_dup(const svn_client_proplist_item_t *item, 410 apr_pool_t *pool); 411 412 /** Information about commits passed back to client from this module. 413 * 414 * @deprecated Provided for backward compatibility with the 1.2 API. 415 */ 416 typedef struct svn_client_commit_info_t 417 { 418 /** just-committed revision. */ 419 svn_revnum_t revision; 420 421 /** server-side date of the commit. */ 422 const char *date; 423 424 /** author of the commit. */ 425 const char *author; 426 427 } svn_client_commit_info_t; 428 429 430 /** 431 * @name Commit state flags 432 * @brief State flags for use with the #svn_client_commit_item3_t structure 433 * (see the note about the namespace for that structure, which also 434 * applies to these flags). 435 * @{ 436 */ 437 #define SVN_CLIENT_COMMIT_ITEM_ADD 0x01 438 #define SVN_CLIENT_COMMIT_ITEM_DELETE 0x02 439 #define SVN_CLIENT_COMMIT_ITEM_TEXT_MODS 0x04 440 #define SVN_CLIENT_COMMIT_ITEM_PROP_MODS 0x08 441 #define SVN_CLIENT_COMMIT_ITEM_IS_COPY 0x10 442 /** One of the flags for a commit item. The node has a lock token that 443 * should be released after a successful commit and, if the node is also 444 * modified, transferred to the server as part of the commit process. 445 * 446 * @since New in 1.2. */ 447 #define SVN_CLIENT_COMMIT_ITEM_LOCK_TOKEN 0x20 448 /** One of the flags for a commit item. The node is the 'moved here' 449 * side of a local move. This is used to check and enforce that the 450 * other side of the move is also included in the commit. 451 * 452 * @since New in 1.8. */ 453 #define SVN_CLIENT_COMMIT_ITEM_MOVED_HERE 0x40 454 /** @} */ 455 456 /** The commit candidate structure. 457 * 458 * In order to avoid backwards compatibility problems clients should use 459 * svn_client_commit_item3_create() to allocate and initialize this 460 * structure instead of doing so themselves. 461 * 462 * @since New in 1.5. 463 */ 464 typedef struct svn_client_commit_item3_t 465 { 466 /* IMPORTANT: If you extend this structure, add new fields to the end. */ 467 468 /** absolute working-copy path of item. Always set during normal commits 469 * (and copies from a working copy) to the repository. Can only be NULL 470 * when stub commit items are created for operations that only involve 471 * direct repository operations. During WC->REPOS copy operations, this 472 * path is the WC source path of the operation. */ 473 const char *path; 474 475 /** node kind (dir, file) */ 476 svn_node_kind_t kind; 477 478 /** commit URL for this item. Points to the repository location of PATH 479 * during commits, or to the final URL of the item when copying from the 480 * working copy to the repository. */ 481 const char *url; 482 483 /** revision of textbase */ 484 svn_revnum_t revision; 485 486 /** copyfrom-url or NULL if not a copied item */ 487 const char *copyfrom_url; 488 489 /** copyfrom-rev, valid when copyfrom_url != NULL */ 490 svn_revnum_t copyfrom_rev; 491 492 /** state flags */ 493 apr_byte_t state_flags; 494 495 /** An array of #svn_prop_t *'s, which are incoming changes from 496 * the repository to WC properties. These changes are applied 497 * post-commit. 498 * 499 * When adding to this array, allocate the #svn_prop_t and its 500 * contents in @c incoming_prop_changes->pool, so that it has the 501 * same lifetime as this data structure. 502 * 503 * See http://subversion.tigris.org/issues/show_bug.cgi?id=806 for a 504 * description of what would happen if the post-commit process 505 * didn't group these changes together with all other changes to the 506 * item. 507 */ 508 apr_array_header_t *incoming_prop_changes; 509 510 /** An array of #svn_prop_t *'s, which are outgoing changes to 511 * make to properties in the repository. These extra property 512 * changes are declared pre-commit, and applied to the repository as 513 * part of a commit. 514 * 515 * When adding to this array, allocate the #svn_prop_t and its 516 * contents in @c outgoing_prop_changes->pool, so that it has the 517 * same lifetime as this data structure. 518 */ 519 apr_array_header_t *outgoing_prop_changes; 520 521 /** 522 * When processing the commit this contains the relative path for 523 * the commit session. #NULL until the commit item is preprocessed. 524 * @since New in 1.7. 525 */ 526 const char *session_relpath; 527 528 /** 529 * When committing a move, this contains the absolute path where 530 * the node was directly moved from. (If an ancestor at the original 531 * location was moved then it points to where the node itself was 532 * moved from; not the original location.) 533 * @since New in 1.8. 534 */ 535 const char *moved_from_abspath; 536 537 } svn_client_commit_item3_t; 538 539 /** The commit candidate structure. 540 * 541 * @deprecated Provided for backward compatibility with the 1.4 API. 542 */ 543 typedef struct svn_client_commit_item2_t 544 { 545 /** absolute working-copy path of item */ 546 const char *path; 547 548 /** node kind (dir, file) */ 549 svn_node_kind_t kind; 550 551 /** commit URL for this item */ 552 const char *url; 553 554 /** revision of textbase */ 555 svn_revnum_t revision; 556 557 /** copyfrom-url or NULL if not a copied item */ 558 const char *copyfrom_url; 559 560 /** copyfrom-rev, valid when copyfrom_url != NULL */ 561 svn_revnum_t copyfrom_rev; 562 563 /** state flags */ 564 apr_byte_t state_flags; 565 566 /** Analogous to the #svn_client_commit_item3_t.incoming_prop_changes 567 * field. 568 */ 569 apr_array_header_t *wcprop_changes; 570 } svn_client_commit_item2_t; 571 572 /** The commit candidate structure. 573 * 574 * @deprecated Provided for backward compatibility with the 1.2 API. 575 */ 576 typedef struct svn_client_commit_item_t 577 { 578 /** absolute working-copy path of item */ 579 const char *path; 580 581 /** node kind (dir, file) */ 582 svn_node_kind_t kind; 583 584 /** commit URL for this item */ 585 const char *url; 586 587 /** revision (copyfrom-rev if _IS_COPY) */ 588 svn_revnum_t revision; 589 590 /** copyfrom-url */ 591 const char *copyfrom_url; 592 593 /** state flags */ 594 apr_byte_t state_flags; 595 596 /** Analogous to the #svn_client_commit_item3_t.incoming_prop_changes 597 * field. 598 */ 599 apr_array_header_t *wcprop_changes; 600 601 } svn_client_commit_item_t; 602 603 /** Return a new commit item object, allocated in @a pool. 604 * 605 * In order to avoid backwards compatibility problems, this function 606 * is used to initialize and allocate the #svn_client_commit_item3_t 607 * structure rather than doing so explicitly, as the size of this 608 * structure may change in the future. 609 * 610 * @since New in 1.6. 611 */ 612 svn_client_commit_item3_t * 613 svn_client_commit_item3_create(apr_pool_t *pool); 614 615 /** Like svn_client_commit_item3_create() but with a stupid "const" 616 * qualifier on the returned structure, and it returns an error that 617 * will never happen. 618 * 619 * @deprecated Provided for backward compatibility with the 1.5 API. 620 */ 621 SVN_DEPRECATED 622 svn_error_t * 623 svn_client_commit_item_create(const svn_client_commit_item3_t **item, 624 apr_pool_t *pool); 625 626 /** 627 * Return a duplicate of @a item, allocated in @a pool. No part of the 628 * new structure will be shared with @a item, except for the adm_access 629 * member. 630 * 631 * @since New in 1.5. 632 */ 633 svn_client_commit_item3_t * 634 svn_client_commit_item3_dup(const svn_client_commit_item3_t *item, 635 apr_pool_t *pool); 636 637 /** 638 * Return a duplicate of @a item, allocated in @a pool. No part of the new 639 * structure will be shared with @a item. 640 * 641 * @deprecated Provided for backward compatibility with the 1.4 API. 642 */ 643 SVN_DEPRECATED 644 svn_client_commit_item2_t * 645 svn_client_commit_item2_dup(const svn_client_commit_item2_t *item, 646 apr_pool_t *pool); 647 648 /** Callback type used by commit-y operations to get a commit log message 649 * from the caller. 650 * 651 * Set @a *log_msg to the log message for the commit, allocated in @a 652 * pool, or @c NULL if wish to abort the commit process. Set @a *tmp_file 653 * to the path of any temporary file which might be holding that log 654 * message, or @c NULL if no such file exists (though, if @a *log_msg is 655 * @c NULL, this value is undefined). The log message MUST be a UTF8 656 * string with LF line separators. 657 * 658 * @a commit_items is a read-only array of #svn_client_commit_item3_t 659 * structures, which may be fully or only partially filled-in, 660 * depending on the type of commit operation. 661 * 662 * @a baton is provided along with the callback for use by the handler. 663 * 664 * All allocations should be performed in @a pool. 665 * 666 * @since New in 1.5. 667 */ 668 typedef svn_error_t *(*svn_client_get_commit_log3_t)( 669 const char **log_msg, 670 const char **tmp_file, 671 const apr_array_header_t *commit_items, 672 void *baton, 673 apr_pool_t *pool); 674 675 /** Callback type used by commit-y operations to get a commit log message 676 * from the caller. 677 * 678 * Set @a *log_msg to the log message for the commit, allocated in @a 679 * pool, or @c NULL if wish to abort the commit process. Set @a *tmp_file 680 * to the path of any temporary file which might be holding that log 681 * message, or @c NULL if no such file exists (though, if @a *log_msg is 682 * @c NULL, this value is undefined). The log message MUST be a UTF8 683 * string with LF line separators. 684 * 685 * @a commit_items is a read-only array of #svn_client_commit_item2_t 686 * structures, which may be fully or only partially filled-in, 687 * depending on the type of commit operation. 688 * 689 * @a baton is provided along with the callback for use by the handler. 690 * 691 * All allocations should be performed in @a pool. 692 * 693 * @deprecated Provided for backward compatibility with the 1.3 API. 694 */ 695 typedef svn_error_t *(*svn_client_get_commit_log2_t)( 696 const char **log_msg, 697 const char **tmp_file, 698 const apr_array_header_t *commit_items, 699 void *baton, 700 apr_pool_t *pool); 701 702 /** Callback type used by commit-y operations to get a commit log message 703 * from the caller. 704 * 705 * Set @a *log_msg to the log message for the commit, allocated in @a 706 * pool, or @c NULL if wish to abort the commit process. Set @a *tmp_file 707 * to the path of any temporary file which might be holding that log 708 * message, or @c NULL if no such file exists (though, if @a *log_msg is 709 * @c NULL, this value is undefined). The log message MUST be a UTF8 710 * string with LF line separators. 711 * 712 * @a commit_items is a read-only array of #svn_client_commit_item_t 713 * structures, which may be fully or only partially filled-in, 714 * depending on the type of commit operation. 715 * 716 * @a baton is provided along with the callback for use by the handler. 717 * 718 * All allocations should be performed in @a pool. 719 * 720 * @deprecated Provided for backward compatibility with the 1.2 API. 721 */ 722 typedef svn_error_t *(*svn_client_get_commit_log_t)( 723 const char **log_msg, 724 const char **tmp_file, 725 apr_array_header_t *commit_items, 726 void *baton, 727 apr_pool_t *pool); 728 729 /** @} */ 730 731 /** 732 * Client blame 733 * 734 * @defgroup clnt_blame Client blame functionality 735 * 736 * @{ 737 */ 738 739 /** Callback type used by svn_client_blame5() to notify the caller 740 * that line @a line_no of the blamed file was last changed in @a revision 741 * which has the revision properties @a rev_props, and that the contents were 742 * @a line. 743 * 744 * @a start_revnum and @a end_revnum contain the start and end revision 745 * number of the entire blame operation, as determined from the repository 746 * inside svn_client_blame5(). This can be useful for the blame receiver 747 * to format the blame output. 748 * 749 * If svn_client_blame5() was called with @a include_merged_revisions set to 750 * TRUE, @a merged_revision, @a merged_rev_props and @a merged_path will be 751 * set, otherwise they will be NULL. @a merged_path will be set to the 752 * absolute repository path. 753 * 754 * All allocations should be performed in @a pool. 755 * 756 * @note If there is no blame information for this line, @a revision will be 757 * invalid and @a rev_props will be NULL. In this case @a local_change 758 * will be true if the reason there is no blame information is that the line 759 * was modified locally. In all other cases @a local_change will be false. 760 * 761 * @since New in 1.7. 762 */ 763 typedef svn_error_t *(*svn_client_blame_receiver3_t)( 764 void *baton, 765 svn_revnum_t start_revnum, 766 svn_revnum_t end_revnum, 767 apr_int64_t line_no, 768 svn_revnum_t revision, 769 apr_hash_t *rev_props, 770 svn_revnum_t merged_revision, 771 apr_hash_t *merged_rev_props, 772 const char *merged_path, 773 const char *line, 774 svn_boolean_t local_change, 775 apr_pool_t *pool); 776 777 /** 778 * Similar to #svn_client_blame_receiver3_t, but with separate author and 779 * date revision properties instead of all revision properties, and without 780 * information about local changes. 781 * 782 * @deprecated Provided for backward compatibility with the 1.6 API. 783 * 784 * @since New in 1.5. 785 */ 786 typedef svn_error_t *(*svn_client_blame_receiver2_t)( 787 void *baton, 788 apr_int64_t line_no, 789 svn_revnum_t revision, 790 const char *author, 791 const char *date, 792 svn_revnum_t merged_revision, 793 const char *merged_author, 794 const char *merged_date, 795 const char *merged_path, 796 const char *line, 797 apr_pool_t *pool); 798 799 /** 800 * Similar to #svn_client_blame_receiver2_t, but without @a merged_revision, 801 * @a merged_author, @a merged_date, or @a merged_path members. 802 * 803 * @note New in 1.4 is that the line is defined to contain only the line 804 * content (and no [partial] EOLs; which was undefined in older versions). 805 * Using this callback with svn_client_blame() or svn_client_blame2() 806 * will still give you the old behaviour. 807 * 808 * @deprecated Provided for backward compatibility with the 1.4 API. 809 */ 810 typedef svn_error_t *(*svn_client_blame_receiver_t)( 811 void *baton, 812 apr_int64_t line_no, 813 svn_revnum_t revision, 814 const char *author, 815 const char *date, 816 const char *line, 817 apr_pool_t *pool); 818 819 820 /** @} */ 821 822 /** 823 * Client diff 824 * 825 * @defgroup clnt_diff Client diff functionality 826 * 827 * @{ 828 */ 829 /** The difference type in an svn_diff_summarize_t structure. 830 * 831 * @since New in 1.4. 832 */ 833 typedef enum svn_client_diff_summarize_kind_t 834 { 835 /** An item with no text modifications */ 836 svn_client_diff_summarize_kind_normal, 837 838 /** An added item */ 839 svn_client_diff_summarize_kind_added, 840 841 /** An item with text modifications */ 842 svn_client_diff_summarize_kind_modified, 843 844 /** A deleted item */ 845 svn_client_diff_summarize_kind_deleted 846 } svn_client_diff_summarize_kind_t; 847 848 849 /** A struct that describes the diff of an item. Passed to 850 * #svn_client_diff_summarize_func_t. 851 * 852 * @note Fields may be added to the end of this structure in future 853 * versions. Therefore, users shouldn't allocate structures of this 854 * type, to preserve binary compatibility. 855 * 856 * @since New in 1.4. 857 */ 858 typedef struct svn_client_diff_summarize_t 859 { 860 /** Path relative to the target. If the target is a file, path is 861 * the empty string. */ 862 const char *path; 863 864 /** Change kind */ 865 svn_client_diff_summarize_kind_t summarize_kind; 866 867 /** Properties changed? For consistency with 'svn status' output, 868 * this should be false if summarize_kind is _added or _deleted. */ 869 svn_boolean_t prop_changed; 870 871 /** File or dir */ 872 svn_node_kind_t node_kind; 873 } svn_client_diff_summarize_t; 874 875 /** 876 * Return a duplicate of @a diff, allocated in @a pool. No part of the new 877 * structure will be shared with @a diff. 878 * 879 * @since New in 1.4. 880 */ 881 svn_client_diff_summarize_t * 882 svn_client_diff_summarize_dup(const svn_client_diff_summarize_t *diff, 883 apr_pool_t *pool); 884 885 886 /** A callback used in svn_client_diff_summarize2() and 887 * svn_client_diff_summarize_peg2() for reporting a @a diff summary. 888 * 889 * All allocations should be performed in @a pool. 890 * 891 * @a baton is a closure object; it should be provided by the implementation, 892 * and passed by the caller. 893 * 894 * @since New in 1.4. 895 */ 896 typedef svn_error_t *(*svn_client_diff_summarize_func_t)( 897 const svn_client_diff_summarize_t *diff, 898 void *baton, 899 apr_pool_t *pool); 900 901 902 903 /** @} */ 904 905 906 /** 907 * Client context 908 * 909 * @defgroup clnt_ctx Client context management 910 * 911 * @{ 912 */ 913 914 /** A client context structure, which holds client specific callbacks, 915 * batons, serves as a cache for configuration options, and other various 916 * and sundry things. In order to avoid backwards compatibility problems 917 * clients should use svn_client_create_context() to allocate and 918 * initialize this structure instead of doing so themselves. 919 */ 920 typedef struct svn_client_ctx_t 921 { 922 /** main authentication baton. */ 923 svn_auth_baton_t *auth_baton; 924 925 /** notification callback function. 926 * This will be called by notify_func2() by default. 927 * @deprecated Provided for backward compatibility with the 1.1 API. 928 * Use @c notify_func2 instead. */ 929 svn_wc_notify_func_t notify_func; 930 931 /** notification callback baton for notify_func() 932 * @deprecated Provided for backward compatibility with the 1.1 API. 933 * Use @c notify_baton2 instead */ 934 void *notify_baton; 935 936 /** Log message callback function. NULL means that Subversion 937 * should try not attempt to fetch a log message. 938 * @deprecated Provided for backward compatibility with the 1.2 API. 939 * Use @c log_msg_func2 instead. */ 940 svn_client_get_commit_log_t log_msg_func; 941 942 /** log message callback baton 943 * @deprecated Provided for backward compatibility with the 1.2 API. 944 * Use @c log_msg_baton2 instead. */ 945 void *log_msg_baton; 946 947 /** a hash mapping of <tt>const char *</tt> configuration file names to 948 * #svn_config_t *'s. For example, the '~/.subversion/config' file's 949 * contents should have the key "config". May be left unset (or set to 950 * NULL) to use the built-in default settings and not use any configuration. 951 */ 952 apr_hash_t *config; 953 954 /** a callback to be used to see if the client wishes to cancel the running 955 * operation. */ 956 svn_cancel_func_t cancel_func; 957 958 /** a baton to pass to the cancellation callback. */ 959 void *cancel_baton; 960 961 /** notification function, defaulting to a function that forwards 962 * to notify_func(). If @c NULL, it will not be invoked. 963 * @since New in 1.2. */ 964 svn_wc_notify_func2_t notify_func2; 965 966 /** notification baton for notify_func2(). 967 * @since New in 1.2. */ 968 void *notify_baton2; 969 970 /** Log message callback function. NULL means that Subversion 971 * should try log_msg_func. 972 * @since New in 1.3. */ 973 svn_client_get_commit_log2_t log_msg_func2; 974 975 /** callback baton for log_msg_func2 976 * @since New in 1.3. */ 977 void *log_msg_baton2; 978 979 /** Notification callback for network progress information. 980 * May be NULL if not used. 981 * @since New in 1.3. */ 982 svn_ra_progress_notify_func_t progress_func; 983 984 /** Callback baton for progress_func. 985 * @since New in 1.3. */ 986 void *progress_baton; 987 988 /** Log message callback function. NULL means that Subversion 989 * should try @c log_msg_func2, then @c log_msg_func. 990 * @since New in 1.5. */ 991 svn_client_get_commit_log3_t log_msg_func3; 992 993 /** The callback baton for @c log_msg_func3. 994 * @since New in 1.5. */ 995 void *log_msg_baton3; 996 997 /** MIME types map. 998 * @since New in 1.5. */ 999 apr_hash_t *mimetypes_map; 1000 1001 /** Conflict resolution callback and baton, if available. 1002 * @since New in 1.5. */ 1003 svn_wc_conflict_resolver_func_t conflict_func; 1004 void *conflict_baton; 1005 1006 /** Custom client name string, or @c NULL. 1007 * @since New in 1.5. */ 1008 const char *client_name; 1009 1010 /** Conflict resolution callback and baton, if available. NULL means that 1011 * subversion should try @c conflict_func. 1012 * @since New in 1.7. */ 1013 svn_wc_conflict_resolver_func2_t conflict_func2; 1014 void *conflict_baton2; 1015 1016 /** A working copy context for the client operation to use. 1017 * This is initialized by svn_client_create_context() and should never 1018 * be @c NULL. 1019 * 1020 * @since New in 1.7. */ 1021 svn_wc_context_t *wc_ctx; 1022 1023 /** Check-tunnel callback 1024 * 1025 * If not @c NULL, and open_tunnel_func is also not @c NULL, this 1026 * callback will be invoked to check if open_tunnel_func should be 1027 * used to create a specific tunnel, or if the default tunnel 1028 * implementation (either built-in or configured in the client 1029 * configuration file) should be used instead. 1030 * @since New in 1.9. 1031 */ 1032 svn_ra_check_tunnel_func_t check_tunnel_func; 1033 1034 /** Open-tunnel callback 1035 * 1036 * If not @c NULL, this callback will be invoked to create a tunnel 1037 * for a ra_svn connection that needs one, overriding any tunnel 1038 * definitions in the client config file. This callback is used only 1039 * for ra_svn and ignored by the other RA modules. 1040 * @since New in 1.9. 1041 */ 1042 svn_ra_open_tunnel_func_t open_tunnel_func; 1043 1044 /** The baton used with check_tunnel_func and open_tunnel_func. 1045 * @since New in 1.9. 1046 */ 1047 void *tunnel_baton; 1048 } svn_client_ctx_t; 1049 1050 /** Initialize a client context. 1051 * Set @a *ctx to a client context object, allocated in @a pool, that 1052 * represents a particular instance of an svn client. @a cfg_hash is used 1053 * to initialise the config member of the returned context object and should 1054 * remain valid for the lifetime of the object. @a cfg_hash may be @c NULL, 1055 * in which case it is ignored. 1056 * 1057 * In order to avoid backwards compatibility problems, clients must 1058 * use this function to initialize and allocate the 1059 * #svn_client_ctx_t structure rather than doing so themselves, as 1060 * the size of this structure may change in the future. 1061 * 1062 * The current implementation never returns error, but callers should 1063 * still check for error, for compatibility with future versions. 1064 * 1065 * @since New in 1.8. 1066 */ 1067 svn_error_t * 1068 svn_client_create_context2(svn_client_ctx_t **ctx, 1069 apr_hash_t *cfg_hash, 1070 apr_pool_t *pool); 1071 1072 1073 /** Similar to svn_client_create_context2 but passes a NULL @a cfg_hash. 1074 * 1075 * @deprecated Provided for backward compatibility with the 1.7 API. 1076 */ 1077 SVN_DEPRECATED 1078 svn_error_t * 1079 svn_client_create_context(svn_client_ctx_t **ctx, 1080 apr_pool_t *pool); 1081 1082 /** @} end group: Client context management */ 1083 1084 /** 1085 * @deprecated Provided for backward compatibility. This constant was never 1086 * used in released versions. 1087 */ 1088 #define SVN_CLIENT_AUTH_USERNAME "username" 1089 /** 1090 * @deprecated Provided for backward compatibility. This constant was never 1091 * used in released versions. 1092 */ 1093 #define SVN_CLIENT_AUTH_PASSWORD "password" 1094 1095 /** Client argument processing 1096 * 1097 * @defgroup clnt_cmdline Client command-line processing 1098 * 1099 * @{ 1100 */ 1101 1102 /** 1103 * Pull remaining target arguments from @a os into @a *targets_p, 1104 * converting them to UTF-8, followed by targets from @a known_targets 1105 * (which might come from, for example, the "--targets" command line option). 1106 * 1107 * Process each target in one of the following ways. For a repository- 1108 * relative URL: resolve to a full URL, contacting the repository if 1109 * necessary to do so, and then treat as a full URL. For a URL: do some 1110 * IRI-to-URI encoding and some auto-escaping, and canonicalize. For a 1111 * local path: canonicalize case and path separators. 1112 * 1113 * If @a keep_last_origpath_on_truepath_collision is TRUE, and there are 1114 * exactly two targets which both case-canonicalize to the same path, the last 1115 * target will be returned in the original non-case-canonicalized form. 1116 * 1117 * Allocate @a *targets_p and its elements in @a pool. 1118 * 1119 * @a ctx is required for possible repository authentication. 1120 * 1121 * If a path has the same name as a Subversion working copy 1122 * administrative directory, return #SVN_ERR_RESERVED_FILENAME_SPECIFIED; 1123 * if multiple reserved paths are encountered, return a chain of 1124 * errors, all of which are #SVN_ERR_RESERVED_FILENAME_SPECIFIED. Do 1125 * not return this type of error in a chain with any other type of 1126 * error, and if this is the only type of error encountered, complete 1127 * the operation before returning the error(s). 1128 * 1129 * Return an error if a target is just a peg specifier with no path, such as 1130 * "@abc". Before v1.6.5 (r878062) this form was interpreted as a literal path; 1131 * it is now ambiguous. The form "@abc@" should now be used to refer to the 1132 * literal path "@abc" with no peg revision, or the form ".@abc" to refer to 1133 * the empty path with peg revision "abc". 1134 * 1135 * @since New in 1.7 1136 */ 1137 svn_error_t * 1138 svn_client_args_to_target_array2(apr_array_header_t **targets_p, 1139 apr_getopt_t *os, 1140 const apr_array_header_t *known_targets, 1141 svn_client_ctx_t *ctx, 1142 svn_boolean_t keep_last_origpath_on_truepath_collision, 1143 apr_pool_t *pool); 1144 1145 /** 1146 * Similar to svn_client_args_to_target_array2() but with 1147 * @a keep_last_origpath_on_truepath_collision always set to FALSE. 1148 * 1149 * @since Since 1.6.5, this returns an error if a path contains a peg 1150 * specifier with no path before it, such as "@abc". 1151 * 1152 * @deprecated Provided for backward compatibility with the 1.6 API. 1153 */ 1154 SVN_DEPRECATED 1155 svn_error_t * 1156 svn_client_args_to_target_array(apr_array_header_t **targets_p, 1157 apr_getopt_t *os, 1158 const apr_array_header_t *known_targets, 1159 svn_client_ctx_t *ctx, 1160 apr_pool_t *pool); 1161 1162 /** @} group end: Client command-line processing */ 1163 1164 /** @} */ 1165 1166 /** 1167 * Client working copy management functions 1168 * 1169 * @defgroup clnt_wc Client working copy management 1170 * 1171 * @{ 1172 */ 1173 1174 /** 1175 * @defgroup clnt_wc_checkout Checkout 1176 * 1177 * @{ 1178 */ 1179 1180 1181 /** 1182 * Checkout a working copy from a repository. 1183 * 1184 * @param[out] result_rev If non-NULL, the value of the revision checked 1185 * out from the repository. 1186 * @param[in] URL The repository URL of the checkout source. 1187 * @param[in] path The root of the new working copy. 1188 * @param[in] peg_revision The peg revision. 1189 * @param[in] revision The operative revision. 1190 * @param[in] depth The depth of the operation. If #svn_depth_unknown, 1191 * then behave as if for #svn_depth_infinity, except in the case 1192 * of resuming a previous checkout of @a path (i.e., updating), 1193 * in which case use the depth of the existing working copy. 1194 * @param[in] ignore_externals If @c TRUE, don't process externals 1195 * definitions as part of this operation. 1196 * @param[in] allow_unver_obstructions If @c TRUE, then tolerate existing 1197 * unversioned items that obstruct incoming paths. Only 1198 * obstructions of the same type (file or dir) as the added 1199 * item are tolerated. The text of obstructing files is left 1200 * as-is, effectively treating it as a user modification after 1201 * the checkout. Working properties of obstructing items are 1202 * set equal to the base properties. <br> 1203 * If @c FALSE, then abort if there are any unversioned 1204 * obstructing items. 1205 * @param[in] ctx The standard client context, used for authentication and 1206 * notification. 1207 * @param[in] pool Used for any temporary allocation. 1208 * 1209 * @return A pointer to an #svn_error_t of the type (this list is not 1210 * exhaustive): <br> 1211 * #SVN_ERR_UNSUPPORTED_FEATURE if @a URL refers to a file rather 1212 * than a directory; <br> 1213 * #SVN_ERR_RA_ILLEGAL_URL if @a URL does not exist; <br> 1214 * #SVN_ERR_CLIENT_BAD_REVISION if @a revision is not one of 1215 * #svn_opt_revision_number, #svn_opt_revision_head, or 1216 * #svn_opt_revision_date. <br> 1217 * If no error occurred, return #SVN_NO_ERROR. 1218 * 1219 * @since New in 1.5. 1220 * 1221 * @see #svn_depth_t <br> #svn_client_ctx_t <br> @ref clnt_revisions for 1222 * a discussion of operative and peg revisions. 1223 */ 1224 svn_error_t * 1225 svn_client_checkout3(svn_revnum_t *result_rev, 1226 const char *URL, 1227 const char *path, 1228 const svn_opt_revision_t *peg_revision, 1229 const svn_opt_revision_t *revision, 1230 svn_depth_t depth, 1231 svn_boolean_t ignore_externals, 1232 svn_boolean_t allow_unver_obstructions, 1233 svn_client_ctx_t *ctx, 1234 apr_pool_t *pool); 1235 1236 1237 /** 1238 * Similar to svn_client_checkout3() but with @a allow_unver_obstructions 1239 * always set to FALSE, and @a depth set according to @a recurse: if 1240 * @a recurse is TRUE, @a depth is #svn_depth_infinity, if @a recurse 1241 * is FALSE, @a depth is #svn_depth_files. 1242 * 1243 * @deprecated Provided for backward compatibility with the 1.4 API. 1244 */ 1245 SVN_DEPRECATED 1246 svn_error_t * 1247 svn_client_checkout2(svn_revnum_t *result_rev, 1248 const char *URL, 1249 const char *path, 1250 const svn_opt_revision_t *peg_revision, 1251 const svn_opt_revision_t *revision, 1252 svn_boolean_t recurse, 1253 svn_boolean_t ignore_externals, 1254 svn_client_ctx_t *ctx, 1255 apr_pool_t *pool); 1256 1257 1258 /** 1259 * Similar to svn_client_checkout2(), but with @a peg_revision 1260 * always set to #svn_opt_revision_unspecified and 1261 * @a ignore_externals always set to FALSE. 1262 * 1263 * @deprecated Provided for backward compatibility with the 1.1 API. 1264 */ 1265 SVN_DEPRECATED 1266 svn_error_t * 1267 svn_client_checkout(svn_revnum_t *result_rev, 1268 const char *URL, 1269 const char *path, 1270 const svn_opt_revision_t *revision, 1271 svn_boolean_t recurse, 1272 svn_client_ctx_t *ctx, 1273 apr_pool_t *pool); 1274 /** @} */ 1275 1276 /** 1277 * @defgroup Update Bring a working copy up-to-date with a repository 1278 * 1279 * @{ 1280 * 1281 */ 1282 1283 /** 1284 * Update working trees @a paths to @a revision, authenticating with the 1285 * authentication baton cached in @a ctx. @a paths is an array of const 1286 * char * paths to be updated. Unversioned paths that are direct children 1287 * of a versioned path will cause an update that attempts to add that path; 1288 * other unversioned paths are skipped. If @a result_revs is not NULL, 1289 * @a *result_revs will be set to an array of svn_revnum_t with each 1290 * element set to the revision to which @a revision was resolved for the 1291 * corresponding element of @a paths. 1292 * 1293 * @a revision must be of kind #svn_opt_revision_number, 1294 * #svn_opt_revision_head, or #svn_opt_revision_date. If @a 1295 * revision does not meet these requirements, return the error 1296 * #SVN_ERR_CLIENT_BAD_REVISION. 1297 * 1298 * The paths in @a paths can be from multiple working copies from multiple 1299 * repositories, but even if they all come from the same repository there 1300 * is no guarantee that revision represented by #svn_opt_revision_head 1301 * will remain the same as each path is updated. 1302 * 1303 * If @a ignore_externals is set, don't process externals definitions 1304 * as part of this operation. 1305 * 1306 * If @a depth is #svn_depth_infinity, update fully recursively. 1307 * Else if it is #svn_depth_immediates or #svn_depth_files, update 1308 * each target and its file entries, but not its subdirectories. Else 1309 * if #svn_depth_empty, update exactly each target, nonrecursively 1310 * (essentially, update the target's properties). 1311 * 1312 * If @a depth is #svn_depth_unknown, take the working depth from 1313 * @a paths and then behave as described above. 1314 * 1315 * If @a depth_is_sticky is set and @a depth is not 1316 * #svn_depth_unknown, then in addition to updating PATHS, also set 1317 * their sticky ambient depth value to @a depth. 1318 * 1319 * If @a allow_unver_obstructions is TRUE then the update tolerates 1320 * existing unversioned items that obstruct added paths. Only 1321 * obstructions of the same type (file or dir) as the added item are 1322 * tolerated. The text of obstructing files is left as-is, effectively 1323 * treating it as a user modification after the update. Working 1324 * properties of obstructing items are set equal to the base properties. 1325 * If @a allow_unver_obstructions is FALSE then the update will abort 1326 * if there are any unversioned obstructing items. 1327 * 1328 * If @a adds_as_modification is TRUE, a local addition at the same path 1329 * as an incoming addition of the same node kind results in a normal node 1330 * with a possible local modification, instead of a tree conflict. 1331 * 1332 * If @a make_parents is TRUE, create any non-existent parent 1333 * directories also by checking them out at depth=empty. 1334 * 1335 * If @a ctx->notify_func2 is non-NULL, invoke @a ctx->notify_func2 with 1336 * @a ctx->notify_baton2 for each item handled by the update, and also for 1337 * files restored from text-base. If @a ctx->cancel_func is non-NULL, invoke 1338 * it passing @a ctx->cancel_baton at various places during the update. 1339 * 1340 * Use @a pool for any temporary allocation. 1341 * 1342 * @todo Multiple Targets 1343 * - Up for debate: an update on multiple targets is *not* atomic. 1344 * Right now, svn_client_update only takes one path. What's 1345 * debatable is whether this should ever change. On the one hand, 1346 * it's kind of losing to have the client application loop over 1347 * targets and call svn_client_update() on each one; each call to 1348 * update initializes a whole new repository session (network 1349 * overhead, etc.) On the other hand, it's a very simple 1350 * implementation, and allows for the possibility that different 1351 * targets may come from different repositories. 1352 * 1353 * @since New in 1.7. 1354 */ 1355 svn_error_t * 1356 svn_client_update4(apr_array_header_t **result_revs, 1357 const apr_array_header_t *paths, 1358 const svn_opt_revision_t *revision, 1359 svn_depth_t depth, 1360 svn_boolean_t depth_is_sticky, 1361 svn_boolean_t ignore_externals, 1362 svn_boolean_t allow_unver_obstructions, 1363 svn_boolean_t adds_as_modification, 1364 svn_boolean_t make_parents, 1365 svn_client_ctx_t *ctx, 1366 apr_pool_t *pool); 1367 1368 /** 1369 * Similar to svn_client_update4() but with @a make_parents always set 1370 * to FALSE and @a adds_as_modification set to TRUE. 1371 * 1372 * @deprecated Provided for backward compatibility with the 1.6 API. 1373 * @since New in 1.5. 1374 */ 1375 SVN_DEPRECATED 1376 svn_error_t * 1377 svn_client_update3(apr_array_header_t **result_revs, 1378 const apr_array_header_t *paths, 1379 const svn_opt_revision_t *revision, 1380 svn_depth_t depth, 1381 svn_boolean_t depth_is_sticky, 1382 svn_boolean_t ignore_externals, 1383 svn_boolean_t allow_unver_obstructions, 1384 svn_client_ctx_t *ctx, 1385 apr_pool_t *pool); 1386 1387 /** 1388 * Similar to svn_client_update3() but with @a allow_unver_obstructions 1389 * always set to FALSE, @a depth_is_sticky to FALSE, and @a depth set 1390 * according to @a recurse: if @a recurse is TRUE, set @a depth to 1391 * #svn_depth_infinity, if @a recurse is FALSE, set @a depth to 1392 * #svn_depth_files. 1393 * 1394 * @deprecated Provided for backward compatibility with the 1.4 API. 1395 */ 1396 SVN_DEPRECATED 1397 svn_error_t * 1398 svn_client_update2(apr_array_header_t **result_revs, 1399 const apr_array_header_t *paths, 1400 const svn_opt_revision_t *revision, 1401 svn_boolean_t recurse, 1402 svn_boolean_t ignore_externals, 1403 svn_client_ctx_t *ctx, 1404 apr_pool_t *pool); 1405 1406 /** 1407 * Similar to svn_client_update2() except that it accepts only a single 1408 * target in @a path, returns a single revision if @a result_rev is 1409 * not NULL, and @a ignore_externals is always set to FALSE. 1410 * 1411 * @deprecated Provided for backward compatibility with the 1.1 API. 1412 */ 1413 SVN_DEPRECATED 1414 svn_error_t * 1415 svn_client_update(svn_revnum_t *result_rev, 1416 const char *path, 1417 const svn_opt_revision_t *revision, 1418 svn_boolean_t recurse, 1419 svn_client_ctx_t *ctx, 1420 apr_pool_t *pool); 1421 /** @} */ 1422 1423 /** 1424 * @defgroup Switch Switch a working copy to another location. 1425 * 1426 * @{ 1427 */ 1428 1429 /** 1430 * Switch an existing working copy directory to a different repository 1431 * location. 1432 * 1433 * This is normally used to switch a working copy directory over to another 1434 * line of development, such as a branch or a tag. Switching an existing 1435 * working copy directory is more efficient than checking out @a url from 1436 * scratch. 1437 * 1438 * @param[out] result_rev If non-NULL, the value of the revision to which 1439 * the working copy was actually switched. 1440 * @param[in] path The directory to be switched. This need not be the 1441 * root of a working copy. 1442 * @param[in] url The repository URL to switch to. 1443 * @param[in] peg_revision The peg revision. 1444 * @param[in] revision The operative revision. 1445 * @param[in] depth The depth of the operation. If #svn_depth_infinity, 1446 * switch fully recursively. Else if #svn_depth_immediates, 1447 * switch @a path and its file children (if any), and 1448 * switch subdirectories but do not update them. Else if 1449 * #svn_depth_files, switch just file children, ignoring 1450 * subdirectories completely. Else if #svn_depth_empty, 1451 * switch just @a path and touch nothing underneath it. 1452 * @param[in] depth_is_sticky If @c TRUE, and @a depth is not 1453 * #svn_depth_unknown, then in addition to switching @a path, also 1454 * set its sticky ambient depth value to @a depth. 1455 * @param[in] ignore_externals If @c TRUE, don't process externals 1456 * definitions as part of this operation. 1457 * @param[in] allow_unver_obstructions If @c TRUE, then tolerate existing 1458 * unversioned items that obstruct incoming paths. Only 1459 * obstructions of the same type (file or dir) as the added 1460 * item are tolerated. The text of obstructing files is left 1461 * as-is, effectively treating it as a user modification after 1462 * the checkout. Working properties of obstructing items are 1463 * set equal to the base properties. <br> 1464 * If @c FALSE, then abort if there are any unversioned 1465 * obstructing items. 1466 * @param[in] ignore_ancestry If @c FALSE, then verify that the file 1467 * or directory at @a path shares some common version control 1468 * ancestry with the switch URL location (represented by the 1469 * combination of @a url, @a peg_revision, and @a revision), 1470 * and returning #SVN_ERR_CLIENT_UNRELATED_RESOURCES if they 1471 * do not. If @c TRUE, no such sanity checks are performed. 1472 * 1473 * @param[in] ctx The standard client context, used for authentication and 1474 * notification. The notifier is invoked for paths affected by 1475 * the switch, and also for files which may be restored from the 1476 * pristine store after being previously removed from the working 1477 * copy. 1478 * @param[in] pool Used for any temporary allocation. 1479 * 1480 * @return A pointer to an #svn_error_t of the type (this list is not 1481 * exhaustive): <br> 1482 * #SVN_ERR_CLIENT_BAD_REVISION if @a revision is not one of 1483 * #svn_opt_revision_number, #svn_opt_revision_head, or 1484 * #svn_opt_revision_date. <br> 1485 * If no error occurred, return #SVN_NO_ERROR. 1486 * 1487 * @since New in 1.7. 1488 * 1489 * @see #svn_depth_t <br> #svn_client_ctx_t <br> @ref clnt_revisions for 1490 * a discussion of operative and peg revisions. 1491 */ 1492 svn_error_t * 1493 svn_client_switch3(svn_revnum_t *result_rev, 1494 const char *path, 1495 const char *url, 1496 const svn_opt_revision_t *peg_revision, 1497 const svn_opt_revision_t *revision, 1498 svn_depth_t depth, 1499 svn_boolean_t depth_is_sticky, 1500 svn_boolean_t ignore_externals, 1501 svn_boolean_t allow_unver_obstructions, 1502 svn_boolean_t ignore_ancestry, 1503 svn_client_ctx_t *ctx, 1504 apr_pool_t *pool); 1505 1506 1507 /** 1508 * Similar to svn_client_switch3() but with @a ignore_ancestry always 1509 * set to TRUE. 1510 * 1511 * @since New in 1.5. 1512 * @deprecated Provided for backward compatibility with the 1.4 API. 1513 */ 1514 SVN_DEPRECATED 1515 svn_error_t * 1516 svn_client_switch2(svn_revnum_t *result_rev, 1517 const char *path, 1518 const char *url, 1519 const svn_opt_revision_t *peg_revision, 1520 const svn_opt_revision_t *revision, 1521 svn_depth_t depth, 1522 svn_boolean_t depth_is_sticky, 1523 svn_boolean_t ignore_externals, 1524 svn_boolean_t allow_unver_obstructions, 1525 svn_client_ctx_t *ctx, 1526 apr_pool_t *pool); 1527 1528 1529 /** 1530 * Similar to svn_client_switch2() but with @a allow_unver_obstructions, 1531 * @a ignore_externals, and @a depth_is_sticky always set to FALSE, 1532 * and @a depth set according to @a recurse: if @a recurse is TRUE, 1533 * set @a depth to #svn_depth_infinity, if @a recurse is FALSE, set 1534 * @a depth to #svn_depth_files. 1535 * 1536 * @deprecated Provided for backward compatibility with the 1.4 API. 1537 */ 1538 SVN_DEPRECATED 1539 svn_error_t * 1540 svn_client_switch(svn_revnum_t *result_rev, 1541 const char *path, 1542 const char *url, 1543 const svn_opt_revision_t *revision, 1544 svn_boolean_t recurse, 1545 svn_client_ctx_t *ctx, 1546 apr_pool_t *pool); 1547 1548 /** @} */ 1549 1550 /** 1551 * @defgroup Add Begin versioning files/directories in a working copy. 1552 * 1553 * @{ 1554 */ 1555 1556 /** 1557 * Schedule a working copy @a path for addition to the repository. 1558 * 1559 * If @a depth is #svn_depth_empty, add just @a path and nothing 1560 * below it. If #svn_depth_files, add @a path and any file 1561 * children of @a path. If #svn_depth_immediates, add @a path, any 1562 * file children, and any immediate subdirectories (but nothing 1563 * underneath those subdirectories). If #svn_depth_infinity, add 1564 * @a path and everything under it fully recursively. 1565 * 1566 * @a path's parent must be under revision control already (unless 1567 * @a add_parents is TRUE), but @a path is not. 1568 * 1569 * If @a force is not set and @a path is already under version 1570 * control, return the error #SVN_ERR_ENTRY_EXISTS. If @a force is 1571 * set, do not error on already-versioned items. When used on a 1572 * directory in conjunction with a @a depth value greater than 1573 * #svn_depth_empty, this has the effect of scheduling for addition 1574 * any unversioned files and directories scattered within even a 1575 * versioned tree (up to @a depth). 1576 * 1577 * If @a ctx->notify_func2 is non-NULL, then for each added item, call 1578 * @a ctx->notify_func2 with @a ctx->notify_baton2 and the path of the 1579 * added item. 1580 * 1581 * If @a no_ignore is FALSE, don't add any file or directory (or recurse 1582 * into any directory) that is unversioned and found by recursion (as 1583 * opposed to being the explicit target @a path) and whose name matches the 1584 * svn:ignore property on its parent directory or the global-ignores list in 1585 * @a ctx->config. If @a no_ignore is TRUE, do include such files and 1586 * directories. (Note that an svn:ignore property can influence this 1587 * behaviour only when recursing into an already versioned directory with @a 1588 * force.) 1589 * 1590 * If @a no_autoprops is TRUE, don't set any autoprops on added files. If 1591 * @a no_autoprops is FALSE then all added files have autprops set as per 1592 * the auto-props list in @a ctx->config and the value of any 1593 * @c SVN_PROP_INHERITABLE_AUTO_PROPS properties inherited by the nearest 1594 * parents of @a path which are already under version control. 1595 * 1596 * If @a add_parents is TRUE, recurse up @a path's directory and look for 1597 * a versioned directory. If found, add all intermediate paths between it 1598 * and @a path. If not found, return #SVN_ERR_CLIENT_NO_VERSIONED_PARENT. 1599 * 1600 * @a scratch_pool is used for temporary allocations only. 1601 * 1602 * @par Important: 1603 * This is a *scheduling* operation. No changes will 1604 * happen to the repository until a commit occurs. This scheduling 1605 * can be removed with svn_client_revert2(). 1606 * 1607 * @since New in 1.8. 1608 */ 1609 svn_error_t * 1610 svn_client_add5(const char *path, 1611 svn_depth_t depth, 1612 svn_boolean_t force, 1613 svn_boolean_t no_ignore, 1614 svn_boolean_t no_autoprops, 1615 svn_boolean_t add_parents, 1616 svn_client_ctx_t *ctx, 1617 apr_pool_t *scratch_pool); 1618 1619 /** 1620 * Similar to svn_client_add5(), but with @a no_autoprops always set to 1621 * FALSE. 1622 * 1623 * @deprecated Provided for backward compatibility with the 1.7 API. 1624 */ 1625 SVN_DEPRECATED 1626 svn_error_t * 1627 svn_client_add4(const char *path, 1628 svn_depth_t depth, 1629 svn_boolean_t force, 1630 svn_boolean_t no_ignore, 1631 svn_boolean_t add_parents, 1632 svn_client_ctx_t *ctx, 1633 apr_pool_t *pool); 1634 1635 /** 1636 * Similar to svn_client_add4(), but with @a add_parents always set to 1637 * FALSE and @a depth set according to @a recursive: if TRUE, then 1638 * @a depth is #svn_depth_infinity, if FALSE, then #svn_depth_empty. 1639 * 1640 * @deprecated Provided for backward compatibility with the 1.4 API. 1641 */ 1642 SVN_DEPRECATED 1643 svn_error_t * 1644 svn_client_add3(const char *path, 1645 svn_boolean_t recursive, 1646 svn_boolean_t force, 1647 svn_boolean_t no_ignore, 1648 svn_client_ctx_t *ctx, 1649 apr_pool_t *pool); 1650 1651 /** 1652 * Similar to svn_client_add3(), but with @a no_ignore always set to 1653 * FALSE. 1654 * 1655 * @deprecated Provided for backward compatibility with the 1.2 API. 1656 */ 1657 SVN_DEPRECATED 1658 svn_error_t * 1659 svn_client_add2(const char *path, 1660 svn_boolean_t recursive, 1661 svn_boolean_t force, 1662 svn_client_ctx_t *ctx, 1663 apr_pool_t *pool); 1664 1665 /** 1666 * Similar to svn_client_add2(), but with @a force always set to FALSE. 1667 * 1668 * @deprecated Provided for backward compatibility with the 1.0 API. 1669 */ 1670 SVN_DEPRECATED 1671 svn_error_t * 1672 svn_client_add(const char *path, 1673 svn_boolean_t recursive, 1674 svn_client_ctx_t *ctx, 1675 apr_pool_t *pool); 1676 1677 /** @} */ 1678 1679 /** 1680 * @defgroup Mkdir Create directories in a working copy or repository. 1681 * 1682 * @{ 1683 */ 1684 1685 /** Create a directory, either in a repository or a working copy. 1686 * 1687 * @a paths is an array of (const char *) paths, either all local WC paths 1688 * or all URLs. 1689 * 1690 * If @a paths contains URLs, use the authentication baton in @a ctx 1691 * and @a message to immediately attempt to commit the creation of the 1692 * directories in @a paths in the repository. 1693 * 1694 * Else, create the directories on disk, and attempt to schedule them 1695 * for addition (using svn_client_add(), whose docstring you should 1696 * read). 1697 * 1698 * If @a make_parents is TRUE, create any non-existent parent directories 1699 * also. 1700 * 1701 * If non-NULL, @a revprop_table is a hash table holding additional, 1702 * custom revision properties (<tt>const char *</tt> names mapped to 1703 * <tt>svn_string_t *</tt> values) to be set on the new revision in 1704 * the event that this is a committing operation. This table cannot 1705 * contain any standard Subversion properties. 1706 * 1707 * @a ctx->log_msg_func3/@a ctx->log_msg_baton3 are a callback/baton 1708 * combo that this function can use to query for a commit log message 1709 * when one is needed. 1710 * 1711 * If @a ctx->notify_func2 is non-NULL, when the directory has been created 1712 * (successfully) in the working copy, call @a ctx->notify_func2 with 1713 * @a ctx->notify_baton2 and the path of the new directory. Note that this is 1714 * only called for items added to the working copy. 1715 * 1716 * If @a commit_callback is non-NULL, then for each successful commit, call 1717 * @a commit_callback with @a commit_baton and a #svn_commit_info_t for 1718 * the commit. 1719 * 1720 * @since New in 1.7. 1721 */ 1722 svn_error_t * 1723 svn_client_mkdir4(const apr_array_header_t *paths, 1724 svn_boolean_t make_parents, 1725 const apr_hash_t *revprop_table, 1726 svn_commit_callback2_t commit_callback, 1727 void *commit_baton, 1728 svn_client_ctx_t *ctx, 1729 apr_pool_t *pool); 1730 1731 /** 1732 * Similar to svn_client_mkdir4(), but returns the commit info in 1733 * @a *commit_info_p rather than through a callback function. 1734 * 1735 * @since New in 1.5. 1736 * @deprecated Provided for backward compatibility with the 1.6 API. 1737 */ 1738 SVN_DEPRECATED 1739 svn_error_t * 1740 svn_client_mkdir3(svn_commit_info_t **commit_info_p, 1741 const apr_array_header_t *paths, 1742 svn_boolean_t make_parents, 1743 const apr_hash_t *revprop_table, 1744 svn_client_ctx_t *ctx, 1745 apr_pool_t *pool); 1746 1747 1748 /** 1749 * Same as svn_client_mkdir3(), but with @a make_parents always FALSE, 1750 * and @a revprop_table always NULL. 1751 * 1752 * @since New in 1.3. 1753 * @deprecated Provided for backward compatibility with the 1.4 API. 1754 */ 1755 SVN_DEPRECATED 1756 svn_error_t * 1757 svn_client_mkdir2(svn_commit_info_t **commit_info_p, 1758 const apr_array_header_t *paths, 1759 svn_client_ctx_t *ctx, 1760 apr_pool_t *pool); 1761 1762 /** 1763 * Same as svn_client_mkdir2(), but takes the #svn_client_commit_info_t 1764 * type for @a commit_info_p. 1765 * 1766 * @deprecated Provided for backward compatibility with the 1.2 API. 1767 */ 1768 SVN_DEPRECATED 1769 svn_error_t * 1770 svn_client_mkdir(svn_client_commit_info_t **commit_info_p, 1771 const apr_array_header_t *paths, 1772 svn_client_ctx_t *ctx, 1773 apr_pool_t *pool); 1774 1775 /** @} */ 1776 1777 /** 1778 * @defgroup Delete Remove files/directories from a working copy or repository. 1779 * 1780 * @{ 1781 */ 1782 1783 /** Delete items from a repository or working copy. 1784 * 1785 * @a paths is an array of (const char *) paths, either all local WC paths 1786 * or all URLs. 1787 * 1788 * If the paths in @a paths are URLs, use the authentication baton in 1789 * @a ctx and @a ctx->log_msg_func3/@a ctx->log_msg_baton3 to 1790 * immediately attempt to commit a deletion of the URLs from the 1791 * repository. Every path must belong to the same repository. 1792 * 1793 * Else, schedule the working copy paths in @a paths for removal from 1794 * the repository. Each path's parent must be under revision control. 1795 * This is just a *scheduling* operation. No changes will happen to 1796 * the repository until a commit occurs. This scheduling can be 1797 * removed with svn_client_revert2(). If a path is a file it is 1798 * immediately removed from the working copy. If the path is a 1799 * directory it will remain in the working copy but all the files, and 1800 * all unversioned items, it contains will be removed. If @a force is 1801 * not set then this operation will fail if any path contains locally 1802 * modified and/or unversioned items. If @a force is set such items 1803 * will be deleted. 1804 * 1805 * If the paths are working copy paths and @a keep_local is TRUE then 1806 * the paths will not be removed from the working copy, only scheduled 1807 * for removal from the repository. Once the scheduled deletion is 1808 * committed, they will appear as unversioned paths in the working copy. 1809 * 1810 * If non-NULL, @a revprop_table is a hash table holding additional, 1811 * custom revision properties (<tt>const char *</tt> names mapped to 1812 * <tt>svn_string_t *</tt> values) to be set on the new revision in 1813 * the event that this is a committing operation. This table cannot 1814 * contain any standard Subversion properties. 1815 * 1816 * @a ctx->log_msg_func3/@a ctx->log_msg_baton3 are a callback/baton 1817 * combo that this function can use to query for a commit log message 1818 * when one is needed. 1819 * 1820 * If @a ctx->notify_func2 is non-NULL, then for each item deleted, call 1821 * @a ctx->notify_func2 with @a ctx->notify_baton2 and the path of the deleted 1822 * item. 1823 * 1824 * If @a commit_callback is non-NULL, then for each successful commit, call 1825 * @a commit_callback with @a commit_baton and a #svn_commit_info_t for 1826 * the commit. 1827 * 1828 * @since New in 1.7. 1829 */ 1830 svn_error_t * 1831 svn_client_delete4(const apr_array_header_t *paths, 1832 svn_boolean_t force, 1833 svn_boolean_t keep_local, 1834 const apr_hash_t *revprop_table, 1835 svn_commit_callback2_t commit_callback, 1836 void *commit_baton, 1837 svn_client_ctx_t *ctx, 1838 apr_pool_t *pool); 1839 1840 /** 1841 * Similar to svn_client_delete4(), but returns the commit info in 1842 * @a *commit_info_p rather than through a callback function. 1843 * 1844 * @since New in 1.5. 1845 * @deprecated Provided for backward compatibility with the 1.6 API. 1846 */ 1847 SVN_DEPRECATED 1848 svn_error_t * 1849 svn_client_delete3(svn_commit_info_t **commit_info_p, 1850 const apr_array_header_t *paths, 1851 svn_boolean_t force, 1852 svn_boolean_t keep_local, 1853 const apr_hash_t *revprop_table, 1854 svn_client_ctx_t *ctx, 1855 apr_pool_t *pool); 1856 1857 /** 1858 * Similar to svn_client_delete3(), but with @a keep_local always set 1859 * to FALSE, and @a revprop_table passed as NULL. 1860 * 1861 * @deprecated Provided for backward compatibility with the 1.4 API. 1862 */ 1863 SVN_DEPRECATED 1864 svn_error_t * 1865 svn_client_delete2(svn_commit_info_t **commit_info_p, 1866 const apr_array_header_t *paths, 1867 svn_boolean_t force, 1868 svn_client_ctx_t *ctx, 1869 apr_pool_t *pool); 1870 1871 /** 1872 * Similar to svn_client_delete2(), but takes the #svn_client_commit_info_t 1873 * type for @a commit_info_p. 1874 * 1875 * @deprecated Provided for backward compatibility with the 1.2 API. 1876 */ 1877 SVN_DEPRECATED 1878 svn_error_t * 1879 svn_client_delete(svn_client_commit_info_t **commit_info_p, 1880 const apr_array_header_t *paths, 1881 svn_boolean_t force, 1882 svn_client_ctx_t *ctx, 1883 apr_pool_t *pool); 1884 1885 1886 /** @} */ 1887 1888 /** 1889 * @defgroup Import Import files into the repository. 1890 * 1891 * @{ 1892 */ 1893 1894 /** 1895 * The callback invoked by svn_client_import5() before adding a node to the 1896 * list of nodes to be imported. 1897 * 1898 * @a baton is the value passed to @a svn_client_import5 as filter_baton. 1899 * 1900 * The callback receives the @a local_abspath for each node and the @a dirent 1901 * for it when walking the directory tree. Only the kind of node, including 1902 * special status is available in @a dirent. 1903 * 1904 * Implementations can set @a *filtered to TRUE, to make the import 1905 * process omit the node and (if the node is a directory) all its 1906 * descendants. 1907 * 1908 * @a scratch_pool can be used for temporary allocations. 1909 * 1910 * @since New in 1.8. 1911 */ 1912 typedef svn_error_t *(*svn_client_import_filter_func_t)( 1913 void *baton, 1914 svn_boolean_t *filtered, 1915 const char *local_abspath, 1916 const svn_io_dirent2_t *dirent, 1917 apr_pool_t *scratch_pool); 1918 1919 /** Import file or directory @a path into repository directory @a url at 1920 * head, authenticating with the authentication baton cached in @a ctx, 1921 * and using @a ctx->log_msg_func3/@a ctx->log_msg_baton3 to get a log message 1922 * for the (implied) commit. If some components of @a url do not exist 1923 * then create parent directories as necessary. 1924 * 1925 * This function reads an unversioned tree from disk and skips any ".svn" 1926 * directories. Even if a file or directory being imported is part of an 1927 * existing WC, this function sees it as unversioned and does not notice any 1928 * existing Subversion properties in it. 1929 * 1930 * If @a path is a directory, the contents of that directory are 1931 * imported directly into the directory identified by @a url. Note that the 1932 * directory @a path itself is not imported -- that is, the basename of 1933 * @a path is not part of the import. 1934 * 1935 * If @a path is a file, then the dirname of @a url is the directory 1936 * receiving the import. The basename of @a url is the filename in the 1937 * repository. In this case if @a url already exists, return error. 1938 * 1939 * If @a ctx->notify_func2 is non-NULL, then call @a ctx->notify_func2 with 1940 * @a ctx->notify_baton2 as the import progresses, with any of the following 1941 * actions: #svn_wc_notify_commit_added, 1942 * #svn_wc_notify_commit_postfix_txdelta. 1943 * 1944 * Use @a scratch_pool for any temporary allocation. 1945 * 1946 * If non-NULL, @a revprop_table is a hash table holding additional, 1947 * custom revision properties (<tt>const char *</tt> names mapped to 1948 * <tt>svn_string_t *</tt> values) to be set on the new revision. 1949 * This table cannot contain any standard Subversion properties. 1950 * 1951 * @a ctx->log_msg_func3/@a ctx->log_msg_baton3 are a callback/baton 1952 * combo that this function can use to query for a commit log message 1953 * when one is needed. 1954 * 1955 * If @a depth is #svn_depth_empty, import just @a path and nothing 1956 * below it. If #svn_depth_files, import @a path and any file 1957 * children of @a path. If #svn_depth_immediates, import @a path, any 1958 * file children, and any immediate subdirectories (but nothing 1959 * underneath those subdirectories). If #svn_depth_infinity, import 1960 * @a path and everything under it fully recursively. 1961 * 1962 * If @a no_ignore is @c FALSE, don't import any file or directory (or 1963 * recurse into any directory) that is found by recursion (as opposed to 1964 * being the explicit target @a path) and whose name matches the 1965 * global-ignores list in @a ctx->config. If @a no_ignore is @c TRUE, do 1966 * include such files and directories. (Note that svn:ignore properties are 1967 * not involved, as auto-props cannot set properties on directories and even 1968 * if the target is part of a WC the import ignores any existing 1969 * properties.) 1970 * 1971 * If @a no_autoprops is TRUE, don't set any autoprops on imported files. If 1972 * @a no_autoprops is FALSE then all imported files have autprops set as per 1973 * the auto-props list in @a ctx->config and the value of any 1974 * @c SVN_PROP_INHERITABLE_AUTO_PROPS properties inherited by and explicitly set 1975 * on @a url if @a url is already under versioned control, or the nearest parents 1976 * of @a path which are already under version control if not. 1977 * 1978 * If @a ignore_unknown_node_types is @c TRUE, ignore files of which the 1979 * node type is unknown, such as device files and pipes. 1980 * 1981 * If @a filter_callback is non-NULL, call it for each node that isn't ignored 1982 * for other reasons with @a filter_baton, to allow third party to ignore 1983 * specific nodes during importing. 1984 * 1985 * If @a commit_callback is non-NULL, then for each successful commit, call 1986 * @a commit_callback with @a commit_baton and a #svn_commit_info_t for 1987 * the commit. 1988 * 1989 * @since New in 1.8. 1990 */ 1991 svn_error_t * 1992 svn_client_import5(const char *path, 1993 const char *url, 1994 svn_depth_t depth, 1995 svn_boolean_t no_ignore, 1996 svn_boolean_t no_autoprops, 1997 svn_boolean_t ignore_unknown_node_types, 1998 const apr_hash_t *revprop_table, 1999 svn_client_import_filter_func_t filter_callback, 2000 void *filter_baton, 2001 svn_commit_callback2_t commit_callback, 2002 void *commit_baton, 2003 svn_client_ctx_t *ctx, 2004 apr_pool_t *scratch_pool); 2005 2006 /** 2007 * Similar to svn_client_import5(), but without support for an optional 2008 * @a filter_callback and @a no_autoprops always set to FALSE. 2009 * 2010 * @since New in 1.7. 2011 * @deprecated Provided for backward compatibility with the 1.7 API. 2012 */ 2013 SVN_DEPRECATED 2014 svn_error_t * 2015 svn_client_import4(const char *path, 2016 const char *url, 2017 svn_depth_t depth, 2018 svn_boolean_t no_ignore, 2019 svn_boolean_t ignore_unknown_node_types, 2020 const apr_hash_t *revprop_table, 2021 svn_commit_callback2_t commit_callback, 2022 void *commit_baton, 2023 svn_client_ctx_t *ctx, 2024 apr_pool_t *pool); 2025 2026 /** 2027 * Similar to svn_client_import4(), but returns the commit info in 2028 * @a *commit_info_p rather than through a callback function. 2029 * 2030 * @since New in 1.5. 2031 * @deprecated Provided for backward compatibility with the 1.6 API. 2032 */ 2033 SVN_DEPRECATED 2034 svn_error_t * 2035 svn_client_import3(svn_commit_info_t **commit_info_p, 2036 const char *path, 2037 const char *url, 2038 svn_depth_t depth, 2039 svn_boolean_t no_ignore, 2040 svn_boolean_t ignore_unknown_node_types, 2041 const apr_hash_t *revprop_table, 2042 svn_client_ctx_t *ctx, 2043 apr_pool_t *pool); 2044 2045 /** 2046 * Similar to svn_client_import3(), but with @a ignore_unknown_node_types 2047 * always set to @c FALSE, @a revprop_table passed as NULL, and @a 2048 * depth set according to @a nonrecursive: if TRUE, then @a depth is 2049 * #svn_depth_files, else #svn_depth_infinity. 2050 * 2051 * @since New in 1.3. 2052 * 2053 * @deprecated Provided for backward compatibility with the 1.4 API 2054 */ 2055 SVN_DEPRECATED 2056 svn_error_t * 2057 svn_client_import2(svn_commit_info_t **commit_info_p, 2058 const char *path, 2059 const char *url, 2060 svn_boolean_t nonrecursive, 2061 svn_boolean_t no_ignore, 2062 svn_client_ctx_t *ctx, 2063 apr_pool_t *pool); 2064 2065 /** 2066 * Similar to svn_client_import2(), but with @a no_ignore always set 2067 * to FALSE and using the #svn_client_commit_info_t type for 2068 * @a commit_info_p. 2069 * 2070 * @deprecated Provided for backward compatibility with the 1.2 API. 2071 */ 2072 SVN_DEPRECATED 2073 svn_error_t * 2074 svn_client_import(svn_client_commit_info_t **commit_info_p, 2075 const char *path, 2076 const char *url, 2077 svn_boolean_t nonrecursive, 2078 svn_client_ctx_t *ctx, 2079 apr_pool_t *pool); 2080 2081 /** @} */ 2082 2083 /** 2084 * @defgroup Commit Commit local modifications to the repository. 2085 * 2086 * @{ 2087 */ 2088 2089 /** 2090 * Commit files or directories into repository, authenticating with 2091 * the authentication baton cached in @a ctx, and using 2092 * @a ctx->log_msg_func3/@a ctx->log_msg_baton3 to obtain the log message. 2093 * Set @a *commit_info_p to the results of the commit, allocated in @a pool. 2094 * 2095 * @a targets is an array of <tt>const char *</tt> paths to commit. They 2096 * need not be canonicalized nor condensed; this function will take care of 2097 * that. If @a targets has zero elements, then do nothing and return 2098 * immediately without error. 2099 * 2100 * If non-NULL, @a revprop_table is a hash table holding additional, 2101 * custom revision properties (<tt>const char *</tt> names mapped to 2102 * <tt>svn_string_t *</tt> values) to be set on the new revision. 2103 * This table cannot contain any standard Subversion properties. 2104 * 2105 * If @a ctx->notify_func2 is non-NULL, then call @a ctx->notify_func2 with 2106 * @a ctx->notify_baton2 as the commit progresses, with any of the following 2107 * actions: #svn_wc_notify_commit_modified, #svn_wc_notify_commit_added, 2108 * #svn_wc_notify_commit_deleted, #svn_wc_notify_commit_replaced, 2109 * #svn_wc_notify_commit_copied, #svn_wc_notify_commit_copied_replaced, 2110 * #svn_wc_notify_commit_postfix_txdelta. 2111 * 2112 * If @a depth is #svn_depth_infinity, commit all changes to and 2113 * below named targets. If @a depth is #svn_depth_empty, commit 2114 * only named targets (that is, only property changes on named 2115 * directory targets, and property and content changes for named file 2116 * targets). If @a depth is #svn_depth_files, behave as above for 2117 * named file targets, and for named directory targets, commit 2118 * property changes on a named directory and all changes to files 2119 * directly inside that directory. If #svn_depth_immediates, behave 2120 * as for #svn_depth_files, and for subdirectories of any named 2121 * directory target commit as though for #svn_depth_empty. 2122 * 2123 * Unlock paths in the repository, unless @a keep_locks is TRUE. 2124 * 2125 * @a changelists is an array of <tt>const char *</tt> changelist 2126 * names, used as a restrictive filter on items that are committed; 2127 * that is, don't commit anything unless it's a member of one of those 2128 * changelists. After the commit completes successfully, remove 2129 * changelist associations from the targets, unless @a 2130 * keep_changelists is set. If @a changelists is 2131 * empty (or altogether @c NULL), no changelist filtering occurs. 2132 * 2133 * If @a commit_as_operations is set to FALSE, when a copy is committed 2134 * all changes below the copy are always committed at the same time 2135 * (independent of the value of @a depth). If @a commit_as_operations is 2136 * #TRUE, changes to descendants are only committed if they are itself 2137 * included via @a depth and targets. 2138 * 2139 * If @a include_file_externals and/or @a include_dir_externals are #TRUE, 2140 * also commit all file and/or dir externals (respectively) that are reached 2141 * by recursion, except for those externals which: 2142 * - have a fixed revision, or 2143 * - come from a different repository root URL (dir externals). 2144 * These flags affect only recursion; externals that directly appear in @a 2145 * targets are always included in the commit. 2146 * 2147 * ### TODO: currently, file externals hidden inside an unversioned dir are 2148 * skipped deliberately, because we can't commit those yet. 2149 * See STMT_SELECT_COMMITTABLE_EXTERNALS_BELOW. 2150 * 2151 * ### TODO: With @c depth_immediates, this function acts as if 2152 * @a include_dir_externals was passed #FALSE, but caller expects 2153 * immediate child dir externals to be included @c depth_empty. 2154 * 2155 * When @a commit_as_operations is #TRUE it is possible to delete a node and 2156 * all its descendants by selecting just the root of the deletion. If it is 2157 * set to #FALSE this will raise an error. 2158 * 2159 * If @a commit_callback is non-NULL, then for each successful commit, call 2160 * @a commit_callback with @a commit_baton and a #svn_commit_info_t for 2161 * the commit. 2162 * 2163 * @note #svn_depth_unknown and #svn_depth_exclude must not be passed 2164 * for @a depth. 2165 * 2166 * Use @a pool for any temporary allocations. 2167 * 2168 * @since New in 1.8. 2169 */ 2170 svn_error_t * 2171 svn_client_commit6(const apr_array_header_t *targets, 2172 svn_depth_t depth, 2173 svn_boolean_t keep_locks, 2174 svn_boolean_t keep_changelists, 2175 svn_boolean_t commit_as_operations, 2176 svn_boolean_t include_file_externals, 2177 svn_boolean_t include_dir_externals, 2178 const apr_array_header_t *changelists, 2179 const apr_hash_t *revprop_table, 2180 svn_commit_callback2_t commit_callback, 2181 void *commit_baton, 2182 svn_client_ctx_t *ctx, 2183 apr_pool_t *pool); 2184 2185 /** 2186 * Similar to svn_client_commit6(), but passes @a include_file_externals as 2187 * FALSE and @a include_dir_externals as FALSE. 2188 * 2189 * @since New in 1.7. 2190 * @deprecated Provided for backward compatibility with the 1.7 API. 2191 */ 2192 SVN_DEPRECATED 2193 svn_error_t * 2194 svn_client_commit5(const apr_array_header_t *targets, 2195 svn_depth_t depth, 2196 svn_boolean_t keep_locks, 2197 svn_boolean_t keep_changelists, 2198 svn_boolean_t commit_as_operations, 2199 const apr_array_header_t *changelists, 2200 const apr_hash_t *revprop_table, 2201 svn_commit_callback2_t commit_callback, 2202 void *commit_baton, 2203 svn_client_ctx_t *ctx, 2204 apr_pool_t *pool); 2205 2206 /** 2207 * Similar to svn_client_commit5(), but returns the commit info in 2208 * @a *commit_info_p rather than through a callback function. Does not use 2209 * #svn_wc_notify_commit_copied or #svn_wc_notify_commit_copied_replaced 2210 * (preferring #svn_wc_notify_commit_added and 2211 * #svn_wc_notify_commit_replaced, respectively, instead). 2212 * 2213 * Also, if no error is returned and @a (*commit_info_p)->revision is set to 2214 * #SVN_INVALID_REVNUM, then the commit was a no-op; nothing needed to 2215 * be committed. 2216 * 2217 * Sets @a commit_as_operations to FALSE to match Subversion 1.6's behavior. 2218 * 2219 * @since New in 1.5. 2220 * @deprecated Provided for backward compatibility with the 1.6 API. 2221 */ 2222 SVN_DEPRECATED 2223 svn_error_t * 2224 svn_client_commit4(svn_commit_info_t **commit_info_p, 2225 const apr_array_header_t *targets, 2226 svn_depth_t depth, 2227 svn_boolean_t keep_locks, 2228 svn_boolean_t keep_changelists, 2229 const apr_array_header_t *changelists, 2230 const apr_hash_t *revprop_table, 2231 svn_client_ctx_t *ctx, 2232 apr_pool_t *pool); 2233 2234 /** 2235 * Similar to svn_client_commit4(), but always with NULL for 2236 * @a changelist_name, FALSE for @a keep_changelist, NULL for @a 2237 * revprop_table, and @a depth set according to @a recurse: if @a 2238 * recurse is TRUE, use #svn_depth_infinity, else #svn_depth_empty. 2239 * 2240 * @deprecated Provided for backward compatibility with the 1.4 API. 2241 * 2242 * @since New in 1.3. 2243 */ 2244 SVN_DEPRECATED 2245 svn_error_t * 2246 svn_client_commit3(svn_commit_info_t **commit_info_p, 2247 const apr_array_header_t *targets, 2248 svn_boolean_t recurse, 2249 svn_boolean_t keep_locks, 2250 svn_client_ctx_t *ctx, 2251 apr_pool_t *pool); 2252 2253 /** 2254 * Similar to svn_client_commit3(), but uses #svn_client_commit_info_t 2255 * for @a commit_info_p. 2256 * 2257 * @deprecated Provided for backward compatibility with the 1.2 API. 2258 * 2259 * @since New in 1.2. 2260 */ 2261 SVN_DEPRECATED 2262 svn_error_t * 2263 svn_client_commit2(svn_client_commit_info_t **commit_info_p, 2264 const apr_array_header_t *targets, 2265 svn_boolean_t recurse, 2266 svn_boolean_t keep_locks, 2267 svn_client_ctx_t *ctx, 2268 apr_pool_t *pool); 2269 2270 /** 2271 * Similar to svn_client_commit2(), but with @a keep_locks set to 2272 * TRUE and @a nonrecursive instead of @a recurse. 2273 * 2274 * @deprecated Provided for backward compatibility with the 1.1 API. 2275 */ 2276 SVN_DEPRECATED 2277 svn_error_t * 2278 svn_client_commit(svn_client_commit_info_t **commit_info_p, 2279 const apr_array_header_t *targets, 2280 svn_boolean_t nonrecursive, 2281 svn_client_ctx_t *ctx, 2282 apr_pool_t *pool); 2283 2284 /** @} */ 2285 2286 /** 2287 * @defgroup Status Report interesting information about paths in the \ 2288 * working copy. 2289 * 2290 * @{ 2291 */ 2292 2293 /** 2294 * Structure for holding the "status" of a working copy item. 2295 * 2296 * @note Fields may be added to the end of this structure in future 2297 * versions. Therefore, to preserve binary compatibility, users 2298 * should not directly allocate structures of this type. 2299 * 2300 * @since New in 1.7. 2301 */ 2302 typedef struct svn_client_status_t 2303 { 2304 /** The kind of node as recorded in the working copy */ 2305 svn_node_kind_t kind; 2306 2307 /** The absolute path to the node */ 2308 const char *local_abspath; 2309 2310 /** The actual size of the working file on disk, or SVN_INVALID_FILESIZE 2311 * if unknown (or if the item isn't a file at all). */ 2312 svn_filesize_t filesize; 2313 2314 /** If the path is under version control, versioned is TRUE, otherwise 2315 * FALSE. */ 2316 svn_boolean_t versioned; 2317 2318 /** Set to TRUE if the node is the victim of some kind of conflict. */ 2319 svn_boolean_t conflicted; 2320 2321 /** The status of the node, based on the restructuring changes and if the 2322 * node has no restructuring changes the text and prop status. */ 2323 enum svn_wc_status_kind node_status; 2324 2325 /** The status of the text of the node, not including restructuring changes. 2326 * Valid values are: svn_wc_status_none, svn_wc_status_normal, 2327 * svn_wc_status_modified and svn_wc_status_conflicted. */ 2328 enum svn_wc_status_kind text_status; 2329 2330 /** The status of the node's properties. 2331 * Valid values are: svn_wc_status_none, svn_wc_status_normal, 2332 * svn_wc_status_modified and svn_wc_status_conflicted. */ 2333 enum svn_wc_status_kind prop_status; 2334 2335 /** A node can be 'locked' if a working copy update is in progress or 2336 * was interrupted. */ 2337 svn_boolean_t wc_is_locked; 2338 2339 /** A file or directory can be 'copied' if it's scheduled for 2340 * addition-with-history (or part of a subtree that is scheduled as such.). 2341 */ 2342 svn_boolean_t copied; 2343 2344 /** The URL of the repository root. */ 2345 const char *repos_root_url; 2346 2347 /** The UUID of the repository */ 2348 const char *repos_uuid; 2349 2350 /** The in-repository path relative to the repository root. */ 2351 const char *repos_relpath; 2352 2353 /** Base revision. */ 2354 svn_revnum_t revision; 2355 2356 /** Last revision this was changed */ 2357 svn_revnum_t changed_rev; 2358 2359 /** Date of last commit. */ 2360 apr_time_t changed_date; 2361 2362 /** Last commit author of this item */ 2363 const char *changed_author; 2364 2365 /** A file or directory can be 'switched' if the switch command has been 2366 * used. If this is TRUE, then file_external will be FALSE. 2367 */ 2368 svn_boolean_t switched; 2369 2370 /** If the item is a file that was added to the working copy with an 2371 * svn:externals; if file_external is TRUE, then switched is always 2372 * FALSE. 2373 */ 2374 svn_boolean_t file_external; 2375 2376 /** The locally present lock. (Values of path, token, owner, comment and 2377 * are available if a lock is present) */ 2378 const svn_lock_t *lock; 2379 2380 /** Which changelist this item is part of, or NULL if not part of any. */ 2381 const char *changelist; 2382 2383 /** The depth of the node as recorded in the working copy 2384 * (#svn_depth_unknown for files or when no depth is recorded) */ 2385 svn_depth_t depth; 2386 2387 /** 2388 * @defgroup svn_wc_status_ood WC out-of-date info from the repository 2389 * @{ 2390 * 2391 * When the working copy item is out-of-date compared to the 2392 * repository, the following fields represent the state of the 2393 * youngest revision of the item in the repository. If the working 2394 * copy is not out of date, the fields are initialized as described 2395 * below. 2396 */ 2397 2398 /** Set to the node kind of the youngest commit, or #svn_node_none 2399 * if not out of date. */ 2400 svn_node_kind_t ood_kind; 2401 2402 /** The status of the node, based on the text status if the node has no 2403 * restructuring changes */ 2404 enum svn_wc_status_kind repos_node_status; 2405 2406 /** The node's text status in the repository. */ 2407 enum svn_wc_status_kind repos_text_status; 2408 2409 /** The node's property status in the repository. */ 2410 enum svn_wc_status_kind repos_prop_status; 2411 2412 /** The node's lock in the repository, if any. */ 2413 const svn_lock_t *repos_lock; 2414 2415 /** Set to the youngest committed revision, or #SVN_INVALID_REVNUM 2416 * if not out of date. */ 2417 svn_revnum_t ood_changed_rev; 2418 2419 /** Set to the most recent commit date, or @c 0 if not out of date. */ 2420 apr_time_t ood_changed_date; 2421 2422 /** Set to the user name of the youngest commit, or @c NULL if not 2423 * out of date or non-existent. Because a non-existent @c 2424 * svn:author property has the same behavior as an out-of-date 2425 * working copy, examine @c ood_changed_rev to determine whether 2426 * the working copy is out of date. */ 2427 const char *ood_changed_author; 2428 2429 /** @} */ 2430 2431 /** Reserved for libsvn_client's internal use; this value is only to be used 2432 * for libsvn_client backwards compatibility wrappers. This value may be NULL 2433 * or to other data in future versions. */ 2434 const void *backwards_compatibility_baton; 2435 2436 /** Set to the local absolute path that this node was moved from, if this 2437 * file or directory has been moved here locally and is the root of that 2438 * move. Otherwise set to NULL. 2439 * 2440 * This will be NULL for moved-here nodes that are just part of a subtree 2441 * that was moved along (and are not themselves a root of a different move 2442 * operation). 2443 * 2444 * @since New in 1.8. */ 2445 const char *moved_from_abspath; 2446 2447 /** Set to the local absolute path that this node was moved to, if this file 2448 * or directory has been moved away locally and corresponds to the root 2449 * of the destination side of the move. Otherwise set to NULL. 2450 * 2451 * Note: Saying just "root" here could be misleading. For example: 2452 * svn mv A AA; 2453 * svn mv AA/B BB; 2454 * creates a situation where A/B is moved-to BB, but one could argue that 2455 * the move source's root actually was AA/B. Note that, as far as the 2456 * working copy is concerned, above case is exactly identical to: 2457 * svn mv A/B BB; 2458 * svn mv A AA; 2459 * In both situations, @a moved_to_abspath would be set for nodes A (moved 2460 * to AA) and A/B (moved to BB), only. 2461 * 2462 * This will be NULL for moved-away nodes that were just part of a subtree 2463 * that was moved along (and are not themselves a root of a different move 2464 * operation). 2465 * 2466 * @since New in 1.8. */ 2467 const char *moved_to_abspath; 2468 2469 /* NOTE! Please update svn_client_status_dup() when adding new fields here. */ 2470 } svn_client_status_t; 2471 2472 /** 2473 * Return a duplicate of @a status, allocated in @a result_pool. No part of the new 2474 * structure will be shared with @a status. 2475 * 2476 * @since New in 1.7. 2477 */ 2478 svn_client_status_t * 2479 svn_client_status_dup(const svn_client_status_t *status, 2480 apr_pool_t *result_pool); 2481 2482 /** 2483 * A callback for reporting a @a status about @a path (which may be an 2484 * absolute or relative path). 2485 * 2486 * @a baton is a closure object; it should be provided by the 2487 * implementation, and passed by the caller. 2488 * 2489 * @a scratch_pool will be cleared between invocations to the callback. 2490 * 2491 * @since New in 1.7. 2492 */ 2493 typedef svn_error_t *(*svn_client_status_func_t)( 2494 void *baton, 2495 const char *path, 2496 const svn_client_status_t *status, 2497 apr_pool_t *scratch_pool); 2498 2499 /** 2500 * Given @a path to a working copy directory (or single file), call 2501 * @a status_func/status_baton with a set of #svn_wc_status_t * 2502 * structures which describe the status of @a path, and its children 2503 * (recursing according to @a depth). 2504 * 2505 * - If @a get_all is set, retrieve all entries; otherwise, 2506 * retrieve only "interesting" entries (local mods and/or 2507 * out of date). 2508 * 2509 * - If @a check_out_of_date is set, contact the repository and 2510 * augment the status structures with information about 2511 * out-of-dateness (with respect to @a revision). Also, if @a 2512 * result_rev is not @c NULL, set @a *result_rev to the actual 2513 * revision against which the working copy was compared (@a 2514 * *result_rev is not meaningful unless @a check_out_of_date is 2515 * set). 2516 * 2517 * - If @a check_working_copy is not set, do not scan the working 2518 * copy for local modifications. This parameter will be ignored 2519 * unless @a check_out_of_date is set. When set, the status 2520 * report will not contain any information about local changes in 2521 * the working copy; this includes local deletions and 2522 * replacements. 2523 * 2524 * If @a no_ignore is @c FALSE, don't report any file or directory (or 2525 * recurse into any directory) that is found by recursion (as opposed to 2526 * being the explicit target @a path) and whose name matches the 2527 * svn:ignore property on its parent directory or the global-ignores 2528 * list in @a ctx->config. If @a no_ignore is @c TRUE, report each such 2529 * file or directory with the status code #svn_wc_status_ignored. 2530 * 2531 * If @a ignore_externals is not set, then recurse into externals 2532 * definitions (if any exist) after handling the main target. This 2533 * calls the client notification function (in @a ctx) with the 2534 * #svn_wc_notify_status_external action before handling each externals 2535 * definition, and with #svn_wc_notify_status_completed 2536 * after each. 2537 * 2538 * If @a depth_as_sticky is set and @a depth is not 2539 * #svn_depth_unknown, then the status is calculated as if depth_is_sticky 2540 * was passed to an equivalent update command. 2541 * 2542 * @a changelists is an array of <tt>const char *</tt> changelist 2543 * names, used as a restrictive filter on items whose statuses are 2544 * reported; that is, don't report status about any item unless 2545 * it's a member of one of those changelists. If @a changelists is 2546 * empty (or altogether @c NULL), no changelist filtering occurs. 2547 * 2548 * If @a path is an absolute path then the @c path parameter passed in each 2549 * call to @a status_func will be an absolute path. 2550 * 2551 * All temporary allocations are performed in @a scratch_pool. 2552 * 2553 * @since New in 1.9. 2554 */ 2555 svn_error_t * 2556 svn_client_status6(svn_revnum_t *result_rev, 2557 svn_client_ctx_t *ctx, 2558 const char *path, 2559 const svn_opt_revision_t *revision, 2560 svn_depth_t depth, 2561 svn_boolean_t get_all, 2562 svn_boolean_t check_out_of_date, 2563 svn_boolean_t check_working_copy, 2564 svn_boolean_t no_ignore, 2565 svn_boolean_t ignore_externals, 2566 svn_boolean_t depth_as_sticky, 2567 const apr_array_header_t *changelists, 2568 svn_client_status_func_t status_func, 2569 void *status_baton, 2570 apr_pool_t *scratch_pool); 2571 2572 2573 /** 2574 * Same as svn_client_status6(), but with @a check_out_of_date set to 2575 * @a update and @a check_working_copy set to @c TRUE. 2576 * 2577 * @since New in 1.7. 2578 * @deprecated Provided for backward compatibility with the 1.8 API. 2579 */ 2580 SVN_DEPRECATED 2581 svn_error_t * 2582 svn_client_status5(svn_revnum_t *result_rev, 2583 svn_client_ctx_t *ctx, 2584 const char *path, 2585 const svn_opt_revision_t *revision, 2586 svn_depth_t depth, 2587 svn_boolean_t get_all, 2588 svn_boolean_t update, 2589 svn_boolean_t no_ignore, 2590 svn_boolean_t ignore_externals, 2591 svn_boolean_t depth_as_sticky, 2592 const apr_array_header_t *changelists, 2593 svn_client_status_func_t status_func, 2594 void *status_baton, 2595 apr_pool_t *scratch_pool); 2596 2597 /** 2598 * Same as svn_client_status5(), but using #svn_wc_status_func3_t 2599 * instead of #svn_client_status_func_t and depth_as_sticky set to TRUE. 2600 * 2601 * @since New in 1.6. 2602 * @deprecated Provided for backward compatibility with the 1.6 API. 2603 */ 2604 SVN_DEPRECATED 2605 svn_error_t * 2606 svn_client_status4(svn_revnum_t *result_rev, 2607 const char *path, 2608 const svn_opt_revision_t *revision, 2609 svn_wc_status_func3_t status_func, 2610 void *status_baton, 2611 svn_depth_t depth, 2612 svn_boolean_t get_all, 2613 svn_boolean_t update, 2614 svn_boolean_t no_ignore, 2615 svn_boolean_t ignore_externals, 2616 const apr_array_header_t *changelists, 2617 svn_client_ctx_t *ctx, 2618 apr_pool_t *pool); 2619 2620 /** 2621 * Same as svn_client_status4(), but using an #svn_wc_status_func2_t 2622 * instead of an #svn_wc_status_func3_t. 2623 * 2624 * @since New in 1.5. 2625 * @deprecated Provided for backward compatibility with the 1.5 API. 2626 */ 2627 SVN_DEPRECATED 2628 svn_error_t * 2629 svn_client_status3(svn_revnum_t *result_rev, 2630 const char *path, 2631 const svn_opt_revision_t *revision, 2632 svn_wc_status_func2_t status_func, 2633 void *status_baton, 2634 svn_depth_t depth, 2635 svn_boolean_t get_all, 2636 svn_boolean_t update, 2637 svn_boolean_t no_ignore, 2638 svn_boolean_t ignore_externals, 2639 const apr_array_header_t *changelists, 2640 svn_client_ctx_t *ctx, 2641 apr_pool_t *pool); 2642 2643 /** 2644 * Like svn_client_status3(), except with @a changelists passed as @c 2645 * NULL, and with @a recurse instead of @a depth. If @a recurse is 2646 * TRUE, behave as if for #svn_depth_infinity; else if @a recurse is 2647 * FALSE, behave as if for #svn_depth_immediates. 2648 * 2649 * @since New in 1.2. 2650 * @deprecated Provided for backward compatibility with the 1.4 API. 2651 */ 2652 SVN_DEPRECATED 2653 svn_error_t * 2654 svn_client_status2(svn_revnum_t *result_rev, 2655 const char *path, 2656 const svn_opt_revision_t *revision, 2657 svn_wc_status_func2_t status_func, 2658 void *status_baton, 2659 svn_boolean_t recurse, 2660 svn_boolean_t get_all, 2661 svn_boolean_t update, 2662 svn_boolean_t no_ignore, 2663 svn_boolean_t ignore_externals, 2664 svn_client_ctx_t *ctx, 2665 apr_pool_t *pool); 2666 2667 2668 /** 2669 * Similar to svn_client_status2(), but with @a ignore_externals 2670 * always set to FALSE, taking the #svn_wc_status_func_t type 2671 * instead of the #svn_wc_status_func2_t type for @a status_func, 2672 * and requiring @a *revision to be non-const even though it is 2673 * treated as constant. 2674 * 2675 * @deprecated Provided for backward compatibility with the 1.1 API. 2676 */ 2677 SVN_DEPRECATED 2678 svn_error_t * 2679 svn_client_status(svn_revnum_t *result_rev, 2680 const char *path, 2681 svn_opt_revision_t *revision, 2682 svn_wc_status_func_t status_func, 2683 void *status_baton, 2684 svn_boolean_t recurse, 2685 svn_boolean_t get_all, 2686 svn_boolean_t update, 2687 svn_boolean_t no_ignore, 2688 svn_client_ctx_t *ctx, 2689 apr_pool_t *pool); 2690 2691 /** @} */ 2692 2693 /** 2694 * @defgroup Log View information about previous revisions of an object. 2695 * 2696 * @{ 2697 */ 2698 2699 /** 2700 * Invoke @a receiver with @a receiver_baton on each log message from 2701 * each (#svn_opt_revision_range_t *) range in @a revision_ranges in turn, 2702 * inclusive (but never invoke @a receiver on a given log message more 2703 * than once). 2704 * 2705 * @a targets contains either a URL followed by zero or more relative 2706 * paths, or 1 working copy path, as <tt>const char *</tt>, for which log 2707 * messages are desired. @a receiver is invoked only on messages whose 2708 * revisions involved a change to some path in @a targets. @a peg_revision 2709 * indicates in which revision @a targets are valid. If @a peg_revision is 2710 * #svn_opt_revision_unspecified, it defaults to #svn_opt_revision_head 2711 * for URLs or #svn_opt_revision_working for WC paths. 2712 * 2713 * If @a limit is greater than zero only invoke @a receiver on the first 2714 * @a limit logs. 2715 * 2716 * If @a discover_changed_paths is set, then the @c changed_paths and @c 2717 * changed_paths2 fields in the @c log_entry argument to @a receiver will be 2718 * populated on each invocation. @note The @c text_modified and @c 2719 * props_modified fields of the changed paths structure may have the value 2720 * #svn_tristate_unknown if the repository does not report that information. 2721 * 2722 * If @a strict_node_history is set, copy history (if any exists) will 2723 * not be traversed while harvesting revision logs for each target. 2724 * 2725 * If @a include_merged_revisions is set, log information for revisions 2726 * which have been merged to @a targets will also be returned. 2727 * 2728 * If @a revprops is NULL, retrieve all revision properties; else, retrieve 2729 * only the revision properties named by the (const char *) array elements 2730 * (i.e. retrieve none if the array is empty). 2731 * 2732 * Use @a pool for any temporary allocation. 2733 * 2734 * If @a ctx->notify_func2 is non-NULL, then call @a ctx->notify_func2/baton2 2735 * with a 'skip' signal on any unversioned targets. 2736 * 2737 * @since New in 1.6. 2738 */ 2739 svn_error_t * 2740 svn_client_log5(const apr_array_header_t *targets, 2741 const svn_opt_revision_t *peg_revision, 2742 const apr_array_header_t *revision_ranges, 2743 int limit, 2744 svn_boolean_t discover_changed_paths, 2745 svn_boolean_t strict_node_history, 2746 svn_boolean_t include_merged_revisions, 2747 const apr_array_header_t *revprops, 2748 svn_log_entry_receiver_t receiver, 2749 void *receiver_baton, 2750 svn_client_ctx_t *ctx, 2751 apr_pool_t *pool); 2752 2753 /** 2754 * Similar to svn_client_log5(), but takes explicit start and end parameters 2755 * instead of an array of revision ranges. 2756 * 2757 * @deprecated Provided for compatibility with the 1.5 API. 2758 * @since New in 1.5. 2759 */ 2760 SVN_DEPRECATED 2761 svn_error_t * 2762 svn_client_log4(const apr_array_header_t *targets, 2763 const svn_opt_revision_t *peg_revision, 2764 const svn_opt_revision_t *start, 2765 const svn_opt_revision_t *end, 2766 int limit, 2767 svn_boolean_t discover_changed_paths, 2768 svn_boolean_t strict_node_history, 2769 svn_boolean_t include_merged_revisions, 2770 const apr_array_header_t *revprops, 2771 svn_log_entry_receiver_t receiver, 2772 void *receiver_baton, 2773 svn_client_ctx_t *ctx, 2774 apr_pool_t *pool); 2775 2776 /** 2777 * Similar to svn_client_log4(), but using #svn_log_message_receiver_t 2778 * instead of #svn_log_entry_receiver_t. Also, @a 2779 * include_merged_revisions is set to @c FALSE and @a revprops is 2780 * svn:author, svn:date, and svn:log. 2781 * 2782 * @deprecated Provided for compatibility with the 1.4 API. 2783 * @since New in 1.4. 2784 */ 2785 SVN_DEPRECATED 2786 svn_error_t * 2787 svn_client_log3(const apr_array_header_t *targets, 2788 const svn_opt_revision_t *peg_revision, 2789 const svn_opt_revision_t *start, 2790 const svn_opt_revision_t *end, 2791 int limit, 2792 svn_boolean_t discover_changed_paths, 2793 svn_boolean_t strict_node_history, 2794 svn_log_message_receiver_t receiver, 2795 void *receiver_baton, 2796 svn_client_ctx_t *ctx, 2797 apr_pool_t *pool); 2798 2799 2800 /** 2801 * Similar to svn_client_log3(), but with the @c kind field of 2802 * @a peg_revision set to #svn_opt_revision_unspecified. 2803 * 2804 * @par Important: 2805 * A special case for the revision range HEAD:1, which was present 2806 * in svn_client_log(), has been removed from svn_client_log2(). Instead, it 2807 * is expected that callers will specify the range HEAD:0, to avoid a 2808 * #SVN_ERR_FS_NO_SUCH_REVISION error when invoked against an empty repository 2809 * (i.e. one not containing a revision 1). 2810 * 2811 * @deprecated Provided for compatibility with the 1.3 API. 2812 * @since New in 1.2. 2813 */ 2814 SVN_DEPRECATED 2815 svn_error_t * 2816 svn_client_log2(const apr_array_header_t *targets, 2817 const svn_opt_revision_t *start, 2818 const svn_opt_revision_t *end, 2819 int limit, 2820 svn_boolean_t discover_changed_paths, 2821 svn_boolean_t strict_node_history, 2822 svn_log_message_receiver_t receiver, 2823 void *receiver_baton, 2824 svn_client_ctx_t *ctx, 2825 apr_pool_t *pool); 2826 2827 2828 /** 2829 * Similar to svn_client_log2(), but with @a limit set to 0, and the 2830 * following special case: 2831 * 2832 * Special case for repositories at revision 0: 2833 * 2834 * If @a start->kind is #svn_opt_revision_head, and @a end->kind is 2835 * #svn_opt_revision_number && @a end->number is @c 1, then handle an 2836 * empty (no revisions) repository specially: instead of erroring 2837 * because requested revision 1 when the highest revision is 0, just 2838 * invoke @a receiver on revision 0, passing @c NULL for changed paths and 2839 * empty strings for the author and date. This is because that 2840 * particular combination of @a start and @a end usually indicates the 2841 * common case of log invocation -- the user wants to see all log 2842 * messages from youngest to oldest, where the oldest commit is 2843 * revision 1. That works fine, except when there are no commits in 2844 * the repository, hence this special case. 2845 * 2846 * @deprecated Provided for backward compatibility with the 1.1 API. 2847 */ 2848 SVN_DEPRECATED 2849 svn_error_t * 2850 svn_client_log(const apr_array_header_t *targets, 2851 const svn_opt_revision_t *start, 2852 const svn_opt_revision_t *end, 2853 svn_boolean_t discover_changed_paths, 2854 svn_boolean_t strict_node_history, 2855 svn_log_message_receiver_t receiver, 2856 void *receiver_baton, 2857 svn_client_ctx_t *ctx, 2858 apr_pool_t *pool); 2859 2860 /** @} */ 2861 2862 /** 2863 * @defgroup Blame Show modification information about lines in a file. 2864 * 2865 * @{ 2866 */ 2867 2868 /** 2869 * Invoke @a receiver with @a receiver_baton on each line-blame item 2870 * associated with revision @a end of @a path_or_url, using @a start 2871 * as the default source of all blame. @a peg_revision indicates in 2872 * which revision @a path_or_url is valid. If @a peg_revision->kind 2873 * is #svn_opt_revision_unspecified, then it defaults to 2874 * #svn_opt_revision_head for URLs or #svn_opt_revision_working for 2875 * WC targets. 2876 * 2877 * If @a start->kind or @a end->kind is #svn_opt_revision_unspecified, 2878 * return the error #SVN_ERR_CLIENT_BAD_REVISION. If either are 2879 * #svn_opt_revision_working, return the error 2880 * #SVN_ERR_UNSUPPORTED_FEATURE. If any of the revisions of @a 2881 * path_or_url have a binary mime-type, return the error 2882 * #SVN_ERR_CLIENT_IS_BINARY_FILE, unless @a ignore_mime_type is TRUE, 2883 * in which case blame information will be generated regardless of the 2884 * MIME types of the revisions. 2885 * 2886 * @a start may resolve to a revision number greater (younger) than @a end 2887 * only if the server is 1.8.0 or greater (supports 2888 * #SVN_RA_CAPABILITY_GET_FILE_REVS_REVERSE) and the client is 1.9.0 or 2889 * newer. 2890 * 2891 * Use @a diff_options to determine how to compare different revisions of the 2892 * target. 2893 * 2894 * If @a include_merged_revisions is TRUE, also return data based upon 2895 * revisions which have been merged to @a path_or_url. 2896 * 2897 * Use @a pool for any temporary allocation. 2898 * 2899 * @since New in 1.7. 2900 */ 2901 svn_error_t * 2902 svn_client_blame5(const char *path_or_url, 2903 const svn_opt_revision_t *peg_revision, 2904 const svn_opt_revision_t *start, 2905 const svn_opt_revision_t *end, 2906 const svn_diff_file_options_t *diff_options, 2907 svn_boolean_t ignore_mime_type, 2908 svn_boolean_t include_merged_revisions, 2909 svn_client_blame_receiver3_t receiver, 2910 void *receiver_baton, 2911 svn_client_ctx_t *ctx, 2912 apr_pool_t *pool); 2913 2914 2915 /** 2916 * Similar to svn_client_blame5(), but with #svn_client_blame_receiver3_t 2917 * as the receiver. 2918 * 2919 * @deprecated Provided for backwards compatibility with the 1.6 API. 2920 * 2921 * @since New in 1.5. 2922 */ 2923 SVN_DEPRECATED 2924 svn_error_t * 2925 svn_client_blame4(const char *path_or_url, 2926 const svn_opt_revision_t *peg_revision, 2927 const svn_opt_revision_t *start, 2928 const svn_opt_revision_t *end, 2929 const svn_diff_file_options_t *diff_options, 2930 svn_boolean_t ignore_mime_type, 2931 svn_boolean_t include_merged_revisions, 2932 svn_client_blame_receiver2_t receiver, 2933 void *receiver_baton, 2934 svn_client_ctx_t *ctx, 2935 apr_pool_t *pool); 2936 2937 /** 2938 * Similar to svn_client_blame4(), but with @a include_merged_revisions set 2939 * to FALSE, and using a #svn_client_blame_receiver2_t as the receiver. 2940 * 2941 * @deprecated Provided for backwards compatibility with the 1.4 API. 2942 * 2943 * @since New in 1.4. 2944 */ 2945 SVN_DEPRECATED 2946 svn_error_t * 2947 svn_client_blame3(const char *path_or_url, 2948 const svn_opt_revision_t *peg_revision, 2949 const svn_opt_revision_t *start, 2950 const svn_opt_revision_t *end, 2951 const svn_diff_file_options_t *diff_options, 2952 svn_boolean_t ignore_mime_type, 2953 svn_client_blame_receiver_t receiver, 2954 void *receiver_baton, 2955 svn_client_ctx_t *ctx, 2956 apr_pool_t *pool); 2957 2958 /** 2959 * Similar to svn_client_blame3(), but with @a diff_options set to 2960 * default options as returned by svn_diff_file_options_parse() and 2961 * @a ignore_mime_type set to FALSE. 2962 * 2963 * @deprecated Provided for backwards compatibility with the 1.3 API. 2964 * 2965 * @since New in 1.2. 2966 */ 2967 SVN_DEPRECATED 2968 svn_error_t * 2969 svn_client_blame2(const char *path_or_url, 2970 const svn_opt_revision_t *peg_revision, 2971 const svn_opt_revision_t *start, 2972 const svn_opt_revision_t *end, 2973 svn_client_blame_receiver_t receiver, 2974 void *receiver_baton, 2975 svn_client_ctx_t *ctx, 2976 apr_pool_t *pool); 2977 2978 /** 2979 * Similar to svn_client_blame2() except that @a peg_revision is always 2980 * the same as @a end. 2981 * 2982 * @deprecated Provided for backward compatibility with the 1.1 API. 2983 */ 2984 SVN_DEPRECATED 2985 svn_error_t * 2986 svn_client_blame(const char *path_or_url, 2987 const svn_opt_revision_t *start, 2988 const svn_opt_revision_t *end, 2989 svn_client_blame_receiver_t receiver, 2990 void *receiver_baton, 2991 svn_client_ctx_t *ctx, 2992 apr_pool_t *pool); 2993 2994 /** @} */ 2995 2996 /** 2997 * @defgroup Diff Generate differences between paths. 2998 * 2999 * @{ 3000 */ 3001 3002 /** 3003 * Produce diff output which describes the delta between 3004 * @a path_or_url1/@a revision1 and @a path_or_url2/@a revision2. Print 3005 * the output of the diff to @a outstream, and any errors to @a 3006 * errstream. @a path_or_url1 and @a path_or_url2 can be either 3007 * working-copy paths or URLs. 3008 * 3009 * If @a relative_to_dir is not @c NULL, the original path and 3010 * modified path will have the @a relative_to_dir stripped from the 3011 * front of the respective paths. If @a relative_to_dir is @c NULL, 3012 * paths will not be modified. If @a relative_to_dir is not 3013 * @c NULL but @a relative_to_dir is not a parent path of the target, 3014 * an error is returned. Finally, if @a relative_to_dir is a URL, an 3015 * error will be returned. 3016 * 3017 * If either @a revision1 or @a revision2 has an `unspecified' or 3018 * unrecognized `kind', return #SVN_ERR_CLIENT_BAD_REVISION. 3019 * 3020 * @a path_or_url1 and @a path_or_url2 must both represent the same node 3021 * kind -- that is, if @a path_or_url1 is a directory, @a path_or_url2 3022 * must also be, and if @a path_or_url1 is a file, @a path_or_url2 must 3023 * also be. 3024 * 3025 * If @a depth is #svn_depth_infinity, diff fully recursively. 3026 * Else if it is #svn_depth_immediates, diff the named paths and 3027 * their file children (if any), and diff properties of 3028 * subdirectories, but do not descend further into the subdirectories. 3029 * Else if #svn_depth_files, behave as if for #svn_depth_immediates 3030 * except don't diff properties of subdirectories. If 3031 * #svn_depth_empty, diff exactly the named paths but nothing 3032 * underneath them. 3033 * 3034 * Use @a ignore_ancestry to control whether or not items being 3035 * diffed will be checked for relatedness first. Unrelated items 3036 * are typically transmitted to the editor as a deletion of one thing 3037 * and the addition of another, but if this flag is TRUE, unrelated 3038 * items will be diffed as if they were related. 3039 * 3040 * If @a no_diff_added is TRUE, then no diff output will be generated 3041 * on added files. 3042 * 3043 * If @a no_diff_deleted is TRUE, then no diff output will be 3044 * generated on deleted files. 3045 * 3046 * If @a show_copies_as_adds is TRUE, then copied files will not be diffed 3047 * against their copyfrom source, and will appear in the diff output 3048 * in their entirety, as if they were newly added. 3049 * ### BUGS: For a repos-repos diff, this is ignored. Instead, a file is 3050 * diffed against its copyfrom source iff the file is the diff target 3051 * and not if some parent directory is the diff target. For a repos-WC 3052 * diff, this is ignored if the file is the diff target. 3053 * 3054 * If @a use_git_diff_format is TRUE, then the git's extended diff format 3055 * will be used. 3056 * ### Do we need to say more about the format? A reference perhaps? 3057 * 3058 * If @a ignore_properties is TRUE, do not show property differences. 3059 * If @a properties_only is TRUE, show only property changes. 3060 * The above two options are mutually exclusive. It is an error to set 3061 * both to TRUE. 3062 * 3063 * Generated headers are encoded using @a header_encoding. 3064 * 3065 * Diff output will not be generated for binary files, unless @a 3066 * ignore_content_type is TRUE, in which case diffs will be shown 3067 * regardless of the content types. 3068 * 3069 * @a diff_options (an array of <tt>const char *</tt>) is used to pass 3070 * additional command line options to the diff processes invoked to compare 3071 * files. @a diff_options is allowed to be @c NULL, in which case a value 3072 * for this option might still be obtained from the Subversion configuration 3073 * file via client context @a ctx. 3074 * 3075 * The authentication baton cached in @a ctx is used to communicate with 3076 * the repository. 3077 * 3078 * @a changelists is an array of <tt>const char *</tt> changelist 3079 * names, used as a restrictive filter on items whose differences are 3080 * reported; that is, don't generate diffs about any item unless 3081 * it's a member of one of those changelists. If @a changelists is 3082 * empty (or altogether @c NULL), no changelist filtering occurs. 3083 * 3084 * @note Changelist filtering only applies to diffs in which at least 3085 * one side of the diff represents working copy data. 3086 * 3087 * @note @a header_encoding doesn't affect headers generated by external 3088 * diff programs. 3089 * 3090 * @note @a relative_to_dir doesn't affect the path index generated by 3091 * external diff programs. 3092 * 3093 * @since New in 1.8. 3094 */ 3095 svn_error_t * 3096 svn_client_diff6(const apr_array_header_t *diff_options, 3097 const char *path_or_url1, 3098 const svn_opt_revision_t *revision1, 3099 const char *path_or_url2, 3100 const svn_opt_revision_t *revision2, 3101 const char *relative_to_dir, 3102 svn_depth_t depth, 3103 svn_boolean_t ignore_ancestry, 3104 svn_boolean_t no_diff_added, 3105 svn_boolean_t no_diff_deleted, 3106 svn_boolean_t show_copies_as_adds, 3107 svn_boolean_t ignore_content_type, 3108 svn_boolean_t ignore_properties, 3109 svn_boolean_t properties_only, 3110 svn_boolean_t use_git_diff_format, 3111 const char *header_encoding, 3112 svn_stream_t *outstream, 3113 svn_stream_t *errstream, 3114 const apr_array_header_t *changelists, 3115 svn_client_ctx_t *ctx, 3116 apr_pool_t *pool); 3117 3118 /** Similar to svn_client_diff6(), but with @a outfile and @a errfile, 3119 * instead of @a outstream and @a errstream, and with @a 3120 * no_diff_added, @a ignore_properties, and @a properties_only always 3121 * passed as @c FALSE (which means that additions and property changes 3122 * are always transmitted). 3123 * 3124 * @deprecated Provided for backward compatibility with the 1.7 API. 3125 * @since New in 1.7. 3126 */ 3127 SVN_DEPRECATED 3128 svn_error_t * 3129 svn_client_diff5(const apr_array_header_t *diff_options, 3130 const char *path1, 3131 const svn_opt_revision_t *revision1, 3132 const char *path2, 3133 const svn_opt_revision_t *revision2, 3134 const char *relative_to_dir, 3135 svn_depth_t depth, 3136 svn_boolean_t ignore_ancestry, 3137 svn_boolean_t no_diff_deleted, 3138 svn_boolean_t show_copies_as_adds, 3139 svn_boolean_t ignore_content_type, 3140 svn_boolean_t use_git_diff_format, 3141 const char *header_encoding, 3142 apr_file_t *outfile, 3143 apr_file_t *errfile, 3144 const apr_array_header_t *changelists, 3145 svn_client_ctx_t *ctx, 3146 apr_pool_t *pool); 3147 3148 /** 3149 * Similar to svn_client_diff5(), but with @a show_copies_as_adds set to 3150 * @c FALSE and @a use_git_diff_format set to @c FALSE. 3151 * 3152 * @deprecated Provided for backward compatibility with the 1.6 API. 3153 * @since New in 1.5. 3154 */ 3155 SVN_DEPRECATED 3156 svn_error_t * 3157 svn_client_diff4(const apr_array_header_t *diff_options, 3158 const char *path1, 3159 const svn_opt_revision_t *revision1, 3160 const char *path2, 3161 const svn_opt_revision_t *revision2, 3162 const char *relative_to_dir, 3163 svn_depth_t depth, 3164 svn_boolean_t ignore_ancestry, 3165 svn_boolean_t no_diff_deleted, 3166 svn_boolean_t ignore_content_type, 3167 const char *header_encoding, 3168 apr_file_t *outfile, 3169 apr_file_t *errfile, 3170 const apr_array_header_t *changelists, 3171 svn_client_ctx_t *ctx, 3172 apr_pool_t *pool); 3173 3174 /** 3175 * Similar to svn_client_diff4(), but with @a changelists passed as @c 3176 * NULL, and @a depth set according to @a recurse: if @a recurse is 3177 * TRUE, set @a depth to #svn_depth_infinity, if @a recurse is 3178 * FALSE, set @a depth to #svn_depth_empty. 3179 * 3180 * @deprecated Provided for backward compatibility with the 1.4 API. 3181 * @since New in 1.3. 3182 */ 3183 SVN_DEPRECATED 3184 svn_error_t * 3185 svn_client_diff3(const apr_array_header_t *diff_options, 3186 const char *path1, 3187 const svn_opt_revision_t *revision1, 3188 const char *path2, 3189 const svn_opt_revision_t *revision2, 3190 svn_boolean_t recurse, 3191 svn_boolean_t ignore_ancestry, 3192 svn_boolean_t no_diff_deleted, 3193 svn_boolean_t ignore_content_type, 3194 const char *header_encoding, 3195 apr_file_t *outfile, 3196 apr_file_t *errfile, 3197 svn_client_ctx_t *ctx, 3198 apr_pool_t *pool); 3199 3200 3201 /** 3202 * Similar to svn_client_diff3(), but with @a header_encoding set to 3203 * @c APR_LOCALE_CHARSET. 3204 * 3205 * @deprecated Provided for backward compatibility with the 1.2 API. 3206 * @since New in 1.2. 3207 */ 3208 SVN_DEPRECATED 3209 svn_error_t * 3210 svn_client_diff2(const apr_array_header_t *diff_options, 3211 const char *path1, 3212 const svn_opt_revision_t *revision1, 3213 const char *path2, 3214 const svn_opt_revision_t *revision2, 3215 svn_boolean_t recurse, 3216 svn_boolean_t ignore_ancestry, 3217 svn_boolean_t no_diff_deleted, 3218 svn_boolean_t ignore_content_type, 3219 apr_file_t *outfile, 3220 apr_file_t *errfile, 3221 svn_client_ctx_t *ctx, 3222 apr_pool_t *pool); 3223 3224 /** 3225 * Similar to svn_client_diff2(), but with @a ignore_content_type 3226 * always set to FALSE. 3227 * 3228 * @deprecated Provided for backward compatibility with the 1.1 API. 3229 */ 3230 SVN_DEPRECATED 3231 svn_error_t * 3232 svn_client_diff(const apr_array_header_t *diff_options, 3233 const char *path1, 3234 const svn_opt_revision_t *revision1, 3235 const char *path2, 3236 const svn_opt_revision_t *revision2, 3237 svn_boolean_t recurse, 3238 svn_boolean_t ignore_ancestry, 3239 svn_boolean_t no_diff_deleted, 3240 apr_file_t *outfile, 3241 apr_file_t *errfile, 3242 svn_client_ctx_t *ctx, 3243 apr_pool_t *pool); 3244 3245 /** 3246 * Produce diff output which describes the delta between the filesystem 3247 * object @a path_or_url in peg revision @a peg_revision, as it changed 3248 * between @a start_revision and @a end_revision. @a path_or_url can 3249 * be either a working-copy path or URL. 3250 * 3251 * If @a peg_revision is #svn_opt_revision_unspecified, behave 3252 * identically to svn_client_diff6(), using @a path_or_url for both of that 3253 * function's @a path_or_url1 and @a path_or_url2 arguments. 3254 * 3255 * All other options are handled identically to svn_client_diff6(). 3256 * 3257 * @since New in 1.8. 3258 */ 3259 svn_error_t * 3260 svn_client_diff_peg6(const apr_array_header_t *diff_options, 3261 const char *path_or_url, 3262 const svn_opt_revision_t *peg_revision, 3263 const svn_opt_revision_t *start_revision, 3264 const svn_opt_revision_t *end_revision, 3265 const char *relative_to_dir, 3266 svn_depth_t depth, 3267 svn_boolean_t ignore_ancestry, 3268 svn_boolean_t no_diff_added, 3269 svn_boolean_t no_diff_deleted, 3270 svn_boolean_t show_copies_as_adds, 3271 svn_boolean_t ignore_content_type, 3272 svn_boolean_t ignore_properties, 3273 svn_boolean_t properties_only, 3274 svn_boolean_t use_git_diff_format, 3275 const char *header_encoding, 3276 svn_stream_t *outstream, 3277 svn_stream_t *errstream, 3278 const apr_array_header_t *changelists, 3279 svn_client_ctx_t *ctx, 3280 apr_pool_t *pool); 3281 3282 /** Similar to svn_client_diff6_peg6(), but with @a outfile and @a errfile, 3283 * instead of @a outstream and @a errstream, and with @a 3284 * no_diff_added, @a ignore_properties, and @a properties_only always 3285 * passed as @c FALSE (which means that additions and property changes 3286 * are always transmitted). 3287 * 3288 * @deprecated Provided for backward compatibility with the 1.7 API. 3289 * @since New in 1.7. 3290 */ 3291 SVN_DEPRECATED 3292 svn_error_t * 3293 svn_client_diff_peg5(const apr_array_header_t *diff_options, 3294 const char *path, 3295 const svn_opt_revision_t *peg_revision, 3296 const svn_opt_revision_t *start_revision, 3297 const svn_opt_revision_t *end_revision, 3298 const char *relative_to_dir, 3299 svn_depth_t depth, 3300 svn_boolean_t ignore_ancestry, 3301 svn_boolean_t no_diff_deleted, 3302 svn_boolean_t show_copies_as_adds, 3303 svn_boolean_t ignore_content_type, 3304 svn_boolean_t use_git_diff_format, 3305 const char *header_encoding, 3306 apr_file_t *outfile, 3307 apr_file_t *errfile, 3308 const apr_array_header_t *changelists, 3309 svn_client_ctx_t *ctx, 3310 apr_pool_t *pool); 3311 3312 /** 3313 * Similar to svn_client_diff_peg5(), but with @a show_copies_as_adds set to 3314 * @c FALSE and @a use_git_diff_format set to @c FALSE. 3315 * 3316 * @since New in 1.5. 3317 * @deprecated Provided for backward compatibility with the 1.6 API. 3318 */ 3319 SVN_DEPRECATED 3320 svn_error_t * 3321 svn_client_diff_peg4(const apr_array_header_t *diff_options, 3322 const char *path, 3323 const svn_opt_revision_t *peg_revision, 3324 const svn_opt_revision_t *start_revision, 3325 const svn_opt_revision_t *end_revision, 3326 const char *relative_to_dir, 3327 svn_depth_t depth, 3328 svn_boolean_t ignore_ancestry, 3329 svn_boolean_t no_diff_deleted, 3330 svn_boolean_t ignore_content_type, 3331 const char *header_encoding, 3332 apr_file_t *outfile, 3333 apr_file_t *errfile, 3334 const apr_array_header_t *changelists, 3335 svn_client_ctx_t *ctx, 3336 apr_pool_t *pool); 3337 3338 /** 3339 * Similar to svn_client_diff_peg4(), but with @a changelists passed 3340 * as @c NULL, and @a depth set according to @a recurse: if @a recurse 3341 * is TRUE, set @a depth to #svn_depth_infinity, if @a recurse is 3342 * FALSE, set @a depth to #svn_depth_files. 3343 * 3344 * @deprecated Provided for backward compatibility with the 1.4 API. 3345 * @since New in 1.3. 3346 */ 3347 SVN_DEPRECATED 3348 svn_error_t * 3349 svn_client_diff_peg3(const apr_array_header_t *diff_options, 3350 const char *path, 3351 const svn_opt_revision_t *peg_revision, 3352 const svn_opt_revision_t *start_revision, 3353 const svn_opt_revision_t *end_revision, 3354 svn_boolean_t recurse, 3355 svn_boolean_t ignore_ancestry, 3356 svn_boolean_t no_diff_deleted, 3357 svn_boolean_t ignore_content_type, 3358 const char *header_encoding, 3359 apr_file_t *outfile, 3360 apr_file_t *errfile, 3361 svn_client_ctx_t *ctx, 3362 apr_pool_t *pool); 3363 3364 /** 3365 * Similar to svn_client_diff_peg3(), but with @a header_encoding set to 3366 * @c APR_LOCALE_CHARSET. 3367 * 3368 * @deprecated Provided for backward compatibility with the 1.2 API. 3369 * @since New in 1.2. 3370 */ 3371 SVN_DEPRECATED 3372 svn_error_t * 3373 svn_client_diff_peg2(const apr_array_header_t *diff_options, 3374 const char *path, 3375 const svn_opt_revision_t *peg_revision, 3376 const svn_opt_revision_t *start_revision, 3377 const svn_opt_revision_t *end_revision, 3378 svn_boolean_t recurse, 3379 svn_boolean_t ignore_ancestry, 3380 svn_boolean_t no_diff_deleted, 3381 svn_boolean_t ignore_content_type, 3382 apr_file_t *outfile, 3383 apr_file_t *errfile, 3384 svn_client_ctx_t *ctx, 3385 apr_pool_t *pool); 3386 3387 /** 3388 * Similar to svn_client_diff_peg2(), but with @a ignore_content_type 3389 * always set to FALSE. 3390 * 3391 * @since New in 1.1. 3392 * @deprecated Provided for backward compatibility with the 1.1 API. 3393 */ 3394 SVN_DEPRECATED 3395 svn_error_t * 3396 svn_client_diff_peg(const apr_array_header_t *diff_options, 3397 const char *path, 3398 const svn_opt_revision_t *peg_revision, 3399 const svn_opt_revision_t *start_revision, 3400 const svn_opt_revision_t *end_revision, 3401 svn_boolean_t recurse, 3402 svn_boolean_t ignore_ancestry, 3403 svn_boolean_t no_diff_deleted, 3404 apr_file_t *outfile, 3405 apr_file_t *errfile, 3406 svn_client_ctx_t *ctx, 3407 apr_pool_t *pool); 3408 3409 /** 3410 * Produce a diff summary which lists the changed items between 3411 * @a path_or_url1/@a revision1 and @a path_or_url2/@a revision2 without 3412 * creating text deltas. @a path_or_url1 and @a path_or_url2 can be 3413 * either working-copy paths or URLs. 3414 * 3415 * The function may report false positives if @a ignore_ancestry is false, 3416 * since a file might have been modified between two revisions, but still 3417 * have the same contents. 3418 * 3419 * Calls @a summarize_func with @a summarize_baton for each difference 3420 * with a #svn_client_diff_summarize_t structure describing the difference. 3421 * 3422 * See svn_client_diff6() for a description of the other parameters. 3423 * 3424 * @since New in 1.5. 3425 */ 3426 svn_error_t * 3427 svn_client_diff_summarize2(const char *path_or_url1, 3428 const svn_opt_revision_t *revision1, 3429 const char *path_or_url2, 3430 const svn_opt_revision_t *revision2, 3431 svn_depth_t depth, 3432 svn_boolean_t ignore_ancestry, 3433 const apr_array_header_t *changelists, 3434 svn_client_diff_summarize_func_t summarize_func, 3435 void *summarize_baton, 3436 svn_client_ctx_t *ctx, 3437 apr_pool_t *pool); 3438 3439 /** 3440 * Similar to svn_client_diff_summarize2(), but with @a changelists 3441 * passed as @c NULL, and @a depth set according to @a recurse: if @a 3442 * recurse is TRUE, set @a depth to #svn_depth_infinity, if @a 3443 * recurse is FALSE, set @a depth to #svn_depth_files. 3444 * 3445 * @deprecated Provided for backward compatibility with the 1.4 API. 3446 * 3447 * @since New in 1.4. 3448 */ 3449 SVN_DEPRECATED 3450 svn_error_t * 3451 svn_client_diff_summarize(const char *path1, 3452 const svn_opt_revision_t *revision1, 3453 const char *path2, 3454 const svn_opt_revision_t *revision2, 3455 svn_boolean_t recurse, 3456 svn_boolean_t ignore_ancestry, 3457 svn_client_diff_summarize_func_t summarize_func, 3458 void *summarize_baton, 3459 svn_client_ctx_t *ctx, 3460 apr_pool_t *pool); 3461 3462 /** 3463 * Produce a diff summary which lists the changed items between the 3464 * filesystem object @a path_or_url in peg revision @a peg_revision, as it 3465 * changed between @a start_revision and @a end_revision. @a path_or_url can 3466 * be either a working-copy path or URL. 3467 * 3468 * If @a peg_revision is #svn_opt_revision_unspecified, behave 3469 * identically to svn_client_diff_summarize2(), using @a path_or_url for 3470 * both of that function's @a path_or_url1 and @a path_or_url2 arguments. 3471 * 3472 * The function may report false positives if @a ignore_ancestry is false, 3473 * as described in the documentation for svn_client_diff_summarize2(). 3474 * 3475 * Call @a summarize_func with @a summarize_baton for each difference 3476 * with a #svn_client_diff_summarize_t structure describing the difference. 3477 * 3478 * See svn_client_diff_peg5() for a description of the other parameters. 3479 * 3480 * @since New in 1.5. 3481 */ 3482 svn_error_t * 3483 svn_client_diff_summarize_peg2(const char *path_or_url, 3484 const svn_opt_revision_t *peg_revision, 3485 const svn_opt_revision_t *start_revision, 3486 const svn_opt_revision_t *end_revision, 3487 svn_depth_t depth, 3488 svn_boolean_t ignore_ancestry, 3489 const apr_array_header_t *changelists, 3490 svn_client_diff_summarize_func_t summarize_func, 3491 void *summarize_baton, 3492 svn_client_ctx_t *ctx, 3493 apr_pool_t *pool); 3494 3495 /** 3496 * Similar to svn_client_diff_summarize_peg2(), but with @a 3497 * changelists passed as @c NULL, and @a depth set according to @a 3498 * recurse: if @a recurse is TRUE, set @a depth to 3499 * #svn_depth_infinity, if @a recurse is FALSE, set @a depth to 3500 * #svn_depth_files. 3501 * 3502 * @deprecated Provided for backward compatibility with the 1.4 API. 3503 * 3504 * @since New in 1.4. 3505 */ 3506 SVN_DEPRECATED 3507 svn_error_t * 3508 svn_client_diff_summarize_peg(const char *path, 3509 const svn_opt_revision_t *peg_revision, 3510 const svn_opt_revision_t *start_revision, 3511 const svn_opt_revision_t *end_revision, 3512 svn_boolean_t recurse, 3513 svn_boolean_t ignore_ancestry, 3514 svn_client_diff_summarize_func_t summarize_func, 3515 void *summarize_baton, 3516 svn_client_ctx_t *ctx, 3517 apr_pool_t *pool); 3518 3519 /** @} */ 3520 3521 /** 3522 * @defgroup Merge Merge changes between branches. 3523 * 3524 * @{ 3525 */ 3526 3527 /** Get information about the state of merging between two branches. 3528 * 3529 * The source is specified by @a source_path_or_url at @a source_revision. 3530 * The target is specified by @a target_path_or_url at @a target_revision, 3531 * which refers to either a WC or a repository location. 3532 * 3533 * Set @a *needs_reintegration to true if an automatic merge from source 3534 * to target would be a reintegration merge: that is, if the last automatic 3535 * merge was in the opposite direction; or to false otherwise. 3536 * 3537 * Set @a *yca_url, @a *yca_rev, @a *base_url, @a *base_rev, @a *right_url, 3538 * @a *right_rev, @a *target_url, @a *target_rev to the repository locations 3539 * of, respectively: the youngest common ancestor of the branches, the base 3540 * chosen for 3-way merge, the right-hand side of the source diff, and the 3541 * target. 3542 * 3543 * Set @a repos_root_url to the URL of the repository root. This is a 3544 * common prefix of all four URL outputs. 3545 * 3546 * Allocate the results in @a result_pool. Any of the output pointers may 3547 * be NULL if not wanted. 3548 * 3549 * @since New in 1.8. 3550 */ 3551 svn_error_t * 3552 svn_client_get_merging_summary(svn_boolean_t *needs_reintegration, 3553 const char **yca_url, svn_revnum_t *yca_rev, 3554 const char **base_url, svn_revnum_t *base_rev, 3555 const char **right_url, svn_revnum_t *right_rev, 3556 const char **target_url, svn_revnum_t *target_rev, 3557 const char **repos_root_url, 3558 const char *source_path_or_url, 3559 const svn_opt_revision_t *source_revision, 3560 const char *target_path_or_url, 3561 const svn_opt_revision_t *target_revision, 3562 svn_client_ctx_t *ctx, 3563 apr_pool_t *result_pool, 3564 apr_pool_t *scratch_pool); 3565 3566 3567 /** Merge changes from @a source1/@a revision1 to @a source2/@a revision2 into 3568 * the working-copy path @a target_wcpath. 3569 * 3570 * @a source1 and @a source2 are either URLs that refer to entries in the 3571 * repository, or paths to entries in the working copy. 3572 * 3573 * By "merging", we mean: apply file differences using 3574 * svn_wc_merge(), and schedule additions & deletions when appropriate. 3575 * 3576 * @a source1 and @a source2 must both represent the same node kind -- that 3577 * is, if @a source1 is a directory, @a source2 must also be, and if @a source1 3578 * is a file, @a source2 must also be. 3579 * 3580 * If either @a revision1 or @a revision2 has an `unspecified' or 3581 * unrecognized `kind', return #SVN_ERR_CLIENT_BAD_REVISION. 3582 * 3583 * If @a depth is #svn_depth_infinity, merge fully recursively. 3584 * Else if #svn_depth_immediates, merge changes at most to files 3585 * that are immediate children of @a target_wcpath and to directory 3586 * properties of @a target_wcpath and its immediate subdirectory children. 3587 * Else if #svn_depth_files, merge at most to immediate file 3588 * children of @a target_wcpath and to @a target_wcpath itself. 3589 * Else if #svn_depth_empty, apply changes only to @a target_wcpath 3590 * (i.e., directory property changes only) 3591 * 3592 * If @a depth is #svn_depth_unknown, use the depth of @a target_wcpath. 3593 * 3594 * If @a ignore_mergeinfo is true, disable merge tracking, by treating the 3595 * two sources as unrelated even if they actually have a common ancestor. 3596 * 3597 * If @a diff_ignore_ancestry is true, diff unrelated nodes as if related: 3598 * that is, diff the 'left' and 'right' versions of a node as if they were 3599 * related (if they are the same kind) even if they are not related. 3600 * Otherwise, diff unrelated items as a deletion of one thing and the 3601 * addition of another. 3602 * 3603 * If @a force_delete is false and the merge involves deleting a file whose 3604 * content differs from the source-left version, or a locally modified 3605 * directory, or an unversioned item, then the operation will fail. If 3606 * @a force_delete is true then all such items will be deleted. 3607 * 3608 * @a merge_options (an array of <tt>const char *</tt>), if non-NULL, 3609 * is used to pass additional command line arguments to the merge 3610 * processes (internal or external). @see 3611 * svn_diff_file_options_parse(). 3612 * 3613 * If @a ctx->notify_func2 is non-NULL, then call @a ctx->notify_func2 with @a 3614 * ctx->notify_baton2 once for each merged target, passing the target's local 3615 * path. 3616 * 3617 * If @a record_only is TRUE, the merge is performed, but is limited only to 3618 * mergeinfo property changes on existing paths in @a target_wcpath. 3619 * 3620 * If @a dry_run is TRUE, the merge is carried out, and full notification 3621 * feedback is provided, but the working copy is not modified. 3622 * 3623 * If allow_mixed_rev is @c FALSE, and @a merge_target is a mixed-revision 3624 * working copy, raise @c SVN_ERR_CLIENT_MERGE_UPDATE_REQUIRED. 3625 * Because users rarely intend to merge into mixed-revision working copies, 3626 * it is recommended to set this parameter to FALSE by default unless the 3627 * user has explicitly requested a merge into a mixed-revision working copy. 3628 * 3629 * The authentication baton cached in @a ctx is used to communicate with the 3630 * repository. 3631 * 3632 * @since New in 1.8. 3633 */ 3634 svn_error_t * 3635 svn_client_merge5(const char *source1, 3636 const svn_opt_revision_t *revision1, 3637 const char *source2, 3638 const svn_opt_revision_t *revision2, 3639 const char *target_wcpath, 3640 svn_depth_t depth, 3641 svn_boolean_t ignore_mergeinfo, 3642 svn_boolean_t diff_ignore_ancestry, 3643 svn_boolean_t force_delete, 3644 svn_boolean_t record_only, 3645 svn_boolean_t dry_run, 3646 svn_boolean_t allow_mixed_rev, 3647 const apr_array_header_t *merge_options, 3648 svn_client_ctx_t *ctx, 3649 apr_pool_t *pool); 3650 3651 /** 3652 * Similar to svn_client_merge5(), but the single @a ignore_ancestry 3653 * parameter maps to both @c ignore_mergeinfo and @c diff_ignore_ancestry. 3654 * 3655 * @deprecated Provided for backward compatibility with the 1.7 API. 3656 * @since New in 1.7. 3657 */ 3658 SVN_DEPRECATED 3659 svn_error_t * 3660 svn_client_merge4(const char *source1, 3661 const svn_opt_revision_t *revision1, 3662 const char *source2, 3663 const svn_opt_revision_t *revision2, 3664 const char *target_wcpath, 3665 svn_depth_t depth, 3666 svn_boolean_t ignore_ancestry, 3667 svn_boolean_t force_delete, 3668 svn_boolean_t record_only, 3669 svn_boolean_t dry_run, 3670 svn_boolean_t allow_mixed_rev, 3671 const apr_array_header_t *merge_options, 3672 svn_client_ctx_t *ctx, 3673 apr_pool_t *pool); 3674 3675 /** 3676 * Similar to svn_client_merge4(), but with @a allow_mixed_rev set to 3677 * @c TRUE. The @a force parameter maps to the @c force_delete parameter 3678 * of svn_client_merge4(). 3679 * 3680 * @deprecated Provided for backward compatibility with the 1.6 API. 3681 * 3682 * @since New in 1.5. 3683 */ 3684 SVN_DEPRECATED 3685 svn_error_t * 3686 svn_client_merge3(const char *source1, 3687 const svn_opt_revision_t *revision1, 3688 const char *source2, 3689 const svn_opt_revision_t *revision2, 3690 const char *target_wcpath, 3691 svn_depth_t depth, 3692 svn_boolean_t ignore_ancestry, 3693 svn_boolean_t force, 3694 svn_boolean_t record_only, 3695 svn_boolean_t dry_run, 3696 const apr_array_header_t *merge_options, 3697 svn_client_ctx_t *ctx, 3698 apr_pool_t *pool); 3699 3700 /** 3701 * Similar to svn_client_merge3(), but with @a record_only set to @c 3702 * FALSE, and @a depth set according to @a recurse: if @a recurse is 3703 * TRUE, set @a depth to #svn_depth_infinity, if @a recurse is 3704 * FALSE, set @a depth to #svn_depth_files. 3705 * 3706 * @deprecated Provided for backward compatibility with the 1.4 API. 3707 * 3708 * @since New in 1.4. 3709 */ 3710 SVN_DEPRECATED 3711 svn_error_t * 3712 svn_client_merge2(const char *source1, 3713 const svn_opt_revision_t *revision1, 3714 const char *source2, 3715 const svn_opt_revision_t *revision2, 3716 const char *target_wcpath, 3717 svn_boolean_t recurse, 3718 svn_boolean_t ignore_ancestry, 3719 svn_boolean_t force, 3720 svn_boolean_t dry_run, 3721 const apr_array_header_t *merge_options, 3722 svn_client_ctx_t *ctx, 3723 apr_pool_t *pool); 3724 3725 3726 /** 3727 * Similar to svn_client_merge2(), but with @a merge_options set to NULL. 3728 * 3729 * @deprecated Provided for backwards compatibility with the 1.3 API. 3730 */ 3731 SVN_DEPRECATED 3732 svn_error_t * 3733 svn_client_merge(const char *source1, 3734 const svn_opt_revision_t *revision1, 3735 const char *source2, 3736 const svn_opt_revision_t *revision2, 3737 const char *target_wcpath, 3738 svn_boolean_t recurse, 3739 svn_boolean_t ignore_ancestry, 3740 svn_boolean_t force, 3741 svn_boolean_t dry_run, 3742 svn_client_ctx_t *ctx, 3743 apr_pool_t *pool); 3744 3745 3746 /** 3747 * Perform a reintegration merge of @a source_path_or_url at @a source_peg_revision 3748 * into @a target_wcpath. 3749 * @a target_wcpath must be a single-revision, #svn_depth_infinity, 3750 * pristine, unswitched working copy -- in other words, it must 3751 * reflect a single revision tree, the "target". The mergeinfo on @a 3752 * source_path_or_url must reflect that all of the target has been merged into it. 3753 * Then this behaves like a merge with svn_client_merge5() from the 3754 * target's URL to the source. 3755 * 3756 * All other options are handled identically to svn_client_merge5(). 3757 * The depth of the merge is always #svn_depth_infinity. 3758 * 3759 * @since New in 1.5. 3760 * @deprecated Provided for backwards compatibility with the 1.7 API. 3761 */ 3762 SVN_DEPRECATED 3763 svn_error_t * 3764 svn_client_merge_reintegrate(const char *source_path_or_url, 3765 const svn_opt_revision_t *source_peg_revision, 3766 const char *target_wcpath, 3767 svn_boolean_t dry_run, 3768 const apr_array_header_t *merge_options, 3769 svn_client_ctx_t *ctx, 3770 apr_pool_t *pool); 3771 3772 /** 3773 * Merge changes from the source branch identified by 3774 * @a source_path_or_url in peg revision @a source_peg_revision, 3775 * into the target branch working copy at @a target_wcpath. 3776 * 3777 * If @a ranges_to_merge is NULL then perform an automatic merge of 3778 * all the eligible changes up to @a source_peg_revision. If the merge 3779 * required is a reintegrate merge, then return an error if the WC has 3780 * mixed revisions, local modifications and/or switched subtrees; if 3781 * the merge is determined to be of the non-reintegrate kind, then 3782 * return an error if @a allow_mixed_rev is false and the WC contains 3783 * mixed revisions. 3784 * 3785 * If @a ranges_to_merge is not NULL then merge the changes specified 3786 * by the revision ranges in @a ranges_to_merge, or, when honouring 3787 * mergeinfo, only the eligible parts of those revision ranges. 3788 * @a ranges_to_merge is an array of <tt>svn_opt_revision_range_t 3789 * *</tt> ranges. These ranges may describe additive and/or 3790 * subtractive merge ranges, they may overlap fully or partially, 3791 * and/or they may partially or fully negate each other. This 3792 * rangelist is not required to be sorted. If any revision in the 3793 * list of provided ranges has an `unspecified' or unrecognized 3794 * `kind', return #SVN_ERR_CLIENT_BAD_REVISION. 3795 * 3796 * If @a ranges_to_merge is an empty array, then do nothing. 3797 * 3798 * All other options are handled identically to svn_client_merge5(). 3799 * 3800 * @since New in 1.8. 3801 */ 3802 svn_error_t * 3803 svn_client_merge_peg5(const char *source_path_or_url, 3804 const apr_array_header_t *ranges_to_merge, 3805 const svn_opt_revision_t *source_peg_revision, 3806 const char *target_wcpath, 3807 svn_depth_t depth, 3808 svn_boolean_t ignore_mergeinfo, 3809 svn_boolean_t diff_ignore_ancestry, 3810 svn_boolean_t force_delete, 3811 svn_boolean_t record_only, 3812 svn_boolean_t dry_run, 3813 svn_boolean_t allow_mixed_rev, 3814 const apr_array_header_t *merge_options, 3815 svn_client_ctx_t *ctx, 3816 apr_pool_t *pool); 3817 3818 /** 3819 * Similar to svn_client_merge_peg5(), but automatic merge is not available 3820 * (@a ranges_to_merge must not be NULL), and the single @a ignore_ancestry 3821 * parameter maps to both @c ignore_mergeinfo and @c diff_ignore_ancestry. 3822 * 3823 * @deprecated Provided for backward compatibility with the 1.7 API. 3824 * @since New in 1.7. 3825 */ 3826 SVN_DEPRECATED 3827 svn_error_t * 3828 svn_client_merge_peg4(const char *source_path_or_url, 3829 const apr_array_header_t *ranges_to_merge, 3830 const svn_opt_revision_t *source_peg_revision, 3831 const char *target_wcpath, 3832 svn_depth_t depth, 3833 svn_boolean_t ignore_ancestry, 3834 svn_boolean_t force_delete, 3835 svn_boolean_t record_only, 3836 svn_boolean_t dry_run, 3837 svn_boolean_t allow_mixed_rev, 3838 const apr_array_header_t *merge_options, 3839 svn_client_ctx_t *ctx, 3840 apr_pool_t *pool); 3841 3842 /** 3843 * Similar to svn_client_merge_peg4(), but with @a allow_mixed_rev set to 3844 * @c TRUE. The @a force parameter maps to the @c force_delete parameter 3845 * of svn_client_merge_peg4(). 3846 * 3847 * @deprecated Provided for backward compatibility with the 1.6 API. 3848 * 3849 * @since New in 1.5. 3850 */ 3851 SVN_DEPRECATED 3852 svn_error_t * 3853 svn_client_merge_peg3(const char *source, 3854 const apr_array_header_t *ranges_to_merge, 3855 const svn_opt_revision_t *peg_revision, 3856 const char *target_wcpath, 3857 svn_depth_t depth, 3858 svn_boolean_t ignore_ancestry, 3859 svn_boolean_t force, 3860 svn_boolean_t record_only, 3861 svn_boolean_t dry_run, 3862 const apr_array_header_t *merge_options, 3863 svn_client_ctx_t *ctx, 3864 apr_pool_t *pool); 3865 3866 /** 3867 * Similar to svn_client_merge_peg3(), but with @a record_only set to 3868 * @c FALSE, and @a depth set according to @a recurse: if @a recurse 3869 * is TRUE, set @a depth to #svn_depth_infinity, if @a recurse is 3870 * FALSE, set @a depth to #svn_depth_files. 3871 * 3872 * @deprecated Provided for backwards compatibility with the 1.4 API. 3873 * 3874 * @since New in 1.4. 3875 */ 3876 SVN_DEPRECATED 3877 svn_error_t * 3878 svn_client_merge_peg2(const char *source, 3879 const svn_opt_revision_t *revision1, 3880 const svn_opt_revision_t *revision2, 3881 const svn_opt_revision_t *peg_revision, 3882 const char *target_wcpath, 3883 svn_boolean_t recurse, 3884 svn_boolean_t ignore_ancestry, 3885 svn_boolean_t force, 3886 svn_boolean_t dry_run, 3887 const apr_array_header_t *merge_options, 3888 svn_client_ctx_t *ctx, 3889 apr_pool_t *pool); 3890 3891 /** 3892 * Similar to svn_client_merge_peg2(), but with @a merge_options set to 3893 * NULL. 3894 * 3895 * @deprecated Provided for backwards compatibility with the 1.3 API. 3896 * 3897 * @since New in 1.1. 3898 */ 3899 SVN_DEPRECATED 3900 svn_error_t * 3901 svn_client_merge_peg(const char *source, 3902 const svn_opt_revision_t *revision1, 3903 const svn_opt_revision_t *revision2, 3904 const svn_opt_revision_t *peg_revision, 3905 const char *target_wcpath, 3906 svn_boolean_t recurse, 3907 svn_boolean_t ignore_ancestry, 3908 svn_boolean_t force, 3909 svn_boolean_t dry_run, 3910 svn_client_ctx_t *ctx, 3911 apr_pool_t *pool); 3912 3913 3914 /** Set @a suggestions to an ordered array of @c const char * 3915 * potential merge sources (expressed as full repository URLs) for @a 3916 * path_or_url at @a peg_revision. @a path_or_url is a working copy 3917 * path or repository URL. @a ctx is a context used for 3918 * authentication in the repository case. Use @a pool for all 3919 * allocations. 3920 * 3921 * @since New in 1.5. 3922 */ 3923 svn_error_t * 3924 svn_client_suggest_merge_sources(apr_array_header_t **suggestions, 3925 const char *path_or_url, 3926 const svn_opt_revision_t *peg_revision, 3927 svn_client_ctx_t *ctx, 3928 apr_pool_t *pool); 3929 3930 3931 /** 3932 * Get the mergeinfo for a single target node (ignoring any subtrees). 3933 * 3934 * Set @a *mergeinfo to a hash mapping <tt>const char *</tt> merge source 3935 * URLs to <tt>svn_rangelist_t *</tt> rangelists describing the ranges which 3936 * have been merged into @a path_or_url as of @a peg_revision, per 3937 * @a path_or_url's explicit mergeinfo or inherited mergeinfo if no 3938 * explicit mergeinfo if found. If no explicit or inherited mergeinfo 3939 * is found, then set @a *mergeinfo to NULL. 3940 * 3941 * Use @a pool for all necessary allocations. 3942 * 3943 * If the server doesn't support retrieval of mergeinfo (which will 3944 * never happen for file:// URLs), return an 3945 * #SVN_ERR_UNSUPPORTED_FEATURE error. 3946 * 3947 * @note Unlike most APIs which deal with mergeinfo, this one returns 3948 * data where the keys of the hash are absolute repository URLs rather 3949 * than repository filesystem paths. 3950 * 3951 * @since New in 1.5. 3952 */ 3953 svn_error_t * 3954 svn_client_mergeinfo_get_merged(apr_hash_t **mergeinfo, 3955 const char *path_or_url, 3956 const svn_opt_revision_t *peg_revision, 3957 svn_client_ctx_t *ctx, 3958 apr_pool_t *pool); 3959 3960 3961 /** 3962 * Describe the revisions that either have or have not been merged from 3963 * one source branch (or subtree) into another. 3964 * 3965 * If @a finding_merged is TRUE, then drive log entry callbacks 3966 * @a receiver / @a receiver_baton with the revisions merged from 3967 * @a source_path_or_url (as of @a source_peg_revision) into 3968 * @a target_path_or_url (as of @a target_peg_revision). If @a 3969 * finding_merged is FALSE then find the revisions eligible for merging. 3970 * 3971 * If both @a source_start_revision and @a source_end_revision are 3972 * unspecified (that is, of kind @c svn_opt_revision_unspecified), 3973 * @a receiver will be called the requested revisions from 0 to 3974 * @a source_peg_revision and in that order (that is, oldest to 3975 * youngest). Otherwise, both @a source_start_revision and 3976 * @a source_end_revision must be specified, which has two effects: 3977 * 3978 * - @a receiver will be called only with revisions which fall 3979 * within range of @a source_start_revision to 3980 * @a source_end_revision, inclusive, and 3981 * 3982 * - those revisions will be ordered in the same "direction" as the 3983 * walk from @a source_start_revision to @a source_end_revision. 3984 * (If @a source_start_revision is the younger of the two, @a 3985 * receiver will be called with revisions in youngest-to-oldest 3986 * order; otherwise, the reverse occurs.) 3987 * 3988 * If @a depth is #svn_depth_empty consider only the explicit or 3989 * inherited mergeinfo on @a target_path_or_url when calculating merged 3990 * revisions from @a source_path_or_url. If @a depth is #svn_depth_infinity 3991 * then also consider the explicit subtree mergeinfo under @a 3992 * target_path_or_url. 3993 * If a depth other than #svn_depth_empty or #svn_depth_infinity is 3994 * requested then return a #SVN_ERR_UNSUPPORTED_FEATURE error. 3995 * 3996 * In addition to the behavior of @a discover_changed_paths described in 3997 * svn_client_log5(), if set to TRUE it enables detection of sub-tree 3998 * merges that are complete but can't be detected as complete without 3999 * access to the changed paths. Sub-tree merges detected as complete will 4000 * be included if @a finding_merged is TRUE or filtered if @a finding_merged 4001 * is FALSE. 4002 * 4003 * @a revprops is the same as for svn_client_log5(). Use @a scratch_pool for 4004 * all temporary allocations. 4005 * 4006 * @a ctx is a context used for authentication. 4007 * 4008 * If the server doesn't support retrieval of mergeinfo, return an 4009 * #SVN_ERR_UNSUPPORTED_FEATURE error. 4010 * 4011 * @since New in 1.8. 4012 */ 4013 svn_error_t * 4014 svn_client_mergeinfo_log2(svn_boolean_t finding_merged, 4015 const char *target_path_or_url, 4016 const svn_opt_revision_t *target_peg_revision, 4017 const char *source_path_or_url, 4018 const svn_opt_revision_t *source_peg_revision, 4019 const svn_opt_revision_t *source_start_revision, 4020 const svn_opt_revision_t *source_end_revision, 4021 svn_log_entry_receiver_t receiver, 4022 void *receiver_baton, 4023 svn_boolean_t discover_changed_paths, 4024 svn_depth_t depth, 4025 const apr_array_header_t *revprops, 4026 svn_client_ctx_t *ctx, 4027 apr_pool_t *scratch_pool); 4028 4029 /** 4030 * Similar to svn_client_mergeinfo_log2(), but with @a source_start_revision 4031 * and @a source_end_revision always of kind @c svn_opt_revision_unspecified; 4032 * 4033 * @deprecated Provided for backwards compatibility with the 1.7 API. 4034 * @since New in 1.7. 4035 */ 4036 SVN_DEPRECATED 4037 svn_error_t * 4038 svn_client_mergeinfo_log(svn_boolean_t finding_merged, 4039 const char *target_path_or_url, 4040 const svn_opt_revision_t *target_peg_revision, 4041 const char *source_path_or_url, 4042 const svn_opt_revision_t *source_peg_revision, 4043 svn_log_entry_receiver_t receiver, 4044 void *receiver_baton, 4045 svn_boolean_t discover_changed_paths, 4046 svn_depth_t depth, 4047 const apr_array_header_t *revprops, 4048 svn_client_ctx_t *ctx, 4049 apr_pool_t *scratch_pool); 4050 4051 /** 4052 * Similar to svn_client_mergeinfo_log(), but finds only merged revisions 4053 * and always operates at @a depth #svn_depth_empty. 4054 * 4055 * @deprecated Provided for backwards compatibility with the 1.6 API. Use 4056 * svn_client_mergeinfo_log() instead. 4057 * @since New in 1.5. 4058 */ 4059 SVN_DEPRECATED 4060 svn_error_t * 4061 svn_client_mergeinfo_log_merged(const char *path_or_url, 4062 const svn_opt_revision_t *peg_revision, 4063 const char *merge_source_path_or_url, 4064 const svn_opt_revision_t *src_peg_revision, 4065 svn_log_entry_receiver_t receiver, 4066 void *receiver_baton, 4067 svn_boolean_t discover_changed_paths, 4068 const apr_array_header_t *revprops, 4069 svn_client_ctx_t *ctx, 4070 apr_pool_t *pool); 4071 4072 /** 4073 * Similar to svn_client_mergeinfo_log(), but finds only eligible revisions 4074 * and always operates at @a depth #svn_depth_empty. 4075 * 4076 * @deprecated Provided for backwards compatibility with the 1.6 API. Use 4077 * svn_client_mergeinfo_log() instead. 4078 * @since New in 1.5. 4079 */ 4080 SVN_DEPRECATED 4081 svn_error_t * 4082 svn_client_mergeinfo_log_eligible(const char *path_or_url, 4083 const svn_opt_revision_t *peg_revision, 4084 const char *merge_source_path_or_url, 4085 const svn_opt_revision_t *src_peg_revision, 4086 svn_log_entry_receiver_t receiver, 4087 void *receiver_baton, 4088 svn_boolean_t discover_changed_paths, 4089 const apr_array_header_t *revprops, 4090 svn_client_ctx_t *ctx, 4091 apr_pool_t *pool); 4092 4093 /** @} */ 4094 4095 /** 4096 * @defgroup Cleanup Cleanup an abnormally terminated working copy. 4097 * 4098 * @{ 4099 */ 4100 4101 /** Recursively vacuum a working copy directory @a dir_abspath, 4102 * removing unnecessary data. 4103 * 4104 * If @a include_externals is @c TRUE, recurse into externals and vacuum them 4105 * as well. 4106 * 4107 * If @a remove_unversioned_items is @c TRUE, remove unversioned items 4108 * in @a dir_abspath after successful working copy cleanup. 4109 * If @a remove_ignored_items is @c TRUE, remove ignored unversioned items 4110 * in @a dir_abspath after successful working copy cleanup. 4111 * 4112 * If @a fix_recorded_timestamps is @c TRUE, this function fixes recorded 4113 * timestamps for unmodified files in the working copy, reducing comparision 4114 * time on future checks. 4115 * 4116 * If @a vacuum_pristines is @c TRUE, and @a dir_abspath points to the working 4117 * copy root unreferenced files in the pristine store are removed. 4118 * 4119 * When asked to remove unversioned or ignored items, and the working copy 4120 * is already locked, return #SVN_ERR_WC_LOCKED. This prevents accidental 4121 * working copy corruption in case users run the cleanup operation to 4122 * remove unversioned items while another client is performing some other 4123 * operation on the working copy. 4124 * 4125 * If @a ctx->cancel_func is non-NULL, invoke it with @a 4126 * ctx->cancel_baton at various points during the operation. If it 4127 * returns an error (typically #SVN_ERR_CANCELLED), return that error 4128 * immediately. 4129 * 4130 * Use @a scratch_pool for any temporary allocations. 4131 * 4132 * @since New in 1.9. 4133 */ 4134 svn_error_t * 4135 svn_client_vacuum(const char *dir_abspath, 4136 svn_boolean_t remove_unversioned_items, 4137 svn_boolean_t remove_ignored_items, 4138 svn_boolean_t fix_recorded_timestamps, 4139 svn_boolean_t vacuum_pristines, 4140 svn_boolean_t include_externals, 4141 svn_client_ctx_t *ctx, 4142 apr_pool_t *scratch_pool); 4143 4144 4145 /** Recursively cleanup a working copy directory @a dir_abspath, finishing any 4146 * incomplete operations, removing lockfiles, etc. 4147 * 4148 * If @a break_locks is @c TRUE, existing working copy locks at or below @a 4149 * dir_abspath are broken, otherwise a normal write lock is obtained. 4150 * 4151 * If @a fix_recorded_timestamps is @c TRUE, this function fixes recorded 4152 * timestamps for unmodified files in the working copy, reducing comparision 4153 * time on future checks. 4154 * 4155 * If @a clear_dav_cache is @c TRUE, the caching of DAV information for older 4156 * mod_dav served repositories is cleared. This clearing invalidates some 4157 * cached information used for pre-HTTPv2 repositories. 4158 * 4159 * If @a vacuum_pristines is @c TRUE, and @a dir_abspath points to the working 4160 * copy root unreferenced files in the pristine store are removed. 4161 * 4162 * If @a include_externals is @c TRUE, recurse into externals and clean 4163 * them up as well. 4164 * 4165 * If @a ctx->cancel_func is non-NULL, invoke it with @a 4166 * ctx->cancel_baton at various points during the operation. If it 4167 * returns an error (typically #SVN_ERR_CANCELLED), return that error 4168 * immediately. 4169 * 4170 * Use @a scratch_pool for any temporary allocations. 4171 * 4172 * @since New in 1.9. 4173 */ 4174 svn_error_t * 4175 svn_client_cleanup2(const char *dir_abspath, 4176 svn_boolean_t break_locks, 4177 svn_boolean_t fix_recorded_timestamps, 4178 svn_boolean_t clear_dav_cache, 4179 svn_boolean_t vacuum_pristines, 4180 svn_boolean_t include_externals, 4181 svn_client_ctx_t *ctx, 4182 apr_pool_t *scratch_pool); 4183 4184 /** Like svn_client_cleanup2(), but no support for not breaking locks and 4185 * cleaning up externals and using a potentially non absolute path. 4186 * 4187 * @deprecated Provided for limited backwards compatibility with the 1.8 API. 4188 */ 4189 SVN_DEPRECATED 4190 svn_error_t * 4191 svn_client_cleanup(const char *dir, 4192 svn_client_ctx_t *ctx, 4193 apr_pool_t *scratch_pool); 4194 4195 4196 /** @} */ 4197 4198 /** 4199 * @defgroup Upgrade Upgrade a working copy. 4200 * 4201 * @{ 4202 */ 4203 4204 /** Recursively upgrade a working copy from any older format to the current 4205 * WC metadata storage format. @a wcroot_dir is the path to the WC root. 4206 * 4207 * Use @a scratch_pool for any temporary allocations. 4208 * 4209 * @since New in 1.7. 4210 */ 4211 svn_error_t * 4212 svn_client_upgrade(const char *wcroot_dir, 4213 svn_client_ctx_t *ctx, 4214 apr_pool_t *scratch_pool); 4215 4216 4217 /** @} */ 4218 4219 /** 4220 * @defgroup Relocate Switch a working copy to a different repository. 4221 * 4222 * @{ 4223 */ 4224 4225 /** 4226 * Recursively modify a working copy rooted at @a wcroot_dir, changing 4227 * any repository URLs that begin with @a from_prefix to begin with @a 4228 * to_prefix instead. 4229 * 4230 * @param wcroot_dir Working copy root directory 4231 * @param from_prefix Original URL 4232 * @param to_prefix New URL 4233 * @param ignore_externals If not set, recurse into external working 4234 * copies after relocating the primary working copy 4235 * @param ctx svn_client_ctx_t 4236 * @param pool The pool from which to perform memory allocations 4237 * 4238 * @since New in 1.7 4239 */ 4240 svn_error_t * 4241 svn_client_relocate2(const char *wcroot_dir, 4242 const char *from_prefix, 4243 const char *to_prefix, 4244 svn_boolean_t ignore_externals, 4245 svn_client_ctx_t *ctx, 4246 apr_pool_t *pool); 4247 4248 /** 4249 * Similar to svn_client_relocate2(), but with @a ignore_externals 4250 * always TRUE. 4251 * 4252 * @note As of the 1.7 API, @a dir is required to be a working copy 4253 * root directory, and @a recurse is required to be TRUE. 4254 * 4255 * @deprecated Provided for limited backwards compatibility with the 4256 * 1.6 API. 4257 */ 4258 SVN_DEPRECATED 4259 svn_error_t * 4260 svn_client_relocate(const char *dir, 4261 const char *from_prefix, 4262 const char *to_prefix, 4263 svn_boolean_t recurse, 4264 svn_client_ctx_t *ctx, 4265 apr_pool_t *pool); 4266 4267 /** @} */ 4268 4269 /** 4270 * @defgroup Revert Remove local changes in a repository. 4271 * 4272 * @{ 4273 */ 4274 4275 /** 4276 * Restore the pristine version of working copy @a paths, 4277 * effectively undoing any local mods. For each path in @a paths, 4278 * revert it if it is a file. Else if it is a directory, revert 4279 * according to @a depth: 4280 * 4281 * @a paths is an array of (const char *) local WC paths. 4282 * 4283 * If @a depth is #svn_depth_empty, revert just the properties on 4284 * the directory; else if #svn_depth_files, revert the properties 4285 * and any files immediately under the directory; else if 4286 * #svn_depth_immediates, revert all of the preceding plus 4287 * properties on immediate subdirectories; else if #svn_depth_infinity, 4288 * revert path and everything under it fully recursively. 4289 * 4290 * @a changelists is an array of <tt>const char *</tt> changelist 4291 * names, used as a restrictive filter on items reverted; that is, 4292 * don't revert any item unless it's a member of one of those 4293 * changelists. If @a changelists is empty (or altogether @c NULL), 4294 * no changelist filtering occurs. 4295 * 4296 * If @a clear_changelists is TRUE, then changelist information for the 4297 * paths is cleared while reverting. 4298 * 4299 * If @a metadata_only is TRUE, the files and directories aren't changed 4300 * by the operation. If there are conflict marker files attached to the 4301 * targets these are removed. 4302 * 4303 * If @a ctx->notify_func2 is non-NULL, then for each item reverted, 4304 * call @a ctx->notify_func2 with @a ctx->notify_baton2 and the path of 4305 * the reverted item. 4306 * 4307 * If an item specified for reversion is not under version control, 4308 * then do not error, just invoke @a ctx->notify_func2 with @a 4309 * ctx->notify_baton2, using notification code #svn_wc_notify_skip. 4310 * 4311 * @since New in 1.9. 4312 */ 4313 svn_error_t * 4314 svn_client_revert3(const apr_array_header_t *paths, 4315 svn_depth_t depth, 4316 const apr_array_header_t *changelists, 4317 svn_boolean_t clear_changelists, 4318 svn_boolean_t metadata_only, 4319 svn_client_ctx_t *ctx, 4320 apr_pool_t *pool); 4321 4322 /** Similar to svn_client_revert2, but with @a clear_changelists set to 4323 * FALSE and @a metadata_only set to FALSE. 4324 * 4325 * @since New in 1.5. 4326 * @deprecated Provided for backwards compatibility with the 1.8 API. 4327 */ 4328 SVN_DEPRECATED 4329 svn_error_t * 4330 svn_client_revert2(const apr_array_header_t *paths, 4331 svn_depth_t depth, 4332 const apr_array_header_t *changelists, 4333 svn_client_ctx_t *ctx, 4334 apr_pool_t *pool); 4335 4336 4337 /** 4338 * Similar to svn_client_revert2(), but with @a changelists passed as 4339 * @c NULL, and @a depth set according to @a recurse: if @a recurse is 4340 * TRUE, @a depth is #svn_depth_infinity, else if @a recurse is 4341 * FALSE, @a depth is #svn_depth_empty. 4342 * 4343 * @note Most APIs map @a recurse==FALSE to @a depth==svn_depth_files; 4344 * revert is deliberately different. 4345 * 4346 * @deprecated Provided for backwards compatibility with the 1.4 API. 4347 */ 4348 SVN_DEPRECATED 4349 svn_error_t * 4350 svn_client_revert(const apr_array_header_t *paths, 4351 svn_boolean_t recursive, 4352 svn_client_ctx_t *ctx, 4353 apr_pool_t *pool); 4354 4355 4356 /** @} */ 4357 4358 /** 4359 * @defgroup Conflicts Dealing with conflicted paths. 4360 * 4361 * @{ 4362 */ 4363 4364 /** 4365 * An opaque type which represents a conflicted node in the working copy. 4366 * 4367 * @since New in 1.10. 4368 */ 4369 typedef struct svn_client_conflict_t svn_client_conflict_t; 4370 4371 /** 4372 * An opaque type which represents a resolution option for a conflict. 4373 * 4374 * @since New in 1.10. 4375 */ 4376 typedef struct svn_client_conflict_option_t svn_client_conflict_option_t; 4377 4378 /** 4379 * A public enumeration of conflict option IDs. 4380 * 4381 * @since New in 1.10, unless noted otherwise. 4382 */ 4383 typedef enum svn_client_conflict_option_id_t { 4384 4385 /* Options for text and property conflicts. 4386 * These values intentionally mirror svn_wc_conflict_choice_t. */ 4387 svn_client_conflict_option_undefined = -1, /* for private use only */ 4388 svn_client_conflict_option_postpone = 0, 4389 svn_client_conflict_option_base_text, 4390 svn_client_conflict_option_incoming_text, /* "theirs-full" */ 4391 svn_client_conflict_option_working_text, /* "mine-full" */ 4392 svn_client_conflict_option_incoming_text_where_conflicted, 4393 svn_client_conflict_option_working_text_where_conflicted, 4394 svn_client_conflict_option_merged_text, 4395 svn_client_conflict_option_unspecified, 4396 /* Values derived from svn_wc_conflict_choice_t end here. */ 4397 4398 /* Tree conflict resolution options start here. */ 4399 4400 /* Accept current working copy state. */ 4401 svn_client_conflict_option_accept_current_wc_state, 4402 4403 /* Options for local move vs incoming edit on update. */ 4404 svn_client_conflict_option_update_move_destination, 4405 4406 /* Options for local delete/replace vs incoming edit on update. */ 4407 svn_client_conflict_option_update_any_moved_away_children, 4408 4409 /* Options for incoming add vs local add or obstruction. */ 4410 svn_client_conflict_option_incoming_add_ignore, 4411 4412 /* Options for incoming file add vs local file add or obstruction. */ 4413 svn_client_conflict_option_incoming_added_file_text_merge, 4414 svn_client_conflict_option_incoming_added_file_replace_and_merge, 4415 4416 /* Options for incoming dir add vs local dir add or obstruction. */ 4417 svn_client_conflict_option_incoming_added_dir_merge, 4418 svn_client_conflict_option_incoming_added_dir_replace, 4419 svn_client_conflict_option_incoming_added_dir_replace_and_merge, 4420 4421 /* Options for incoming delete vs any */ 4422 svn_client_conflict_option_incoming_delete_ignore, 4423 svn_client_conflict_option_incoming_delete_accept, 4424 4425 /* Options for incoming move vs local edit */ 4426 svn_client_conflict_option_incoming_move_file_text_merge, 4427 svn_client_conflict_option_incoming_move_dir_merge, 4428 4429 /* Options for local move vs incoming edit on merge. */ 4430 svn_client_conflict_option_local_move_file_text_merge 4431 } svn_client_conflict_option_id_t; 4432 4433 /** 4434 * Set a merged property value on @a option to @a merged_propval. 4435 * 4436 * Setting the merged value is required before resolving the property 4437 * conflict using an option with ID svn_client_conflict_option_merged_text. 4438 * 4439 * The contents of @a merged_propval are not copied, so the storage it 4440 * points to needs to remain valid until svn_client_conflict_prop_resolve() 4441 * has been called with @a option. 4442 * 4443 * @since New in 1.10. 4444 */ 4445 void 4446 svn_client_conflict_option_set_merged_propval( 4447 svn_client_conflict_option_t *option, 4448 const svn_string_t *merged_propval); 4449 4450 /** 4451 * Get a list of possible repository paths which can be applied to the 4452 * svn_client_conflict_option_incoming_move_file_text_merge or 4453 * svn_client_conflict_option_incoming_move_dir_merge resolution 4454 * @a option. (If a different option is passed in, this function will 4455 * raise an assertion failure.) 4456 * 4457 * In some situations, there can be multiple possible destinations for an 4458 * incoming move. One such situation is where a file was copied and moved 4459 * in the same revision: svn cp a b; svn mv a c; svn commit 4460 * When this move is merged elsewhere, both b and c will appear as valid move 4461 * destinations to the conflict resolver. To resolve such ambiguity, the client 4462 * may call this function to obtain a list of possible destinations the user 4463 * may choose from. 4464 * 4465 * The array is allocated in @a result_pool and will have "const char *" 4466 * elements pointing to strings also allocated in @a result_pool. 4467 * All paths are relpaths, and relative to the repository root. 4468 * 4469 * @see svn_client_conflict_option_set_moved_to_repos_relpath() 4470 * @since New in 1.10. 4471 */ 4472 svn_error_t * 4473 svn_client_conflict_option_get_moved_to_repos_relpath_candidates( 4474 apr_array_header_t **possible_moved_to_repos_relpaths, 4475 svn_client_conflict_option_t *option, 4476 apr_pool_t *result_pool, 4477 apr_pool_t *scratch_pool); 4478 4479 /** 4480 * Set the preferred moved target repository path for the 4481 * svn_client_conflict_option_incoming_move_file_text_merge or 4482 * svn_client_conflict_option_incoming_move_dir_merge resolution option. 4483 * 4484 * @a preferred_move_target_idx must be a valid index into the list returned 4485 * by svn_client_conflict_option_get_moved_to_repos_relpath_candidates(). 4486 * 4487 * This function can be called multiple times. 4488 * It affects the output of svn_client_conflict_tree_get_description() and 4489 * svn_client_conflict_option_get_description(). Call these functions again 4490 * to get updated descriptions containing the newly selected move target. 4491 * 4492 * @since New in 1.10. 4493 */ 4494 svn_error_t * 4495 svn_client_conflict_option_set_moved_to_repos_relpath( 4496 svn_client_conflict_option_t *option, 4497 int preferred_move_target_idx, 4498 svn_client_ctx_t *ctx, 4499 apr_pool_t *scratch_pool); 4500 4501 /** 4502 * Get a list of possible moved-to abspaths in the working copy which can be 4503 * applied to the svn_client_conflict_option_incoming_move_file_text_merge 4504 * or svn_client_conflict_option_incoming_move_dir_merge resolution @a option. 4505 * (If a different option is passed in, this function will raise an assertion 4506 * failure.) 4507 * 4508 * All paths in the returned list correspond to the repository path which 4509 * is assumed to be the destination of the incoming move operation. 4510 * To support cases where this destination path is ambiguous, the client may 4511 * call svn_client_conflict_option_get_moved_to_repos_relpath_candidates() 4512 * before calling this function to let the user select a repository path first. 4513 * 4514 * If no possible moved-to paths can be found, return an empty array. 4515 * This doesn't mean that no move happened in the repository. It is possible 4516 * that the move destination is outside the scope of the current working copy, 4517 * for example, in which case the conflict must be resolved in some other way. 4518 * 4519 * @see svn_client_conflict_option_set_moved_to_abspath() 4520 * @since New in 1.10. 4521 */ 4522 svn_error_t * 4523 svn_client_conflict_option_get_moved_to_abspath_candidates( 4524 apr_array_header_t **possible_moved_to_abspaths, 4525 svn_client_conflict_option_t *option, 4526 apr_pool_t *result_pool, 4527 apr_pool_t *scratch_pool); 4528 4529 /** 4530 * Set the preferred moved target abspath for the 4531 * svn_client_conflict_option_incoming_move_file_text_merge or 4532 * svn_client_conflict_option_incoming_move_dir_merge resolution option. 4533 * 4534 * @a preferred_move_target_idx must be a valid index into the list 4535 * returned by svn_client_conflict_option_get_moved_to_abspath_candidates(). 4536 * 4537 * @since New in 1.10. 4538 */ 4539 svn_error_t * 4540 svn_client_conflict_option_set_moved_to_abspath( 4541 svn_client_conflict_option_t *option, 4542 int preferred_move_target_idx, 4543 svn_client_ctx_t *ctx, 4544 apr_pool_t *scratch_pool); 4545 4546 /** 4547 * Given an @a option_id, try to find the corresponding option in @a options, 4548 * which is an array of svn_client_conflict_option_t * elements. 4549 * 4550 * Return NULL if no corresponding option can be be found. 4551 * 4552 * @since New in 1.10. 4553 */ 4554 svn_client_conflict_option_t * 4555 svn_client_conflict_option_find_by_id( 4556 apr_array_header_t *options, 4557 svn_client_conflict_option_id_t option_id); 4558 4559 /** 4560 * Return a conflict for the conflicted path @a local_abspath. 4561 * 4562 * @since New in 1.10. 4563 */ 4564 svn_error_t * 4565 svn_client_conflict_get(svn_client_conflict_t **conflict, 4566 const char *local_abspath, 4567 svn_client_ctx_t *ctx, 4568 apr_pool_t *result_pool, 4569 apr_pool_t *scratch_pool); 4570 4571 /** 4572 * Callback for svn_client_conflict_conflict_walk(); 4573 * 4574 * The lifetime of @a conflict is limited. Its allocation in 4575 * memory will not persist beyond this callback's execution. 4576 * 4577 * @since New in 1.10. 4578 */ 4579 typedef svn_error_t *(*svn_client_conflict_walk_func_t)( 4580 void *baton, 4581 svn_client_conflict_t *conflict, 4582 apr_pool_t *scratch_pool); 4583 4584 /** 4585 * Walk all conflicts within the specified @a depth of @a local_abspath. 4586 * Pass each conflict found during the walk to the @conflict_walk_func 4587 * callback, along with @a conflict_walk_func_baton. 4588 * Use cancellation and notification support provided by client context @a ctx. 4589 * 4590 * This callback may choose to resolve the conflict. If the act of resolving 4591 * a conflict creates new conflicts within the walked working copy (as might 4592 * be the case for some tree conflicts), the callback will be invoked for each 4593 * such new conflict as well. 4594 * 4595 * @since New in 1.10. 4596 */ 4597 svn_error_t * 4598 svn_client_conflict_walk(const char *local_abspath, 4599 svn_depth_t depth, 4600 svn_client_conflict_walk_func_t conflict_walk_func, 4601 void *conflict_walk_func_baton, 4602 svn_client_ctx_t *ctx, 4603 apr_pool_t *scratch_pool); 4604 4605 /** 4606 * Indicate the types of conflicts present on the working copy node 4607 * described by @a conflict. Any output argument may be @c NULL if 4608 * the caller is not interested in the status of a particular type. 4609 * 4610 * The returned @a *props_conflicted array is allocated in @a result_pool. 4611 * It contains the names of conflicted properties. If no property conflict 4612 * exists, the array will contain no elements. 4613 * 4614 * @since New in 1.10. 4615 */ 4616 svn_error_t * 4617 svn_client_conflict_get_conflicted(svn_boolean_t *text_conflicted, 4618 apr_array_header_t **props_conflicted, 4619 svn_boolean_t *tree_conflicted, 4620 svn_client_conflict_t *conflict, 4621 apr_pool_t *result_pool, 4622 apr_pool_t *scratch_pool); 4623 4624 /** 4625 * Return a textual human-readable description of the property conflict 4626 * described by @a conflict, allocated in @a result_pool. The description 4627 * is encoded in UTF-8 and may contain multiple lines separated by 4628 * @c APR_EOL_STR. The last line is not terminated by a newline. 4629 * 4630 * Additionally, the description may be localized to the language used 4631 * by the current locale. 4632 * 4633 * @since New in 1.10. 4634 */ 4635 svn_error_t * 4636 svn_client_conflict_prop_get_description(const char **description, 4637 svn_client_conflict_t *conflict, 4638 apr_pool_t *result_pool, 4639 apr_pool_t *scratch_pool); 4640 4641 /** 4642 * Return a textual human-readable description of the tree conflict 4643 * described by @a conflict, allocated in @a result_pool. The description 4644 * is encoded in UTF-8 and may contain multiple lines separated by 4645 * @c APR_EOL_STR. The last line is not terminated by a newline. 4646 * 4647 * Additionally, the description may be localized to the language used 4648 * by the current locale. 4649 * 4650 * While client implementors are free to enhance descriptions by adding 4651 * additional information to the text, or break up very long lines for 4652 * formatting purposes, there is no syntax defined for descriptions, and 4653 * implementors should not rely on any particular parts of descriptions 4654 * to remain stable over time, apart from what is stated below. 4655 * Descriptions may or may not form complete sentences. They may contain 4656 * paths relative to the repository root; such paths always start with "^/", 4657 * and end with either a peg revision (e.g. "@100") or a colon followed by 4658 * a range of revisions (as in svn:mergeinfo, e.g. ":100-200"). 4659 * Paths may appear on a line of their own to avoid overlong lines. 4660 * Any revision numbers mentioned elsewhere in the description are 4661 * prefixed with the letter 'r' (e.g. "r99"). 4662 * 4663 * The description has two parts: One part describes the "incoming change" 4664 * applied by an update, merge, or switch operation. The other part 4665 * describes the "local change" which occurred in the working copy or 4666 * perhaps in the history of a merge target branch. 4667 * Both parts are provided independently to allow for some flexibility 4668 * when displaying the description. As a convention, displaying the 4669 * "incoming change" first and the "local change" second is recommended. 4670 * 4671 * By default, the description is based only on information available in 4672 * the working copy. If svn_client_conflict_tree_get_details() was already 4673 * called for @a conflict, the description might also contain useful 4674 * information obtained from the repository and provide for a much better 4675 * user experience. 4676 * 4677 * @since New in 1.10. 4678 */ 4679 svn_error_t * 4680 svn_client_conflict_tree_get_description( 4681 const char **incoming_change_description, 4682 const char **local_change_description, 4683 svn_client_conflict_t *conflict, 4684 svn_client_ctx_t *ctx, 4685 apr_pool_t *result_pool, 4686 apr_pool_t *scratch_pool); 4687 4688 /** 4689 * Set @a *options to an array of pointers to svn_client_conflict_option_t 4690 * objects applicable to text conflicts described by @a conflict. 4691 * 4692 * @since New in 1.10. 4693 */ 4694 svn_error_t * 4695 svn_client_conflict_text_get_resolution_options(apr_array_header_t **options, 4696 svn_client_conflict_t *conflict, 4697 svn_client_ctx_t *ctx, 4698 apr_pool_t *result_pool, 4699 apr_pool_t *scratch_pool); 4700 4701 /** 4702 * Set @a *options to an array of pointers to svn_client_conflict_option_t 4703 * objects applicable to property conflicts described by @a conflict. 4704 * 4705 * @since New in 1.10. 4706 */ 4707 svn_error_t * 4708 svn_client_conflict_prop_get_resolution_options(apr_array_header_t **options, 4709 svn_client_conflict_t *conflict, 4710 svn_client_ctx_t *ctx, 4711 apr_pool_t *result_pool, 4712 apr_pool_t *scratch_pool); 4713 4714 /** 4715 * Set @a *options to an array of pointers to svn_client_conflict_option_t 4716 * objects applicable to the tree conflict described by @a conflict. 4717 * 4718 * By default, the list of options is based only on information available in 4719 * the working copy. If svn_client_conflict_tree_get_details() was already 4720 * called for @a conflict, a more useful list of options might be returned. 4721 * 4722 * @since New in 1.10. 4723 */ 4724 svn_error_t * 4725 svn_client_conflict_tree_get_resolution_options(apr_array_header_t **options, 4726 svn_client_conflict_t *conflict, 4727 svn_client_ctx_t *ctx, 4728 apr_pool_t *result_pool, 4729 apr_pool_t *scratch_pool); 4730 4731 /** 4732 * Find more information about the tree conflict represented by @a conflict. 4733 * 4734 * A call to svn_client_conflict_tree_get_description() may yield much better 4735 * results after this function has been called. 4736 * 4737 * A call to svn_client_conflict_tree_get_resolution_options() may provide 4738 * more useful resolution options if this function has been called. 4739 * 4740 * This function may contact the repository. Use the authentication baton 4741 * cached in @a ctx for authentication if contacting the repository. 4742 * 4743 * @since New in 1.10. 4744 */ 4745 svn_error_t * 4746 svn_client_conflict_tree_get_details(svn_client_conflict_t *conflict, 4747 svn_client_ctx_t *ctx, 4748 apr_pool_t *scratch_pool); 4749 4750 /** 4751 * Return an ID for @a option. This ID can be used by callers to associate 4752 * arbitrary data with a particular conflict resolution option. 4753 * 4754 * The ID of a particular resolution option will never change in future 4755 * revisions of this API. 4756 * 4757 * @since New in 1.10. 4758 */ 4759 svn_client_conflict_option_id_t 4760 svn_client_conflict_option_get_id(svn_client_conflict_option_t *option); 4761 4762 /** 4763 * Return a textual human-readable label of @a option, allocated in 4764 * @a result_pool. The label is encoded in UTF-8 and usually 4765 * contains up to three words. 4766 * 4767 * Additionally, the label may be localized to the language used 4768 * by the current locale. 4769 * 4770 * @since New in 1.10. 4771 */ 4772 const char * 4773 svn_client_conflict_option_get_label(svn_client_conflict_option_t *option, 4774 apr_pool_t *result_pool); 4775 4776 /** 4777 * Return a textual human-readable description of @a option, allocated in 4778 * @a result_pool. The description is encoded in UTF-8 and may contain 4779 * multiple lines separated by @c APR_EOL_STR. 4780 * 4781 * Additionally, the description may be localized to the language used 4782 * by the current locale. 4783 * 4784 * @since New in 1.10. 4785 */ 4786 const char * 4787 svn_client_conflict_option_get_description(svn_client_conflict_option_t *option, 4788 apr_pool_t *result_pool); 4789 4790 /** 4791 * Return the ID of the recommended resolution option. If no specific option 4792 * is recommended, return @c svn_client_conflict_option_unspecified; 4793 * 4794 * Client implementations which aim to avoid excessive interactive prompting 4795 * may wish to try a recommended resolution option before falling back to 4796 * asking the user which option to use. 4797 * 4798 * Conflict resolution with a recommended option is not guaranteed to succeed. 4799 * Clients should check for errors when trying to resolve a conflict and fall 4800 * back to other options and/or interactive prompting when the recommended 4801 * option fails to resolve a conflict. 4802 * 4803 * If @a conflict is a tree conflict, svn_client_conflict_tree_get_details() 4804 * should be called before this function to allow for useful recommendations. 4805 * 4806 * @since New in 1.10. 4807 */ 4808 svn_client_conflict_option_id_t 4809 svn_client_conflict_get_recommended_option_id(svn_client_conflict_t *conflict); 4810 4811 /** 4812 * Return the absolute path to the conflicted working copy node described 4813 * by @a conflict. 4814 * 4815 * @since New in 1.10. 4816 */ 4817 const char * 4818 svn_client_conflict_get_local_abspath(svn_client_conflict_t *conflict); 4819 4820 /** 4821 * Return the operation during which the conflict described by @a 4822 * conflict was recorded. 4823 * 4824 * @since New in 1.10. 4825 */ 4826 svn_wc_operation_t 4827 svn_client_conflict_get_operation(svn_client_conflict_t *conflict); 4828 4829 /** 4830 * Return the action an update, switch, or merge operation attempted to 4831 * perform on the working copy node described by @a conflict. 4832 * 4833 * @since New in 1.10. 4834 */ 4835 svn_wc_conflict_action_t 4836 svn_client_conflict_get_incoming_change(svn_client_conflict_t *conflict); 4837 4838 /** 4839 * Return the reason why the attempted action performed by an update, switch, 4840 * or merge operation conflicted with the state of the node in the working copy. 4841 * 4842 * During update and switch operations this local change is part of uncommitted 4843 * modifications in the working copy. During merge operations it may 4844 * additionally be part of the history of the merge target branch, anywhere 4845 * between the common ancestor revision and the working copy revision. 4846 * 4847 * @since New in 1.10. 4848 */ 4849 svn_wc_conflict_reason_t 4850 svn_client_conflict_get_local_change(svn_client_conflict_t *conflict); 4851 4852 /** 4853 * Return information about the repository associated with @a conflict. 4854 * In case of a foreign-repository merge this will differ from the 4855 * repository information associated with the merge target working copy. 4856 * 4857 * @since New in 1.10. 4858 */ 4859 svn_error_t * 4860 svn_client_conflict_get_repos_info(const char **repos_root_url, 4861 const char **repos_uuid, 4862 svn_client_conflict_t *conflict, 4863 apr_pool_t *result_pool, 4864 apr_pool_t *scratch_pool); 4865 4866 /** 4867 * Return the repository-relative location and the node kind of the incoming 4868 * old version of the conflicted node described by @a conflict. 4869 * 4870 * If the repository-relative path is not available, the @a 4871 * *incoming_old_repos_relpath will be set to @c NULL, 4872 * 4873 * If the peg revision is not available, @a *incoming_old_regrev will be 4874 * set to SVN_INVALID_REVNUM. 4875 * 4876 * If the node kind is not available or if the node does not exist at the 4877 * specified path and revision, @a *incoming_old_node_kind will be set to 4878 * svn_node_none. 4879 * ### Should return svn_node_unkown if not available? 4880 * 4881 * Any output parameter may be set to @c NULL by the caller to indicate that 4882 * a particular piece of information should not be returned. 4883 * 4884 * In case of tree conflicts, this path@revision does not necessarily exist 4885 * in the repository, and it does not necessarily represent the incoming 4886 * change which is responsible for the occurance of the tree conflict. 4887 * The responsible incoming change is generally located somewhere between 4888 * the old and new incoming versions. 4889 * 4890 * @since New in 1.10. 4891 */ 4892 svn_error_t * 4893 svn_client_conflict_get_incoming_old_repos_location( 4894 const char **incoming_old_repos_relpath, 4895 svn_revnum_t *incoming_old_regrev, 4896 svn_node_kind_t *incoming_old_node_kind, 4897 svn_client_conflict_t *conflict, 4898 apr_pool_t *result_pool, 4899 apr_pool_t *scratch_pool); 4900 4901 /** 4902 * Like svn_client_conflict_get_incoming_old_repos_location(), expect this 4903 * function returns the same data for the incoming new version. 4904 * 4905 * The same note about tree conflicts applies. 4906 * 4907 * @since New in 1.10. 4908 */ 4909 svn_error_t * 4910 svn_client_conflict_get_incoming_new_repos_location( 4911 const char **incoming_new_repos_relpath, 4912 svn_revnum_t *incoming_new_regrev, 4913 svn_node_kind_t *incoming_new_node_kind, 4914 svn_client_conflict_t *conflict, 4915 apr_pool_t *result_pool, 4916 apr_pool_t *scratch_pool); 4917 4918 /** 4919 * Return the node kind of the tree conflict victim described by @a conflict. 4920 * The victim is the local node in the working copy which was affected by the 4921 * tree conflict at the time the conflict was raised. 4922 * 4923 * @since New in 1.10. 4924 */ 4925 svn_node_kind_t 4926 svn_client_conflict_tree_get_victim_node_kind(svn_client_conflict_t *conflict); 4927 4928 /** 4929 * Resolve a tree @a conflict using resolution option @a option. 4930 * 4931 * May raise an error in case the tree conflict cannot be resolved yet, for 4932 * instance @c SVN_ERR_WC_OBSTRUCTED_UPDATE, @c SVN_ERR_WC_FOUND_CONFLICT, 4933 * or @c SVN_ERR_WC_CONFLICT_RESOLVER_FAILUE. 4934 * This may happen when other tree conflicts, or unversioned obstructions, 4935 * block the resolution of this tree conflict. In such a case the other 4936 * conflicts should be resolved first and resolution of this conflict should 4937 * be attempted again later. 4938 * 4939 * @since New in 1.10. 4940 */ 4941 svn_error_t * 4942 svn_client_conflict_tree_resolve(svn_client_conflict_t *conflict, 4943 svn_client_conflict_option_t *option, 4944 svn_client_ctx_t *ctx, 4945 apr_pool_t *scratch_pool); 4946 4947 /** 4948 * Like svn_client_conflict_tree_resolve(), except that it identifies 4949 * the desired resolution option by ID @a option_id. 4950 * 4951 * If the provided @a option_id is the ID of an option which resolves 4952 * @a conflict, try to resolve the tree conflict using that option. 4953 * Else, return @c SVN_ERR_CLIENT_CONFLICT_OPTION_NOT_APPLICABLE. 4954 * 4955 * @since New in 1.10. 4956 */ 4957 svn_error_t * 4958 svn_client_conflict_tree_resolve_by_id( 4959 svn_client_conflict_t *conflict, 4960 svn_client_conflict_option_id_t option_id, 4961 svn_client_ctx_t *ctx, 4962 apr_pool_t *scratch_pool); 4963 4964 /** 4965 * Return the ID of the option this tree @a conflict has been resolved to. 4966 * If the conflict has not been resolved yet, then return 4967 * @c svn_client_conflict_option_unspecified. 4968 * 4969 * @since New in 1.10. 4970 */ 4971 svn_client_conflict_option_id_t 4972 svn_client_conflict_tree_get_resolution(svn_client_conflict_t *conflict); 4973 4974 /** 4975 * Return the path to the legacy property conflicts reject file 4976 * for the property conflicts represented by @a conflict. 4977 * 4978 * This function exists for backwards compatibility only and should not be 4979 * used in new code. 4980 * 4981 * @since New in 1.10. 4982 */ 4983 const char * 4984 svn_client_conflict_prop_get_reject_abspath(svn_client_conflict_t *conflict); 4985 4986 /** 4987 * Return the set of property values involved in the conflict of property 4988 * PROPNAME described by @a conflict. If a property value is unavailable the 4989 * corresponding output argument is set to @c NULL. 4990 * 4991 * A 3-way diff of these property values can be generated with 4992 * svn_diff_mem_string_diff3(). A merged version with conflict 4993 * markers can be generated with svn_diff_mem_string_output_merge3(). 4994 * 4995 * @since New in 1.10. 4996 */ 4997 svn_error_t * 4998 svn_client_conflict_prop_get_propvals(const svn_string_t **base_propval, 4999 const svn_string_t **working_propval, 5000 const svn_string_t **incoming_old_propval, 5001 const svn_string_t **incoming_new_propval, 5002 svn_client_conflict_t *conflict, 5003 const char *propname, 5004 apr_pool_t *result_pool); 5005 5006 /** 5007 * Resolve a property @a conflict in property @a propname using resolution 5008 * option @a option. To resolve all properties to the same option at once, 5009 * set @a propname to the empty string "". 5010 * 5011 * @since New in 1.10. 5012 */ 5013 svn_error_t * 5014 svn_client_conflict_prop_resolve(svn_client_conflict_t *conflict, 5015 const char *propname, 5016 svn_client_conflict_option_t *option, 5017 svn_client_ctx_t *ctx, 5018 apr_pool_t *scratch_pool); 5019 /** 5020 * If the provided @a option_id is the ID of an option which resolves 5021 * @a conflict, resolve the property conflict in property @a propname 5022 * using that option. 5023 * Else, return @c SVN_ERR_CLIENT_CONFLICT_OPTION_NOT_APPLICABLE. 5024 * 5025 * @since New in 1.10. 5026 */ 5027 svn_error_t * 5028 svn_client_conflict_prop_resolve_by_id( 5029 svn_client_conflict_t *conflict, 5030 const char *propname, 5031 svn_client_conflict_option_id_t option_id, 5032 svn_client_ctx_t *ctx, 5033 apr_pool_t *scratch_pool); 5034 5035 /** 5036 * Return the ID of the option this property @a conflict in property 5037 * @a propname has been resolved to. 5038 * If the conflict has not been resolved yet, then return 5039 * @c svn_client_conflict_option_unspecified. 5040 * 5041 * @since New in 1.10. 5042 */ 5043 svn_client_conflict_option_id_t 5044 svn_client_conflict_prop_get_resolution(svn_client_conflict_t *conflict, 5045 const char *propname); 5046 5047 /** 5048 * Return the MIME-type of the working version of the text-conflicted file 5049 * described by @a conflict. 5050 * 5051 * ### Really needed? What about base/incoming_old/incoming_new values? 5052 * @since: New in 1.10. 5053 */ 5054 const char * 5055 svn_client_conflict_text_get_mime_type(svn_client_conflict_t *conflict); 5056 5057 /** 5058 * Return absolute paths to the versions of the text-conflicted file 5059 * described by @a conflict. 5060 * 5061 * If a particular content is not available, it is set to @c NULL. 5062 * 5063 * ### Should this be returning svn_stream_t instead of paths? 5064 * @since: New in 1.10. 5065 */ 5066 svn_error_t * 5067 svn_client_conflict_text_get_contents(const char **base_abspath, 5068 const char **working_abspath, 5069 const char **incoming_old_abspath, 5070 const char **incoming_new_abspath, 5071 svn_client_conflict_t *conflict, 5072 apr_pool_t *result_pool, 5073 apr_pool_t *scratch_pool); 5074 5075 /** 5076 * Resolve a text @a conflict using resolution option @a option. 5077 * 5078 * @since New in 1.10. 5079 */ 5080 svn_error_t * 5081 svn_client_conflict_text_resolve(svn_client_conflict_t *conflict, 5082 svn_client_conflict_option_t *option, 5083 svn_client_ctx_t *ctx, 5084 apr_pool_t *scratch_pool); 5085 5086 /** 5087 * If the provided @a option_id is the ID of an option which resolves 5088 * @a conflict, resolve the text conflict using that option. 5089 * Else, return @c SVN_ERR_CLIENT_CONFLICT_OPTION_NOT_APPLICABLE. 5090 * 5091 * @since New in 1.10. 5092 */ 5093 svn_error_t * 5094 svn_client_conflict_text_resolve_by_id( 5095 svn_client_conflict_t *conflict, 5096 svn_client_conflict_option_id_t option_id, 5097 svn_client_ctx_t *ctx, 5098 apr_pool_t *scratch_pool); 5099 5100 /** 5101 * Return the ID of the option this text @a conflict has been resolved to. 5102 * If the conflict has not been resolved yet, then return 5103 * @c svn_client_conflict_option_unspecified. 5104 * 5105 * @since New in 1.10. 5106 */ 5107 svn_client_conflict_option_id_t 5108 svn_client_conflict_text_get_resolution(svn_client_conflict_t *conflict); 5109 5110 /** @} */ 5111 5112 /** 5113 * @defgroup Resolved Mark conflicted paths as resolved. 5114 * 5115 * @{ 5116 */ 5117 5118 /** 5119 * Similar to svn_client_resolve(), but without automatic conflict 5120 * resolution support. 5121 * 5122 * @deprecated Provided for backward compatibility with the 1.4 API. 5123 * Use svn_client_resolve() with @a conflict_choice == @c 5124 * svn_wc_conflict_choose_merged instead. 5125 */ 5126 SVN_DEPRECATED 5127 svn_error_t * 5128 svn_client_resolved(const char *path, 5129 svn_boolean_t recursive, 5130 svn_client_ctx_t *ctx, 5131 apr_pool_t *pool); 5132 5133 /** Perform automatic conflict resolution on a working copy @a path. 5134 * 5135 * If @a conflict_choice is 5136 * 5137 * - #svn_wc_conflict_choose_base: 5138 * resolve the conflict with the old file contents 5139 * 5140 * - #svn_wc_conflict_choose_mine_full: 5141 * use the original working contents 5142 * 5143 * - #svn_wc_conflict_choose_theirs_full: 5144 * use the new contents 5145 * 5146 * - #svn_wc_conflict_choose_merged: 5147 * don't change the contents at all, just remove the conflict 5148 * status, which is the pre-1.5 behavior. 5149 * 5150 * - #svn_wc_conflict_choose_theirs_conflict 5151 * ###... 5152 * 5153 * - #svn_wc_conflict_choose_mine_conflict 5154 * ###... 5155 * 5156 * - svn_wc_conflict_choose_unspecified 5157 * invoke @a ctx->conflict_func2 with @a ctx->conflict_baton2 to obtain 5158 * a resolution decision for each conflict. This can be used to 5159 * implement interactive conflict resolution but is NOT RECOMMENDED for 5160 * new code. To perform conflict resolution based on interactive user 5161 * input on a per-conflict basis, use svn_client_conflict_text_resolve(), 5162 * svn_client_conflict_prop_resolve(), and 5163 * svn_client_conflict_tree_resolve() instead of svn_client_resolve(). 5164 * 5165 * #svn_wc_conflict_choose_theirs_conflict and 5166 * #svn_wc_conflict_choose_mine_conflict are not legal for binary 5167 * files or properties. 5168 * 5169 * If @a path is not in a state of conflict to begin with, do nothing. 5170 * If @a path's conflict state is removed and @a ctx->notify_func2 is non-NULL, 5171 * call @a ctx->notify_func2 with @a ctx->notify_baton2 and @a path. 5172 * ### with what notification parameters? 5173 * 5174 * If @a depth is #svn_depth_empty, act only on @a path; if 5175 * #svn_depth_files, resolve @a path and its conflicted file 5176 * children (if any); if #svn_depth_immediates, resolve @a path and 5177 * all its immediate conflicted children (both files and directories, 5178 * if any); if #svn_depth_infinity, resolve @a path and every 5179 * conflicted file or directory anywhere beneath it. 5180 * 5181 * Note that this operation will try to lock the parent directory of 5182 * @a path in order to be able to resolve tree-conflicts on @a path. 5183 * 5184 * @since New in 1.5. 5185 */ 5186 svn_error_t * 5187 svn_client_resolve(const char *path, 5188 svn_depth_t depth, 5189 svn_wc_conflict_choice_t conflict_choice, 5190 svn_client_ctx_t *ctx, 5191 apr_pool_t *pool); 5192 5193 5194 /** @} */ 5195 5196 /** 5197 * @defgroup Copy Copy paths in the working copy and repository. 5198 * 5199 * @{ 5200 */ 5201 5202 /** 5203 * A structure which describes the source of a copy operation--its path, 5204 * revision, and peg revision. 5205 * 5206 * @since New in 1.5. 5207 */ 5208 typedef struct svn_client_copy_source_t 5209 { 5210 /** The source path or URL. */ 5211 const char *path; 5212 5213 /** The source operational revision. */ 5214 const svn_opt_revision_t *revision; 5215 5216 /** The source peg revision. */ 5217 const svn_opt_revision_t *peg_revision; 5218 } svn_client_copy_source_t; 5219 5220 /** Copy each source in @a sources to @a dst_path. 5221 * 5222 * If multiple @a sources are given, @a dst_path must be a directory, 5223 * and @a sources will be copied as children of @a dst_path. 5224 * 5225 * @a sources is an array of <tt>svn_client_copy_source_t *</tt> elements, 5226 * either all referring to local WC items or all referring to versioned 5227 * items in the repository. 5228 * 5229 * If @a sources has only one item, attempt to copy it to @a dst_path. If 5230 * @a copy_as_child is TRUE and @a dst_path already exists, attempt to copy the 5231 * item as a child of @a dst_path. If @a copy_as_child is FALSE and 5232 * @a dst_path already exists, fail with #SVN_ERR_ENTRY_EXISTS if @a dst_path 5233 * is a working copy path and #SVN_ERR_FS_ALREADY_EXISTS if @a dst_path is a 5234 * URL. 5235 * 5236 * If @a sources has multiple items, and @a copy_as_child is TRUE, all 5237 * @a sources are copied as children of @a dst_path. If any child of 5238 * @a dst_path already exists with the same name any item in @a sources, 5239 * fail with #SVN_ERR_ENTRY_EXISTS if @a dst_path is a working copy path and 5240 * #SVN_ERR_FS_ALREADY_EXISTS if @a dst_path is a URL. 5241 * 5242 * If @a sources has multiple items, and @a copy_as_child is FALSE, fail 5243 * with #SVN_ERR_CLIENT_MULTIPLE_SOURCES_DISALLOWED. 5244 * 5245 * If @a dst_path is a URL, use the authentication baton 5246 * in @a ctx and @a ctx->log_msg_func3/@a ctx->log_msg_baton3 to immediately 5247 * attempt to commit the copy action in the repository. 5248 * 5249 * If @a dst_path is not a URL, then this is just a variant of 5250 * svn_client_add(), where the @a sources are scheduled for addition 5251 * as copies. No changes will happen to the repository until a commit occurs. 5252 * This scheduling can be removed with svn_client_revert2(). 5253 * 5254 * If @a make_parents is TRUE, create any non-existent parent directories 5255 * also. Otherwise the parent of @a dst_path must already exist. 5256 * 5257 * If @a ignore_externals is set, don't process externals definitions 5258 * as part of this operation. 5259 * 5260 * If @a metadata_only is @c TRUE and copying a file in a working copy, 5261 * everything in the metadata is updated as if the node is moved, but the 5262 * actual disk copy operation is not performed. This feature is useful for 5263 * clients that want to keep the working copy in sync while the actual working 5264 * copy is updated by some other task. 5265 * 5266 * If @a pin_externals is set, pin URLs in copied externals definitions 5267 * to their current revision unless they were already pinned to a 5268 * particular revision. A pinned external uses a URL which points at a 5269 * fixed revision, rather than the HEAD revision. Externals in the copy 5270 * destination are pinned to either a working copy base revision or the 5271 * HEAD revision of a repository (as of the time the copy operation is 5272 * performed), depending on the type of the copy source: 5273 <pre> 5274 copy source: working copy (WC) REPOS 5275 ------------+------------------------+---------------------------+ 5276 copy WC | external's WC BASE rev | external's repos HEAD rev | 5277 dest: |------------------------+---------------------------+ 5278 REPOS | external's WC BASE rev | external's repos HEAD rev | 5279 ------------+------------------------+---------------------------+ 5280 </pre> 5281 * If the copy source is a working copy, then all externals must be checked 5282 * out, be at a single-revision, contain no local modifications, and contain 5283 * no switched subtrees. Else, #SVN_ERR_WC_PATH_UNEXPECTED_STATUS is returned. 5284 * 5285 * If non-NULL, @a externals_to_pin restricts pinning to a subset of externals. 5286 * It is a hash table keyed by either a local absolute path or a URL at which 5287 * an svn:externals property is set. The hash table contains apr_array_header_t* 5288 * elements as returned by svn_wc_parse_externals_description3(). These arrays 5289 * contain elements of type svn_wc_external_item2_t*, each of which corresponds 5290 * to a single line of an svn:externals definition. Externals corresponding to 5291 * these items will be pinned, other externals will not be pinned. 5292 * If @a externals_to_pin is @c NULL then all externals are pinned. 5293 * If @a pin_externals is @c FALSE then @a externals_to_pin is ignored. 5294 * 5295 * If non-NULL, @a revprop_table is a hash table holding additional, 5296 * custom revision properties (<tt>const char *</tt> names mapped to 5297 * <tt>svn_string_t *</tt> values) to be set on the new revision in 5298 * the event that this is a committing operation. This table cannot 5299 * contain any standard Subversion properties. 5300 * 5301 * @a ctx->log_msg_func3/@a ctx->log_msg_baton3 are a callback/baton combo 5302 * that this function can use to query for a commit log message when one is 5303 * needed. 5304 * 5305 * If @a ctx->notify_func2 is non-NULL, invoke it with @a ctx->notify_baton2 5306 * for each item added at the new location, passing the new, relative path of 5307 * the added item. 5308 * 5309 * If @a commit_callback is non-NULL, then for each successful commit, call 5310 * @a commit_callback with @a commit_baton and a #svn_commit_info_t for 5311 * the commit. 5312 * 5313 * @since New in 1.9. 5314 */ 5315 svn_error_t * 5316 svn_client_copy7(const apr_array_header_t *sources, 5317 const char *dst_path, 5318 svn_boolean_t copy_as_child, 5319 svn_boolean_t make_parents, 5320 svn_boolean_t ignore_externals, 5321 svn_boolean_t metadata_only, 5322 svn_boolean_t pin_externals, 5323 const apr_hash_t *externals_to_pin, 5324 const apr_hash_t *revprop_table, 5325 svn_commit_callback2_t commit_callback, 5326 void *commit_baton, 5327 svn_client_ctx_t *ctx, 5328 apr_pool_t *pool); 5329 5330 /** 5331 * Similar to svn_client_copy7(), but doesn't support meta_data_only 5332 * and cannot pin externals. 5333 * 5334 * 5335 * @since New in 1.7. 5336 * @deprecated Provided for backward compatibility with the 1.8 API. 5337 */ 5338 SVN_DEPRECATED 5339 svn_error_t * 5340 svn_client_copy6(const apr_array_header_t *sources, 5341 const char *dst_path, 5342 svn_boolean_t copy_as_child, 5343 svn_boolean_t make_parents, 5344 svn_boolean_t ignore_externals, 5345 const apr_hash_t *revprop_table, 5346 svn_commit_callback2_t commit_callback, 5347 void *commit_baton, 5348 svn_client_ctx_t *ctx, 5349 apr_pool_t *pool); 5350 5351 /** 5352 * Similar to svn_client_copy6(), but returns the commit info in 5353 * @a *commit_info_p rather than through a callback function. 5354 * 5355 * @since New in 1.6. 5356 * @deprecated Provided for backward compatibility with the 1.6 API. 5357 */ 5358 SVN_DEPRECATED 5359 svn_error_t * 5360 svn_client_copy5(svn_commit_info_t **commit_info_p, 5361 const apr_array_header_t *sources, 5362 const char *dst_path, 5363 svn_boolean_t copy_as_child, 5364 svn_boolean_t make_parents, 5365 svn_boolean_t ignore_externals, 5366 const apr_hash_t *revprop_table, 5367 svn_client_ctx_t *ctx, 5368 apr_pool_t *pool); 5369 5370 /** 5371 * Similar to svn_client_copy5(), with @a ignore_externals set to @c FALSE. 5372 * 5373 * @since New in 1.5. 5374 * 5375 * @deprecated Provided for backward compatibility with the 1.5 API. 5376 */ 5377 SVN_DEPRECATED 5378 svn_error_t * 5379 svn_client_copy4(svn_commit_info_t **commit_info_p, 5380 const apr_array_header_t *sources, 5381 const char *dst_path, 5382 svn_boolean_t copy_as_child, 5383 svn_boolean_t make_parents, 5384 const apr_hash_t *revprop_table, 5385 svn_client_ctx_t *ctx, 5386 apr_pool_t *pool); 5387 5388 /** 5389 * Similar to svn_client_copy4(), with only one @a src_path, @a 5390 * copy_as_child set to @c FALSE, @a revprop_table passed as NULL, and 5391 * @a make_parents set to @c FALSE. Also, use @a src_revision as both 5392 * the operational and peg revision. 5393 * 5394 * @since New in 1.4. 5395 * 5396 * @deprecated Provided for backward compatibility with the 1.4 API. 5397 */ 5398 SVN_DEPRECATED 5399 svn_error_t * 5400 svn_client_copy3(svn_commit_info_t **commit_info_p, 5401 const char *src_path, 5402 const svn_opt_revision_t *src_revision, 5403 const char *dst_path, 5404 svn_client_ctx_t *ctx, 5405 apr_pool_t *pool); 5406 5407 5408 /** 5409 * Similar to svn_client_copy3(), with the difference that if @a dst_path 5410 * already exists and is a directory, copy the item into that directory, 5411 * keeping its name (the last component of @a src_path). 5412 * 5413 * @since New in 1.3. 5414 * 5415 * @deprecated Provided for backward compatibility with the 1.3 API. 5416 */ 5417 SVN_DEPRECATED 5418 svn_error_t * 5419 svn_client_copy2(svn_commit_info_t **commit_info_p, 5420 const char *src_path, 5421 const svn_opt_revision_t *src_revision, 5422 const char *dst_path, 5423 svn_client_ctx_t *ctx, 5424 apr_pool_t *pool); 5425 5426 5427 /** 5428 * Similar to svn_client_copy2(), but uses #svn_client_commit_info_t 5429 * for @a commit_info_p. 5430 * 5431 * @deprecated Provided for backward compatibility with the 1.2 API. 5432 */ 5433 SVN_DEPRECATED 5434 svn_error_t * 5435 svn_client_copy(svn_client_commit_info_t **commit_info_p, 5436 const char *src_path, 5437 const svn_opt_revision_t *src_revision, 5438 const char *dst_path, 5439 svn_client_ctx_t *ctx, 5440 apr_pool_t *pool); 5441 5442 5443 /** @} */ 5444 5445 /** 5446 * @defgroup Move Move paths in the working copy or repository. 5447 * 5448 * @{ 5449 */ 5450 5451 /** 5452 * Move @a src_paths to @a dst_path. 5453 * 5454 * @a src_paths is an array of (const char *) paths -- either all WC paths 5455 * or all URLs -- of versioned items. If multiple @a src_paths are given, 5456 * @a dst_path must be a directory and @a src_paths will be moved as 5457 * children of @a dst_path. 5458 * 5459 * If @a src_paths are repository URLs: 5460 * 5461 * - @a dst_path must also be a repository URL. 5462 * 5463 * - The authentication baton in @a ctx and @a ctx->log_msg_func/@a 5464 * ctx->log_msg_baton are used to commit the move. 5465 * 5466 * - The move operation will be immediately committed. 5467 * 5468 * If @a src_paths are working copy paths: 5469 * 5470 * - @a dst_path must also be a working copy path. 5471 * 5472 * - @a ctx->log_msg_func3 and @a ctx->log_msg_baton3 are ignored. 5473 * 5474 * - This is a scheduling operation. No changes will happen to the 5475 * repository until a commit occurs. This scheduling can be removed 5476 * with svn_client_revert2(). If one of @a src_paths is a file it is 5477 * removed from the working copy immediately. If one of @a src_path 5478 * is a directory it will remain in the working copy but all the files, 5479 * and unversioned items, it contains will be removed. 5480 * 5481 * If @a src_paths has only one item, attempt to move it to @a dst_path. If 5482 * @a move_as_child is TRUE and @a dst_path already exists, attempt to move the 5483 * item as a child of @a dst_path. If @a move_as_child is FALSE and 5484 * @a dst_path already exists, fail with #SVN_ERR_ENTRY_EXISTS if @a dst_path 5485 * is a working copy path and #SVN_ERR_FS_ALREADY_EXISTS if @a dst_path is a 5486 * URL. 5487 * 5488 * If @a src_paths has multiple items, and @a move_as_child is TRUE, all 5489 * @a src_paths are moved as children of @a dst_path. If any child of 5490 * @a dst_path already exists with the same name any item in @a src_paths, 5491 * fail with #SVN_ERR_ENTRY_EXISTS if @a dst_path is a working copy path and 5492 * #SVN_ERR_FS_ALREADY_EXISTS if @a dst_path is a URL. 5493 * 5494 * If @a src_paths has multiple items, and @a move_as_child is FALSE, fail 5495 * with #SVN_ERR_CLIENT_MULTIPLE_SOURCES_DISALLOWED. 5496 * 5497 * If @a make_parents is TRUE, create any non-existent parent directories 5498 * also. Otherwise, the parent of @a dst_path must already exist. 5499 * 5500 * If @a allow_mixed_revisions is @c FALSE, #SVN_ERR_WC_MIXED_REVISIONS 5501 * will be raised if the move source is a mixed-revision subtree. 5502 * If @a allow_mixed_revisions is TRUE, a mixed-revision move source is 5503 * allowed but the move will degrade to a copy and a delete without local 5504 * move tracking. This parameter should be set to FALSE except where backwards 5505 * compatibility to svn_client_move6() is required. 5506 * 5507 * If @a metadata_only is @c TRUE and moving a file in a working copy, 5508 * everything in the metadata is updated as if the node is moved, but the 5509 * actual disk move operation is not performed. This feature is useful for 5510 * clients that want to keep the working copy in sync while the actual working 5511 * copy is updated by some other task. 5512 * 5513 * If non-NULL, @a revprop_table is a hash table holding additional, 5514 * custom revision properties (<tt>const char *</tt> names mapped to 5515 * <tt>svn_string_t *</tt> values) to be set on the new revision in 5516 * the event that this is a committing operation. This table cannot 5517 * contain any standard Subversion properties. 5518 * 5519 * @a ctx->log_msg_func3/@a ctx->log_msg_baton3 are a callback/baton combo that 5520 * this function can use to query for a commit log message when one is needed. 5521 * 5522 * If @a ctx->notify_func2 is non-NULL, then for each item moved, call 5523 * @a ctx->notify_func2 with the @a ctx->notify_baton2 twice, once to indicate 5524 * the deletion of the moved thing, and once to indicate the addition of 5525 * the new location of the thing. 5526 * 5527 * ### Is this really true? What about svn_wc_notify_commit_replaced()? ### 5528 * 5529 * If @a commit_callback is non-NULL, then for each successful commit, call 5530 * @a commit_callback with @a commit_baton and a #svn_commit_info_t for 5531 * the commit. 5532 * 5533 * @since New in 1.8. 5534 */ 5535 svn_error_t * 5536 svn_client_move7(const apr_array_header_t *src_paths, 5537 const char *dst_path, 5538 svn_boolean_t move_as_child, 5539 svn_boolean_t make_parents, 5540 svn_boolean_t allow_mixed_revisions, 5541 svn_boolean_t metadata_only, 5542 const apr_hash_t *revprop_table, 5543 svn_commit_callback2_t commit_callback, 5544 void *commit_baton, 5545 svn_client_ctx_t *ctx, 5546 apr_pool_t *pool); 5547 5548 /** 5549 * Similar to svn_client_move7(), but with @a allow_mixed_revisions always 5550 * set to @c TRUE and @a metadata_only always to @c FALSE. 5551 * 5552 * @since New in 1.7. 5553 * @deprecated Provided for backward compatibility with the 1.7 API. 5554 */ 5555 SVN_DEPRECATED 5556 svn_error_t * 5557 svn_client_move6(const apr_array_header_t *src_paths, 5558 const char *dst_path, 5559 svn_boolean_t move_as_child, 5560 svn_boolean_t make_parents, 5561 const apr_hash_t *revprop_table, 5562 svn_commit_callback2_t commit_callback, 5563 void *commit_baton, 5564 svn_client_ctx_t *ctx, 5565 apr_pool_t *pool); 5566 5567 /** 5568 * Similar to svn_client_move6(), but returns the commit info in 5569 * @a *commit_info_p rather than through a callback function. 5570 * 5571 * A WC-to-WC move will include any modified and/or unversioned children. 5572 * @a force is ignored. 5573 * 5574 * @since New in 1.5. 5575 * @deprecated Provided for backward compatibility with the 1.6 API. 5576 */ 5577 SVN_DEPRECATED 5578 svn_error_t * 5579 svn_client_move5(svn_commit_info_t **commit_info_p, 5580 const apr_array_header_t *src_paths, 5581 const char *dst_path, 5582 svn_boolean_t force, 5583 svn_boolean_t move_as_child, 5584 svn_boolean_t make_parents, 5585 const apr_hash_t *revprop_table, 5586 svn_client_ctx_t *ctx, 5587 apr_pool_t *pool); 5588 5589 /** 5590 * Similar to svn_client_move5(), with only one @a src_path, @a 5591 * move_as_child set to @c FALSE, @a revprop_table passed as NULL, and 5592 * @a make_parents set to @c FALSE. 5593 * 5594 * Note: The behaviour of @a force changed in 1.5 (r860885 and r861421), when 5595 * the 'move' semantics were improved to just move the source including any 5596 * modified and/or unversioned items in it. Before that, @a force 5597 * controlled what happened to such items, but now @a force is ignored. 5598 * 5599 * @since New in 1.4. 5600 * 5601 * @deprecated Provided for backward compatibility with the 1.4 API. 5602 */ 5603 SVN_DEPRECATED 5604 svn_error_t * 5605 svn_client_move4(svn_commit_info_t **commit_info_p, 5606 const char *src_path, 5607 const char *dst_path, 5608 svn_boolean_t force, 5609 svn_client_ctx_t *ctx, 5610 apr_pool_t *pool); 5611 5612 /** 5613 * Similar to svn_client_move4(), with the difference that if @a dst_path 5614 * already exists and is a directory, move the item into that directory, 5615 * keeping its name (the last component of @a src_path). 5616 * 5617 * @since New in 1.3. 5618 * 5619 * @deprecated Provided for backward compatibility with the 1.3 API. 5620 */ 5621 SVN_DEPRECATED 5622 svn_error_t * 5623 svn_client_move3(svn_commit_info_t **commit_info_p, 5624 const char *src_path, 5625 const char *dst_path, 5626 svn_boolean_t force, 5627 svn_client_ctx_t *ctx, 5628 apr_pool_t *pool); 5629 5630 /** 5631 * Similar to svn_client_move3(), but uses #svn_client_commit_info_t 5632 * for @a commit_info_p. 5633 * 5634 * @deprecated Provided for backward compatibility with the 1.2 API. 5635 * 5636 * @since New in 1.2. 5637 */ 5638 SVN_DEPRECATED 5639 svn_error_t * 5640 svn_client_move2(svn_client_commit_info_t **commit_info_p, 5641 const char *src_path, 5642 const char *dst_path, 5643 svn_boolean_t force, 5644 svn_client_ctx_t *ctx, 5645 apr_pool_t *pool); 5646 5647 /** 5648 * Similar to svn_client_move2(), but an extra argument @a src_revision 5649 * must be passed. This has no effect, but must be of kind 5650 * #svn_opt_revision_unspecified or #svn_opt_revision_head, 5651 * otherwise error #SVN_ERR_UNSUPPORTED_FEATURE is returned. 5652 * 5653 * @deprecated Provided for backward compatibility with the 1.1 API. 5654 */ 5655 SVN_DEPRECATED 5656 svn_error_t * 5657 svn_client_move(svn_client_commit_info_t **commit_info_p, 5658 const char *src_path, 5659 const svn_opt_revision_t *src_revision, 5660 const char *dst_path, 5661 svn_boolean_t force, 5662 svn_client_ctx_t *ctx, 5663 apr_pool_t *pool); 5664 5665 /** @} */ 5666 5667 5668 /** Properties 5669 * 5670 * Note that certain svn-controlled properties must always have their 5671 * values set and stored in UTF8 with LF line endings. When 5672 * retrieving these properties, callers must convert the values back 5673 * to native locale and native line-endings before displaying them to 5674 * the user. For help with this task, see 5675 * svn_prop_needs_translation(), svn_subst_translate_string(), and 5676 * svn_subst_detranslate_string(). 5677 * 5678 * @defgroup svn_client_prop_funcs Property functions 5679 * @{ 5680 */ 5681 5682 5683 /** 5684 * Set @a propname to @a propval on @a url. A @a propval of @c NULL will 5685 * delete the property. 5686 * 5687 * Immediately attempt to commit the property change in the repository, 5688 * using the authentication baton in @a ctx and @a 5689 * ctx->log_msg_func3/@a ctx->log_msg_baton3. 5690 * 5691 * If the property has changed on @a url since revision 5692 * @a base_revision_for_url (which must not be #SVN_INVALID_REVNUM), no 5693 * change will be made and an error will be returned. 5694 * 5695 * If non-NULL, @a revprop_table is a hash table holding additional, 5696 * custom revision properties (<tt>const char *</tt> names mapped to 5697 * <tt>svn_string_t *</tt> values) to be set on the new revision. This 5698 * table cannot contain any standard Subversion properties. 5699 * 5700 * If @a commit_callback is non-NULL, then call @a commit_callback with 5701 * @a commit_baton and a #svn_commit_info_t for the commit. 5702 * 5703 * If @a propname is an svn-controlled property (i.e. prefixed with 5704 * #SVN_PROP_PREFIX), then the caller is responsible for ensuring that 5705 * the value is UTF8-encoded and uses LF line-endings. 5706 * 5707 * If @a skip_checks is TRUE, do no validity checking. But if @a 5708 * skip_checks is FALSE, and @a propname is not a valid property for @a 5709 * url, return an error, either #SVN_ERR_ILLEGAL_TARGET (if the property is 5710 * not appropriate for @a url), or * #SVN_ERR_BAD_MIME_TYPE (if @a propname 5711 * is "svn:mime-type", but @a propval is not a valid mime-type). 5712 * 5713 * Use @a scratch_pool for all memory allocation. 5714 * 5715 * @since New in 1.7. 5716 */ 5717 svn_error_t * 5718 svn_client_propset_remote(const char *propname, 5719 const svn_string_t *propval, 5720 const char *url, 5721 svn_boolean_t skip_checks, 5722 svn_revnum_t base_revision_for_url, 5723 const apr_hash_t *revprop_table, 5724 svn_commit_callback2_t commit_callback, 5725 void *commit_baton, 5726 svn_client_ctx_t *ctx, 5727 apr_pool_t *scratch_pool); 5728 5729 /** 5730 * Set @a propname to @a propval on each (const char *) target in @a 5731 * targets. The targets must be all working copy paths. A @a propval 5732 * of @c NULL will delete the property. 5733 * 5734 * If @a depth is #svn_depth_empty, set the property on each member of 5735 * @a targets only; if #svn_depth_files, set it on @a targets and their 5736 * file children (if any); if #svn_depth_immediates, on @a targets and all 5737 * of their immediate children (both files and directories); if 5738 * #svn_depth_infinity, on @a targets and everything beneath them. 5739 * 5740 * @a changelists is an array of <tt>const char *</tt> changelist 5741 * names, used as a restrictive filter on items whose properties are 5742 * set; that is, don't set properties on any item unless it's a member 5743 * of one of those changelists. If @a changelists is empty (or 5744 * altogether @c NULL), no changelist filtering occurs. 5745 * 5746 * If @a propname is an svn-controlled property (i.e. prefixed with 5747 * #SVN_PROP_PREFIX), then the caller is responsible for ensuring that 5748 * the value is UTF8-encoded and uses LF line-endings. 5749 * 5750 * If @a skip_checks is TRUE, do no validity checking. But if @a 5751 * skip_checks is FALSE, and @a propname is not a valid property for @a 5752 * targets, return an error, either #SVN_ERR_ILLEGAL_TARGET (if the 5753 * property is not appropriate for @a targets), or 5754 * #SVN_ERR_BAD_MIME_TYPE (if @a propname is "svn:mime-type", but @a 5755 * propval is not a valid mime-type). 5756 * 5757 * If @a ctx->cancel_func is non-NULL, invoke it passing @a 5758 * ctx->cancel_baton at various places during the operation. 5759 * 5760 * Use @a scratch_pool for all memory allocation. 5761 * 5762 * @since New in 1.7. 5763 */ 5764 svn_error_t * 5765 svn_client_propset_local(const char *propname, 5766 const svn_string_t *propval, 5767 const apr_array_header_t *targets, 5768 svn_depth_t depth, 5769 svn_boolean_t skip_checks, 5770 const apr_array_header_t *changelists, 5771 svn_client_ctx_t *ctx, 5772 apr_pool_t *scratch_pool); 5773 5774 /** 5775 * An amalgamation of svn_client_propset_local() and 5776 * svn_client_propset_remote() that takes only a single target, and 5777 * returns the commit info in @a *commit_info_p rather than through a 5778 * callback function. 5779 * 5780 * @since New in 1.5. 5781 * @deprecated Provided for backward compatibility with the 1.6 API. 5782 */ 5783 SVN_DEPRECATED 5784 svn_error_t * 5785 svn_client_propset3(svn_commit_info_t **commit_info_p, 5786 const char *propname, 5787 const svn_string_t *propval, 5788 const char *target, 5789 svn_depth_t depth, 5790 svn_boolean_t skip_checks, 5791 svn_revnum_t base_revision_for_url, 5792 const apr_array_header_t *changelists, 5793 const apr_hash_t *revprop_table, 5794 svn_client_ctx_t *ctx, 5795 apr_pool_t *pool); 5796 5797 /** 5798 * Like svn_client_propset3(), but with @a base_revision_for_url 5799 * always #SVN_INVALID_REVNUM; @a commit_info_p always @c NULL; @a 5800 * changelists always @c NULL; @a revprop_table always @c NULL; and @a 5801 * depth set according to @a recurse: if @a recurse is TRUE, @a depth 5802 * is #svn_depth_infinity, else #svn_depth_empty. 5803 * 5804 * @deprecated Provided for backward compatibility with the 1.4 API. 5805 */ 5806 SVN_DEPRECATED 5807 svn_error_t * 5808 svn_client_propset2(const char *propname, 5809 const svn_string_t *propval, 5810 const char *target, 5811 svn_boolean_t recurse, 5812 svn_boolean_t skip_checks, 5813 svn_client_ctx_t *ctx, 5814 apr_pool_t *pool); 5815 5816 /** 5817 * Like svn_client_propset2(), but with @a skip_checks always FALSE and a 5818 * newly created @a ctx. 5819 * 5820 * @deprecated Provided for backward compatibility with the 1.1 API. 5821 */ 5822 SVN_DEPRECATED 5823 svn_error_t * 5824 svn_client_propset(const char *propname, 5825 const svn_string_t *propval, 5826 const char *target, 5827 svn_boolean_t recurse, 5828 apr_pool_t *pool); 5829 5830 /** Set @a propname to @a propval on revision @a revision in the repository 5831 * represented by @a URL. Use the authentication baton in @a ctx for 5832 * authentication, and @a pool for all memory allocation. Return the actual 5833 * rev affected in @a *set_rev. A @a propval of @c NULL will delete the 5834 * property. 5835 * 5836 * If @a original_propval is non-NULL, then just before setting the 5837 * new value, check that the old value matches @a original_propval; 5838 * if they do not match, return the error #SVN_ERR_RA_OUT_OF_DATE. 5839 * This is to help clients support interactive editing of revprops: 5840 * without this check, the window during which the property may change 5841 * underneath the user is as wide as the amount of time the user 5842 * spends editing the property. With this check, the window is 5843 * reduced to a small, constant amount of time right before we set the 5844 * new value. (To check that an old value is still non-existent, set 5845 * @a original_propval->data to NULL, and @a original_propval->len is 5846 * ignored.) 5847 * If the server advertises #SVN_RA_CAPABILITY_ATOMIC_REVPROPS, the 5848 * check of @a original_propval is done atomically. 5849 * 5850 * Note: the representation of "property is not set" in @a 5851 * original_propval differs from the representation in other APIs 5852 * (such as svn_fs_change_rev_prop2() and svn_ra_change_rev_prop2()). 5853 * 5854 * If @a force is TRUE, allow newlines in the author property. 5855 * 5856 * If @a propname is an svn-controlled property (i.e. prefixed with 5857 * #SVN_PROP_PREFIX), then the caller is responsible for ensuring that 5858 * the value UTF8-encoded and uses LF line-endings. 5859 * 5860 * Note that unlike its cousin svn_client_propset3(), this routine 5861 * doesn't affect the working copy at all; it's a pure network 5862 * operation that changes an *unversioned* property attached to a 5863 * revision. This can be used to tweak log messages, dates, authors, 5864 * and the like. Be careful: it's a lossy operation. 5865 5866 * @a ctx->notify_func2 and @a ctx->notify_baton2 are the notification 5867 * functions and baton which are called upon successful setting of the 5868 * property. 5869 * 5870 * Also note that unless the administrator creates a 5871 * pre-revprop-change hook in the repository, this feature will fail. 5872 * 5873 * @since New in 1.6. 5874 */ 5875 svn_error_t * 5876 svn_client_revprop_set2(const char *propname, 5877 const svn_string_t *propval, 5878 const svn_string_t *original_propval, 5879 const char *URL, 5880 const svn_opt_revision_t *revision, 5881 svn_revnum_t *set_rev, 5882 svn_boolean_t force, 5883 svn_client_ctx_t *ctx, 5884 apr_pool_t *pool); 5885 5886 /** 5887 * Similar to svn_client_revprop_set2(), but with @a original_propval 5888 * always @c NULL. 5889 * 5890 * @deprecated Provided for backward compatibility with the 1.5 API. 5891 */ 5892 SVN_DEPRECATED 5893 svn_error_t * 5894 svn_client_revprop_set(const char *propname, 5895 const svn_string_t *propval, 5896 const char *URL, 5897 const svn_opt_revision_t *revision, 5898 svn_revnum_t *set_rev, 5899 svn_boolean_t force, 5900 svn_client_ctx_t *ctx, 5901 apr_pool_t *pool); 5902 5903 /** 5904 * Set @a *props to a hash table whose keys are absolute paths or URLs 5905 * of items on which property @a propname is explicitly set, and whose 5906 * values are <tt>svn_string_t *</tt> representing the property value for 5907 * @a propname at that path. 5908 * 5909 * If @a inherited_props is not @c NULL, then set @a *inherited_props to a 5910 * depth-first ordered array of #svn_prop_inherited_item_t * structures 5911 * representing the properties inherited by @a target. If @a target is a 5912 * working copy path, then properties inherited by @a target as far as the 5913 * root of the working copy are obtained from the working copy's actual 5914 * property values. Properties inherited from above the working copy root 5915 * come from the inherited properties cache. If @a target is a URL, then 5916 * the inherited properties come from the repository. If @a inherited_props 5917 * is not @c NULL and no inheritable properties are found, then set 5918 * @a *inherited_props to an empty array. 5919 * 5920 * The #svn_prop_inherited_item_t->path_or_url members of the 5921 * #svn_prop_inherited_item_t * structures in @a *inherited_props are 5922 * URLs if @a target is a URL or if @a target is a working copy path but the 5923 * property represented by the structure is above the working copy root (i.e. 5924 * the inherited property is from the cache). In all other cases the 5925 * #svn_prop_inherited_item_t->path_or_url members are absolute working copy 5926 * paths. 5927 * 5928 * Allocate @a *props (including keys and values) and @a *inherited_props 5929 * (including its elements) in @a result_pool, use @a scratch_pool for 5930 * temporary allocations. 5931 * 5932 * @a target is a WC absolute path or a URL. 5933 * 5934 * Don't store any path, not even @a target, if it does not have a 5935 * property named @a propname. 5936 * 5937 * If @a revision->kind is #svn_opt_revision_unspecified, then: get 5938 * properties from the working copy if @a target is a working copy 5939 * path, or from the repository head if @a target is a URL. Else get 5940 * the properties as of @a revision. The actual node revision 5941 * selected is determined by the path as it exists in @a peg_revision. 5942 * If @a peg_revision->kind is #svn_opt_revision_unspecified, then 5943 * it defaults to #svn_opt_revision_head for URLs or 5944 * #svn_opt_revision_working for WC targets. Use the authentication 5945 * baton in @a ctx for authentication if contacting the repository. 5946 * If @a actual_revnum is not @c NULL, the actual revision number used 5947 * for the fetch is stored in @a *actual_revnum. 5948 * 5949 * If @a depth is #svn_depth_empty, fetch the property from 5950 * @a target only; if #svn_depth_files, fetch from @a target and its 5951 * file children (if any); if #svn_depth_immediates, from @a target 5952 * and all of its immediate children (both files and directories); if 5953 * #svn_depth_infinity, from @a target and everything beneath it. 5954 * 5955 * @a changelists is an array of <tt>const char *</tt> changelist 5956 * names, used as a restrictive filter on items whose properties are 5957 * gotten; that is, don't get @a propname on any item unless it's a member 5958 * of one of those changelists. If @a changelists is empty (or 5959 * altogether @c NULL), no changelist filtering occurs. 5960 * 5961 * If error, don't touch @a *props, otherwise @a *props is a hash table 5962 * even if empty. 5963 * 5964 * This function returns SVN_ERR_UNVERSIONED_RESOURCE when it is called on 5965 * unversioned nodes. 5966 * 5967 * @since New in 1.8. 5968 */ 5969 svn_error_t * 5970 svn_client_propget5(apr_hash_t **props, 5971 apr_array_header_t **inherited_props, 5972 const char *propname, 5973 const char *target, /* abspath or URL */ 5974 const svn_opt_revision_t *peg_revision, 5975 const svn_opt_revision_t *revision, 5976 svn_revnum_t *actual_revnum, 5977 svn_depth_t depth, 5978 const apr_array_header_t *changelists, 5979 svn_client_ctx_t *ctx, 5980 apr_pool_t *result_pool, 5981 apr_pool_t *scratch_pool); 5982 5983 /** 5984 * Similar to svn_client_propget5 but with @a inherited_props always 5985 * passed as NULL. 5986 * 5987 * @since New in 1.7. 5988 * @deprecated Provided for backward compatibility with the 1.7 API. 5989 */ 5990 SVN_DEPRECATED 5991 svn_error_t * 5992 svn_client_propget4(apr_hash_t **props, 5993 const char *propname, 5994 const char *target, /* abspath or URL */ 5995 const svn_opt_revision_t *peg_revision, 5996 const svn_opt_revision_t *revision, 5997 svn_revnum_t *actual_revnum, 5998 svn_depth_t depth, 5999 const apr_array_header_t *changelists, 6000 svn_client_ctx_t *ctx, 6001 apr_pool_t *result_pool, 6002 apr_pool_t *scratch_pool); 6003 6004 /** 6005 * Similar to svn_client_propget4(), but with the following change to the 6006 * output hash keys: keys are `<tt>char *</tt>' paths, prefixed by 6007 * @a target, which is a working copy path or a URL. 6008 * 6009 * This function returns SVN_ERR_ENTRY_NOT_FOUND where svn_client_propget4 6010 * would return SVN_ERR_UNVERSIONED_RESOURCE. 6011 * 6012 * @since New in 1.5. 6013 * @deprecated Provided for backward compatibility with the 1.6 API. 6014 */ 6015 SVN_DEPRECATED 6016 svn_error_t * 6017 svn_client_propget3(apr_hash_t **props, 6018 const char *propname, 6019 const char *target, 6020 const svn_opt_revision_t *peg_revision, 6021 const svn_opt_revision_t *revision, 6022 svn_revnum_t *actual_revnum, 6023 svn_depth_t depth, 6024 const apr_array_header_t *changelists, 6025 svn_client_ctx_t *ctx, 6026 apr_pool_t *pool); 6027 6028 /** 6029 * Similar to svn_client_propget3(), except that @a actual_revnum and 6030 * @a changelists are always @c NULL, and @a depth is set according to 6031 * @a recurse: if @a recurse is TRUE, then @a depth is 6032 * #svn_depth_infinity, else #svn_depth_empty. 6033 * 6034 * @deprecated Provided for backward compatibility with the 1.4 API. 6035 */ 6036 SVN_DEPRECATED 6037 svn_error_t * 6038 svn_client_propget2(apr_hash_t **props, 6039 const char *propname, 6040 const char *target, 6041 const svn_opt_revision_t *peg_revision, 6042 const svn_opt_revision_t *revision, 6043 svn_boolean_t recurse, 6044 svn_client_ctx_t *ctx, 6045 apr_pool_t *pool); 6046 6047 /** 6048 * Similar to svn_client_propget2(), except that @a peg_revision is 6049 * always the same as @a revision. 6050 * 6051 * @deprecated Provided for backward compatibility with the 1.1 API. 6052 */ 6053 SVN_DEPRECATED 6054 svn_error_t * 6055 svn_client_propget(apr_hash_t **props, 6056 const char *propname, 6057 const char *target, 6058 const svn_opt_revision_t *revision, 6059 svn_boolean_t recurse, 6060 svn_client_ctx_t *ctx, 6061 apr_pool_t *pool); 6062 6063 /** Set @a *propval to the value of @a propname on revision @a revision 6064 * in the repository represented by @a URL. Use the authentication baton 6065 * in @a ctx for authentication, and @a pool for all memory allocation. 6066 * Return the actual rev queried in @a *set_rev. 6067 * 6068 * If @a propname does not exist on @a revision, set @a *propval to @c NULL. 6069 * 6070 * Note that unlike its cousin svn_client_propget(), this routine 6071 * doesn't affect the working copy at all; it's a pure network 6072 * operation that queries an *unversioned* property attached to a 6073 * revision. This can query log messages, dates, authors, and the 6074 * like. 6075 */ 6076 svn_error_t * 6077 svn_client_revprop_get(const char *propname, 6078 svn_string_t **propval, 6079 const char *URL, 6080 const svn_opt_revision_t *revision, 6081 svn_revnum_t *set_rev, 6082 svn_client_ctx_t *ctx, 6083 apr_pool_t *pool); 6084 6085 /** 6086 * Invoke @a receiver with @a receiver_baton to return the regular explicit, and 6087 * possibly the inherited, properties of @a target, a URL or working copy path. 6088 * @a receiver will be called for each path encountered. 6089 * 6090 * @a target is a WC path or a URL. 6091 * 6092 * If @a revision->kind is #svn_opt_revision_unspecified, then get the 6093 * explicit (and possibly the inherited) properties from the working copy, 6094 * if @a target is a working copy path, or from the repository head if 6095 * @a target is a URL. Else get the properties as of @a revision. 6096 * The actual node revision selected is determined by the path as it exists 6097 * in @a peg_revision. If @a peg_revision->kind is 6098 * #svn_opt_revision_unspecified, then it defaults to #svn_opt_revision_head 6099 * for URLs or #svn_opt_revision_working for WC targets. Use the 6100 * authentication baton cached in @a ctx for authentication if contacting 6101 * the repository. 6102 * 6103 * If @a depth is #svn_depth_empty, list only the properties of 6104 * @a target itself. If @a depth is #svn_depth_files, and 6105 * @a target is a directory, list the properties of @a target 6106 * and its file entries. If #svn_depth_immediates, list the properties 6107 * of its immediate file and directory entries. If #svn_depth_infinity, 6108 * list the properties of its file entries and recurse (with 6109 * #svn_depth_infinity) on directory entries. #svn_depth_unknown is 6110 * equivalent to #svn_depth_empty. All other values produce undefined 6111 * results. 6112 * 6113 * @a changelists is an array of <tt>const char *</tt> changelist 6114 * names, used as a restrictive filter on items whose properties are 6115 * listed; that is, don't list properties on any item unless it's a member 6116 * of one of those changelists. If @a changelists is empty (or 6117 * altogether @c NULL), no changelist filtering occurs. 6118 * 6119 * If @a get_target_inherited_props is true, then also return any inherited 6120 * properties when @a receiver is called for @a target. If @a target is a 6121 * working copy path, then properties inherited by @a target as far as the 6122 * root of the working copy are obtained from the working copy's actual 6123 * property values. Properties inherited from above the working copy 6124 * root come from the inherited properties cache. If @a target is a URL, 6125 * then the inherited properties come from the repository. 6126 * If @a get_target_inherited_props is false, then no inherited properties 6127 * are returned to @a receiver. 6128 * 6129 * If @a target is not found, return the error #SVN_ERR_ENTRY_NOT_FOUND. 6130 * 6131 * @since New in 1.8. 6132 */ 6133 svn_error_t * 6134 svn_client_proplist4(const char *target, 6135 const svn_opt_revision_t *peg_revision, 6136 const svn_opt_revision_t *revision, 6137 svn_depth_t depth, 6138 const apr_array_header_t *changelists, 6139 svn_boolean_t get_target_inherited_props, 6140 svn_proplist_receiver2_t receiver, 6141 void *receiver_baton, 6142 svn_client_ctx_t *ctx, 6143 apr_pool_t *scratch_pool); 6144 6145 /** 6146 * Similar to svn_client_proplist4(), except that the @a receiver type 6147 * is a #svn_proplist_receiver_t, @a get_target_inherited_props is 6148 * always passed NULL, and there is no separate scratch pool. 6149 * 6150 * @since New in 1.5. 6151 * @deprecated Provided for backward compatibility with the 1.7 API. 6152 */ 6153 SVN_DEPRECATED 6154 svn_error_t * 6155 svn_client_proplist3(const char *target, 6156 const svn_opt_revision_t *peg_revision, 6157 const svn_opt_revision_t *revision, 6158 svn_depth_t depth, 6159 const apr_array_header_t *changelists, 6160 svn_proplist_receiver_t receiver, 6161 void *receiver_baton, 6162 svn_client_ctx_t *ctx, 6163 apr_pool_t *pool); 6164 6165 /** 6166 * Similar to svn_client_proplist3(), except the properties are 6167 * returned as an array of #svn_client_proplist_item_t * structures 6168 * instead of by invoking the receiver function, there's no support 6169 * for @a changelists filtering, and @a recurse is used instead of a 6170 * #svn_depth_t parameter (FALSE corresponds to #svn_depth_empty, 6171 * and TRUE to #svn_depth_infinity). 6172 * 6173 * @since New in 1.2. 6174 * 6175 * @deprecated Provided for backward compatibility with the 1.4 API. 6176 */ 6177 SVN_DEPRECATED 6178 svn_error_t * 6179 svn_client_proplist2(apr_array_header_t **props, 6180 const char *target, 6181 const svn_opt_revision_t *peg_revision, 6182 const svn_opt_revision_t *revision, 6183 svn_boolean_t recurse, 6184 svn_client_ctx_t *ctx, 6185 apr_pool_t *pool); 6186 6187 /** 6188 * Similar to svn_client_proplist2(), except that @a peg_revision is 6189 * always the same as @a revision. 6190 * 6191 * @deprecated Provided for backward compatibility with the 1.1 API. 6192 */ 6193 SVN_DEPRECATED 6194 svn_error_t * 6195 svn_client_proplist(apr_array_header_t **props, 6196 const char *target, 6197 const svn_opt_revision_t *revision, 6198 svn_boolean_t recurse, 6199 svn_client_ctx_t *ctx, 6200 apr_pool_t *pool); 6201 6202 /** Set @a *props to a hash of the revision props attached to @a revision in 6203 * the repository represented by @a URL. Use the authentication baton cached 6204 * in @a ctx for authentication, and @a pool for all memory allocation. 6205 * Return the actual rev queried in @a *set_rev. 6206 * 6207 * The allocated hash maps (<tt>const char *</tt>) property names to 6208 * (#svn_string_t *) property values. 6209 * 6210 * Note that unlike its cousin svn_client_proplist(), this routine 6211 * doesn't read a working copy at all; it's a pure network operation 6212 * that reads *unversioned* properties attached to a revision. 6213 */ 6214 svn_error_t * 6215 svn_client_revprop_list(apr_hash_t **props, 6216 const char *URL, 6217 const svn_opt_revision_t *revision, 6218 svn_revnum_t *set_rev, 6219 svn_client_ctx_t *ctx, 6220 apr_pool_t *pool); 6221 /** @} */ 6222 6223 6224 /** 6225 * @defgroup Export Export a tree from version control. 6226 * 6227 * @{ 6228 */ 6229 6230 /** 6231 * Export the contents of either a subversion repository or a 6232 * subversion working copy into a 'clean' directory (meaning a 6233 * directory with no administrative directories). If @a result_rev 6234 * is not @c NULL and the path being exported is a repository URL, set 6235 * @a *result_rev to the value of the revision actually exported (set 6236 * it to #SVN_INVALID_REVNUM for local exports). 6237 * 6238 * @a from_path_or_url is either the path the working copy on disk, or 6239 * a URL to the repository you wish to export. 6240 * 6241 * When exporting a directory, @a to_path is the path to the directory 6242 * where you wish to create the exported tree; when exporting a file, it 6243 * is the path of the file that will be created. If @a to_path is the 6244 * empty path, then the basename of the export file/directory in the repository 6245 * will be used. If @a to_path represents an existing directory, and a 6246 * file is being exported, then a file with the that basename will be 6247 * created under that directory (as with 'copy' operations). 6248 * 6249 * @a peg_revision is the revision where the path is first looked up 6250 * when exporting from a repository. If @a peg_revision->kind is 6251 * #svn_opt_revision_unspecified, then it defaults to #svn_opt_revision_head 6252 * for URLs or #svn_opt_revision_working for WC targets. 6253 * 6254 * @a revision is the revision that should be exported. 6255 * 6256 * @a peg_revision and @a revision must not be @c NULL. 6257 * 6258 * @a ctx->notify_func2 and @a ctx->notify_baton2 are the notification 6259 * functions and baton which are passed to svn_client_checkout() when 6260 * exporting from a repository. 6261 * 6262 * @a ctx is a context used for authentication in the repository case. 6263 * 6264 * @a overwrite if TRUE will cause the export to overwrite files or 6265 * directories. 6266 * 6267 * If @a ignore_externals is set, don't process externals definitions 6268 * as part of this operation. 6269 * 6270 * If @a ignore_keywords is set, don't expand keywords as part of this 6271 * operation. 6272 * 6273 * @a native_eol allows you to override the standard eol marker on the 6274 * platform you are running on. Can be either "LF", "CR" or "CRLF" or 6275 * NULL. If NULL will use the standard eol marker. Any other value 6276 * will cause the #SVN_ERR_IO_UNKNOWN_EOL error to be returned. 6277 * 6278 * If @a depth is #svn_depth_infinity, export fully recursively. Else 6279 * if it is #svn_depth_immediates, export @a from_path_or_url and its 6280 * immediate children (if any), but with subdirectories empty and at 6281 * #svn_depth_empty. Else if #svn_depth_files, export @a 6282 * from_path_or_url and its immediate file children (if any) only. If 6283 * @a depth is #svn_depth_empty, then export exactly @a 6284 * from_path_or_url and none of its children. 6285 * 6286 * All allocations are done in @a pool. 6287 * 6288 * @since New in 1.7. 6289 */ 6290 svn_error_t * 6291 svn_client_export5(svn_revnum_t *result_rev, 6292 const char *from_path_or_url, 6293 const char *to_path, 6294 const svn_opt_revision_t *peg_revision, 6295 const svn_opt_revision_t *revision, 6296 svn_boolean_t overwrite, 6297 svn_boolean_t ignore_externals, 6298 svn_boolean_t ignore_keywords, 6299 svn_depth_t depth, 6300 const char *native_eol, 6301 svn_client_ctx_t *ctx, 6302 apr_pool_t *pool); 6303 6304 /** 6305 * Similar to svn_client_export5(), but with @a ignore_keywords set 6306 * to FALSE. 6307 * 6308 * @deprecated Provided for backward compatibility with the 1.6 API. 6309 * @since New in 1.5. 6310 */ 6311 SVN_DEPRECATED 6312 svn_error_t * 6313 svn_client_export4(svn_revnum_t *result_rev, 6314 const char *from_path_or_url, 6315 const char *to_path, 6316 const svn_opt_revision_t *peg_revision, 6317 const svn_opt_revision_t *revision, 6318 svn_boolean_t overwrite, 6319 svn_boolean_t ignore_externals, 6320 svn_depth_t depth, 6321 const char *native_eol, 6322 svn_client_ctx_t *ctx, 6323 apr_pool_t *pool); 6324 6325 6326 /** 6327 * Similar to svn_client_export4(), but with @a depth set according to 6328 * @a recurse: if @a recurse is TRUE, set @a depth to 6329 * #svn_depth_infinity, if @a recurse is FALSE, set @a depth to 6330 * #svn_depth_files. 6331 * 6332 * @deprecated Provided for backward compatibility with the 1.4 API. 6333 * 6334 * @since New in 1.2. 6335 */ 6336 SVN_DEPRECATED 6337 svn_error_t * 6338 svn_client_export3(svn_revnum_t *result_rev, 6339 const char *from_path_or_url, 6340 const char *to_path, 6341 const svn_opt_revision_t *peg_revision, 6342 const svn_opt_revision_t *revision, 6343 svn_boolean_t overwrite, 6344 svn_boolean_t ignore_externals, 6345 svn_boolean_t recurse, 6346 const char *native_eol, 6347 svn_client_ctx_t *ctx, 6348 apr_pool_t *pool); 6349 6350 6351 /** 6352 * Similar to svn_client_export3(), but with @a peg_revision 6353 * always set to #svn_opt_revision_unspecified, @a overwrite set to 6354 * the value of @a force, @a ignore_externals always FALSE, and 6355 * @a recurse always TRUE. 6356 * 6357 * @since New in 1.1. 6358 * @deprecated Provided for backward compatibility with the 1.1 API. 6359 */ 6360 SVN_DEPRECATED 6361 svn_error_t * 6362 svn_client_export2(svn_revnum_t *result_rev, 6363 const char *from_path_or_url, 6364 const char *to_path, 6365 svn_opt_revision_t *revision, 6366 svn_boolean_t force, 6367 const char *native_eol, 6368 svn_client_ctx_t *ctx, 6369 apr_pool_t *pool); 6370 6371 6372 /** 6373 * Similar to svn_client_export2(), but with @a native_eol always set 6374 * to NULL. 6375 * 6376 * @deprecated Provided for backward compatibility with the 1.0 API. 6377 */ 6378 SVN_DEPRECATED 6379 svn_error_t * 6380 svn_client_export(svn_revnum_t *result_rev, 6381 const char *from_path_or_url, 6382 const char *to_path, 6383 svn_opt_revision_t *revision, 6384 svn_boolean_t force, 6385 svn_client_ctx_t *ctx, 6386 apr_pool_t *pool); 6387 6388 /** @} */ 6389 6390 /** 6391 * @defgroup List List / ls 6392 * 6393 * @{ 6394 */ 6395 6396 /** The type of function invoked by svn_client_list3() to report the details 6397 * of each directory entry being listed. 6398 * 6399 * @a baton is the baton that was passed to the caller. @a path is the 6400 * entry's path relative to @a abs_path; it is the empty path when reporting 6401 * the top node of the list operation. @a dirent contains some or all of 6402 * the directory entry's details, as determined by the caller. @a lock is 6403 * the entry's lock, if it is locked and if lock information is being 6404 * reported by the caller; otherwise @a lock is NULL. @a abs_path is the 6405 * repository path of the top node of the list operation; it is relative to 6406 * the repository root and begins with "/". 6407 * 6408 * If svn_client_list3() was called with @a include_externals set to TRUE, 6409 * @a external_parent_url and @a external_target will be set. 6410 * @a external_parent_url is url of the directory which has the 6411 * externals definitions. @a external_target is the target subdirectory of 6412 * externals definitions which is relative to the parent directory that holds 6413 * the external item. 6414 * 6415 * If external_parent_url and external_target are defined, the item being 6416 * listed is part of the external described by external_parent_url and 6417 * external_target. Else, the item is not part of any external. 6418 * Moreover, we will never mix items which are part of separate 6419 * externals, and will always finish listing an external before listing 6420 * the next one. 6421 * 6422 * @a scratch_pool may be used for temporary allocations. 6423 * 6424 * @since New in 1.8. 6425 */ 6426 typedef svn_error_t *(*svn_client_list_func2_t)( 6427 void *baton, 6428 const char *path, 6429 const svn_dirent_t *dirent, 6430 const svn_lock_t *lock, 6431 const char *abs_path, 6432 const char *external_parent_url, 6433 const char *external_target, 6434 apr_pool_t *scratch_pool); 6435 6436 /** 6437 * Similar to #svn_client_list_func2_t, but without any information about 6438 * externals definitions. 6439 * 6440 * @deprecated Provided for backward compatibility with the 1.7 API. 6441 * 6442 * @since New in 1.4 6443 * 6444 * */ 6445 typedef svn_error_t *(*svn_client_list_func_t)(void *baton, 6446 const char *path, 6447 const svn_dirent_t *dirent, 6448 const svn_lock_t *lock, 6449 const char *abs_path, 6450 apr_pool_t *pool); 6451 6452 /** 6453 * Report the directory entry, and possibly children, for @a 6454 * path_or_url at @a revision. The actual node revision selected is 6455 * determined by the path as it exists in @a peg_revision. If @a 6456 * peg_revision->kind is #svn_opt_revision_unspecified, then it defaults 6457 * to #svn_opt_revision_head for URLs or #svn_opt_revision_working 6458 * for WC targets. 6459 * 6460 * Report directory entries by invoking @a list_func/@a baton with @a path 6461 * relative to @a path_or_url. The dirent for @a path_or_url is reported 6462 * using an empty @a path. If @a path_or_url is a directory, also report 6463 * its children. If @a path_or_url is non-existent, return 6464 * #SVN_ERR_FS_NOT_FOUND. 6465 * 6466 * If the @a patterns array of <tt>const char *</tt> is not @c NULL, only 6467 * report paths whose last segment matches one of the specified glob 6468 * patterns. This does not affect the size of the tree nor the number of 6469 * externals being covered. 6470 * 6471 * If @a fetch_locks is TRUE, include locks when reporting directory entries. 6472 * 6473 * If @a include_externals is TRUE, also list all external items 6474 * reached by recursion. @a depth value passed to the original list target 6475 * applies for the externals also. 6476 * 6477 * Use @a scratch_pool for temporary allocations. 6478 * 6479 * Use authentication baton cached in @a ctx to authenticate against the 6480 * repository. 6481 * 6482 * If @a depth is #svn_depth_empty, list just @a path_or_url itself. 6483 * If @a depth is #svn_depth_files, list @a path_or_url and its file 6484 * entries. If #svn_depth_immediates, list its immediate file and 6485 * directory entries. If #svn_depth_infinity, list file entries and 6486 * recurse (with #svn_depth_infinity) on directory entries. 6487 * 6488 * @a dirent_fields controls which fields in the #svn_dirent_t's are 6489 * filled in. To have them totally filled in use #SVN_DIRENT_ALL, 6490 * otherwise simply bitwise OR together the combination of @c SVN_DIRENT_ 6491 * fields you care about. 6492 * 6493 * @since New in 1.10. 6494 */ 6495 svn_error_t * 6496 svn_client_list4(const char *path_or_url, 6497 const svn_opt_revision_t *peg_revision, 6498 const svn_opt_revision_t *revision, 6499 const apr_array_header_t *patterns, 6500 svn_depth_t depth, 6501 apr_uint32_t dirent_fields, 6502 svn_boolean_t fetch_locks, 6503 svn_boolean_t include_externals, 6504 svn_client_list_func2_t list_func, 6505 void *baton, 6506 svn_client_ctx_t *ctx, 6507 apr_pool_t *scratch_pool); 6508 6509 /** Similar to svn_client_list4(), but with @a patterns set to @c NULL. 6510 * 6511 * @since New in 1.8. 6512 * 6513 * @deprecated Provided for backwards compatibility with the 1.9 API. 6514 */ 6515 SVN_DEPRECATED 6516 svn_error_t * 6517 svn_client_list3(const char *path_or_url, 6518 const svn_opt_revision_t *peg_revision, 6519 const svn_opt_revision_t *revision, 6520 svn_depth_t depth, 6521 apr_uint32_t dirent_fields, 6522 svn_boolean_t fetch_locks, 6523 svn_boolean_t include_externals, 6524 svn_client_list_func2_t list_func, 6525 void *baton, 6526 svn_client_ctx_t *ctx, 6527 apr_pool_t *pool); 6528 6529 6530 /** Similar to svn_client_list3(), but with @a include_externals set 6531 * to FALSE, and using a #svn_client_list_func_t as callback. 6532 * 6533 * @since New in 1.5. 6534 * 6535 * @deprecated Provided for backwards compatibility with the 1.7 API. 6536 */ 6537 SVN_DEPRECATED 6538 svn_error_t * 6539 svn_client_list2(const char *path_or_url, 6540 const svn_opt_revision_t *peg_revision, 6541 const svn_opt_revision_t *revision, 6542 svn_depth_t depth, 6543 apr_uint32_t dirent_fields, 6544 svn_boolean_t fetch_locks, 6545 svn_client_list_func_t list_func, 6546 void *baton, 6547 svn_client_ctx_t *ctx, 6548 apr_pool_t *pool); 6549 6550 /** 6551 * Similar to svn_client_list2(), but with @a recurse instead of @a depth. 6552 * If @a recurse is TRUE, pass #svn_depth_files for @a depth; else 6553 * pass #svn_depth_infinity. 6554 * 6555 * @since New in 1.4. 6556 * 6557 * @deprecated Provided for backward compatibility with the 1.4 API. 6558 */ 6559 SVN_DEPRECATED 6560 svn_error_t * 6561 svn_client_list(const char *path_or_url, 6562 const svn_opt_revision_t *peg_revision, 6563 const svn_opt_revision_t *revision, 6564 svn_boolean_t recurse, 6565 apr_uint32_t dirent_fields, 6566 svn_boolean_t fetch_locks, 6567 svn_client_list_func_t list_func, 6568 void *baton, 6569 svn_client_ctx_t *ctx, 6570 apr_pool_t *pool); 6571 6572 /** 6573 * Same as svn_client_list(), but always passes #SVN_DIRENT_ALL for 6574 * the @a dirent_fields argument and returns all information in two 6575 * hash tables instead of invoking a callback. 6576 * 6577 * Set @a *dirents to a newly allocated hash of directory entries. 6578 * The @a dirents hash maps entry names (<tt>const char *</tt>) to 6579 * #svn_dirent_t *'s. 6580 * 6581 * If @a locks is not @c NULL, set @a *locks to a hash table mapping 6582 * entry names (<tt>const char *</tt>) to #svn_lock_t *'s. 6583 * 6584 * @since New in 1.3. 6585 * 6586 * @deprecated Provided for backward compatibility with the 1.3 API. 6587 * Use svn_client_list2() instead. 6588 */ 6589 SVN_DEPRECATED 6590 svn_error_t * 6591 svn_client_ls3(apr_hash_t **dirents, 6592 apr_hash_t **locks, 6593 const char *path_or_url, 6594 const svn_opt_revision_t *peg_revision, 6595 const svn_opt_revision_t *revision, 6596 svn_boolean_t recurse, 6597 svn_client_ctx_t *ctx, 6598 apr_pool_t *pool); 6599 6600 /** 6601 * Same as svn_client_ls3(), but without the ability to get locks. 6602 * 6603 * @since New in 1.2. 6604 * 6605 * @deprecated Provided for backward compatibility with the 1.2 API. 6606 * Use svn_client_list2() instead. 6607 */ 6608 SVN_DEPRECATED 6609 svn_error_t * 6610 svn_client_ls2(apr_hash_t **dirents, 6611 const char *path_or_url, 6612 const svn_opt_revision_t *peg_revision, 6613 const svn_opt_revision_t *revision, 6614 svn_boolean_t recurse, 6615 svn_client_ctx_t *ctx, 6616 apr_pool_t *pool); 6617 6618 /** 6619 * Similar to svn_client_ls2() except that @a peg_revision is always 6620 * the same as @a revision. 6621 * 6622 * @deprecated Provided for backward compatibility with the 1.1 API. 6623 * Use svn_client_list2() instead. 6624 */ 6625 SVN_DEPRECATED 6626 svn_error_t * 6627 svn_client_ls(apr_hash_t **dirents, 6628 const char *path_or_url, 6629 svn_opt_revision_t *revision, 6630 svn_boolean_t recurse, 6631 svn_client_ctx_t *ctx, 6632 apr_pool_t *pool); 6633 6634 6635 /** @} */ 6636 6637 /** 6638 * @defgroup Cat View the contents of a file in the repository. 6639 * 6640 * @{ 6641 */ 6642 6643 /** 6644 * Output the content of a file. 6645 * 6646 * @param[out] props Optional output argument to obtain properties. 6647 * @param[in] out The stream to which the content will be written. 6648 * @param[in] path_or_url The path or URL of the file. 6649 * @param[in] peg_revision The peg revision. 6650 * @param[in] revision The operative revision. 6651 * @param[in] expand_keywords When true, keywords (when set) are expanded. 6652 * @param[in] ctx The standard client context, used for possible 6653 * authentication. 6654 * 6655 * @return A pointer to an #svn_error_t of the type (this list is not 6656 * exhaustive): <br> 6657 * An unspecified error if @a revision is of kind 6658 * #svn_opt_revision_previous (or some other kind that requires 6659 * a local path), because the desired revision cannot be 6660 * determined. <br> 6661 * If no error occurred, return #SVN_NO_ERROR. 6662 * 6663 * If @a *props is not NULL it is set to a hash of all the file's 6664 * non-inherited properties. If it is NULL, the properties are only 6665 * used for determining how and if the file should be translated. 6666 * 6667 * @see #svn_client_ctx_t <br> @ref clnt_revisions for 6668 * a discussion of operative and peg revisions. 6669 * 6670 * @since New in 1.9. 6671 */ 6672 svn_error_t * 6673 svn_client_cat3(apr_hash_t **props, 6674 svn_stream_t *out, 6675 const char *path_or_url, 6676 const svn_opt_revision_t *peg_revision, 6677 const svn_opt_revision_t *revision, 6678 svn_boolean_t expand_keywords, 6679 svn_client_ctx_t *ctx, 6680 apr_pool_t *result_pool, 6681 apr_pool_t *scratch_pool); 6682 6683 /** 6684 * Similar to svn_client_cat3() except without the option of directly 6685 * reading the properties, and with @a expand_keywords always TRUE. 6686 * 6687 * @since New in 1.2. 6688 * @deprecated Provided for backward compatibility with the 1.8 API. 6689 */ 6690 SVN_DEPRECATED 6691 svn_error_t * 6692 svn_client_cat2(svn_stream_t *out, 6693 const char *path_or_url, 6694 const svn_opt_revision_t *peg_revision, 6695 const svn_opt_revision_t *revision, 6696 svn_client_ctx_t *ctx, 6697 apr_pool_t *pool); 6698 6699 6700 /** 6701 * Similar to svn_client_cat2() except that the peg revision is always 6702 * the same as @a revision. 6703 * 6704 * @deprecated Provided for backward compatibility with the 1.1 API. 6705 */ 6706 SVN_DEPRECATED 6707 svn_error_t * 6708 svn_client_cat(svn_stream_t *out, 6709 const char *path_or_url, 6710 const svn_opt_revision_t *revision, 6711 svn_client_ctx_t *ctx, 6712 apr_pool_t *pool); 6713 6714 /** @} end group: cat */ 6715 6716 6717 6718 /** Shelving commands 6719 * 6720 * @defgroup svn_client_shelve_funcs Client Shelving Functions 6721 * @{ 6722 */ 6723 6724 /** Shelve a change. 6725 * 6726 * Shelve as @a name the local modifications found by @a paths, @a depth, 6727 * @a changelists. Revert the shelved change from the WC unless @a keep_local 6728 * is true. 6729 * 6730 * If @a dry_run is true, don't actually do it. 6731 * 6732 * @since New in 1.10. 6733 * @warning EXPERIMENTAL. 6734 */ 6735 SVN_EXPERIMENTAL 6736 svn_error_t * 6737 svn_client_shelve(const char *name, 6738 const apr_array_header_t *paths, 6739 svn_depth_t depth, 6740 const apr_array_header_t *changelists, 6741 svn_boolean_t keep_local, 6742 svn_boolean_t dry_run, 6743 svn_client_ctx_t *ctx, 6744 apr_pool_t *pool); 6745 6746 /** Unshelve the shelved change @a name. 6747 * 6748 * @a local_abspath is any path in the WC and is used to find the WC root. 6749 * Rename the shelved patch to add a '.bak' extension unless @a keep is true. 6750 * 6751 * If @a dry_run is true, don't actually do it. 6752 * 6753 * @since New in 1.10. 6754 * @warning EXPERIMENTAL. 6755 */ 6756 SVN_EXPERIMENTAL 6757 svn_error_t * 6758 svn_client_unshelve(const char *name, 6759 const char *local_abspath, 6760 svn_boolean_t keep, 6761 svn_boolean_t dry_run, 6762 svn_client_ctx_t *ctx, 6763 apr_pool_t *pool); 6764 6765 /** Delete the shelved patch @a name. 6766 * 6767 * @a local_abspath is any path in the WC and is used to find the WC root. 6768 * 6769 * If @a dry_run is true, don't actually do it. 6770 * 6771 * @since New in 1.10. 6772 * @warning EXPERIMENTAL. 6773 */ 6774 SVN_EXPERIMENTAL 6775 svn_error_t * 6776 svn_client_shelves_delete(const char *name, 6777 const char *local_abspath, 6778 svn_boolean_t dry_run, 6779 svn_client_ctx_t *ctx, 6780 apr_pool_t *pool); 6781 6782 /** Information about a shelved patch. 6783 * 6784 * @since New in 1.10. 6785 * @warning EXPERIMENTAL. 6786 */ 6787 typedef struct svn_client_shelved_patch_info_t 6788 { 6789 const char *message; /* first line of log message */ 6790 const char *patch_path; /* abspath of the patch file */ 6791 svn_io_dirent2_t *dirent; /* info about the patch file */ 6792 apr_time_t mtime; /* a copy of dirent->mtime */ 6793 } svn_client_shelved_patch_info_t; 6794 6795 /** Set @a *shelved_patch_infos to a hash, keyed by patch name, of pointers to 6796 * @c svn_client_shelved_patch_info_t structures. 6797 * 6798 * @a local_abspath is any path in the WC and is used to find the WC root. 6799 * 6800 * @since New in 1.10. 6801 * @warning EXPERIMENTAL. 6802 */ 6803 SVN_EXPERIMENTAL 6804 svn_error_t * 6805 svn_client_shelves_list(apr_hash_t **shelved_patch_infos, 6806 const char *local_abspath, 6807 svn_client_ctx_t *ctx, 6808 apr_pool_t *result_pool, 6809 apr_pool_t *scratch_pool); 6810 6811 /** Set @a *any_shelved to indicate if there are any shelved changes in this WC. 6812 * 6813 * This shall provide the answer fast, regardless of how many changes 6814 * are stored, unlike svn_client_shelves_list(). 6815 * 6816 * ### Initial implementation isn't O(1) fast -- it just calls 6817 * svn_client_shelves_list(). 6818 * 6819 * @a local_abspath is any path in the WC and is used to find the WC root. 6820 * 6821 * @since New in 1.10. 6822 * @warning EXPERIMENTAL. 6823 */ 6824 SVN_EXPERIMENTAL 6825 svn_error_t * 6826 svn_client_shelves_any(svn_boolean_t *any_shelved, 6827 const char *local_abspath, 6828 svn_client_ctx_t *ctx, 6829 apr_pool_t *scratch_pool); 6830 6831 /** Set @a *affected_paths to a hash with one entry for each path affected 6832 * by the shelf @a name. The hash key is the old path and value is 6833 * the new path, both relative to the WC root. The key and value are the 6834 * same except when a path is moved or copied. 6835 * 6836 * @since New in 1.10. 6837 * @warning EXPERIMENTAL. 6838 */ 6839 SVN_EXPERIMENTAL 6840 svn_error_t * 6841 svn_client_shelf_get_paths(apr_hash_t **affected_paths, 6842 const char *name, 6843 const char *local_abspath, 6844 svn_client_ctx_t *ctx, 6845 apr_pool_t *result_pool, 6846 apr_pool_t *scratch_pool); 6847 6848 /** Set @a *has_changes to indicate whether the shelf @a name 6849 * contains any modifications, in other words if svn_client_shelf_get_paths() 6850 * would return a non-empty set of paths. 6851 * 6852 * @since New in 1.10. 6853 * @warning EXPERIMENTAL. 6854 */ 6855 SVN_EXPERIMENTAL 6856 svn_error_t * 6857 svn_client_shelf_has_changes(svn_boolean_t *has_changes, 6858 const char *name, 6859 const char *local_abspath, 6860 svn_client_ctx_t *ctx, 6861 apr_pool_t *scratch_pool); 6862 6863 /** @} */ 6864 6865 /** Changelist commands 6866 * 6867 * @defgroup svn_client_changelist_funcs Client Changelist Functions 6868 * @{ 6869 */ 6870 6871 /** Implementation note: 6872 * 6873 * For now, changelists are implemented by scattering the 6874 * associations across multiple .svn/entries files in a working copy. 6875 * However, this client API was written so that we have the option of 6876 * changing the underlying implementation -- we may someday want to 6877 * store changelist definitions in a centralized database. 6878 */ 6879 6880 /** 6881 * Add each path in @a paths (recursing to @a depth as necessary) to 6882 * @a changelist. If a path is already a member of another 6883 * changelist, then remove it from the other changelist and add it to 6884 * @a changelist. (For now, a path cannot belong to two changelists 6885 * at once.) 6886 * 6887 * @a paths is an array of (const char *) local WC paths. 6888 * 6889 * @a changelists is an array of <tt>const char *</tt> changelist 6890 * names, used as a restrictive filter on items whose changelist 6891 * assignments are adjusted; that is, don't tweak the changeset of any 6892 * item unless it's currently a member of one of those changelists. 6893 * If @a changelists is empty (or altogether @c NULL), no changelist 6894 * filtering occurs. 6895 * 6896 * @note This metadata is purely a client-side "bookkeeping" 6897 * convenience, and is entirely managed by the working copy. 6898 * 6899 * @since New in 1.5. 6900 */ 6901 svn_error_t * 6902 svn_client_add_to_changelist(const apr_array_header_t *paths, 6903 const char *changelist, 6904 svn_depth_t depth, 6905 const apr_array_header_t *changelists, 6906 svn_client_ctx_t *ctx, 6907 apr_pool_t *pool); 6908 6909 /** 6910 * Remove each path in @a paths (recursing to @a depth as necessary) 6911 * from changelists to which they are currently assigned. 6912 * 6913 * @a paths is an array of (const char *) local WC paths. 6914 * 6915 * @a changelists is an array of <tt>const char *</tt> changelist 6916 * names, used as a restrictive filter on items whose changelist 6917 * assignments are removed; that is, don't remove from a changeset any 6918 * item unless it's currently a member of one of those changelists. 6919 * If @a changelists is empty (or altogether @c NULL), all changelist 6920 * assignments in and under each path in @a paths (to @a depth) will 6921 * be removed. 6922 * 6923 * @note This metadata is purely a client-side "bookkeeping" 6924 * convenience, and is entirely managed by the working copy. 6925 * 6926 * @since New in 1.5. 6927 */ 6928 svn_error_t * 6929 svn_client_remove_from_changelists(const apr_array_header_t *paths, 6930 svn_depth_t depth, 6931 const apr_array_header_t *changelists, 6932 svn_client_ctx_t *ctx, 6933 apr_pool_t *pool); 6934 6935 6936 /** 6937 * Beginning at @a path, crawl to @a depth to discover every path in 6938 * or under @a path which belongs to one of the changelists in @a 6939 * changelists (an array of <tt>const char *</tt> changelist names). 6940 * If @a changelists is @c NULL, discover paths with any changelist. 6941 * Call @a callback_func (with @a callback_baton) each time a 6942 * changelist-having path is discovered. 6943 * 6944 * @a path is a local WC path. 6945 * 6946 * If @a ctx->cancel_func is not @c NULL, invoke it passing @a 6947 * ctx->cancel_baton during the recursive walk. 6948 * 6949 * @since New in 1.5. 6950 */ 6951 svn_error_t * 6952 svn_client_get_changelists(const char *path, 6953 const apr_array_header_t *changelists, 6954 svn_depth_t depth, 6955 svn_changelist_receiver_t callback_func, 6956 void *callback_baton, 6957 svn_client_ctx_t *ctx, 6958 apr_pool_t *pool); 6959 6960 /** @} */ 6961 6962 6963 6964 /** Locking commands 6965 * 6966 * @defgroup svn_client_locking_funcs Client Locking Functions 6967 * @{ 6968 */ 6969 6970 /** 6971 * Lock @a targets in the repository. @a targets is an array of 6972 * <tt>const char *</tt> paths - either all working copy paths or all URLs. 6973 * All targets must be in the same repository. 6974 * 6975 * If a target is already locked in the repository, no lock will be 6976 * acquired unless @a steal_lock is TRUE, in which case the locks are 6977 * stolen. @a comment, if non-NULL, is an xml-escapable description 6978 * stored with each lock in the repository. Each acquired lock will 6979 * be stored in the working copy if the targets are WC paths. 6980 * 6981 * For each target @a ctx->notify_func2/notify_baton2 will be used to indicate 6982 * whether it was locked. An action of #svn_wc_notify_locked 6983 * means that the path was locked. If the path was not locked because 6984 * it was out of date or there was already a lock in the repository, 6985 * the notification function will be called with 6986 * #svn_wc_notify_failed_lock, and the error passed in the notification 6987 * structure. 6988 * 6989 * Use @a pool for temporary allocations. 6990 * 6991 * @since New in 1.2. 6992 */ 6993 svn_error_t * 6994 svn_client_lock(const apr_array_header_t *targets, 6995 const char *comment, 6996 svn_boolean_t steal_lock, 6997 svn_client_ctx_t *ctx, 6998 apr_pool_t *pool); 6999 7000 /** 7001 * Unlock @a targets in the repository. @a targets is an array of 7002 * <tt>const char *</tt> paths - either all working copy paths or all URLs. 7003 * All targets must be in the same repository. 7004 * 7005 * If the targets are WC paths, and @a break_lock is FALSE, the working 7006 * copy must contain a lock for each target. 7007 * If this is not the case, or the working copy lock doesn't match the 7008 * lock token in the repository, an error will be signaled. 7009 * 7010 * If the targets are URLs, the locks may be broken even if @a break_lock 7011 * is FALSE, but only if the lock owner is the same as the 7012 * authenticated user. 7013 * 7014 * If @a break_lock is TRUE, the locks will be broken in the 7015 * repository. In both cases, the locks, if any, will be removed from 7016 * the working copy if the targets are WC paths. 7017 * 7018 * The notification functions in @a ctx will be called for each 7019 * target. If the target was successfully unlocked, 7020 * #svn_wc_notify_unlocked will be used. Else, if the error is 7021 * directly related to unlocking the path (see 7022 * #SVN_ERR_IS_UNLOCK_ERROR), #svn_wc_notify_failed_unlock will be 7023 * used and the error will be passed in the notification structure. 7024 7025 * Use @a pool for temporary allocations. 7026 * 7027 * @since New in 1.2. 7028 */ 7029 svn_error_t * 7030 svn_client_unlock(const apr_array_header_t *targets, 7031 svn_boolean_t break_lock, 7032 svn_client_ctx_t *ctx, 7033 apr_pool_t *pool); 7034 7035 /** @} */ 7036 7037 /** 7038 * @defgroup Info Show repository information about a working copy. 7039 * 7040 * @{ 7041 */ 7042 7043 /** The size of the file is unknown. 7044 * Used as value in fields of type @c apr_size_t in #svn_info_t. 7045 * 7046 * @since New in 1.5 7047 * @deprecated Provided for backward compatibility with the 1.6 API. 7048 */ 7049 #define SVN_INFO_SIZE_UNKNOWN ((apr_size_t) -1) 7050 7051 /** 7052 * A structure which describes various system-generated metadata about 7053 * a working-copy path or URL. 7054 * 7055 * @note Fields may be added to the end of this structure in future 7056 * versions. Therefore, users shouldn't allocate structures of this 7057 * type, to preserve binary compatibility. 7058 * 7059 * @since New in 1.2. 7060 * @deprecated Provided for backward compatibility with the 1.6 API. The new 7061 * API is #svn_client_info2_t. 7062 */ 7063 typedef struct svn_info_t 7064 { 7065 /** Where the item lives in the repository. */ 7066 const char *URL; 7067 7068 /** The revision of the object. If path_or_url is a working-copy 7069 * path, then this is its current working revnum. If path_or_url 7070 * is a URL, then this is the repos revision that path_or_url lives in. */ 7071 svn_revnum_t rev; 7072 7073 /** The node's kind. */ 7074 svn_node_kind_t kind; 7075 7076 /** The root URL of the repository. */ 7077 const char *repos_root_URL; 7078 7079 /** The repository's UUID. */ 7080 const char *repos_UUID; 7081 7082 /** The last revision in which this object changed. */ 7083 svn_revnum_t last_changed_rev; 7084 7085 /** The date of the last_changed_rev. */ 7086 apr_time_t last_changed_date; 7087 7088 /** The author of the last_changed_rev. */ 7089 const char *last_changed_author; 7090 7091 /** An exclusive lock, if present. Could be either local or remote. */ 7092 svn_lock_t *lock; 7093 7094 /** Whether or not to ignore the next 10 wc-specific fields. */ 7095 svn_boolean_t has_wc_info; 7096 7097 /** 7098 * @name Working-copy path fields 7099 * These things only apply to a working-copy path. 7100 * See svn_wc_entry_t for explanations. 7101 * @{ 7102 */ 7103 svn_wc_schedule_t schedule; 7104 const char *copyfrom_url; 7105 svn_revnum_t copyfrom_rev; 7106 apr_time_t text_time; 7107 apr_time_t prop_time; /* will always be 0 for svn 1.4 and later */ 7108 const char *checksum; 7109 const char *conflict_old; 7110 const char *conflict_new; 7111 const char *conflict_wrk; 7112 const char *prejfile; 7113 /** @since New in 1.5. */ 7114 const char *changelist; 7115 /** @since New in 1.5. */ 7116 svn_depth_t depth; 7117 7118 /** 7119 * Similar to working_size64, but will be #SVN_INFO_SIZE_UNKNOWN when 7120 * its value would overflow apr_size_t (so when size >= 4 GB - 1 byte). 7121 * 7122 * @deprecated Provided for backward compatibility with the 1.5 API. 7123 */ 7124 apr_size_t working_size; 7125 7126 /** @} */ 7127 7128 /** 7129 * Similar to size64, but size will be #SVN_INFO_SIZE_UNKNOWN when 7130 * its value would overflow apr_size_t (so when size >= 4 GB - 1 byte). 7131 * 7132 * @deprecated Provided for backward compatibility with the 1.5 API. 7133 */ 7134 apr_size_t size; 7135 7136 /** 7137 * The size of the file in the repository (untranslated, 7138 * e.g. without adjustment of line endings and keyword 7139 * expansion). Only applicable for file -- not directory -- URLs. 7140 * For working copy paths, size64 will be #SVN_INVALID_FILESIZE. 7141 * @since New in 1.6. 7142 */ 7143 svn_filesize_t size64; 7144 7145 /** 7146 * The size of the file after being translated into its local 7147 * representation, or #SVN_INVALID_FILESIZE if unknown. 7148 * Not applicable for directories. 7149 * @since New in 1.6. 7150 * @name Working-copy path fields 7151 * @{ 7152 */ 7153 svn_filesize_t working_size64; 7154 7155 /** 7156 * Info on any tree conflict of which this node is a victim. Otherwise NULL. 7157 * @since New in 1.6. 7158 */ 7159 svn_wc_conflict_description_t *tree_conflict; 7160 7161 /** @} */ 7162 7163 } svn_info_t; 7164 7165 7166 /** 7167 * The callback invoked by svn_client_info2(). Each invocation 7168 * describes @a path with the information present in @a info. Note 7169 * that any fields within @a info may be NULL if information is 7170 * unavailable. Use @a pool for all temporary allocation. 7171 * 7172 * @since New in 1.2. 7173 * @deprecated Provided for backward compatibility with the 1.6 API. The new 7174 * API is #svn_client_info_receiver2_t. 7175 */ 7176 typedef svn_error_t *(*svn_info_receiver_t)( 7177 void *baton, 7178 const char *path, 7179 const svn_info_t *info, 7180 apr_pool_t *pool); 7181 7182 /** 7183 * Return a duplicate of @a info, allocated in @a pool. No part of the new 7184 * structure will be shared with @a info. 7185 * 7186 * @since New in 1.3. 7187 * @deprecated Provided for backward compatibility with the 1.6 API. The new 7188 * API is #svn_client_info2_dup(). 7189 */ 7190 SVN_DEPRECATED 7191 svn_info_t * 7192 svn_info_dup(const svn_info_t *info, 7193 apr_pool_t *pool); 7194 7195 /** 7196 * A structure which describes various system-generated metadata about 7197 * a working-copy path or URL. 7198 * 7199 * @note Fields may be added to the end of this structure in future 7200 * versions. Therefore, users shouldn't allocate structures of this 7201 * type, to preserve binary compatibility. 7202 * 7203 * @since New in 1.7. 7204 */ 7205 typedef struct svn_client_info2_t 7206 { 7207 /** Where the item lives in the repository. */ 7208 const char *URL; 7209 7210 /** The revision of the object. If the target is a working-copy 7211 * path, then this is its current working revnum. If the target 7212 * is a URL, then this is the repos revision that it lives in. */ 7213 svn_revnum_t rev; 7214 7215 /** The root URL of the repository. */ 7216 const char *repos_root_URL; 7217 7218 /** The repository's UUID. */ 7219 const char *repos_UUID; 7220 7221 /** The node's kind. */ 7222 svn_node_kind_t kind; 7223 7224 /** The size of the file in the repository (untranslated, 7225 * e.g. without adjustment of line endings and keyword 7226 * expansion). Only applicable for file -- not directory -- URLs. 7227 * For working copy paths, @a size will be #SVN_INVALID_FILESIZE. */ 7228 svn_filesize_t size; 7229 7230 /** The last revision in which this object changed. */ 7231 svn_revnum_t last_changed_rev; 7232 7233 /** The date of the last_changed_rev. */ 7234 apr_time_t last_changed_date; 7235 7236 /** The author of the last_changed_rev. */ 7237 const char *last_changed_author; 7238 7239 /** An exclusive lock, if present. Could be either local or remote. */ 7240 const svn_lock_t *lock; 7241 7242 /** Possible information about the working copy, NULL if not valid. */ 7243 const svn_wc_info_t *wc_info; 7244 7245 } svn_client_info2_t; 7246 7247 /** 7248 * Return a duplicate of @a info, allocated in @a pool. No part of the new 7249 * structure will be shared with @a info. 7250 * 7251 * @since New in 1.7. 7252 */ 7253 svn_client_info2_t * 7254 svn_client_info2_dup(const svn_client_info2_t *info, 7255 apr_pool_t *pool); 7256 7257 /** 7258 * The callback invoked by info retrievers. Each invocation 7259 * describes @a abspath_or_url with the information present in @a info. 7260 * Use @a scratch_pool for all temporary allocation. 7261 * 7262 * @since New in 1.7. 7263 */ 7264 typedef svn_error_t *(*svn_client_info_receiver2_t)( 7265 void *baton, 7266 const char *abspath_or_url, 7267 const svn_client_info2_t *info, 7268 apr_pool_t *scratch_pool); 7269 7270 /** 7271 * Invoke @a receiver with @a receiver_baton to return information 7272 * about @a abspath_or_url in @a revision. The information returned is 7273 * system-generated metadata, not the sort of "property" metadata 7274 * created by users. See #svn_client_info2_t. 7275 * 7276 * If both revision arguments are either #svn_opt_revision_unspecified 7277 * or @c NULL, then information will be pulled solely from the working copy; 7278 * no network connections will be made. 7279 * 7280 * Otherwise, information will be pulled from a repository. The 7281 * actual node revision selected is determined by the @a abspath_or_url 7282 * as it exists in @a peg_revision. If @a peg_revision->kind is 7283 * #svn_opt_revision_unspecified, then it defaults to 7284 * #svn_opt_revision_head for URLs or #svn_opt_revision_working for 7285 * WC targets. 7286 * 7287 * If @a abspath_or_url is not a local path, then if @a revision is of 7288 * kind #svn_opt_revision_previous (or some other kind that requires 7289 * a local path), an error will be returned, because the desired 7290 * revision cannot be determined. 7291 * 7292 * Use the authentication baton cached in @a ctx to authenticate 7293 * against the repository. 7294 * 7295 * If @a abspath_or_url is a file, just invoke @a receiver on it. If it 7296 * is a directory, then descend according to @a depth. If @a depth is 7297 * #svn_depth_empty, invoke @a receiver on @a abspath_or_url and 7298 * nothing else; if #svn_depth_files, on @a abspath_or_url and its 7299 * immediate file children; if #svn_depth_immediates, the preceding 7300 * plus on each immediate subdirectory; if #svn_depth_infinity, then 7301 * recurse fully, invoking @a receiver on @a abspath_or_url and 7302 * everything beneath it. 7303 * 7304 * If @a fetch_excluded is TRUE, also also send excluded nodes in the working 7305 * copy to @a receiver, otherwise these are skipped. If @a fetch_actual_only 7306 * is TRUE also send nodes that don't exist as versioned but are still 7307 * tree conflicted. 7308 * 7309 * If @a include_externals is @c TRUE, recurse into externals and report about 7310 * them as well. 7311 * 7312 * @a changelists is an array of <tt>const char *</tt> changelist 7313 * names, used as a restrictive filter on items whose info is 7314 * reported; that is, don't report info about any item unless 7315 * it's a member of one of those changelists. If @a changelists is 7316 * empty (or altogether @c NULL), no changelist filtering occurs. 7317 * 7318 * @since New in 1.9. 7319 */ 7320 svn_error_t * 7321 svn_client_info4(const char *abspath_or_url, 7322 const svn_opt_revision_t *peg_revision, 7323 const svn_opt_revision_t *revision, 7324 svn_depth_t depth, 7325 svn_boolean_t fetch_excluded, 7326 svn_boolean_t fetch_actual_only, 7327 svn_boolean_t include_externals, 7328 const apr_array_header_t *changelists, 7329 svn_client_info_receiver2_t receiver, 7330 void *receiver_baton, 7331 svn_client_ctx_t *ctx, 7332 apr_pool_t *scratch_pool); 7333 7334 7335 /** Similar to svn_client_info4, but doesn't support walking externals. 7336 * 7337 * @since New in 1.7. 7338 * @deprecated Provided for backward compatibility with the 1.8 API. 7339 */ 7340 SVN_DEPRECATED 7341 svn_error_t * 7342 svn_client_info3(const char *abspath_or_url, 7343 const svn_opt_revision_t *peg_revision, 7344 const svn_opt_revision_t *revision, 7345 svn_depth_t depth, 7346 svn_boolean_t fetch_excluded, 7347 svn_boolean_t fetch_actual_only, 7348 const apr_array_header_t *changelists, 7349 svn_client_info_receiver2_t receiver, 7350 void *receiver_baton, 7351 svn_client_ctx_t *ctx, 7352 apr_pool_t *scratch_pool); 7353 7354 /** Similar to svn_client_info3, but uses an svn_info_receiver_t instead of 7355 * a #svn_client_info_receiver2_t, and @a path_or_url may be a relative path. 7356 * 7357 * @since New in 1.5. 7358 * @deprecated Provided for backward compatibility with the 1.6 API. 7359 */ 7360 SVN_DEPRECATED 7361 svn_error_t * 7362 svn_client_info2(const char *path_or_url, 7363 const svn_opt_revision_t *peg_revision, 7364 const svn_opt_revision_t *revision, 7365 svn_info_receiver_t receiver, 7366 void *receiver_baton, 7367 svn_depth_t depth, 7368 const apr_array_header_t *changelists, 7369 svn_client_ctx_t *ctx, 7370 apr_pool_t *pool); 7371 7372 /** 7373 * Similar to svn_client_info2() but with @a changelists passed as @c 7374 * NULL, and @a depth set according to @a recurse: if @a recurse is 7375 * TRUE, @a depth is #svn_depth_infinity, else #svn_depth_empty. 7376 * 7377 * @deprecated Provided for backward compatibility with the 1.4 API. 7378 */ 7379 SVN_DEPRECATED 7380 svn_error_t * 7381 svn_client_info(const char *path_or_url, 7382 const svn_opt_revision_t *peg_revision, 7383 const svn_opt_revision_t *revision, 7384 svn_info_receiver_t receiver, 7385 void *receiver_baton, 7386 svn_boolean_t recurse, 7387 svn_client_ctx_t *ctx, 7388 apr_pool_t *pool); 7389 7390 /** 7391 * Set @a *wcroot_abspath to the local abspath of the root of the 7392 * working copy in which @a local_abspath resides. 7393 * 7394 * @since New in 1.7. 7395 */ 7396 svn_error_t * 7397 svn_client_get_wc_root(const char **wcroot_abspath, 7398 const char *local_abspath, 7399 svn_client_ctx_t *ctx, 7400 apr_pool_t *result_pool, 7401 apr_pool_t *scratch_pool); 7402 7403 /** 7404 * Set @a *min_revision and @a *max_revision to the lowest and highest 7405 * revision numbers found within @a local_abspath. If @a committed is 7406 * TRUE, set @a *min_revision and @a *max_revision to the lowest and 7407 * highest comitted (i.e. "last changed") revision numbers, 7408 * respectively. NULL may be passed for either of @a min_revision and 7409 * @a max_revision to indicate the caller's lack of interest in the 7410 * value. Use @a scratch_pool for temporary allocations. 7411 * 7412 * @since New in 1.7. 7413 */ 7414 svn_error_t * 7415 svn_client_min_max_revisions(svn_revnum_t *min_revision, 7416 svn_revnum_t *max_revision, 7417 const char *local_abspath, 7418 svn_boolean_t committed, 7419 svn_client_ctx_t *ctx, 7420 apr_pool_t *scratch_pool); 7421 7422 /** @} */ 7423 7424 7425 /** 7426 * @defgroup Patch Apply a patch to the working copy 7427 * 7428 * @{ 7429 */ 7430 7431 /** 7432 * The callback invoked by svn_client_patch() before attempting to patch 7433 * the target file at @a canon_path_from_patchfile (the path as parsed from 7434 * the patch file, but in canonicalized form). The callback can set 7435 * @a *filtered to @c TRUE to prevent the file from being patched, or else 7436 * must set it to @c FALSE. 7437 * 7438 * The callback is also provided with @a patch_abspath, the path of a 7439 * temporary file containing the patched result, and with @a reject_abspath, 7440 * the path to a temporary file containing the diff text of any hunks 7441 * which were rejected during patching. 7442 * 7443 * Because the callback is invoked before the patching attempt is made, 7444 * there is no guarantee that the target file will actually be patched 7445 * successfully. Client implementations must pay attention to notification 7446 * feedback provided by svn_client_patch() to find out which paths were 7447 * patched successfully. 7448 * 7449 * Note also that the files at @a patch_abspath and @a reject_abspath are 7450 * guaranteed to remain on disk after patching only if the 7451 * @a remove_tempfiles parameter for svn_client_patch() is @c FALSE. 7452 * 7453 * The const char * parameters may be allocated in @a scratch_pool which 7454 * will be cleared after each invocation. 7455 * 7456 * @since New in 1.7. 7457 */ 7458 typedef svn_error_t *(*svn_client_patch_func_t)( 7459 void *baton, 7460 svn_boolean_t *filtered, 7461 const char *canon_path_from_patchfile, 7462 const char *patch_abspath, 7463 const char *reject_abspath, 7464 apr_pool_t *scratch_pool); 7465 7466 /** 7467 * Apply a unidiff patch that's located at absolute path 7468 * @a patch_abspath to the working copy directory at @a wc_dir_abspath. 7469 * 7470 * This function makes a best-effort attempt at applying the patch. 7471 * It might skip patch targets which cannot be patched (e.g. targets 7472 * that are outside of the working copy). It will also reject hunks 7473 * which cannot be applied to a target in case the hunk's context 7474 * does not match anywhere in the patch target. 7475 * 7476 * If @a dry_run is TRUE, the patching process is carried out, and full 7477 * notification feedback is provided, but the working copy is not modified. 7478 * 7479 * @a strip_count specifies how many leading path components should be 7480 * stripped from paths obtained from the patch. It is an error if a 7481 * negative strip count is passed. 7482 * 7483 * If @a reverse is @c TRUE, apply patches in reverse, deleting lines 7484 * the patch would add and adding lines the patch would delete. 7485 * 7486 * If @a ignore_whitespace is TRUE, allow patches to be applied if they 7487 * only differ from the target by whitespace. 7488 * 7489 * If @a remove_tempfiles is TRUE, lifetimes of temporary files created 7490 * during patching will be managed internally. Otherwise, the caller should 7491 * take ownership of these files, the names of which can be obtained by 7492 * passing a @a patch_func callback. 7493 * 7494 * If @a patch_func is non-NULL, invoke @a patch_func with @a patch_baton 7495 * for each patch target processed. 7496 * 7497 * If @a ctx->notify_func2 is non-NULL, invoke @a ctx->notify_func2 with 7498 * @a ctx->notify_baton2 as patching progresses. 7499 * 7500 * If @a ctx->cancel_func is non-NULL, invoke it passing @a 7501 * ctx->cancel_baton at various places during the operation. 7502 * 7503 * Use @a scratch_pool for temporary allocations. 7504 * 7505 * @since New in 1.7. 7506 */ 7507 svn_error_t * 7508 svn_client_patch(const char *patch_abspath, 7509 const char *wc_dir_abspath, 7510 svn_boolean_t dry_run, 7511 int strip_count, 7512 svn_boolean_t reverse, 7513 svn_boolean_t ignore_whitespace, 7514 svn_boolean_t remove_tempfiles, 7515 svn_client_patch_func_t patch_func, 7516 void *patch_baton, 7517 svn_client_ctx_t *ctx, 7518 apr_pool_t *scratch_pool); 7519 7520 /** @} */ 7521 7522 /** @} end group: Client working copy management */ 7523 7524 /** 7525 * 7526 * @defgroup clnt_sessions Client session related functions 7527 * 7528 * @{ 7529 * 7530 */ 7531 7532 7533 /* Converting paths to URLs. */ 7534 7535 /** Set @a *url to the URL for @a path_or_url allocated in result_pool. 7536 * 7537 * If @a path_or_url is already a URL, set @a *url to @a path_or_url. 7538 * 7539 * If @a path_or_url is a versioned item, set @a *url to @a 7540 * path_or_url's entry URL. If @a path_or_url is unversioned (has 7541 * no entry), set @a *url to NULL. 7542 * 7543 * Use @a ctx->wc_ctx to retrieve the information. Use 7544 ** @a scratch_pool for temporary allocations. 7545 * 7546 * @since New in 1.7. 7547 */ 7548 svn_error_t * 7549 svn_client_url_from_path2(const char **url, 7550 const char *path_or_url, 7551 svn_client_ctx_t *ctx, 7552 apr_pool_t *result_pool, 7553 apr_pool_t *scratch_pool); 7554 7555 /** Similar to svn_client_url_from_path2(), but without a context argument. 7556 * 7557 * @since New in 1.5. 7558 * @deprecated Provided for backward compatibility with the 1.6 API. 7559 */ 7560 SVN_DEPRECATED 7561 svn_error_t * 7562 svn_client_url_from_path(const char **url, 7563 const char *path_or_url, 7564 apr_pool_t *pool); 7565 7566 7567 7568 /* Fetching a repository's root URL and UUID. */ 7569 7570 /** Set @a *repos_root_url and @a *repos_uuid, to the root URL and UUID of 7571 * the repository in which @a abspath_or_url is versioned. Use the 7572 * authentication baton and working copy context cached in @a ctx as 7573 * necessary. @a repos_root_url and/or @a repos_uuid may be NULL if not 7574 * wanted. 7575 * 7576 * This function will open a temporary RA session to the repository if 7577 * necessary to get the information. 7578 * 7579 * Allocate @a *repos_root_url and @a *repos_uuid in @a result_pool. 7580 * Use @a scratch_pool for temporary allocations. 7581 * 7582 * @since New in 1.8. 7583 */ 7584 svn_error_t * 7585 svn_client_get_repos_root(const char **repos_root_url, 7586 const char **repos_uuid, 7587 const char *abspath_or_url, 7588 svn_client_ctx_t *ctx, 7589 apr_pool_t *result_pool, 7590 apr_pool_t *scratch_pool); 7591 7592 /** Set @a *url to the repository root URL of the repository in which 7593 * @a path_or_url is versioned (or scheduled to be versioned), 7594 * allocated in @a pool. @a ctx is required for possible repository 7595 * authentication. 7596 * 7597 * @since New in 1.5. 7598 * @deprecated Provided for backward compatibility with the 1.7 API. Use 7599 * svn_client_get_repos_root() instead, with an absolute path. 7600 */ 7601 SVN_DEPRECATED 7602 svn_error_t * 7603 svn_client_root_url_from_path(const char **url, 7604 const char *path_or_url, 7605 svn_client_ctx_t *ctx, 7606 apr_pool_t *pool); 7607 7608 /** Get repository @a uuid for @a url. 7609 * 7610 * Use a @a pool to open a temporary RA session to @a url, discover the 7611 * repository uuid, and free the session. Return the uuid in @a uuid, 7612 * allocated in @a pool. @a ctx is required for possible repository 7613 * authentication. 7614 * 7615 * @deprecated Provided for backward compatibility with the 1.7 API. Use 7616 * svn_client_get_repos_root() instead. 7617 */ 7618 SVN_DEPRECATED 7619 svn_error_t * 7620 svn_client_uuid_from_url(const char **uuid, 7621 const char *url, 7622 svn_client_ctx_t *ctx, 7623 apr_pool_t *pool); 7624 7625 7626 /** Return the repository @a uuid for working-copy @a local_abspath, 7627 * allocated in @a result_pool. Use @a ctx->wc_ctx to retrieve the 7628 * information. 7629 * 7630 * Use @a scratch_pool for temporary allocations. 7631 * 7632 * @since New in 1.7. 7633 * @deprecated Provided for backward compatibility with the 1.7 API. Use 7634 * svn_client_get_repos_root() instead. 7635 */ 7636 SVN_DEPRECATED 7637 svn_error_t * 7638 svn_client_uuid_from_path2(const char **uuid, 7639 const char *local_abspath, 7640 svn_client_ctx_t *ctx, 7641 apr_pool_t *result_pool, 7642 apr_pool_t *scratch_pool); 7643 7644 /** Similar to svn_client_uuid_from_path2(), but with a relative path and 7645 * an access baton. 7646 * 7647 * @deprecated Provided for backward compatibility with the 1.6 API. 7648 */ 7649 SVN_DEPRECATED 7650 svn_error_t * 7651 svn_client_uuid_from_path(const char **uuid, 7652 const char *path, 7653 svn_wc_adm_access_t *adm_access, 7654 svn_client_ctx_t *ctx, 7655 apr_pool_t *pool); 7656 7657 7658 /* Opening RA sessions. */ 7659 7660 /** Open an RA session rooted at @a url, and return it in @a *session. 7661 * 7662 * Use the authentication baton stored in @a ctx for authentication. 7663 * @a *session is allocated in @a result_pool. 7664 * 7665 * If @a wri_abspath is not NULL, use the working copy identified by @a 7666 * wri_abspath to potentially avoid transferring unneeded data. 7667 * 7668 * @note This function is similar to svn_ra_open4(), but the caller avoids 7669 * having to providing its own callback functions. 7670 * @since New in 1.8. 7671 */ 7672 svn_error_t * 7673 svn_client_open_ra_session2(svn_ra_session_t **session, 7674 const char *url, 7675 const char *wri_abspath, 7676 svn_client_ctx_t *ctx, 7677 apr_pool_t *result_pool, 7678 apr_pool_t *scratch_pool); 7679 7680 /** Similar to svn_client_open_ra_session2(), but with @ wri_abspath 7681 * always passed as NULL, and with the same pool used as both @a 7682 * result_pool and @a scratch_pool. 7683 * 7684 * @since New in 1.3. 7685 * @deprecated Provided for backward compatibility with the 1.7 API. 7686 */ 7687 SVN_DEPRECATED 7688 svn_error_t * 7689 svn_client_open_ra_session(svn_ra_session_t **session, 7690 const char *url, 7691 svn_client_ctx_t *ctx, 7692 apr_pool_t *pool); 7693 7694 7695 /** @} end group: Client session related functions */ 7696 7697 /** @} */ 7698 7699 #ifdef __cplusplus 7700 } 7701 #endif /* __cplusplus */ 7702 7703 #endif /* SVN_CLIENT_H */ 7704