00001 /**
00002 * @copyright
00003 * ====================================================================
00004 * Copyright (c) 2000-2004 CollabNet. All rights reserved.
00005 *
00006 * This software is licensed as described in the file COPYING, which
00007 * you should have received as part of this distribution. The terms
00008 * are also available at http://subversion.tigris.org/license-1.html.
00009 * If newer versions of this license are posted there, you may use a
00010 * newer version instead, at your option.
00011 *
00012 * This software consists of voluntary contributions made by many
00013 * individuals. For exact contribution history, see the revision
00014 * history and logs, available at http://subversion.tigris.org/.
00015 * ====================================================================
00016 * @endcopyright
00017 *
00018 * @file svn_wc.h
00019 * @brief The Subversion Working Copy Library
00020 *
00021 * Requires:
00022 * - A working copy
00023 *
00024 * Provides:
00025 * - Ability to manipulate working copy's versioned data.
00026 * - Ability to manipulate working copy's administrative files.
00027 *
00028 * Used By:
00029 * - Clients.
00030 */
00031
00032 #ifndef SVN_WC_H
00033 #define SVN_WC_H
00034
00035
00036 #include <apr.h>
00037 #include <apr_pools.h>
00038 #include <apr_tables.h>
00039 #include <apr_hash.h>
00040
00041 #include "svn_types.h"
00042 #include "svn_string.h"
00043 #include "svn_delta.h"
00044 #include "svn_error.h"
00045 #include "svn_opt.h"
00046 #include "svn_ra.h" /* for svn_ra_reporter_t type */
00047
00048 #ifdef __cplusplus
00049 extern "C" {
00050 #endif /* __cplusplus */
00051
00052
00053 /**
00054 * Get libsvn_wc version information.
00055 *
00056 * @since New in 1.1.
00057 */
00058 const svn_version_t *svn_wc_version (void);
00059
00060
00061 /* Locking/Opening/Closing */
00062
00063 /** Baton for access to a working copy administrative area.
00064 *
00065 * One day all such access will require a baton, we're not there yet.
00066 *
00067 * Access batons can be grouped into sets, by passing an existing open
00068 * baton when opening a new baton. Given one baton in a set, other batons
00069 * may be retrieved. This allows an entire hierarchy to be locked, and
00070 * then the set of batons can be passed around by passing a single baton.
00071 */
00072 typedef struct svn_wc_adm_access_t svn_wc_adm_access_t;
00073
00074
00075 /**
00076 * Return, in @a *adm_access, a pointer to a new access baton for the working
00077 * copy administrative area associated with the directory @a path. If
00078 * @a write_lock is true the baton will include a write lock, otherwise the
00079 * baton can only be used for read access. If @a path refers to a directory
00080 * that is already write locked then the error @c SVN_ERR_WC_LOCKED will be
00081 * returned. The error @c SVN_ERR_WC_NOT_DIRECTORY will be returned if
00082 * @a path is not a versioned directory.
00083 *
00084 * If @a associated is an open access baton then @a adm_access will be added
00085 * to the set containing @a associated. @a associated can be @c NULL, in
00086 * which case @a adm_access is the start of a new set.
00087 *
00088 * @a depth specifies how much to lock. Zero means just the specified
00089 * directory. Any negative value means to lock the entire working copy
00090 * directory hierarchy under @a path. A positive value indicates the number of
00091 * levels of directories to lock -- 1 means just immediate subdirectories, 2
00092 * means immediate subdirectories and their subdirectories, etc. All the
00093 * access batons will become part of the set containing @a adm_access. This
00094 * is an all-or-nothing option, if it is not possible to lock all the
00095 * requested directories then an error will be returned and @a adm_access will
00096 * be invalid, with the exception that subdirectories of @a path that are
00097 * missing from the physical filesystem will not be locked and will not cause
00098 * an error. The error @c SVN_ERR_WC_LOCKED will be returned if a
00099 * subdirectory of @a path is already write locked.
00100 *
00101 * If @a cancel_func is non-null, call it with @a cancel_baton to determine
00102 * if the client has cancelled the operation.
00103 *
00104 * @a pool will be used to allocate memory for the baton and any subsequently
00105 * cached items. If @a adm_access has not been closed when the pool is
00106 * cleared, it will be closed automatically at that point, and removed from
00107 * its set. A baton closed in this way will not remove physical locks from
00108 * the working copy if cleanup is required.
00109 *
00110 * The first baton in a set, with @a associated passed as @c NULL, must have
00111 * the longest lifetime of all the batons in the set. This implies it must be
00112 * the root of the hierarchy.
00113 *
00114 * @since New in 1.2.
00115 */
00116 svn_error_t *svn_wc_adm_open3 (svn_wc_adm_access_t **adm_access,
00117 svn_wc_adm_access_t *associated,
00118 const char *path,
00119 svn_boolean_t write_lock,
00120 int depth,
00121 svn_cancel_func_t cancel_func,
00122 void *cancel_baton,
00123 apr_pool_t *pool);
00124
00125 /**
00126 * Similar to svn_wc_adm_open3(), but without cancellation support.
00127 *
00128 * @deprecated Provided for backward compatibility with the 1.1 API.
00129 */
00130 svn_error_t *svn_wc_adm_open2 (svn_wc_adm_access_t **adm_access,
00131 svn_wc_adm_access_t *associated,
00132 const char *path,
00133 svn_boolean_t write_lock,
00134 int depth,
00135 apr_pool_t *pool);
00136
00137 /**
00138 * Similar to svn_wc_adm_open2(), but with @a tree_lock instead of
00139 * @a depth. @a depth is set to -1 if @a tree_lock is @c TRUE, else 0.
00140 *
00141 * @deprecated Provided for backward compatibility with the 1.0 API.
00142 */
00143 svn_error_t *svn_wc_adm_open (svn_wc_adm_access_t **adm_access,
00144 svn_wc_adm_access_t *associated,
00145 const char *path,
00146 svn_boolean_t write_lock,
00147 svn_boolean_t tree_lock,
00148 apr_pool_t *pool);
00149
00150 /**
00151 * Checks the working copy to determine the node type of @a path. If
00152 * @a path is a versioned directory then the behaviour is like that of
00153 * svn_wc_adm_open3(), otherwise, if @a path is a file or does not
00154 * exist, then the behaviour is like that of svn_wc_adm_open3() with
00155 * @a path replaced by the parent directory of @a path. If @a path is
00156 * an unversioned directory, the behaviour is also like that of
00157 * svn_wc_adm_open3() on the parent, except that if the open fails,
00158 * then the returned SVN_ERR_WC_NOT_DIRECTORY error refers to @a path,
00159 * not to @a path's parent.
00160 *
00161 * @since New in 1.2.
00162 */
00163 svn_error_t *svn_wc_adm_probe_open3 (svn_wc_adm_access_t **adm_access,
00164 svn_wc_adm_access_t *associated,
00165 const char *path,
00166 svn_boolean_t write_lock,
00167 int depth,
00168 svn_cancel_func_t cancel_func,
00169 void *cancel_baton,
00170 apr_pool_t *pool);
00171
00172 /**
00173 * Similar to svn_wc_adm_probe_open3() without the cancel
00174 * functionality.
00175 *
00176 * @deprecated Provided for backward compatibility with the 1.1 API.
00177 */
00178 svn_error_t *svn_wc_adm_probe_open2 (svn_wc_adm_access_t **adm_access,
00179 svn_wc_adm_access_t *associated,
00180 const char *path,
00181 svn_boolean_t write_lock,
00182 int depth,
00183 apr_pool_t *pool);
00184
00185 /**
00186 * Similar to svn_wc_adm_probe_open2(), but with @a tree_lock instead of
00187 * @a depth. @a depth is set to -1 if @a tree_lock is @c TRUE, else 0.
00188 *
00189 * @deprecated Provided for backward compatibility with the 1.0 API.
00190 */
00191 svn_error_t *svn_wc_adm_probe_open (svn_wc_adm_access_t **adm_access,
00192 svn_wc_adm_access_t *associated,
00193 const char *path,
00194 svn_boolean_t write_lock,
00195 svn_boolean_t tree_lock,
00196 apr_pool_t *pool);
00197
00198 /**
00199 * Open access batons for @a path and return in @a *anchor_access and
00200 * @a *target the anchor and target required to drive an editor. Return
00201 * in @a *target_access the access baton for the target, which may be the
00202 * same as @a *anchor_access. All the access batons will be in the
00203 * @a *anchor_access set.
00204 *
00205 * @a depth determines the depth used when opening @a path if @a path is a
00206 * versioned directory, @a depth is ignored otherwise. If @a write_lock is
00207 * @c TRUE the access batons will hold write locks.
00208 *
00209 * If @a cancel_func is non-null, call it with @a cancel_baton to determine
00210 * if the client has cancelled the operation.
00211 *
00212 * This function is essentially a combination of svn_wc_adm_open3() and
00213 * svn_wc_get_actual_target(), with the emphasis on reducing physical IO.
00214 *
00215 * @since New in 1.2.
00216 */
00217 svn_error_t *
00218 svn_wc_adm_open_anchor (svn_wc_adm_access_t **anchor_access,
00219 svn_wc_adm_access_t **target_access,
00220 const char **target,
00221 const char *path,
00222 svn_boolean_t write_lock,
00223 int depth,
00224 svn_cancel_func_t cancel_func,
00225 void *cancel_baton,
00226 apr_pool_t *pool);
00227
00228 /** Return, in @a *adm_access, a pointer to an existing access baton associated
00229 * with @a path. @a path must be a directory that is locked as part of the
00230 * set containing the @a associated access baton.
00231 *
00232 * If the requested access baton is marked as missing in, or is simply
00233 * absent from, @a associated, return SVN_ERR_WC_NOT_LOCKED.
00234 *
00235 * @a pool is used only for local processing, it is not used for the batons.
00236 */
00237 svn_error_t *svn_wc_adm_retrieve (svn_wc_adm_access_t **adm_access,
00238 svn_wc_adm_access_t *associated,
00239 const char *path,
00240 apr_pool_t *pool);
00241
00242 /** Checks the working copy to determine the node type of @a path. If
00243 * @a path is a versioned directory then the behaviour is like that of
00244 * svn_wc_adm_retrieve(), otherwise, if @a path is a file, an unversioned
00245 * directory, or does not exist, then the behaviour is like that of
00246 * svn_wc_adm_retrieve() with @a path replaced by the parent directory of
00247 * @a path.
00248 */
00249 svn_error_t *svn_wc_adm_probe_retrieve (svn_wc_adm_access_t **adm_access,
00250 svn_wc_adm_access_t *associated,
00251 const char *path,
00252 apr_pool_t *pool);
00253
00254 /**
00255 * Try various ways to obtain an access baton for @a path.
00256 *
00257 * First, try to obtain @a *adm_access via svn_wc_adm_probe_retrieve(),
00258 * but if this fails because @a associated can't give a baton for
00259 * @a path or @a path's parent, then try svn_wc_adm_probe_open3(),
00260 * this time passing @a write_lock and @a depth. If there is
00261 * still no access because @a path is not a versioned directory, then
00262 * just set @a *adm_access to null and return success. But if it is
00263 * because @a path is locked, then return the error @c SVN_ERR_WC_LOCKED,
00264 * and the effect on @a *adm_access is undefined. (Or if the attempt
00265 * fails for any other reason, return the corresponding error, and the
00266 * effect on @a *adm_access is also undefined.)
00267 *
00268 * If svn_wc_adm_probe_open3() succeeds, then add @a *adm_access to
00269 * @a associated.
00270 *
00271 * If @a cancel_func is non-null, call it with @a cancel_baton to determine
00272 * if the client has cancelled the operation.
00273 *
00274 * Use @a pool only for local processing, not to allocate @a *adm_access.
00275 *
00276 * @since New in 1.2.
00277 */
00278 svn_error_t *svn_wc_adm_probe_try3 (svn_wc_adm_access_t **adm_access,
00279 svn_wc_adm_access_t *associated,
00280 const char *path,
00281 svn_boolean_t write_lock,
00282 int depth,
00283 svn_cancel_func_t cancel_func,
00284 void *cancel_baton,
00285 apr_pool_t *pool);
00286
00287 /**
00288 * Similar to svn_wc_adm_probe_try3() without the cancel
00289 * functionality.
00290 *
00291 * @deprecated Provided for backward compatibility with the 1.1 API.
00292 */
00293 svn_error_t *svn_wc_adm_probe_try2 (svn_wc_adm_access_t **adm_access,
00294 svn_wc_adm_access_t *associated,
00295 const char *path,
00296 svn_boolean_t write_lock,
00297 int depth,
00298 apr_pool_t *pool);
00299
00300 /**
00301 * Similar to svn_wc_adm_probe_try2(), but with @a tree_lock instead of
00302 * @a depth. @a depth is set to -1 if @a tree_lock is @c TRUE, else 0.
00303 *
00304 * @deprecated Provided for backward compatibility with the 1.0 API.
00305 */
00306 svn_error_t *svn_wc_adm_probe_try (svn_wc_adm_access_t **adm_access,
00307 svn_wc_adm_access_t *associated,
00308 const char *path,
00309 svn_boolean_t write_lock,
00310 svn_boolean_t tree_lock,
00311 apr_pool_t *pool);
00312
00313
00314 /** Give up the access baton @a adm_access, and its lock if any. This will
00315 * recursively close any batons in the same set that are direct
00316 * subdirectories of @a adm_access. Any physical locks will be removed from
00317 * the working copy. Lock removal is unconditional, there is no check to
00318 * determine if cleanup is required.
00319 */
00320 svn_error_t *svn_wc_adm_close (svn_wc_adm_access_t *adm_access);
00321
00322 /** Return the path used to open the access baton @a adm_access */
00323 const char *svn_wc_adm_access_path (svn_wc_adm_access_t *adm_access);
00324
00325 /** Return the pool used by access baton @a adm_access */
00326 apr_pool_t *svn_wc_adm_access_pool (svn_wc_adm_access_t *adm_access);
00327
00328 /** Return @c TRUE is the access baton @a adm_access has a write lock,
00329 * @c FALSE otherwise. Compared to svn_wc_locked() this is a cheap, fast
00330 * function that doesn't access the filesystem.
00331 */
00332 svn_boolean_t svn_wc_adm_locked(svn_wc_adm_access_t *adm_access);
00333
00334 /** Set @a *locked to non-zero if @a path is locked, else set it to zero. */
00335 svn_error_t *svn_wc_locked (svn_boolean_t *locked,
00336 const char *path,
00337 apr_pool_t *pool);
00338
00339
00340 /**
00341 * Return @c TRUE if @a name is the name of the WC administrative
00342 * directory. Use @a pool for any temporary allocations.
00343 *
00344 * For compatibility, the default name (.svn) will always be treated
00345 * as an admin dir name, even if the working copy is actually using an
00346 * alternative name.
00347 *
00348 * @since New in 1.3.
00349 */
00350 svn_boolean_t svn_wc_is_adm_dir (const char *name, apr_pool_t *pool);
00351
00352
00353 /**
00354 * Return the name of the administrative directory.
00355 * Use @a pool for any temporary allocations.
00356 *
00357 * The returned pointer will refer to either a statically allocated
00358 * string, or to a string allocated in @a pool.
00359 *
00360 * @since New in 1.3.
00361 */
00362 const char *svn_wc_get_adm_dir (apr_pool_t *pool);
00363
00364
00365 /**
00366 * Use @a name for the administrative directory in the working copy.
00367 * Use @a pool for any temporary allocations.
00368 *
00369 * The list of valid names is limited. Currently only ".svn" (the
00370 * default) and "_svn" are allowed.
00371 *
00372 * @note This function changes global (per-process) state and must be
00373 * called in a single-threaded context during the initialization of a
00374 * Subversion client.
00375 *
00376 * @since New in 1.3.
00377 */
00378 svn_error_t *svn_wc_set_adm_dir (const char *name, apr_pool_t *pool);
00379
00380
00381
00382 /** Traversal information is information gathered by a working copy
00383 * crawl or update. For example, the before and after values of the
00384 * svn:externals property are important after an update, and since
00385 * we're traversing the working tree anyway (a complete traversal
00386 * during the initial crawl, and a traversal of changed paths during
00387 * the checkout/update/switch), it makes sense to gather the
00388 * property's values then instead of making a second pass.
00389 */
00390 typedef struct svn_wc_traversal_info_t svn_wc_traversal_info_t;
00391
00392
00393 /** Return a new, empty traversal info object, allocated in @a pool. */
00394 svn_wc_traversal_info_t *svn_wc_init_traversal_info (apr_pool_t *pool);
00395
00396
00397 /** Set @a *externals_old and @a *externals_new to hash tables representing
00398 * changes to values of the svn:externals property on directories
00399 * traversed by @a traversal_info.
00400 *
00401 * @a traversal_info is obtained from svn_wc_init_traversal_info(), but is
00402 * only useful after it has been passed through another function, such
00403 * as svn_wc_crawl_revisions(), svn_wc_get_update_editor(),
00404 * svn_wc_get_switch_editor(), etc.
00405 *
00406 * Each hash maps <tt>const char *</tt> directory names onto
00407 * <tt>const char *</tt> values of the externals property for that directory.
00408 * The dir names are full paths -- that is, anchor plus target, not target
00409 * alone. The values are not parsed, they are simply copied raw, and are
00410 * never null: directories that acquired or lost the property are
00411 * simply omitted from the appropriate table. Directories whose value
00412 * of the property did not change show the same value in each hash.
00413 *
00414 * The hashes, keys, and values have the same lifetime as @a traversal_info.
00415 */
00416 void svn_wc_edited_externals (apr_hash_t **externals_old,
00417 apr_hash_t **externals_new,
00418 svn_wc_traversal_info_t *traversal_info);
00419
00420
00421 /** One external item. This usually represents one line from an
00422 * svn:externals description but with the path and URL
00423 * canonicalized.
00424 */
00425 typedef struct svn_wc_external_item_t
00426 {
00427 /** The name of the subdirectory into which this external should be
00428 checked out. This is relative to the parent directory that
00429 holds this external item. (Note that these structs are often
00430 stored in hash tables with the target dirs as keys, so this
00431 field will often be redundant.) */
00432 const char *target_dir;
00433
00434 /** Where to check out from. */
00435 const char *url;
00436
00437 /** What revision to check out. The only valid kinds for this are
00438 svn_opt_revision_number, svn_opt_revision_date, and
00439 svn_opt_revision_head. */
00440 svn_opt_revision_t revision;
00441
00442 } svn_wc_external_item_t;
00443
00444
00445 /**
00446 * Return a duplicate of @a item, allocated in @a pool. No part of the new
00447 * item will be shared with @a item.
00448 *
00449 * @since New in 1.3.
00450 */
00451 svn_wc_external_item_t *
00452 svn_wc_external_item_dup (const svn_wc_external_item_t *item,
00453 apr_pool_t *pool);
00454
00455
00456 /**
00457 * If @a externals_p is non-null, set @a *externals_p to an array of
00458 * @c svn_wc_external_item_t * objects based on @a desc.
00459 *
00460 * If the format of @a desc is invalid, don't touch @a *externals_p and
00461 * return @c SVN_ERR_CLIENT_INVALID_EXTERNALS_DESCRIPTION. Thus, if
00462 * you just want to check the validity of an externals description,
00463 * and don't care about the parsed result, pass null for @a externals_p.
00464 *
00465 * The format of @a desc is the same as for values of the directory
00466 * property @c SVN_PROP_EXTERNALS, which see.
00467 *
00468 * Allocate the table, keys, and values in @a pool.
00469 *
00470 * Use @a parent_directory only in constructing error strings.
00471 *
00472 * @since New in 1.1.
00473 */
00474 svn_error_t *
00475 svn_wc_parse_externals_description2 (apr_array_header_t **externals_p,
00476 const char *parent_directory,
00477 const char *desc,
00478 apr_pool_t *pool);
00479
00480
00481 /**
00482 * Similar to svn_wc_parse_externals_description2(), but returns the
00483 * parsed externals in a hash instead of an array. This function
00484 * should not be used, as storing the externals in a hash causes their
00485 * order of evaluation to be not easily identifiable.
00486 *
00487 * @deprecated Provided for backward compatibility with the 1.0 API.
00488 */
00489 svn_error_t *
00490 svn_wc_parse_externals_description (apr_hash_t **externals_p,
00491 const char *parent_directory,
00492 const char *desc,
00493 apr_pool_t *pool);
00494
00495
00496
00497 /* Notification/callback handling. */
00498
00499 /**
00500 * @defgroup svn_wc_notifications notification callback handling
00501 * @{
00502 *
00503 * In many cases, the WC library will scan a working copy and make
00504 * changes. The caller usually wants to know when each of these changes
00505 * has been made, so that it can display some kind of notification to
00506 * the user.
00507 *
00508 * These notifications have a standard callback function type, which
00509 * takes the path of the file that was affected, and a caller-
00510 * supplied baton.
00511 *
00512 * Note that the callback is a 'void' return -- this is a simple
00513 * reporting mechanism, rather than an opportunity for the caller to
00514 * alter the operation of the WC library.
00515 *
00516 * Note also that some of the actions are used across several
00517 * different Subversion commands. For example, the update actions are
00518 * also used for checkouts, switches, and merges.
00519 */
00520
00521 /** The type of action occurring. */
00522 typedef enum svn_wc_notify_action_t
00523 {
00524 /** Adding a path to revision control. */
00525 svn_wc_notify_add = 0,
00526
00527 /** Copying a versioned path. */
00528 svn_wc_notify_copy,
00529
00530 /** Deleting a versioned path. */
00531 svn_wc_notify_delete,
00532
00533 /** Restoring a missing path from the pristine text-base. */
00534 svn_wc_notify_restore,
00535
00536 /** Reverting a modified path. */
00537 svn_wc_notify_revert,
00538
00539 /** A revert operation has failed. */
00540 svn_wc_notify_failed_revert,
00541
00542 /** Resolving a conflict. */
00543 svn_wc_notify_resolved,
00544
00545 /** Skipping a path. */
00546 svn_wc_notify_skip,
00547
00548 /** Got a delete in an update. */
00549 svn_wc_notify_update_delete,
00550
00551 /** Got an add in an update. */
00552 svn_wc_notify_update_add,
00553
00554 /** Got any other action in an update. */
00555 svn_wc_notify_update_update,
00556
00557 /** The last notification in an update (including updates of externals). */
00558 svn_wc_notify_update_completed,
00559
00560 /** Updating an external module. */
00561 svn_wc_notify_update_external,
00562
00563 /** The last notification in a status (including status on externals). */
00564 svn_wc_notify_status_completed,
00565
00566 /** Running status on an external module. */
00567 svn_wc_notify_status_external,
00568
00569 /** Committing a modification. */
00570 svn_wc_notify_commit_modified,
00571
00572 /** Committing an addition. */
00573 svn_wc_notify_commit_added,
00574
00575 /** Committing a deletion. */
00576 svn_wc_notify_commit_deleted,
00577
00578 /** Committing a replacement. */
00579 svn_wc_notify_commit_replaced,
00580
00581 /** Transmitting post-fix text-delta data for a file. */
00582 svn_wc_notify_commit_postfix_txdelta,
00583
00584 /** Processed a single revision's blame. */
00585 svn_wc_notify_blame_revision,
00586
00587 /** Locking a path. @since New in 1.2. */
00588 svn_wc_notify_locked,
00589
00590 /** Unlocking a path. @since New in 1.2. */
00591 svn_wc_notify_unlocked,
00592
00593 /** Failed to lock a path. @since New in 1.2. */
00594 svn_wc_notify_failed_lock,
00595
00596 /** Failed to unlock a path. @since New in 1.2. */
00597 svn_wc_notify_failed_unlock
00598 } svn_wc_notify_action_t;
00599
00600
00601 /** The type of notification that is occurring. */
00602 typedef enum svn_wc_notify_state_t
00603 {
00604 svn_wc_notify_state_inapplicable = 0,
00605
00606 /** Notifier doesn't know or isn't saying. */
00607 svn_wc_notify_state_unknown,
00608
00609 /** The state did not change. */
00610 svn_wc_notify_state_unchanged,
00611
00612 /** The item wasn't present. */
00613 svn_wc_notify_state_missing,
00614
00615 /** An unversioned item obstructed work. */
00616 svn_wc_notify_state_obstructed,
00617
00618 /** Pristine state was modified. */
00619 svn_wc_notify_state_changed,
00620
00621 /** Modified state had mods merged in. */
00622 svn_wc_notify_state_merged,
00623
00624 /** Modified state got conflicting mods. */
00625 svn_wc_notify_state_conflicted
00626
00627 } svn_wc_notify_state_t;
00628
00629 /**
00630 * What happened to a lock during an operation.
00631 *
00632 * @since New in 1.2.
00633 */
00634 typedef enum svn_wc_notify_lock_state_t {
00635 svn_wc_notify_lock_state_inapplicable = 0,
00636 svn_wc_notify_lock_state_unknown,
00637 /** The lock wasn't changed. */
00638 svn_wc_notify_lock_state_unchanged,
00639 /** The item was locked. */
00640 svn_wc_notify_lock_state_locked,
00641 /** The item was unlocked. */
00642 svn_wc_notify_lock_state_unlocked
00643 } svn_wc_notify_lock_state_t;
00644
00645 /**
00646 * Structure used in the @c svn_wc_notify_func2_t function.
00647 *
00648 * @c path is either absolute or relative to the current working directory
00649 * (i.e., not relative to an anchor). @c action describes what happened
00650 * to @c path.
00651 *
00652 * @c kind, @c content_state, @c prop_state and @c lock_state are from
00653 * after @c action, not before. @c lock_state reflects the addition
00654 * or removal of a lock token in the working copy.
00655 *
00656 * If @c mime_type is non-null, it indicates the mime-type of @c path.
00657 * It is always @c NULL for directories.
00658 *
00659 * If @c action is @c svn_wc_notify_update_completed, @c revision is the
00660 * target revision of the update, or @c SVN_INVALID_REVNUM if not
00661 * available. If @c action is @c svn_wc_notify_blame_revision, @c
00662 * revision is the processed revision. In all other cases, @c
00663 * revision is @c SVN_INVALID_REVNUM.
00664 *
00665 * For an @c action of svn_wc_notify_locked, @c lock is the lock
00666 * structure received from the repository. For other actions, it is
00667 * @c NULL.
00668 *
00669 * @c err is @c NULL, except when @c action is @c
00670 * svn_wc_notify_failed_lock or @c svn_wc_notify_failed_unlock, in
00671 * which case it points to an error describing the reason for the failure.
00672 *
00673 * Note that if @c action is @c svn_wc_notify_update, then @c path has
00674 * already been installed, so it is legitimate for an implementation of
00675 * @c svn_wc_notify_func2_t to examine @c path in the working copy.
00676 *
00677 * @note The purpose of the @c kind, @c mime_type, @c content_state, and
00678 * @c prop_state fields is to provide "for free" information that an
00679 * implementation is likely to want, and which it would otherwise be
00680 * forced to deduce via expensive operations such as reading entries
00681 * and properties. However, if the caller does not have this
00682 * information, it will simply pass the corresponding `*_unknown'
00683 * values, and it is up to the implementation how to handle that
00684 * (i.e., whether to attempt deduction, or just to punt and
00685 * give a less informative notification).
00686 *
00687 * @note Callers of notification functions should use svn_wc_create_notify()
00688 * to create structures of this type to allow for extensibility.
00689 *
00690 * @since New in 1.2.
00691 */
00692 typedef struct svn_wc_notify_t {
00693 const char *path;
00694 svn_wc_notify_action_t action;
00695 svn_node_kind_t kind;
00696 const char *mime_type;
00697 const svn_lock_t *lock;
00698 svn_error_t *err;
00699 svn_wc_notify_state_t content_state;
00700 svn_wc_notify_state_t prop_state;
00701 svn_wc_notify_lock_state_t lock_state;
00702 svn_revnum_t revision;
00703 /* NOTE: Add new fields at the end to preserve binary compatibility.
00704 Also, if you add fields here, you have to update svn_wc_create_notify
00705 and svn_wc_dup_notify. */
00706 } svn_wc_notify_t;
00707
00708 /**
00709 * Allocate an @c svn_wc_notify_t structure in @a pool, initialize and return
00710 * it.
00711 *
00712 * Set the @c path field of the created struct to @a path, and @c action to
00713 * @a action. Set all other fields to their @c _unknown, @c NULL or
00714 * invalid value, respectively.
00715 *
00716 * @since New in 1.2.
00717 */
00718 svn_wc_notify_t *
00719 svn_wc_create_notify (const char *path, svn_wc_notify_action_t action,
00720 apr_pool_t *pool);
00721
00722 /**
00723 * Return a deep copy of @a notify, allocated in @a pool.
00724 *
00725 * @since New in 1.2.
00726 */
00727 svn_wc_notify_t *
00728 svn_wc_dup_notify (const svn_wc_notify_t *notify, apr_pool_t *pool);
00729
00730 /**
00731 * Notify the world that @a notify->action has happened to @a notify->path.
00732 *
00733 * Recommendation: callers of @c svn_wc_notify_func2_t should avoid
00734 * invoking it multiple times on the same path within a given
00735 * operation, and implementations should not bother checking for such
00736 * duplicate calls. For example, in an update, the caller should not
00737 * invoke the notify func on receiving a prop change and then again
00738 * on receiving a text change. Instead, wait until all changes have
00739 * been received, and then invoke the notify func once (from within
00740 * an @c svn_delta_editor_t's close_file(), for example), passing
00741 * the appropriate @a notify->content_state and @a notify->prop_state flags.
00742 *
00743 * @since New in 1.2.
00744 */
00745 typedef void (*svn_wc_notify_func2_t) (void *baton,
00746 const svn_wc_notify_t *notify,
00747 apr_pool_t *pool);
00748
00749 /**
00750 * Similar to @c svn_wc_notify_func2_t, but takes the information as arguments
00751 * instead of struct fields.
00752 *
00753 * @deprecated Provided for backward compatibility with the 1.1 API.
00754 */
00755 typedef void (*svn_wc_notify_func_t) (void *baton,
00756 const char *path,
00757 svn_wc_notify_action_t action,
00758 svn_node_kind_t kind,
00759 const char *mime_type,
00760 svn_wc_notify_state_t content_state,
00761 svn_wc_notify_state_t prop_state,
00762 svn_revnum_t revision);
00763
00764 /** @} */
00765
00766
00767
00768 /**
00769 * A callback vtable invoked by our diff-editors, as they receive
00770 * diffs from the server. 'svn diff' and 'svn merge' both implement
00771 * their own versions of this table.
00772 *
00773 * @since New in 1.2.
00774 */
00775 typedef struct svn_wc_diff_callbacks2_t
00776 {
00777 /** A file @a path has changed. If @a tmpfile2 is non-null, the
00778 * contents have changed and those changes can be seen by comparing
00779 * @a tmpfile1 and @a tmpfile2, which represent @a rev1 and @a rev2 of
00780 * the file, respectively.
00781 *
00782 * If known, the @c svn:mime-type value of each file is passed into
00783 * @a mimetype1 and @a mimetype2; either or both of the values can
00784 * be NULL. The implementor can use this information to decide if
00785 * (or how) to generate differences.
00786 *
00787 * @a propchanges is an array of (@c svn_prop_t) structures. If it has
00788 * any elements, the original list of properties is provided in
00789 * @a originalprops, which is a hash of @c svn_string_t values, keyed on the
00790 * property name.
00791 *
00792 * @a adm_access will be an access baton for the directory containing
00793 * @a path, or @c NULL if the diff editor is not using access batons.
00794 *
00795 * If @a contentstate is non-null, set @a *contentstate to the state of
00796 * the file contents after the operation has been performed. The same
00797 * applies for @a propstate regarding the property changes. (In
00798 * practice, this is only useful with merge, not diff; diff callbacks
00799 * will probably set @a *contentstate and @a *propstate to
00800 * @c svn_wc_notify_state_unknown, since they do not change the state and
00801 * therefore do not bother to know the state after the operation.)
00802 */
00803 svn_error_t *(*file_changed) (svn_wc_adm_access_t *adm_access,
00804 svn_wc_notify_state_t *contentstate,
00805 svn_wc_notify_state_t *propstate,
00806 const char *path,
00807 const char *tmpfile1,
00808 const char *tmpfile2,
00809 svn_revnum_t rev1,
00810 svn_revnum_t rev2,
00811 const char *mimetype1,
00812 const char *mimetype2,
00813 const apr_array_header_t *propchanges,
00814 apr_hash_t *originalprops,
00815 void *diff_baton);
00816
00817 /** A file @a path was added. The contents can be seen by comparing
00818 * @a tmpfile1 and @a tmpfile2, which represent @a rev1 and @a rev2
00819 * of the file, respectively. (If either file is empty, the rev
00820 * will be 0.)
00821 *
00822 * If known, the @c svn:mime-type value of each file is passed into
00823 * @a mimetype1 and @a mimetype2; either or both of the values can
00824 * be NULL. The implementor can use this information to decide if
00825 * (or how) to generate differences.
00826 *
00827 * @a propchanges is an array of (@c svn_prop_t) structures. If it contains
00828 * any elements, the original list of properties is provided in
00829 * @a originalprops, which is a hash of @c svn_string_t values, keyed on the
00830 * property name.
00831 *
00832 * @a adm_access will be an access baton for the directory containing
00833 * @a path, or @c NULL if the diff editor is not using access batons.
00834 *
00835 * If @a contentstate is non-null, set @a *contentstate to the state of the
00836 * file contents after the operation has been performed. The same
00837 * applies for @a propstate regarding the property changes. (In practice,
00838 * this is only useful with merge, not diff; diff callbacks will
00839 * probably set @a *contentstate and *propstate to
00840 * @c svn_wc_notify_state_unknown, since they do not change the state
00841 * and therefore do not bother to know the state after the operation.)
00842 *
00843 */
00844 svn_error_t *(*file_added) (svn_wc_adm_access_t *adm_access,
00845 svn_wc_notify_state_t *contentstate,
00846 svn_wc_notify_state_t *propstate,
00847 const char *path,
00848 const char *tmpfile1,
00849 const char *tmpfile2,
00850 svn_revnum_t rev1,
00851 svn_revnum_t rev2,
00852 const char *mimetype1,
00853 const char *mimetype2,
00854 const apr_array_header_t *propchanges,
00855 apr_hash_t *originalprops,
00856 void *diff_baton);
00857
00858 /** A file @a path was deleted. The [loss of] contents can be seen by
00859 * comparing @a tmpfile1 and @a tmpfile2. @a originalprops provides
00860 * the properties of the file.
00861 *
00862 * If known, the @c svn:mime-type value of each file is passed into
00863 * @a mimetype1 and @a mimetype2; either or both of the values can
00864 * be NULL. The implementor can use this information to decide if
00865 * (or how) to generate differences.
00866 *
00867 * @a adm_access will be an access baton for the directory containing
00868 * @a path, or @c NULL if the diff editor is not using access batons.
00869 *
00870 * If @a state is non-null, set @a *state to the state of the item
00871 * after the delete operation has been performed. (In practice,
00872 * this is only useful with merge, not diff; diff callbacks will
00873 * probably set @a *state to @c svn_wc_notify_state_unknown, since
00874 * they do not change the state and therefore do not bother to know
00875 * the state after the operation.)
00876 */
00877 svn_error_t *(*file_deleted) (svn_wc_adm_access_t *adm_access,
00878 svn_wc_notify_state_t *state,
00879 const char *path,
00880 const char *tmpfile1,
00881 const char *tmpfile2,
00882 const char *mimetype1,
00883 const char *mimetype2,
00884 apr_hash_t *originalprops,
00885 void *diff_baton);
00886
00887 /** A directory @a path was added. @a rev is the revision that the
00888 * directory came from.
00889 *
00890 * @a adm_access will be an access baton for the directory containing
00891 * @a path, or @c NULL if the diff editor is not using access batons.
00892 */
00893 svn_error_t *(*dir_added) (svn_wc_adm_access_t *adm_access,
00894 svn_wc_notify_state_t *state,
00895 const char *path,
00896 svn_revnum_t rev,
00897 void *diff_baton);
00898
00899 /** A directory @a path was deleted.
00900 *
00901 * @a adm_access will be an access baton for the directory containing
00902 * @a path, or @c NULL if the diff editor is not using access batons.
00903 *
00904 * If @a state is non-null, set @a *state to the state of the item
00905 * after the delete operation has been performed. (In practice,
00906 * this is only useful with merge, not diff; diff callbacks will
00907 * probably set @a *state to @c svn_wc_notify_state_unknown, since
00908 * they do not change the state and therefore do not bother to know
00909 * the state after the operation.)
00910 */
00911 svn_error_t *(*dir_deleted) (svn_wc_adm_access_t *adm_access,
00912 svn_wc_notify_state_t *state,
00913 const char *path,
00914 void *diff_baton);
00915
00916 /** A list of property changes (@a propchanges) was applied to the
00917 * directory @a path.
00918 *
00919 * The array is a list of (@c svn_prop_t) structures.
00920 *
00921 * The original list of properties is provided in @a original_props,
00922 * which is a hash of @c svn_string_t values, keyed on the property
00923 * name.
00924 *
00925 * @a adm_access will be an access baton for the directory containing
00926 * @a path, or @c NULL if the diff editor is not using access batons.
00927 *
00928 * If @a state is non-null, set @a *state to the state of the properties
00929 * after the operation has been performed. (In practice, this is only
00930 * useful with merge, not diff; diff callbacks will probably set @a *state
00931 * to @c svn_wc_notify_state_unknown, since they do not change the state
00932 * and therefore do not bother to know the state after the operation.)
00933 */
00934 svn_error_t *(*dir_props_changed) (svn_wc_adm_access_t *adm_access,
00935 svn_wc_notify_state_t *state,
00936 const char *path,
00937 const apr_array_header_t *propchanges,
00938 apr_hash_t *original_props,
00939 void *diff_baton);
00940
00941 } svn_wc_diff_callbacks2_t;
00942
00943 /**
00944 * Similar to @c svn_wc_diff_callbacks2_t, but with file additions/content
00945 * changes and property changes split into different functions.
00946 *
00947 * @deprecated Provided for backward compatibility with the 1.1 API.
00948 */
00949 typedef struct svn_wc_diff_callbacks_t
00950 {
00951 /** Similar to @c file_changed in @c svn_wc_diff_callbacks2_t, but without
00952 * property change information. @a tmpfile2 is never NULL. @a state applies
00953 * to the file contents. */
00954 svn_error_t *(*file_changed) (svn_wc_adm_access_t *adm_access,
00955 svn_wc_notify_state_t *state,
00956 const char *path,
00957 const char *tmpfile1,
00958 const char *tmpfile2,
00959 svn_revnum_t rev1,
00960 svn_revnum_t rev2,
00961 const char *mimetype1,
00962 const char *mimetype2,
00963 void *diff_baton);
00964
00965 /** Similar to @c file_added in @c svn_wc_diff_callbacks2_t, but without
00966 * property change information. @a *state applies to the file contents. */
00967 svn_error_t *(*file_added) (svn_wc_adm_access_t *adm_access,
00968 svn_wc_notify_state_t *state,
00969 const char *path,
00970 const char *tmpfile1,
00971 const char *tmpfile2,
00972 svn_revnum_t rev1,
00973 svn_revnum_t rev2,
00974 const char *mimetype1,
00975 const char *mimetype2,
00976 void *diff_baton);
00977
00978 /** Similar to @c file_deleted in @c svn_wc_diff_callbacks2_t, but without
00979 * the properties. */
00980 svn_error_t *(*file_deleted) (svn_wc_adm_access_t *adm_access,
00981 svn_wc_notify_state_t *state,
00982 const char *path,
00983 const char *tmpfile1,
00984 const char *tmpfile2,
00985 const char *mimetype1,
00986 const char *mimetype2,
00987 void *diff_baton);
00988
00989 /** The same as @c dir_added in @c svn_wc_diff_callbacks2_t. */
00990 svn_error_t *(*dir_added) (svn_wc_adm_access_t *adm_access,
00991 svn_wc_notify_state_t *state,
00992 const char *path,
00993 svn_revnum_t rev,
00994 void *diff_baton);
00995
00996 /** The same as @c dir_deleted in @c svn_wc_diff_callbacks2_t. */
00997 svn_error_t *(*dir_deleted) (svn_wc_adm_access_t *adm_access,
00998 svn_wc_notify_state_t *state,
00999 const char *path,
01000 void *diff_baton);
01001
01002 /** Similar to @c dir_props_changed in @c svn_wc_diff_callbacks2_t, but this
01003 * function is called for files as well as directories. */
01004 svn_error_t *(*props_changed) (svn_wc_adm_access_t *adm_access,
01005 svn_wc_notify_state_t *state,
01006 const char *path,
01007 const apr_array_header_t *propchanges,
01008 apr_hash_t *original_props,
01009 void *diff_baton);
01010
01011 } svn_wc_diff_callbacks_t;
01012
01013
01014 /* Asking questions about a working copy. */
01015
01016 /** Set @a *wc_format to @a path's working copy format version number if
01017 * @a path is a valid working copy directory, else set it to 0.
01018 * Return error @c APR_ENOENT if @a path does not exist at all.
01019 */
01020 svn_error_t *svn_wc_check_wc (const char *path,
01021 int *wc_format,
01022 apr_pool_t *pool);
01023
01024
01025 /** Set @a *has_binary_prop to @c TRUE iff @a path has been marked
01026 * with a property indicating that it is non-text (in other words, binary).
01027 * @a adm_access is an access baton set that contains @a path.
01028 */
01029 svn_error_t *svn_wc_has_binary_prop (svn_boolean_t *has_binary_prop,
01030 const char *path,
01031 svn_wc_adm_access_t *adm_access,
01032 apr_pool_t *pool);
01033
01034
01035 /* Detecting modification. */
01036
01037 /** Set @a *modified_p to non-zero if @a filename's text is modified
01038 * with regard to the base revision, else set @a *modified_p to zero.
01039 * @a filename is a path to the file, not just a basename. @a adm_access
01040 * must be an access baton for @a filename.
01041 *
01042 * If @a force_comparison is @c TRUE, this function will not allow
01043 * early return mechanisms that avoid actual content comparison.
01044 * Instead, if there is a text base, a full byte-by-byte comparison
01045 * will be done, and the entry checksum verified as well. (This means
01046 * that if the text base is much longer than the working file, every
01047 * byte of the text base will still be examined.)
01048 *
01049 * If @a filename does not exist, consider it unmodified. If it exists
01050 * but is not under revision control (not even scheduled for
01051 * addition), return the error @c SVN_ERR_ENTRY_NOT_FOUND. */
01052 svn_error_t *svn_wc_text_modified_p (svn_boolean_t *modified_p,
01053 const char *filename,
01054 svn_boolean_t force_comparison,
01055 svn_wc_adm_access_t *adm_access,
01056 apr_pool_t *pool);
01057
01058
01059 /** Set @a *modified_p to non-zero if @a path's properties are modified
01060 * with regard to the base revision, else set @a modified_p to zero.
01061 * @a adm_access must be an access baton for @a path.
01062 */
01063 svn_error_t *svn_wc_props_modified_p (svn_boolean_t *modified_p,
01064 const char *path,
01065 svn_wc_adm_access_t *adm_access,
01066 apr_pool_t *pool);
01067
01068
01069
01070
01071 /** Administrative subdir.
01072 *
01073 * Ideally, this would be completely private to wc internals (in fact,
01074 * it used to be that adm_subdir() in adm_files.c was the only function
01075 * who knew the adm subdir's name). However, import wants to protect
01076 * against importing administrative subdirs, so now the name is a
01077 * matter of public record.
01078 *
01079 * @deprecated Provided for backward compatibility with the 1.2 API.
01080 */
01081 #define SVN_WC_ADM_DIR_NAME ".svn"
01082
01083
01084
01085 /* Entries and status. */
01086
01087 /** The schedule states an entry can be in. */
01088 typedef enum svn_wc_schedule_t
01089 {
01090 /** Nothing special here */
01091 svn_wc_schedule_normal,
01092
01093 /** Slated for addition */
01094 svn_wc_schedule_add,
01095
01096 /** Slated for deletion */
01097 svn_wc_schedule_delete,
01098
01099 /** Slated for replacement (delete + add) */
01100 svn_wc_schedule_replace
01101
01102 } svn_wc_schedule_t;
01103
01104
01105 /** A working copy entry -- that is, revision control information about
01106 * one versioned entity.
01107 */
01108 typedef struct svn_wc_entry_t
01109 {
01110 /* IMPORTANT: If you extend this structure, check svn_wc_entry_dup() to see
01111 if you need to extend that as well. */
01112
01113 /* General Attributes */
01114
01115 /** entry's name */
01116 const char *name;
01117
01118 /** base revision */
01119 svn_revnum_t revision;
01120
01121 /** url in repository */
01122 const char *url;
01123
01124 /** canonical repository URL or NULL if not known */
01125 const char *repos;
01126
01127 /** repository uuid */
01128 const char *uuid;
01129
01130 /** node kind (file, dir, ...) */
01131 svn_node_kind_t kind;
01132
01133 /* State information */
01134
01135 /** scheduling (add, delete, replace ...) */
01136 svn_wc_schedule_t schedule;
01137
01138 /** in a copied state */
01139 svn_boolean_t copied;
01140
01141 /** deleted, but parent rev lags behind */
01142 svn_boolean_t deleted;
01143
01144 /** absent -- we know an entry of this name exists, but that's all
01145 (usually this happens because of authz restrictions) */
01146 svn_boolean_t absent;
01147
01148 /** for THIS_DIR entry, implies whole entries file is incomplete */
01149 svn_boolean_t incomplete;
01150
01151 /** copyfrom location */
01152 const char *copyfrom_url;
01153
01154 /** copyfrom revision */
01155 svn_revnum_t copyfrom_rev;
01156
01157 /** old version of conflicted file */
01158 const char *conflict_old;
01159
01160 /** new version of conflicted file */
01161 const char *conflict_new;
01162
01163 /** working version of conflicted file */
01164 const char *conflict_wrk;
01165
01166 /** property reject file */
01167 const char *prejfile;
01168
01169 /** last up-to-date time for text contents (0 means no information available)
01170 */
01171 apr_time_t text_time;
01172
01173 /** last up-to-date time for properties (0 means no information available) */
01174 apr_time_t prop_time;
01175
01176 /** base64-encoded checksum for the untranslated text base file,
01177 * can be @c NULL for backwards compatibility.
01178 */
01179 const char *checksum;
01180
01181 /* "Entry props" */
01182
01183 /** last revision this was changed */
01184 svn_revnum_t cmt_rev;
01185
01186 /** last date this was changed */
01187 apr_time_t cmt_date;
01188
01189 /** last commit author of this item */
01190 const char *cmt_author;
01191
01192 /** lock token or NULL if path not locked in this WC
01193 * @since New in 1.2.
01194 */
01195 const char *lock_token;
01196 /** lock owner, or NULL if not locked in this WC
01197 * @since New in 1.2.
01198 */
01199 const char *lock_owner;
01200 /** lock comment or NULL if not locked in this WC or no comment
01201 * @since New in 1.2.
01202 */
01203 const char *lock_comment;
01204 /** Lock creation date or 0 if not locked in this WC
01205 * @since New in 1.2.
01206 */
01207 apr_time_t lock_creation_date;
01208
01209 /* IMPORTANT: If you extend this structure, check svn_wc_entry_dup() to see
01210 if you need to extend that as well. */
01211 } svn_wc_entry_t;
01212
01213
01214 /** How an entries file's owner dir is named in the entries file. */
01215 #define SVN_WC_ENTRY_THIS_DIR ""
01216
01217
01218 /** Set @a *entry to an entry for @a path, allocated in the access baton
01219 * pool. If @a show_hidden is true, return the entry even if it's in
01220 * 'deleted' or 'absent' state. If @a path is not under revision
01221 * control, or if entry is hidden, not scheduled for re-addition,
01222 * and @a show_hidden is @c FALSE, then set @a *entry to @c NULL.
01223 *
01224 * @a *entry should not be modified, since doing so modifies the entries
01225 * cache in @a adm_access without changing the entries file on disk.
01226 *
01227 * If @a path is not a directory then @a adm_access must be an access baton
01228 * for the parent directory of @a path. To avoid needing to know whether
01229 * @a path is a directory or not, if @a path is a directory @a adm_access
01230 * can still be an access baton for the parent of @a path so long as the
01231 * access baton for @a path itself is in the same access baton set.
01232 *
01233 * Note that it is possible for @a path to be absent from disk but still
01234 * under revision control; and conversely, it is possible for @a path to
01235 * be present, but not under revision control.
01236 *
01237 * Use @a pool only for local processing.
01238 */
01239 svn_error_t *svn_wc_entry (const svn_wc_entry_t **entry,
01240 const char *path,
01241 svn_wc_adm_access_t *adm_access,
01242 svn_boolean_t show_hidden,
01243 apr_pool_t *pool);
01244
01245
01246 /** Parse the `entries' file for @a adm_access and return a hash @a entries,
01247 * whose keys are (<tt>const char *</tt>) entry names and values are
01248 * (<tt>svn_wc_entry_t *</tt>). The hash @a entries, and its keys and
01249 * values, are allocated from the pool used to open the @a adm_access
01250 * baton (that's how the entries caching works). @a pool is used for
01251 * transient allocations.
01252 *
01253 * Entries that are in a 'deleted' or 'absent' state (and not
01254 * scheduled for re-addition) are not returned in the hash, unless
01255 * @a show_hidden is true.
01256 *
01257 * @par Important:
01258 * The @a entries hash is the entries cache in @a adm_access
01259 * and so usually the hash itself, the keys and the values should be treated
01260 * as read-only. If any of these are modified then it is the caller's
01261 * responsibility to ensure that the entries file on disk is updated. Treat
01262 * the hash values as type (<tt>const svn_wc_entry_t *</tt>) if you wish to
01263 * avoid accidental modification. Modifying the schedule member is a
01264 * particularly bad idea, as the entries writing process relies on having
01265 * access to the original schedule. Use a duplicate entry to modify the
01266 * schedule.
01267 *
01268 * @par Important:
01269 * Only the entry structures representing files and
01270 * @c SVN_WC_ENTRY_THIS_DIR contain complete information. The entry
01271 * structures representing subdirs have only the `kind' and `state'
01272 * fields filled in. If you want info on a subdir, you must use this
01273 * routine to open its @a path and read the @c SVN_WC_ENTRY_THIS_DIR
01274 * structure, or call svn_wc_entry() on its @a path.
01275 */
01276 svn_error_t *svn_wc_entries_read (apr_hash_t **entries,
01277 svn_wc_adm_access_t *adm_access,
01278 svn_boolean_t show_hidden,
01279 apr_pool_t *pool);
01280
01281
01282 /** Return a duplicate of @a entry, allocated in @a pool. No part of the new
01283 * entry will be shared with @a entry.
01284 */
01285 svn_wc_entry_t *svn_wc_entry_dup (const svn_wc_entry_t *entry,
01286 apr_pool_t *pool);
01287
01288
01289 /** Given a @a dir_path under version control, decide if one of its
01290 * entries (@a entry) is in state of conflict; return the answers in
01291 * @a text_conflicted_p and @a prop_conflicted_p.
01292 *
01293 * (If the entry mentions that a .rej or .prej exist, but they are
01294 * both removed, assume the conflict has been resolved by the user.)
01295 */
01296 svn_error_t *svn_wc_conflicted_p (svn_boolean_t *text_conflicted_p,
01297 svn_boolean_t *prop_conflicted_p,
01298 const char *dir_path,
01299 const svn_wc_entry_t *entry,
01300 apr_pool_t *pool);
01301
01302 /** Set @a *url and @a *rev to the ancestor URL and revision for @a path,
01303 * allocating in @a pool. @a adm_access must be an access baton for @a path.
01304 *
01305 * If @a url or @a rev is null, then ignore it (just don't return the
01306 * corresponding information).
01307 */
01308 svn_error_t *svn_wc_get_ancestry (char **url,
01309 svn_revnum_t *rev,
01310 const char *path,
01311 svn_wc_adm_access_t *adm_access,
01312 apr_pool_t *pool);
01313
01314
01315 /** A callback vtable invoked by the generic entry-walker function. */
01316 typedef struct svn_wc_entry_callbacks_t
01317 {
01318 /** An @a entry was found at @a path. */
01319 svn_error_t *(*found_entry) (const char *path,
01320 const svn_wc_entry_t *entry,
01321 void *walk_baton,
01322 apr_pool_t *pool);
01323
01324 /* ### add more callbacks as new callers need them. */
01325
01326 } svn_wc_entry_callbacks_t;
01327
01328
01329 /**
01330 * A generic entry-walker.
01331 *
01332 * Do a recursive depth-first entry-walk beginning on @a path, which can
01333 * be a file or dir. Call callbacks in @a walk_callbacks, passing
01334 * @a walk_baton to each. Use @a pool for looping, recursion, and to
01335 * allocate all entries returned. @a adm_access must be an access baton
01336 * for @a path.
01337 *
01338 * If @a cancel_func is non-null, call it with @a cancel_baton to determine
01339 * if the client has cancelled the operation.
01340 *
01341 * Like our other entries interfaces, entries that are in a 'deleted'
01342 * or 'absent' state (and not scheduled for re-addition) are not
01343 * discovered, unless @a show_hidden is true.
01344 *
01345 * When a new directory is entered, @c SVN_WC_ENTRY_THIS_DIR will always
01346 * be returned first.
01347 *
01348 * @note Callers should be aware that each directory will be
01349 * returned *twice*: first as an entry within its parent, and
01350 * subsequently as the '.' entry within itself. The two calls can be
01351 * distinguished by looking for @c SVN_WC_ENTRY_THIS_DIR in the 'name'
01352 * field of the entry.
01353 *
01354 * @since New in 1.2.
01355 */
01356 svn_error_t *svn_wc_walk_entries2 (const char *path,
01357 svn_wc_adm_access_t *adm_access,
01358 const svn_wc_entry_callbacks_t
01359 *walk_callbacks,
01360 void *walk_baton,
01361 svn_boolean_t show_hidden,
01362 svn_cancel_func_t cancel_func,
01363 void *cancel_baton,
01364 apr_pool_t *pool);
01365
01366 /**
01367 * Similar to svn_wc_walk_entries2(), but without cancellation support.
01368 *
01369 * @deprecated Provided for backward compatibility with the 1.0 API.
01370 */
01371 svn_error_t *svn_wc_walk_entries (const char *path,
01372 svn_wc_adm_access_t *adm_access,
01373 const svn_wc_entry_callbacks_t
01374 *walk_callbacks,
01375 void *walk_baton,
01376 svn_boolean_t show_hidden,
01377 apr_pool_t *pool);
01378
01379
01380 /** Mark missing @a path as 'deleted' in its @a parent's list of entries.
01381 *
01382 * Return @c SVN_ERR_WC_PATH_FOUND if @a path isn't actually missing.
01383 */
01384 svn_error_t *svn_wc_mark_missing_deleted (const char *path,
01385 svn_wc_adm_access_t *parent,
01386 apr_pool_t *pool);
01387
01388
01389
01390 /** Ensure that an administrative area exists for @a path, so that @a
01391 * path is a working copy subdir based on @a url at @a revision, and
01392 * with repository UUID @a uuid and repository root URL @a repos.
01393 * @a uuid and @a repos may be @c NULL. If non-@c NULL, @a repos must be a
01394 * prefix of @a url.
01395 *
01396 * If the administrative area does not exist, then create it and
01397 * initialize it to an unlocked state.
01398 *
01399 * If the administrative area already exists then the given @a url
01400 * must match the URL in the administrative area or an error will be
01401 * returned. The given @a revision must also match except for the
01402 * special case of adding a directory that has a name matching one
01403 * scheduled for deletion, in which case @a revision must be zero.
01404 *
01405 * Do not ensure existence of @a path itself; if @a path does not
01406 * exist, return error.
01407 *
01408 * @since New in 1.3.
01409 */
01410 svn_error_t *svn_wc_ensure_adm2 (const char *path,
01411 const char *uuid,
01412 const char *url,
01413 const char *repos,
01414 svn_revnum_t revision,
01415 apr_pool_t *pool);
01416
01417
01418 /** Similar to svn_wc_ensure_adm2(), but with @a repos set to @c NULL.
01419 *
01420 * @deprecated Provided for backwards compatibility with the 1.2 API.
01421 */
01422 svn_error_t *svn_wc_ensure_adm (const char *path,
01423 const char *uuid,
01424 const char *url,
01425 svn_revnum_t revision,
01426 apr_pool_t *pool);
01427
01428
01429 /** Set the repository root URL of @a path to @a repos, if possible.
01430 *
01431 * @a adm_access must contain @a path and be write-locked, if @a path
01432 * is versioned. Return no error if path is missing or unversioned.
01433 * Use @a pool for temporary allocations.
01434 *
01435 * @note In some circumstances, the repository root can't be set
01436 * without making the working copy corrupt. In such cases, this
01437 * function just returns no error, without modifying the @a path entry.
01438 *
01439 * @note This function exists to make it possible to try to set the repository
01440 * root in old working copies; new working copies normally get this set at
01441 * creation time.
01442 *
01443 * @since New in 1.3.
01444 */
01445 svn_error_t *
01446 svn_wc_maybe_set_repos_root (svn_wc_adm_access_t *adm_access,
01447 const char *path, const char *repos,
01448 apr_pool_t *pool);
01449
01450
01451 /**
01452 * @defgroup svn_wc_status working copy status.
01453 * @{
01454 *
01455 * We have two functions for getting working copy status: one function
01456 * for getting the status of exactly one thing, and another for
01457 * getting the statuses of (potentially) multiple things.
01458 *
01459 * The WebDAV concept of "depth" may be useful in understanding the
01460 * motivation behind this. Suppose we're getting the status of
01461 * directory D. The three depth levels would mean
01462 *
01463 * depth 0: D itself (just the named directory)
01464 * depth 1: D and its immediate children (D + its entries)
01465 * depth Infinity: D and all its descendants (full recursion)
01466 *
01467 * To offer all three levels, we could have one unified function,
01468 * taking a `depth' parameter. Unfortunately, because this function
01469 * would have to handle multiple return values as well as the single
01470 * return value case, getting the status of just one entity would
01471 * become cumbersome: you'd have to roll through a hash to find one
01472 * lone status.
01473 *
01474 * So we have svn_wc_status() for depth 0, and
01475 * svn_wc_get_status_editor() for depths 1 and 2, since the latter
01476 * two involve multiple return values.
01477 *
01478 * @note The status structures may contain a @c NULL ->entry field.
01479 * This indicates an item that is not versioned in the working copy.
01480 */
01481
01482 enum svn_wc_status_kind
01483 {
01484 /** does not exist */
01485 svn_wc_status_none = 1,
01486
01487 /** is not a versioned thing in this wc */
01488 svn_wc_status_unversioned,
01489
01490 /** exists, but uninteresting */
01491 svn_wc_status_normal,
01492
01493 /** is scheduled for addition */
01494 svn_wc_status_added,
01495
01496 /** under v.c., but is missing */
01497 svn_wc_status_missing,
01498
01499 /** scheduled for deletion */
01500 svn_wc_status_deleted,
01501
01502 /** was deleted and then re-added */
01503 svn_wc_status_replaced,
01504
01505 /** text or props have been modified */
01506 svn_wc_status_modified,
01507
01508 /** local mods received repos mods */
01509 svn_wc_status_merged,
01510
01511 /** local mods received conflicting repos mods */
01512 svn_wc_status_conflicted,
01513
01514 /** a resource marked as ignored */
01515 svn_wc_status_ignored,
01516
01517 /** an unversioned resource is in the way of the versioned resource */
01518 svn_wc_status_obstructed,
01519
01520 /** an unversioned path populated by an svn:externals property */
01521 svn_wc_status_external,
01522
01523 /** a directory doesn't contain a complete entries list */
01524 svn_wc_status_incomplete
01525 };
01526
01527 /**
01528 * Structure for holding the "status" of a working copy item.
01529 *
01530 * The item's entry data is in @a entry, augmented and possibly shadowed
01531 * by the other fields. @a entry is @c NULL if this item is not under
01532 * version control.
01533 *
01534 * @note Fields may be added to the end of this structure in future
01535 * versions. Therefore, users shouldn't allocate structures of this
01536 * type, to preserve binary compatibility.
01537 *
01538 * @since New in 1.2.
01539 */
01540 typedef struct svn_wc_status2_t
01541 {
01542 /** Can be @c NULL if not under version control. */
01543 svn_wc_entry_t *entry;
01544
01545 /** The status of the entries text. */
01546 enum svn_wc_status_kind text_status;
01547
01548 /** The status of the entries properties. */
01549 enum svn_wc_status_kind prop_status;
01550
01551 /** a directory can be 'locked' if a working copy update was interrupted. */
01552 svn_boolean_t locked;
01553
01554 /** a file or directory can be 'copied' if it's scheduled for
01555 * addition-with-history (or part of a subtree that is scheduled as such.).
01556 */
01557 svn_boolean_t copied;
01558
01559 /** a file or directory can be 'switched' if the switch command has been
01560 * used.
01561 */
01562 svn_boolean_t switched;
01563
01564 /** The entry's text status in the repository. */
01565 enum svn_wc_status_kind repos_text_status;
01566
01567 /** The entry's property status in the repository. */
01568 enum svn_wc_status_kind repos_prop_status;
01569
01570 /** The entry's lock in the repository, if any. */
01571 svn_lock_t *repos_lock;
01572
01573 /** Set to the URI (actual or expected) of the item.
01574 * @since New in 1.3
01575 */
01576 const char *url;
01577
01578 /**
01579 * @defgroup svn_wc_status_ood WC out of date info from the repository
01580 * @{
01581 *
01582 * When the working copy item is out of date compared to the
01583 * repository, the following fields represent the state of the
01584 * youngest revision of the item in the repository. If the working
01585 * copy is not out of date, the fields are initialized as described
01586 * below.
01587 */
01588
01589 /** Set to the youngest committed revision, or @c SVN_INVALID_REVNUM
01590 * if not out of date.
01591 * @since New in 1.3
01592 */
01593 svn_revnum_t ood_last_cmt_rev;
01594
01595 /** Set to the most recent commit date, or @c 0 if not out of date.
01596 * @since New in 1.3
01597 */
01598 apr_time_t ood_last_cmt_date;
01599
01600 /** Set to the node kind of the youngest commit, or @c svn_node_none
01601 * if not out of date.
01602 * @since New in 1.3
01603 */
01604 svn_node_kind_t ood_kind;
01605
01606 /** Set to the user name of the youngest commit, or @c NULL if not
01607 * out of date or non-existent. Because a non-existent @c
01608 * svn:author property has the same behavior as an out of date
01609 * working copy, examine @c ood_last_cmt_rev to determine whether
01610 * the working copy is out of date.
01611 * @since New in 1.3
01612 */
01613 const char *ood_last_cmt_author;
01614
01615 /** @} */
01616
01617 } svn_wc_status2_t;
01618
01619
01620
01621 /**
01622 * Same as @c svn_wc_status2_t, but without the svn_lock_t 'repos_lock' field.
01623 *
01624 * @deprecated Provided for backward compatibility with the 1.1 API.
01625 */
01626 typedef struct svn_wc_status_t
01627 {
01628 /** Can be @c NULL if not under version control. */
01629 svn_wc_entry_t *entry;
01630
01631 /** The status of the entries text. */
01632 enum svn_wc_status_kind text_status;
01633
01634 /** The status of the entries properties. */
01635 enum svn_wc_status_kind prop_status;
01636
01637 /** a directory can be 'locked' if a working copy update was interrupted. */
01638 svn_boolean_t locked;
01639
01640 /** a file or directory can be 'copied' if it's scheduled for
01641 * addition-with-history (or part of a subtree that is scheduled as such.).
01642 */
01643 svn_boolean_t copied;
01644
01645 /** a file or directory can be 'switched' if the switch command has been
01646 * used.
01647 */
01648 svn_boolean_t switched;
01649
01650 /** The entry's text status in the repository. */
01651 enum svn_wc_status_kind repos_text_status;
01652
01653 /** The entry's property status in the repository. */
01654 enum svn_wc_status_kind repos_prop_status;
01655
01656 } svn_wc_status_t;
01657
01658
01659
01660 /**
01661 * Return a deep copy of the @a orig_stat status structure, allocated
01662 * in @a pool.
01663 *
01664 * @since New in 1.2.
01665 */
01666 svn_wc_status2_t *svn_wc_dup_status2 (svn_wc_status2_t *orig_stat,
01667 apr_pool_t *pool);
01668
01669
01670 /**
01671 * Same as svn_wc_dup_status2(), but for older svn_wc_status_t structures.
01672 *
01673 * @deprecated Provided for backward compatibility with the 1.1 API.
01674 */
01675 svn_wc_status_t *svn_wc_dup_status (svn_wc_status_t *orig_stat,
01676 apr_pool_t *pool);
01677
01678
01679 /**
01680 * Fill @a *status for @a path, allocating in @a pool.
01681 * @a adm_access must be an access baton for @a path.
01682 *
01683 * Here are some things to note about the returned structure. A quick
01684 * examination of the @c status->text_status after a successful return of
01685 * this function can reveal the following things:
01686 *
01687 * - @c svn_wc_status_none : @a path is not versioned, and is either not
01688 * present on disk, or is ignored by svn's
01689 * default ignore regular expressions or the
01690 * svn:ignore property setting for @a path's
01691 * parent directory.
01692 *
01693 * - @c svn_wc_status_missing : @a path is versioned, but is missing from
01694 * the working copy.
01695 *
01696 * - @c svn_wc_status_unversioned : @a path is not versioned, but is
01697 * present on disk and not being
01698 * ignored (see above).
01699 *
01700 * The other available results for the @c text_status field are more
01701 * straightforward in their meanings. See the comments on the
01702 * @c svn_wc_status_kind structure for some hints.
01703 *
01704 * @since New in 1.2.
01705 */
01706 svn_error_t *svn_wc_status2 (svn_wc_status2_t **status,
01707 const char *path,
01708 svn_wc_adm_access_t *adm_access,
01709 apr_pool_t *pool);
01710
01711
01712 /**
01713 * Same as svn_wc_status2(), but for older svn_wc_status_t structures.
01714 *
01715 * @deprecated Provided for backward compatibility with the 1.1 API.
01716 */
01717 svn_error_t *svn_wc_status (svn_wc_status_t **status,
01718 const char *path,
01719 svn_wc_adm_access_t *adm_access,
01720 apr_pool_t *pool);
01721
01722
01723
01724
01725 /**
01726 * A callback for reporting a @a status about @a path.
01727 *
01728 * @a baton is a closure object; it should be provided by the
01729 * implementation, and passed by the caller.
01730 *
01731 * @since New in 1.2.
01732 */
01733 typedef void (*svn_wc_status_func2_t) (void *baton,
01734 const char *path,
01735 svn_wc_status2_t *status);
01736
01737 /**
01738 * Same as svn_wc_status_func2_t(), but for older svn_wc_status_t structures.
01739 *
01740 * @deprecated Provided for backward compatibility with the 1.1 API.
01741 */
01742 typedef void (*svn_wc_status_func_t) (void *baton,
01743 const char *path,
01744 svn_wc_status_t *status);
01745
01746
01747 /**
01748 * Set @a *editor and @a *edit_baton to an editor that generates @c
01749 * svn_wc_status2_t structures and sends them through @a status_func /
01750 * @a status_baton. @a anchor is an access baton, with a tree lock,
01751 * for the local path to the working copy which will be used as the
01752 * root of our editor. If @a target is not empty, it represents an
01753 * entry in the @a anchor path which is the subject of the editor
01754 * drive (otherwise, the @a anchor is the subject).
01755 *
01756 * If @a set_locks_baton is non-@c NULL, it will be set to a baton that can
01757 * be used in a call to the svn_wc_status_set_repos_locks() function.
01758 *
01759 * Callers drive this editor to describe working copy out-of-dateness
01760 * with respect to the repository. If this information is not
01761 * available or not desired, callers should simply call the
01762 * close_edit() function of the @a editor vtable.
01763 *
01764 * If the editor driver calls @a editor's set_target_revision() vtable
01765 * function, then when the edit drive is completed, @a *edit_revision
01766 * will contain the revision delivered via that interface.
01767 *
01768 * @a config is a hash mapping @c SVN_CONFIG_CATEGORY's to @c
01769 * svn_config_t's.
01770 *
01771 * Assuming the target is a directory, then:
01772 *
01773 * - If @a get_all is false, then only locally-modified entries will be
01774 * returned. If true, then all entries will be returned.
01775 *
01776 * - If @a recurse is false, status structures will be returned only
01777 * for the target and its immediate children. Otherwise, this
01778 * operation is fully recursive.
01779 *
01780 * If @a no_ignore is set, statuses that would typically be ignored
01781 * will instead be reported.
01782 *
01783 * If @a cancel_func is non-null, call it with @a cancel_baton while building
01784 * the @a statushash to determine if the client has cancelled the operation.
01785 *
01786 * If @a traversal_info is non-null, then record pre-update traversal
01787 * state in it. (Caller should obtain @a traversal_info from
01788 * svn_wc_init_traversal_info().)
01789 *
01790 * Allocate the editor itself in @a pool, but the editor does temporary
01791 * allocations in a subpool of @a pool.
01792 *
01793 * @since New in 1.2.
01794 */
01795 svn_error_t *svn_wc_get_status_editor2 (const svn_delta_editor_t **editor,
01796 void **edit_baton,
01797 void **set_locks_baton,
01798 svn_revnum_t *edit_revision,
01799 svn_wc_adm_access_t *anchor,
01800 const char *target,
01801 apr_hash_t *config,
01802 svn_boolean_t recurse,
01803 svn_boolean_t get_all,
01804 svn_boolean_t no_ignore,
01805 svn_wc_status_func2_t status_func,
01806 void *status_baton,
01807 svn_cancel_func_t cancel_func,
01808 void *cancel_baton,
01809 svn_wc_traversal_info_t *traversal_info,
01810 apr_pool_t *pool);
01811
01812
01813 /**
01814 * Same as svn_wc_get_status_editor2(), but with @a set_locks_baton set
01815 * to @c NULL, and taking a deprecated svn_wc_status_func_t argument.
01816 *
01817 * @deprecated Provided for backward compatibility with the 1.1 API.
01818 */
01819 svn_error_t *svn_wc_get_status_editor (const svn_delta_editor_t **editor,
01820 void **edit_baton,
01821 svn_revnum_t *edit_revision,
01822 svn_wc_adm_access_t *anchor,
01823 const char *target,
01824 apr_hash_t *config,
01825 svn_boolean_t recurse,
01826 svn_boolean_t get_all,
01827 svn_boolean_t no_ignore,
01828 svn_wc_status_func_t status_func,
01829 void *status_baton,
01830 svn_cancel_func_t cancel_func,
01831 void *cancel_baton,
01832 svn_wc_traversal_info_t *traversal_info,
01833 apr_pool_t *pool);
01834
01835
01836 /**
01837 * Associate @a locks, a hash table mapping <tt>const char*</tt>
01838 * absolute repository paths to <tt>svn_lock_t</tt> objects, with a
01839 * @a set_locks_baton returned by an earlier call to
01840 * svn_wc_get_status_editor2(). @a repos_root is the repository root URL.
01841 * Perform all allocations in @a pool.
01842 *
01843 * @note @a locks will not be copied, so it must be valid throughout the
01844 * edit. @a pool must also not be destroyed or cleared before the edit is
01845 * finished.
01846 *
01847 * @since New in 1.2.
01848 */
01849 svn_error_t *
01850 svn_wc_status_set_repos_locks (void *set_locks_baton,
01851 apr_hash_t *locks,
01852 const char *repos_root,
01853 apr_pool_t *pool);
01854
01855 /** @} */
01856
01857
01858 /**
01859 * Copy @a src to @a dst_basename in @a dst_parent, and schedule
01860 * @a dst_basename for addition to the repository, remembering the copy
01861 * history.
01862 *
01863 * @a src must be a file or directory under version control; @a dst_parent
01864 * must be a directory under version control in the same working copy;
01865 * @a dst_basename will be the name of the copied item, and it must not
01866 * exist already.
01867 *
01868 * If @a cancel_func is non-null, call it with @a cancel_baton at
01869 * various points during the operation. If it returns an error
01870 * (typically @c SVN_ERR_CANCELLED), return that error immediately.
01871 *
01872 * For each file or directory copied, @a notify_func will be called
01873 * with its path and the @a notify_baton. @a notify_func may be @c NULL
01874 * if you are not interested in this information.
01875 *
01876 * @par Important:
01877 * This is a variant of svn_wc_add(). No changes will happen
01878 * to the repository until a commit occurs. This scheduling can be
01879 * removed with svn_client_revert().
01880 *
01881 * @since New in 1.2.
01882 */
01883 svn_error_t *svn_wc_copy2 (const char *src,
01884 svn_wc_adm_access_t *dst_parent,
01885 const char *dst_basename,
01886 svn_cancel_func_t cancel_func,
01887 void *cancel_baton,
01888 svn_wc_notify_func2_t notify_func,
01889 void *notify_baton,
01890 apr_pool_t *pool);
01891
01892 /**
01893 * Similar to svn_wc_copy2(), but takes an @c svn_wc_notify_func_t instead.
01894 *
01895 * @deprecated Provided for backward compatibility with the 1.1 API.
01896 */
01897 svn_error_t *svn_wc_copy (const char *src,
01898 svn_wc_adm_access_t *dst_parent,
01899 const char *dst_basename,
01900 svn_cancel_func_t cancel_func,
01901 void *cancel_baton,
01902 svn_wc_notify_func_t notify_func,
01903 void *notify_baton,
01904 apr_pool_t *pool);
01905
01906 /**
01907 * Schedule @a path for deletion, it will be deleted from the repository on
01908 * the next commit. If @a path refers to a directory, then a recursive
01909 * deletion will occur. @a adm_access must hold a write lock for the parent
01910 * of @a path.
01911 *
01912 * This function immediately deletes all files, modified and unmodified,
01913 * versioned and unversioned from the working copy. It also immediately
01914 * deletes unversioned directories and directories that are scheduled to be
01915 * added. Only versioned directories will remain in the working copy,
01916 * these get deleted by the update following the commit.
01917 *
01918 * If @a cancel_func is non-null, call it with @a cancel_baton at
01919 * various points during the operation. If it returns an error
01920 * (typically @c SVN_ERR_CANCELLED), return that error immediately.
01921 *
01922 * For each path marked for deletion, @a notify_func will be called with
01923 * the @a notify_baton and that path. The @a notify_func callback may be
01924 * @c NULL if notification is not needed.
01925 *
01926 * @since New in 1.2.
01927 */
01928 svn_error_t *svn_wc_delete2 (const char *path,
01929 svn_wc_adm_access_t *adm_access,
01930 svn_cancel_func_t cancel_func,
01931 void *cancel_baton,
01932 svn_wc_notify_func2_t notify_func,
01933 void *notify_baton,
01934 apr_pool_t *pool);
01935
01936 /**
01937 * Similar to svn_wc_delete2(), but takes an @c svn_wc_notify_func_t instead.
01938 *
01939 * @deprecated Provided for backward compatibility with the 1.1 API.
01940 */
01941 svn_error_t *svn_wc_delete (const char *path,
01942 svn_wc_adm_access_t *adm_access,
01943 svn_cancel_func_t cancel_func,
01944 void *cancel_baton,
01945 svn_wc_notify_func_t notify_func,
01946 void *notify_baton,
01947 apr_pool_t *pool);
01948
01949
01950 /**
01951 * Put @a path under version control by adding an entry in its parent,
01952 * and, if @a path is a directory, adding an administrative area. The
01953 * new entry and anything under it is scheduled for addition to the
01954 * repository. @a parent_access should hold a write lock for the parent
01955 * directory of @a path. If @a path is a directory then an access baton
01956 * for @a path will be added to the set containing @a parent_access.
01957 *
01958 * If @a path does not exist, return @c SVN_ERR_WC_PATH_NOT_FOUND.
01959 *
01960 * If @a copyfrom_url is non-null, it and @a copyfrom_rev are used as
01961 * `copyfrom' args. This is for copy operations, where one wants
01962 * to schedule @a path for addition with a particular history.
01963 *
01964 * If @a cancel_func is non-null, call it with @a cancel_baton at
01965 * various points during the operation. If it returns an error
01966 * (typically @c SVN_ERR_CANCELLED), return that error immediately.
01967 *
01968 * When the @a path has been added, then @a notify_func will be called
01969 * (if it is not @c NULL) with the @a notify_baton and the path.
01970 *
01971 * Return @c SVN_ERR_WC_NODE_KIND_CHANGE if @a path is both an unversioned
01972 * directory and a file that is scheduled for deletion or in state deleted.
01973 *
01974 *<pre> ### This function currently does double duty -- it is also
01975 * ### responsible for "switching" a working copy directory over to a
01976 * ### new copyfrom ancestry and scheduling it for addition. Here is
01977 * ### the old doc string from Ben, lightly edited to bring it
01978 * ### up-to-date, explaining the true, secret life of this function:</pre>
01979 *
01980 * Given a @a path within a working copy of type KIND, follow this algorithm:
01981 *
01982 * - if @a path is not under version control:
01983 * - Place it under version control and schedule for addition;
01984 * if @a copyfrom_url is non-null, use it and @a copyfrom_rev as
01985 * 'copyfrom' history
01986 *
01987 * - if @a path is already under version control:
01988 * (This can only happen when a directory is copied, in which
01989 * case ancestry must have been supplied as well.)
01990 *
01991 * - Schedule the directory itself for addition with copyfrom history.
01992 * - Mark all its children with a 'copied' flag
01993 * - Rewrite all the URLs to what they will be after a commit.
01994 * - ### TODO: remove old wcprops too, see the '###'below
01995 *
01996 *<pre> ### I think possibly the "switchover" functionality should be
01997 * ### broken out into a separate function, but its all intertwined in
01998 * ### the code right now. Ben, thoughts? Hard? Easy? Mauve?</pre>
01999 *
02000 * ### Update: see "###" comment in svn_wc_add_repos_file()'s doc
02001 * string about this.
02002 *
02003 * @since New in 1.2.
02004 */
02005 svn_error_t *svn_wc_add2 (const char *path,
02006 svn_wc_adm_access_t *parent_access,
02007 const char *copyfrom_url,
02008 svn_revnum_t copyfrom_rev,
02009 svn_cancel_func_t cancel_func,
02010 void *cancel_baton,
02011 svn_wc_notify_func2_t notify_func,
02012 void *notify_baton,
02013 apr_pool_t *pool);
02014
02015 /**
02016 * Similar to svn_wc_add2(), but takes an @c svn_wc_notify_func_t instead.
02017 *
02018 * @deprecated Provided for backward compatibility with the 1.1 API.
02019 */
02020 svn_error_t *svn_wc_add (const char *path,
02021 svn_wc_adm_access_t *parent_access,
02022 const char *copyfrom_url,
02023 svn_revnum_t copyfrom_rev,
02024 svn_cancel_func_t cancel_func,
02025 void *cancel_baton,
02026 svn_wc_notify_func_t notify_func,
02027 void *notify_baton,
02028 apr_pool_t *pool);
02029
02030 /** Add a file to a working copy at @a dst_path, obtaining the file's
02031 * contents from @a new_text_path and its properties from @a new_props,
02032 * which normally come from the repository file represented by the
02033 * copyfrom args, see below. The new file will be scheduled for
02034 * addition with history.
02035 *
02036 * Automatically remove @a new_text_path upon successful completion.
02037 *
02038 * @a adm_access, or an access baton in its associated set, must
02039 * contain a write lock for the parent of @a dst_path.
02040 *
02041 * If @a copyfrom_url is non-null, then @a copyfrom_rev must be a
02042 * valid revision number, and together they are the copyfrom history
02043 * for the new file.
02044 *
02045 * Use @a pool for temporary allocations.
02046 *
02047 * ### This function is very redundant with svn_wc_add(). Ideally,
02048 * we'd merge them, so that svn_wc_add() would just take optional
02049 * new_props and optional copyfrom information. That way it could be
02050 * used for both 'svn add somefilesittingonmydisk' and for adding
02051 * files from repositories, with or without copyfrom history.
02052 *
02053 * The problem with this Ideal Plan is that svn_wc_add() also takes
02054 * care of recursive URL-rewriting. There's a whole comment in its
02055 * doc string about how that's really weird, outside its core mission,
02056 * etc, etc. So another part of the Ideal Plan is that that
02057 * functionality of svn_wc_add() would move into a separate function.
02058 */
02059 svn_error_t *svn_wc_add_repos_file (const char *dst_path,
02060 svn_wc_adm_access_t *adm_access,
02061 const char *new_text_path,
02062 apr_hash_t *new_props,
02063 const char *copyfrom_url,
02064 svn_revnum_t copyfrom_rev,
02065 apr_pool_t *pool);
02066
02067
02068 /** Remove entry @a name in @a adm_access from revision control. @a name
02069 * must be either a file or @c SVN_WC_ENTRY_THIS_DIR. @a adm_access must
02070 * hold a write lock.
02071 *
02072 * If @a name is a file, all its info will be removed from @a adm_access's
02073 * administrative directory. If @a name is @c SVN_WC_ENTRY_THIS_DIR, then
02074 * @a adm_access's entire administrative area will be deleted, along with
02075 * *all* the administrative areas anywhere in the tree below @a adm_access.
02076 *
02077 * Normally, only administrative data is removed. However, if
02078 * @a destroy_wf is true, then all working file(s) and dirs are deleted
02079 * from disk as well. When called with @a destroy_wf, any locally
02080 * modified files will *not* be deleted, and the special error
02081 * @c SVN_ERR_WC_LEFT_LOCAL_MOD might be returned. (Callers only need to
02082 * check for this special return value if @a destroy_wf is true.)
02083 *
02084 * If @a instant_error is TRUE, then return @c
02085 * SVN_ERR_WC_LEFT_LOCAL_MOD the instant a locally modified file is
02086 * encountered. Otherwise, leave locally modified files in place and
02087 * return the error only after all the recursion is complete.
02088 *
02089 * If @a cancel_func is non-null, call it with @a cancel_baton at
02090 * various points during the removal. If it returns an error
02091 * (typically @c SVN_ERR_CANCELLED), return that error immediately.
02092 *
02093 * WARNING: This routine is exported for careful, measured use by
02094 * libsvn_client. Do *not* call this routine unless you really
02095 * understand what the heck you're doing.
02096 */
02097 svn_error_t *
02098 svn_wc_remove_from_revision_control (svn_wc_adm_access_t *adm_access,
02099 const char *name,
02100 svn_boolean_t destroy_wf,
02101 svn_boolean_t instant_error,
02102 svn_cancel_func_t cancel_func,
02103 void *cancel_baton,
02104 apr_pool_t *pool);
02105
02106
02107 /**
02108 * Assuming @a path is under version control and in a state of conflict,
02109 * then take @a path *out* of this state. If @a resolve_text is true then
02110 * any text conflict is resolved, if @a resolve_props is true then any
02111 * property conflicts are resolved. If @a recurse is true, then search
02112 * recursively for conflicts to resolve.
02113 *
02114 * @a adm_access is an access baton, with a write lock, for @a path.
02115 *
02116 * Needless to say, this function doesn't touch conflict markers or
02117 * anything of that sort -- only a human can semantically resolve a
02118 * conflict. Instead, this function simply marks a file as "having
02119 * been resolved", clearing the way for a commit.
02120 *
02121 * The implementation details are opaque, as our "conflicted" criteria
02122 * might change over time. (At the moment, this routine removes the
02123 * three fulltext 'backup' files and any .prej file created in a conflict,
02124 * and modifies @a path's entry.)
02125 *
02126 * If @a path is not under version control, return @c SVN_ERR_ENTRY_NOT_FOUND.
02127 * If @a path isn't in a state of conflict to begin with, do nothing, and
02128 * return @c SVN_NO_ERROR.
02129 *
02130 * If @c path was successfully taken out of a state of conflict, report this
02131 * information to @c notify_func (if non-@c NULL.) If only text or only
02132 * property conflict resolution was requested, and it was successful, then
02133 * success gets reported.
02134 *
02135 * @since New in 1.2.
02136 */
02137 svn_error_t *svn_wc_resolved_conflict2 (const char *path,
02138 svn_wc_adm_access_t *adm_access,
02139 svn_boolean_t resolve_text,
02140 svn_boolean_t resolve_props,
02141 svn_boolean_t recurse,
02142 svn_wc_notify_func2_t notify_func,
02143 void *notify_baton,
02144 svn_cancel_func_t cancel_func,
02145 void *cancel_baton,
02146 apr_pool_t *pool);
02147
02148 /**
02149 * Similar to svn_wc_resolved_conflict2(), but takes an
02150 * svn_wc_notify_func_t and doesn't have cancellation support.
02151 *
02152 * @deprecated Provided for backward compatibility with the 1.0 API.
02153 */
02154 svn_error_t *svn_wc_resolved_conflict (const char *path,
02155 svn_wc_adm_access_t *adm_access,
02156 svn_boolean_t resolve_text,
02157 svn_boolean_t resolve_props,
02158 svn_boolean_t recurse,
02159 svn_wc_notify_func_t notify_func,
02160 void *notify_baton,
02161 apr_pool_t *pool);
02162
02163
02164 /* Commits. */
02165
02166 /**
02167 * Bump a successfully committed absolute @a path to @a new_revnum after a
02168 * commit succeeds. @a rev_date and @a rev_author are the (server-side)
02169 * date and author of the new revision; one or both may be @c NULL.
02170 * @a adm_access must hold a write lock appropriate for @a path.
02171 *
02172 * If non-null, @a wcprops is an array of <tt>svn_prop_t *</tt> changes to
02173 * wc properties; if an @c svn_prop_t->value is null, then that property is
02174 * deleted.
02175 *
02176 * If @a remove_lock is @c TRUE, any entryprops related to a repository
02177 * lock will be removed.
02178 *
02179 * If @a recurse is true and @a path is a directory, then bump every
02180 * versioned object at or under @a path. This is usually done for
02181 * copied trees.
02182 *
02183 * @since New in 1.2.
02184 */
02185 svn_error_t *svn_wc_process_committed2 (const char *path,
02186 svn_wc_adm_access_t *adm_access,
02187 svn_boolean_t recurse,
02188 svn_revnum_t new_revnum,
02189 const char *rev_date,
02190 const char *rev_author,
02191 apr_array_header_t *wcprop_changes,
02192 svn_boolean_t remove_lock,
02193 apr_pool_t *pool);
02194
02195
02196 /**
02197 * Similar to svn_wc_process_committed2(), but with @a remove_lock set to
02198 * @c FALSE.
02199 *
02200 * @deprecated Provided for backward compatibility with the 1.1 API.
02201 */
02202 svn_error_t *svn_wc_process_committed (const char *path,
02203 svn_wc_adm_access_t *adm_access,
02204 svn_boolean_t recurse,
02205 svn_revnum_t new_revnum,
02206 const char *rev_date,
02207 const char *rev_author,
02208 apr_array_header_t *wcprop_changes,
02209 apr_pool_t *pool);
02210
02211
02212
02213
02214
02215 /**
02216 * Do a depth-first crawl in a working copy, beginning at @a path.
02217 *
02218 * Communicate the `state' of the working copy's revisions to
02219 * @a reporter/@a report_baton. Obviously, if @a path is a file instead
02220 * of a directory, this depth-first crawl will be a short one.
02221 *
02222 * No locks are or logs are created, nor are any animals harmed in the
02223 * process. No cleanup is necessary. @a adm_access must be an access
02224 * baton for the @a path hierarchy, it does not require a write lock.
02225 *
02226 * After all revisions are reported, @a reporter->finish_report() is
02227 * called, which immediately causes the RA layer to update the working
02228 * copy. Thus the return value may very well reflect the result of
02229 * the update!
02230 *
02231 * If @a restore_files is true, then unexpectedly missing working files
02232 * will be restored from the administrative directory's cache. For each
02233 * file restored, the @a notify_func function will be called with the
02234 * @a notify_baton and the path of the restored file. @a notify_func may
02235 * be @c NULL if this notification is not required. If @a
02236 * use_commit_times is true, then set restored files' timestamps to
02237 * their last-commit-times.
02238 *
02239 * If @a traversal_info is non-null, then record pre-update traversal
02240 * state in it. (Caller should obtain @a traversal_info from
02241 * svn_wc_init_traversal_info().)
02242 *
02243 * @since New in 1.2.
02244 */
02245 svn_error_t *
02246 svn_wc_crawl_revisions2 (const char *path,
02247 svn_wc_adm_access_t *adm_access,
02248 const svn_ra_reporter2_t *reporter,
02249 void *report_baton,
02250 svn_boolean_t restore_files,
02251 svn_boolean_t recurse,
02252 svn_boolean_t use_commit_times,
02253 svn_wc_notify_func2_t notify_func,
02254 void *notify_baton,
02255 svn_wc_traversal_info_t *traversal_info,
02256 apr_pool_t *pool);
02257
02258 /**
02259 * Similar to svn_wc_crawl_revisions2(), but takes an svn_wc_notify_func_t
02260 * and a @c svn_reporter_t instead.
02261 *
02262 * @deprecated Provided for backward compatibility with the 1.1 API.
02263 */
02264 svn_error_t *
02265 svn_wc_crawl_revisions (const char *path,
02266 svn_wc_adm_access_t *adm_access,
02267 const svn_ra_reporter_t *reporter,
02268 void *report_baton,
02269 svn_boolean_t restore_files,
02270 svn_boolean_t recurse,
02271 svn_boolean_t use_commit_times,
02272 svn_wc_notify_func_t notify_func,
02273 void *notify_baton,
02274 svn_wc_traversal_info_t *traversal_info,
02275 apr_pool_t *pool);
02276
02277
02278 /* Updates. */
02279
02280 /** Set @a *wc_root to @c TRUE if @a path represents a "working copy root",
02281 * @c FALSE otherwise. Use @a pool for any intermediate allocations.
02282 *
02283 * If @a path is not found, return the error @c SVN_ERR_ENTRY_NOT_FOUND.
02284 *
02285 * @note Due to the way in which "WC-root-ness" is calculated, passing
02286 * a @a path of `.' to this function will always return @c TRUE.
02287 */
02288 svn_error_t *svn_wc_is_wc_root (svn_boolean_t *wc_root,
02289 const char *path,
02290 svn_wc_adm_access_t *adm_access,
02291 apr_pool_t *pool);
02292
02293
02294 /** Conditionally split @a path into an @a anchor and @a target for the
02295 * purpose of updating and committing.
02296 *
02297 * @a anchor is the directory at which the update or commit editor
02298 * should be rooted.
02299 *
02300 * @a target is the actual subject (relative to the @a anchor) of the
02301 * update/commit, or "" if the @a anchor itself is the subject.
02302 *
02303 * Allocate @a anchor and @a target in @a pool.
02304 */
02305 svn_error_t *svn_wc_get_actual_target (const char *path,
02306 const char **anchor,
02307 const char **target,
02308 apr_pool_t *pool);
02309
02310
02311
02312 /* Update and update-like functionality. */
02313
02314 /**
02315 * Set @a *editor and @a *edit_baton to an editor and baton for updating a
02316 * working copy.
02317 *
02318 * If @a ti is non-null, record traversal info in @a ti, for use by
02319 * post-traversal accessors such as svn_wc_edited_externals().
02320 *
02321 * @a anchor is an access baton, with a write lock, for the local path to the
02322 * working copy which will be used as the root of our editor. Further
02323 * locks will be acquired if the update creates new directories. All
02324 * locks, both those in @a anchor and newly acquired ones, will be released
02325 * when the editor driver calls @c close_edit.
02326 *
02327 * @a target is the entry in @a anchor that will actually be updated, or
02328 * empty if all of @a anchor should be updated.
02329 *
02330 * The editor invokes @a notify_func with @a notify_baton as the update
02331 * progresses, if @a notify_func is non-null.
02332 *
02333 * If @a cancel_func is non-null, the editor will invoke @a cancel_func with
02334 * @a cancel_baton as the update progresses to see if it should continue.
02335 *
02336 * If @a diff3_cmd is non-null, then use it as the diff3 command for
02337 * any merging; otherwise, use the built-in merge code.
02338 *
02339 * @a target_revision is a pointer to a revision location which, after
02340 * successful completion of the drive of this editor, will be
02341 * populated with the revision to which the working copy was updated.
02342 *
02343 * If @a use_commit_times is TRUE, then all edited/added files will
02344 * have their working timestamp set to the last-committed-time. If
02345 * FALSE, the working files will be touched with the 'now' time.
02346 *
02347 * @since New in 1.2.
02348 */
02349 svn_error_t *svn_wc_get_update_editor2 (svn_revnum_t *target_revision,
02350 svn_wc_adm_access_t *anchor,
02351 const char *target,
02352 svn_boolean_t use_commit_times,
02353 svn_boolean_t recurse,
02354 svn_wc_notify_func2_t notify_func,
02355 void *notify_baton,
02356 svn_cancel_func_t cancel_func,
02357 void *cancel_baton,
02358 const char *diff3_cmd,
02359 const svn_delta_editor_t **editor,
02360 void **edit_baton,
02361 svn_wc_traversal_info_t *ti,
02362 apr_pool_t *pool);
02363
02364 /**
02365 * Similar to svn_wc_get_update_editor2(), but takes an svn_wc_notify_func_t
02366 * instead.
02367 *
02368 * @deprecated Provided for backward compatibility with the 1.1 API.
02369 */
02370 svn_error_t *svn_wc_get_update_editor (svn_revnum_t *target_revision,
02371 svn_wc_adm_access_t *anchor,
02372 const char *target,
02373 svn_boolean_t use_commit_times,
02374 svn_boolean_t recurse,
02375 svn_wc_notify_func_t notify_func,
02376 void *notify_baton,
02377 svn_cancel_func_t cancel_func,
02378 void *cancel_baton,
02379 const char *diff3_cmd,
02380 const svn_delta_editor_t **editor,
02381 void **edit_baton,
02382 svn_wc_traversal_info_t *ti,
02383 apr_pool_t *pool);
02384
02385 /**
02386 * A variant of svn_wc_get_update_editor().
02387 *
02388 * Set @a *editor and @a *edit_baton to an editor and baton for "switching"
02389 * a working copy to a new @a switch_url. (Right now, this URL must be
02390 * within the same repository that the working copy already comes
02391 * from.) @a switch_url must not be @c NULL.
02392 *
02393 * If @a ti is non-null, record traversal info in @a ti, for use by
02394 * post-traversal accessors such as svn_wc_edited_externals().
02395 *
02396 * @a anchor is an access baton, with a write lock, for the local path to the
02397 * working copy which will be used as the root of our editor. Further
02398 * locks will be acquired if the switch creates new directories. All
02399 * locks, both those in @a anchor and newly acquired ones, will be released
02400 * when the editor driver calls @c close_edit.
02401 *
02402 * @a target is the entry in @a anchor that will actually be updated, or
02403 * empty if all of @a anchor should be updated.
02404 *
02405 * The editor invokes @a notify_func with @a notify_baton as the switch
02406 * progresses, if @a notify_func is non-null.
02407 *
02408 * If @a cancel_func is non-null, it will be called with @a cancel_baton as
02409 * the switch progresses to determine if it should continue.
02410 *
02411 * If @a diff3_cmd is non-null, then use it as the diff3 command for
02412 * any merging; otherwise, use the built-in merge code.
02413 *
02414 * @a target_revision is a pointer to a revision location which, after
02415 * successful completion of the drive of this editor, will be
02416 * populated with the revision to which the working copy was updated.
02417 *
02418 * If @a use_commit_times is TRUE, then all edited/added files will
02419 * have their working timestamp set to the last-committed-time. If
02420 * FALSE, the working files will be touched with the 'now' time.
02421 *
02422 * @since New in 1.2.
02423 */
02424 svn_error_t *svn_wc_get_switch_editor2 (svn_revnum_t *target_revision,
02425 svn_wc_adm_access_t *anchor,
02426 const char *target,
02427 const char *switch_url,
02428 svn_boolean_t use_commit_times,
02429 svn_boolean_t recurse,
02430 svn_wc_notify_func2_t notify_func,
02431 void *notify_baton,
02432 svn_cancel_func_t cancel_func,
02433 void *cancel_baton,
02434 const char *diff3_cmd,
02435 const svn_delta_editor_t **editor,
02436 void **edit_baton,
02437 svn_wc_traversal_info_t *ti,
02438 apr_pool_t *pool);
02439
02440 /**
02441 * Similar to svn_wc_get_switch_editor2(), but takes an
02442 * @c svn_wc_notify_func_t instead.
02443 *
02444 * @deprecated Provided for backward compatibility with the 1.1 API.
02445 */
02446 svn_error_t *svn_wc_get_switch_editor (svn_revnum_t *target_revision,
02447 svn_wc_adm_access_t *anchor,
02448 const char *target,
02449 const char *switch_url,
02450 svn_boolean_t use_commit_times,
02451 svn_boolean_t recurse,
02452 svn_wc_notify_func_t notify_func,
02453 void *notify_baton,
02454 svn_cancel_func_t cancel_func,
02455 void *cancel_baton,
02456 const char *diff3_cmd,
02457 const svn_delta_editor_t **editor,
02458 void **edit_baton,
02459 svn_wc_traversal_info_t *ti,
02460 apr_pool_t *pool);
02461
02462
02463
02464 /* A word about the implementation of working copy property storage:
02465 *
02466 * Since properties are key/val pairs, you'd think we store them in
02467 * some sort of Berkeley DB-ish format, and even store pending changes
02468 * to them that way too.
02469 *
02470 * However, we already have libsvn_subr/hashdump.c working, and it
02471 * uses a human-readable format. That will be very handy when we're
02472 * debugging, and presumably we will not be dealing with any huge
02473 * properties or property lists initially. Therefore, we will
02474 * continue to use hashdump as the internal mechanism for storing and
02475 * reading from property lists, but note that the interface here is
02476 * _not_ dependent on that. We can swap in a DB-based implementation
02477 * at any time and users of this library will never know the
02478 * difference.
02479 */
02480
02481 /** Set @a *props to a hash table mapping <tt>char *</tt> names onto
02482 * <tt>svn_string_t *</tt> values for all the regular properties of
02483 * @a path. Allocate the table, names, and values in @a pool. If
02484 * the node has no properties, an empty hash is returned. @a adm_access
02485 * is an access baton set that contains @a path.
02486 */
02487 svn_error_t *svn_wc_prop_list (apr_hash_t **props,
02488 const char *path,
02489 svn_wc_adm_access_t *adm_access,
02490 apr_pool_t *pool);
02491
02492
02493 /** Set @a *value to the value of property @a name for @a path, allocating
02494 * @a *value in @a pool. If no such prop, set @a *value to @c NULL.
02495 * @a name may be a regular or wc property; if it is an entry property,
02496 * return the error @c SVN_ERR_BAD_PROP_KIND. @a adm_access is an access
02497 * baton set that contains @a path.
02498 */
02499 svn_error_t *svn_wc_prop_get (const svn_string_t **value,
02500 const char *name,
02501 const char *path,
02502 svn_wc_adm_access_t *adm_access,
02503 apr_pool_t *pool);
02504
02505 /**
02506 * Set property @a name to @a value for @a path, or if @a value is
02507 * null, remove property @a name from @a path. @a adm_access is an
02508 * access baton with a write lock for @a path.
02509 *
02510 * If @a skip_checks is true, do no validity checking. But if @a
02511 * skip_checks is false, and @a name is not a valid property for @a
02512 * path, return an error, either @c SVN_ERR_ILLEGAL_TARGET (if the
02513 * property is not appropriate for @a path), or @c
02514 * SVN_ERR_BAD_MIME_TYPE (if @a name is "svn:mime-type", but @a value
02515 * is not a valid mime-type).
02516 *
02517 * @a name may be a wc property or a regular property; but if it is an
02518 * entry property, return the error @c SVN_ERR_BAD_PROP_KIND, even if
02519 * @a skip_checks is true.
02520 *
02521 * Use @a pool for temporary allocation.
02522 *
02523 * @since New in 1.2.
02524 */
02525 svn_error_t *svn_wc_prop_set2 (const char *name,
02526 const svn_string_t *value,
02527 const char *path,
02528 svn_wc_adm_access_t *adm_access,
02529 svn_boolean_t skip_checks,
02530 apr_pool_t *pool);
02531
02532
02533 /**
02534 * Like svn_wc_prop_set2(), but with @a skip_checks always false.
02535 *
02536 * @deprecated Provided for backward compatibility with the 1.1 API.
02537 */
02538 svn_error_t *svn_wc_prop_set (const char *name,
02539 const svn_string_t *value,
02540 const char *path,
02541 svn_wc_adm_access_t *adm_access,
02542 apr_pool_t *pool);
02543
02544
02545 /** Return true iff @a name is a 'normal' property name. 'Normal' is
02546 * defined as a user-visible and user-tweakable property that shows up
02547 * when you fetch a proplist.
02548 *
02549 * The function currently parses the namespace like so:
02550 *
02551 * - 'svn:wc:' ==> a wcprop, stored/accessed separately via different API.
02552 *
02553 * - 'svn:entry:' ==> an "entry" prop, shunted into the 'entries' file.
02554 *
02555 * If these patterns aren't found, then the property is assumed to be
02556 * Normal.
02557 */
02558 svn_boolean_t svn_wc_is_normal_prop (const char *name);
02559
02560
02561
02562 /** Return true iff @a name is a 'wc' property name. */
02563 svn_boolean_t svn_wc_is_wc_prop (const char *name);
02564
02565 /** Return true iff @a name is a 'entry' property name. */
02566 svn_boolean_t svn_wc_is_entry_prop (const char *name);
02567
02568
02569
02570
02571 /* Diffs */
02572
02573
02574 /**
02575 * Return an @a editor/@a edit_baton for diffing a working copy against the
02576 * repository.
02577 *
02578 * @a anchor/@a target represent the base of the hierarchy to be compared.
02579 *
02580 * @a callbacks/@a callback_baton is the callback table to use when two
02581 * files are to be compared.
02582 *
02583 * @a recurse determines whether to descend into subdirectories when @a target
02584 * is a directory. If @a recurse is @c TRUE then @a anchor should be part of
02585 * an access baton set for the @a target hierarchy.
02586 *
02587 * @a ignore_ancestry determines whether paths that have discontinuous node
02588 * ancestry are treated as delete/add or as simple modifications. If
02589 * @a ignore_ancestry is @c FALSE, then any discontinuous node ancestry will
02590 * result in the diff given as a full delete followed by an add.
02591 *
02592 * If @a use_text_base is true, then compare the repository against
02593 * the working copy's text-base files, rather than the working files.
02594 *
02595 * Normally, the difference from repository->working_copy is shown.
02596 * If @ reverse_order is true, then show working_copy->repository diffs.
02597 *
02598 * If @a cancel_func is non-null, it will be used along with @a cancel_baton
02599 * to periodically check if the client has canceled the operation.
02600 *
02601 * @since New in 1.2.
02602 */
02603 svn_error_t *svn_wc_get_diff_editor3 (svn_wc_adm_access_t *anchor,
02604 const char *target,
02605 const svn_wc_diff_callbacks2_t *callbacks,
02606 void *callback_baton,
02607 svn_boolean_t recurse,
02608 svn_boolean_t ignore_ancestry,
02609 svn_boolean_t use_text_base,
02610 svn_boolean_t reverse_order,
02611 svn_cancel_func_t cancel_func,
02612 void *cancel_baton,
02613 const svn_delta_editor_t **editor,
02614 void **edit_baton,
02615 apr_pool_t *pool);
02616
02617
02618 /**
02619 * Similar to svn_wc_get_diff_editor3(), but with an
02620 * @c svn_wc_diff_callbacks_t instead of @c svn_wc_diff_callbacks2_t.
02621 *
02622 * @deprecated Provided for backward compatibility with the 1.1 API.
02623 */
02624 svn_error_t *svn_wc_get_diff_editor2 (svn_wc_adm_access_t *anchor,
02625 const char *target,
02626 const svn_wc_diff_callbacks_t *callbacks,
02627 void *callback_baton,
02628 svn_boolean_t recurse,
02629 svn_boolean_t ignore_ancestry,
02630 svn_boolean_t use_text_base,
02631 svn_boolean_t reverse_order,
02632 svn_cancel_func_t cancel_func,
02633 void *cancel_baton,
02634 const svn_delta_editor_t **editor,
02635 void **edit_baton,
02636 apr_pool_t *pool);
02637
02638
02639 /**
02640 * Similar to svn_wc_get_diff_editor2(), but with @a ignore_ancestry
02641 * always set to @c FALSE.
02642 *
02643 * @deprecated Provided for backward compatibility with the 1.0 API.
02644 */
02645 svn_error_t *svn_wc_get_diff_editor (svn_wc_adm_access_t *anchor,
02646 const char *target,
02647 const svn_wc_diff_callbacks_t *callbacks,
02648 void *callback_baton,
02649 svn_boolean_t recurse,
02650 svn_boolean_t use_text_base,
02651 svn_boolean_t reverse_order,
02652 svn_cancel_func_t cancel_func,
02653 void *cancel_baton,
02654 const svn_delta_editor_t **editor,
02655 void **edit_baton,
02656 apr_pool_t *pool);
02657
02658
02659 /**
02660 * Compare working copy against the text-base.
02661 *
02662 * @a anchor/@a target represent the base of the hierarchy to be compared.
02663 *
02664 * @a callbacks/@a callback_baton is the callback table to use when two
02665 * files are to be compared.
02666 *
02667 * @a recurse determines whether to descend into subdirectories when @a target
02668 * is a directory. If @a recurse is @c TRUE then @a anchor should be part of
02669 * an access baton set for the @a target hierarchy.
02670 *
02671 * @a ignore_ancestry determines whether paths that have discontinuous node
02672 * ancestry are treated as delete/add or as simple modifications. If
02673 * @a ignore_ancestry is @c FALSE, then any discontinuous node ancestry will
02674 * result in the diff given as a full delete followed by an add.
02675 *
02676 * @since New in 1.2.
02677 */
02678 svn_error_t *svn_wc_diff3 (svn_wc_adm_access_t *anchor,
02679 const char *target,
02680 const svn_wc_diff_callbacks2_t *callbacks,
02681 void *callback_baton,
02682 svn_boolean_t recurse,
02683 svn_boolean_t ignore_ancestry,
02684 apr_pool_t *pool);
02685
02686 /**
02687 * Similar to svn_wc_diff3(), but with a @c svn_wc_diff_callbacks_t argument
02688 * instead of @c svn_wc_diff_callbacks2_t.
02689 *
02690 * @deprecated Provided for backward compatibility with the 1.1 API.
02691 */
02692 svn_error_t *svn_wc_diff2 (svn_wc_adm_access_t *anchor,
02693 const char *target,
02694 const svn_wc_diff_callbacks_t *callbacks,
02695 void *callback_baton,
02696 svn_boolean_t recurse,
02697 svn_boolean_t ignore_ancestry,
02698 apr_pool_t *pool);
02699
02700 /**
02701 * Similar to svn_wc_diff2(), but with @a ignore_ancestry always set
02702 * to @c FALSE.
02703 *
02704 * @deprecated Provided for backward compatibility with the 1.0 API.
02705 */
02706 svn_error_t *svn_wc_diff (svn_wc_adm_access_t *anchor,
02707 const char *target,
02708 const svn_wc_diff_callbacks_t *callbacks,
02709 void *callback_baton,
02710 svn_boolean_t recurse,
02711 apr_pool_t *pool);
02712
02713
02714 /** Given a @a path to a file or directory under version control, discover
02715 * any local changes made to properties and/or the set of 'pristine'
02716 * properties. @a adm_access is an access baton set for @a path.
02717 *
02718 * If @a propchanges is non-@c NULL, return these changes as an array of
02719 * @c svn_prop_t structures stored in @a *propchanges. The structures and
02720 * array will be allocated in @a pool. If there are no local property
02721 * modifications on @a path, then set @a *propchanges to @c NULL.
02722 *
02723 * If @a original_props is non-@c NULL, then set @a *original_props to
02724 * hashtable (<tt>const char *name</tt> -> <tt>const svn_string_t *value</tt>)
02725 * that represents the 'pristine' property list of @a path. This hashtable is
02726 * allocated in @a pool, and can be used to compare old and new values of
02727 * properties.
02728 */
02729 svn_error_t *svn_wc_get_prop_diffs (apr_array_header_t **propchanges,
02730 apr_hash_t **original_props,
02731 const char *path,
02732 svn_wc_adm_access_t *adm_access,
02733 apr_pool_t *pool);
02734
02735
02736 /** The outcome of a merge carried out (or tried as a dry-run) by
02737 * svn_wc_merge()
02738 */
02739 typedef enum svn_wc_merge_outcome_t
02740 {
02741 /** The working copy is (or would be) unchanged. The changes to be
02742 * merged were already present in the working copy
02743 */
02744 svn_wc_merge_unchanged,
02745
02746 /** The working copy has been (or would be) changed. */
02747 svn_wc_merge_merged,
02748
02749 /** The working copy has been (or would be) changed, but there was (or
02750 * would be) a conflict
02751 */
02752 svn_wc_merge_conflict,
02753
02754 /** No merge was performed, probably because the target file was
02755 * either absent or not under version control.
02756 */
02757 svn_wc_merge_no_merge
02758
02759 } svn_wc_merge_outcome_t;
02760
02761 /** Given paths to three fulltexts, merge the differences between @a left
02762 * and @a right into @a merge_target. (It may help to know that @a left,
02763 * @a right, and @a merge_target correspond to "OLDER", "YOURS", and "MINE",
02764 * respectively, in the diff3 documentation.) Use @a pool for any
02765 * temporary allocation.
02766 *
02767 * @a adm_access is an access baton with a write lock for the directory
02768 * containing @a merge_target.
02769 *
02770 * This function assumes that @a left and @a right are in repository-normal
02771 * form (linefeeds, with keywords contracted); if necessary,
02772 * @a merge_target is temporarily converted to this form to receive the
02773 * changes, then translated back again.
02774 *
02775 * If @a merge_target is absent, or present but not under version
02776 * control, then set @a *merge_outcome to @c svn_wc_merge_no_merge and
02777 * return success without merging anything. (The reasoning is that if
02778 * the file is not versioned, then it is probably unrelated to the
02779 * changes being considered, so they should not be merged into it.)
02780 *
02781 * @a dry_run determines whether the working copy is modified. When it
02782 * is @c FALSE the merge will cause @a merge_target to be modified, when it
02783 * is @c TRUE the merge will be carried out to determine the result but
02784 * @a merge_target will not be modified.
02785 *
02786 * If @a diff3_cmd is non-null, then use it as the diff3 command for
02787 * any merging; otherwise, use the built-in merge code.
02788 *
02789 * The outcome of the merge is returned in @a *merge_outcome. If there is
02790 * a conflict and @a dry_run is @c FALSE, then
02791 *
02792 * * Put conflict markers around the conflicting regions in
02793 * @a merge_target, labeled with @a left_label, @a right_label, and
02794 * @a target_label. (If any of these labels are @c NULL, default
02795 * values will be used.)
02796 *
02797 * * Copy @a left, @a right, and the original @a merge_target to unique
02798 * names in the same directory as @a merge_target, ending with the
02799 * suffixes ".LEFT_LABEL", ".RIGHT_LABEL", and ".TARGET_LABEL"
02800 * respectively.
02801 *
02802 * * Mark the entry for @a merge_target as "conflicted", and track the
02803 * above mentioned backup files in the entry as well.
02804 *
02805 * Binary case:
02806 *
02807 * If @a merge_target is a binary file, then no merging is attempted,
02808 * the merge is deemed to be a conflict. If @a dry_run is @c FALSE the
02809 * working @a merge_target is untouched, and copies of @a left and
02810 * @a right are created next to it using @a left_label and @a right_label.
02811 * @a merge_target's entry is marked as "conflicted", and begins
02812 * tracking the two backup files. If @a dry_run is @c TRUE no files are
02813 * changed. The outcome of the merge is returned in @a *merge_outcome.
02814 */
02815 svn_error_t *svn_wc_merge (const char *left,
02816 const char *right,
02817 const char *merge_target,
02818 svn_wc_adm_access_t *adm_access,
02819 const char *left_label,
02820 const char *right_label,
02821 const char *target_label,
02822 svn_boolean_t dry_run,
02823 enum svn_wc_merge_outcome_t *merge_outcome,
02824 const char *diff3_cmd,
02825 apr_pool_t *pool);
02826
02827
02828 /** Given a @a path under version control, merge an array of @a
02829 * propchanges into the path's existing properties. @a propchanges is
02830 * an array of @c svn_prop_t objects, and @a baseprops is a hash
02831 * representing the original set of properties that @a propchanges is
02832 * working against. @a adm_access is an access baton for the directory
02833 * containing @a path.
02834 *
02835 * If @a base_merge is @c FALSE only the working properties will be changed,
02836 * if it is @c TRUE both the base and working properties will be changed.
02837 *
02838 * If @a state is non-null, set @a *state to the state of the properties
02839 * after the merge.
02840 *
02841 * If conflicts are found when merging working properties, they are
02842 * described in a temporary .prej file (or appended to an already-existing
02843 * .prej file), and the entry is marked "conflicted". Base properties
02844 * are changed unconditionally, if @a base_merge is @c TRUE, they never result
02845 * in a conflict.
02846 *
02847 * If @a path is not under version control, return the error
02848 * SVN_ERR_UNVERSIONED_RESOURCE and don't touch anyone's properties.
02849 *
02850 * @since New in 1.3.
02851 */
02852 svn_error_t *
02853 svn_wc_merge_props (svn_wc_notify_state_t *state,
02854 const char *path,
02855 svn_wc_adm_access_t *adm_access,
02856 apr_hash_t *baseprops,
02857 const apr_array_header_t *propchanges,
02858 svn_boolean_t base_merge,
02859 svn_boolean_t dry_run,
02860 apr_pool_t *pool);
02861
02862
02863 /**
02864 * Similar to svn_wc_merge_props(), but no baseprops are given.
02865 * Instead, it's assumed that the incoming propchanges are based
02866 * against the working copy's own baseprops. While this assumption is
02867 * correct for 'svn update', it's incorrect for 'svn merge', and can
02868 * cause flawed behavior. (See issue #2035.)
02869 *
02870 * @deprecated Provided for backward compatibility with the 1.2 API.
02871 */
02872 svn_error_t *
02873 svn_wc_merge_prop_diffs (svn_wc_notify_state_t *state,
02874 const char *path,
02875 svn_wc_adm_access_t *adm_access,
02876 const apr_array_header_t *propchanges,
02877 svn_boolean_t base_merge,
02878 svn_boolean_t dry_run,
02879 apr_pool_t *pool);
02880
02881
02882
02883 /** Given a @a path to a wc file, return a @a pristine_path which points to a
02884 * pristine version of the file. This is needed so clients can do
02885 * diffs. If the WC has no text-base, return a @c NULL instead of a
02886 * path.
02887 */
02888 svn_error_t *svn_wc_get_pristine_copy_path (const char *path,
02889 const char **pristine_path,
02890 apr_pool_t *pool);
02891
02892
02893 /**
02894 * Recurse from @a path, cleaning up unfinished log business. Perform
02895 * necessary allocations in @a pool. Any working copy locks under @a path
02896 * will be taken over and then cleared by this function. If @a diff3_cmd
02897 * is non-null, then use it as the diff3 command for any merging; otherwise,
02898 * use the built-in merge code.
02899 *
02900 * WARNING: there is no mechanism that will protect locks that are still
02901 * being used.
02902 *
02903 * If @a cancel_func is non-null, invoke it with @a cancel_baton at
02904 * various points during the operation. If it returns an error
02905 * (typically @c SVN_ERR_CANCELLED), return that error immediately.
02906 *
02907 * @since New in 1.2.
02908 */
02909 svn_error_t *
02910 svn_wc_cleanup2 (const char *path,
02911 const char *diff3_cmd,
02912 svn_cancel_func_t cancel_func,
02913 void *cancel_baton,
02914 apr_pool_t *pool);
02915
02916 /**
02917 * Similar to svn_wc_cleanup2(). @a optional_adm_access is an historic
02918 * relic and not used, it may be NULL.
02919 *
02920 * @deprecated Provided for backward compatibility with the 1.1 API.
02921 */
02922 svn_error_t *
02923 svn_wc_cleanup (const char *path,
02924 svn_wc_adm_access_t *optional_adm_access,
02925 const char *diff3_cmd,
02926 svn_cancel_func_t cancel_func,
02927 void *cancel_baton,
02928 apr_pool_t *pool);
02929
02930
02931 /** Relocation validation callback typedef.
02932 *
02933 * Called for each relocated file/directory. @a uuid contains the
02934 * expected repository UUID, @a url contains the tentative URL.
02935 *
02936 * @a baton is a closure object; it should be provided by the
02937 * implementation, and passed by the caller.
02938 */
02939 typedef svn_error_t *(*svn_wc_relocation_validator_t) (void *baton,
02940 const char *uuid,
02941 const char *url);
02942
02943
02944 /** Change repository references at @a path that begin with @a from
02945 * to begin with @a to instead. Perform necessary allocations in @a pool.
02946 * If @a recurse is true, do so. @a validator (and its baton,
02947 * @a validator_baton), will be called for each newly generated URL.
02948 *
02949 * @a adm_access is an access baton for the directory containing
02950 * @a path.
02951 */
02952 svn_error_t *
02953 svn_wc_relocate (const char *path,
02954 svn_wc_adm_access_t *adm_access,
02955 const char *from,
02956 const char *to,
02957 svn_boolean_t recurse,
02958 svn_wc_relocation_validator_t validator,
02959 void *validator_baton,
02960 apr_pool_t *pool);
02961
02962
02963 /**
02964 * Revert changes to @a path (perhaps in a @a recursive fashion). Perform
02965 * necessary allocations in @a pool.
02966 *
02967 * @a parent_access is an access baton for the directory containing @a path,
02968 * unless @a path is a wc root, in which case @a parent_access refers to
02969 * @a path itself.
02970 *
02971 * If @a cancel_func is non-null, call it with @a cancel_baton at
02972 * various points during the reversion process. If it returns an
02973 * error (typically @c SVN_ERR_CANCELLED), return that error
02974 * immediately.
02975 *
02976 * If @a use_commit_times is TRUE, then all reverted working-files
02977 * will have their timestamp set to the last-committed-time. If
02978 * FALSE, the reverted working-files will be touched with the 'now' time.
02979 *
02980 * For each item reverted, @a notify_func will be called with @a notify_baton
02981 * and the path of the reverted item. @a notify_func may be @c NULL if this
02982 * notification is not needed.
02983 *
02984 * If @a path is not under version control, return the error
02985 * SVN_ERR_UNVERSIONED_RESOURCE.
02986 *
02987 * @since New in 1.2.
02988 */
02989 svn_error_t *
02990 svn_wc_revert2 (const char *path,
02991 svn_wc_adm_access_t *parent_access,
02992 svn_boolean_t recursive,
02993 svn_boolean_t use_commit_times,
02994 svn_cancel_func_t cancel_func,
02995 void *cancel_baton,
02996 svn_wc_notify_func2_t notify_func,
02997 void *notify_baton,
02998 apr_pool_t *pool);
02999
03000 /**
03001 * Similar to svn_wc_revert2(), but takes an @c svn_wc_notify_func_t instead.
03002 *
03003 * @deprecated Provided for backward compatibility with the 1.1 API.
03004 */
03005 svn_error_t *
03006 svn_wc_revert (const char *path,
03007 svn_wc_adm_access_t *parent_access,
03008 svn_boolean_t recursive,
03009 svn_boolean_t use_commit_times,
03010 svn_cancel_func_t cancel_func,
03011 void *cancel_baton,
03012 svn_wc_notify_func_t notify_func,
03013 void *notify_baton,
03014 apr_pool_t *pool);
03015
03016
03017 /* Tmp files */
03018
03019 /** Create a unique temporary file in administrative tmp/ area of
03020 * directory @a path. Return a handle in @a *fp.
03021 *
03022 * The flags will be <tt>APR_WRITE | APR_CREATE | APR_EXCL</tt> and
03023 * optionally @c APR_DELONCLOSE (if the @a delete_on_close argument is
03024 * set @c TRUE).
03025 *
03026 * This means that as soon as @a fp is closed, the tmp file will vanish.
03027 */
03028 svn_error_t *
03029 svn_wc_create_tmp_file (apr_file_t **fp,
03030 const char *path,
03031 svn_boolean_t delete_on_close,
03032 apr_pool_t *pool);
03033
03034
03035
03036 /* EOL conversion and keyword expansion. */
03037
03038 /** Set @a *xlated_p to a path to a possibly translated copy of versioned
03039 * file @a vfile, or to @a vfile itself if no translation is necessary.
03040 * That is, if @a vfile's properties indicate newline conversion or
03041 * keyword expansion, point @a *xlated_p to a copy of @a vfile whose
03042 * newlines are unconverted and keywords contracted, in whatever
03043 * manner is indicated by @a vfile's properties; otherwise, set @a *xlated_p
03044 * to @a vfile.
03045 *
03046 * If @a force_repair is set, the translated file will have any
03047 * inconsistent line endings repaired. This should only be used when
03048 * the resultant file is being created for comparison against @a vfile's
03049 * text base.
03050 *
03051 * Caller is responsible for detecting if they are different (pointer
03052 * comparison is sufficient), and for removing @a *xlated_p if
03053 * necessary.
03054 *
03055 * This function is generally used to get a file that can be compared
03056 * meaningfully against @a vfile's text base.
03057 *
03058 * If @a *xlated_p is different from @a vfile, then choose @a *xlated_p's
03059 * name using svn_io_open_unique_file() with @c SVN_WC__TMP_EXT, and
03060 * allocate it in @a pool. Also use @a pool for any temporary allocation.
03061 *
03062 * If an error is returned, the effect on @a *xlated_p is undefined.
03063 */
03064 svn_error_t *svn_wc_translated_file (const char **xlated_p,
03065 const char *vfile,
03066 svn_wc_adm_access_t *adm_access,
03067 svn_boolean_t force_repair,
03068 apr_pool_t *pool);
03069
03070
03071
03072 /* Text/Prop Deltas Using an Editor */
03073
03074
03075 /** Send the local modifications for versioned file @a path (with
03076 * matching @a file_baton) through @a editor, then close @a file_baton
03077 * afterwards. Use @a pool for any temporary allocation and
03078 * @a adm_access as an access baton for @a path.
03079 *
03080 * This process creates a copy of @a path with keywords and eol
03081 * untranslated. If @a tempfile is non-null, set @a *tempfile to the
03082 * path to this copy. Do not clean up the copy; caller can do that.
03083 * (The purpose of handing back the tmp copy is that it is usually about
03084 * to become the new text base anyway, but the installation of the new
03085 * text base is outside the scope of this function.)
03086 *
03087 * If @a fulltext, send the untranslated copy of @a path through @a editor
03088 * as full-text; else send it as svndiff against the current text base.
03089 *
03090 * If sending a diff, and the recorded checksum for @a path's text-base
03091 * does not match the current actual checksum, then remove the tmp
03092 * copy (and set @a *tempfile to null if appropriate), and return the
03093 * error @c SVN_ERR_WC_CORRUPT_TEXT_BASE.
03094 *
03095 * @note This is intended for use with both infix and postfix
03096 * text-delta styled editor drivers.
03097 */
03098 svn_error_t *svn_wc_transmit_text_deltas (const char *path,
03099 svn_wc_adm_access_t *adm_access,
03100 svn_boolean_t fulltext,
03101 const svn_delta_editor_t *editor,
03102 void *file_baton,
03103 const char **tempfile,
03104 apr_pool_t *pool);
03105
03106
03107 /** Given a @a path with its accompanying @a entry, transmit all local
03108 * property modifications using the appropriate @a editor method (in
03109 * conjunction with @a baton). @a adm_access is an access baton set
03110 * that contains @a path. Use @a pool for all allocations.
03111 *
03112 * If a temporary file remains after this function is finished, the
03113 * path to that file is returned in @a *tempfile (so the caller can
03114 * clean this up if it wishes to do so).
03115 */
03116 svn_error_t *svn_wc_transmit_prop_deltas (const char *path,
03117 svn_wc_adm_access_t *adm_access,
03118 const svn_wc_entry_t *entry,
03119 const svn_delta_editor_t *editor,
03120 void *baton,
03121 const char **tempfile,
03122 apr_pool_t *pool);
03123
03124
03125 /** Get the run-time configured list of ignore patterns from the
03126 * @c svn_config_t's in the @a config hash, and store them in @a *patterns.
03127 * Allocate @a *patterns and its contents in @a pool.
03128 */
03129 svn_error_t *svn_wc_get_default_ignores (apr_array_header_t **patterns,
03130 apr_hash_t *config,
03131 apr_pool_t *pool);
03132
03133 /** Get the list of ignore patterns from the @c svn_config_t's in the
03134 * @a config hash and the local ignore patterns from the directory
03135 * in @a adm_access, and store them in @a *patterns.
03136 * Allocate @a *patterns and its contents in @a pool.
03137 *
03138 * @since New in 1.3.
03139 */
03140 svn_error_t *svn_wc_get_ignores (apr_array_header_t **patterns,
03141 apr_hash_t *config,
03142 svn_wc_adm_access_t *adm_access,
03143 apr_pool_t *pool);
03144
03145
03146 /** Add @a lock to the working copy for @a path. @a adm_access must contain
03147 * a write lock for @a path. If @a path is read-only, due to locking
03148 * properties, make it writable. Perform temporary allocations in @a
03149 * pool. */
03150 svn_error_t *svn_wc_add_lock (const char *path, const svn_lock_t *lock,
03151 svn_wc_adm_access_t *adm_access,
03152 apr_pool_t *pool);
03153
03154 /** Remove any lock from @a path. @a adm_access must contain a
03155 * write-lock for @a path. If @a path has a lock and the locking
03156 * so specifies, make the file read-only. Don't return an error if @a
03157 * path didn't have a lock. Perform temporary allocations in @a pool. */
03158 svn_error_t *svn_wc_remove_lock (const char *path,
03159 svn_wc_adm_access_t *adm_access,
03160 apr_pool_t *pool);
03161
03162
03163 #ifdef __cplusplus
03164 }
03165 #endif /* __cplusplus */
03166
03167 #endif /* SVN_WC_H */
1.2.14 written by Dimitri van Heesch,
© 1997-2002