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