00001 /** 00002 * @copyright 00003 * ==================================================================== 00004 * Copyright (c) 2000-2007 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 Subversion's working copy library 00020 * 00021 * Requires: 00022 * - A working copy 00023 * 00024 * Provides: 00025 * - Ability to manipulate working copy's versioned data. 00026 * - Ability to manipulate working copy's administrative files. 00027 * 00028 * Used By: 00029 * - Clients. 00030 */ 00031 00032 #ifndef SVN_WC_H 00033 #define SVN_WC_H 00034 00035 00036 #include <apr.h> 00037 #include <apr_pools.h> 00038 #include <apr_tables.h> 00039 #include <apr_hash.h> 00040 00041 #include "svn_types.h" 00042 #include "svn_string.h" 00043 #include "svn_delta.h" 00044 #include "svn_error.h" 00045 #include "svn_opt.h" 00046 #include "svn_ra.h" /* for svn_ra_reporter_t type */ 00047 00048 #ifdef __cplusplus 00049 extern "C" { 00050 #endif /* __cplusplus */ 00051 00052 00053 /** 00054 * Get libsvn_wc version information. 00055 * 00056 * @since New in 1.1. 00057 */ 00058 const svn_version_t *svn_wc_version(void); 00059 00060 /** 00061 * @defgroup svn_wc Working copy management 00062 * @{ 00063 */ 00064 00065 /** Flags for use with svn_wc_translated_file2 00066 * 00067 * @defgroup translate_flags Translation flags 00068 * 00069 * @{ 00070 */ 00071 00072 /** Translate from Normal Form. 00073 * 00074 * The working copy text bases and repository files are stored 00075 * in normal form. Some files' contents - or ever representation - 00076 * differs between the working copy and the normal form. This flag 00077 * specifies to take the latter form as input and transform it 00078 * to the former. 00079 * 00080 * Either this flag or @c SVN_WC_TRANSLATE_TO_NF should be specified, 00081 * but not both. 00082 */ 00083 #define SVN_WC_TRANSLATE_FROM_NF 0x00000000 00084 00085 /** Translate to Normal Form. 00086 * 00087 * Either this flag or @c SVN_WC_TRANSLATE_FROM_NF should be specified, 00088 * but not both. 00089 */ 00090 #define SVN_WC_TRANSLATE_TO_NF 0x00000001 00091 00092 /** Force repair of eol styles, making sure the output file consistently 00093 * contains the one eol style as specified by the svn:eol-style 00094 * property and the required translation direction. 00095 * 00096 */ 00097 #define SVN_WC_TRANSLATE_FORCE_EOL_REPAIR 0x00000002 00098 00099 /** Don't register a pool cleanup to delete the output file */ 00100 #define SVN_WC_TRANSLATE_NO_OUTPUT_CLEANUP 0x00000004 00101 00102 /** Guarantee a new file is created on successful return. 00103 * The default shortcuts translation by returning the path 00104 * of the untranslated file when no translation is required. 00105 */ 00106 #define SVN_WC_TRANSLATE_FORCE_COPY 0x00000008 00107 00108 /** Use a non-wc-local tmp directory for creating output files, 00109 * instead of in the working copy admin tmp area which is the default. 00110 * 00111 * @since New in 1.4. 00112 */ 00113 #define SVN_WC_TRANSLATE_USE_GLOBAL_TMP 0x00000010 00114 00115 /** @} */ 00116 00117 00118 /* Locking/Opening/Closing */ 00119 00120 /** Baton for access to a working copy administrative area. 00121 * 00122 * One day all such access will require a baton, we're not there yet. 00123 * 00124 * Access batons can be grouped into sets, by passing an existing open 00125 * baton when opening a new baton. Given one baton in a set, other batons 00126 * may be retrieved. This allows an entire hierarchy to be locked, and 00127 * then the set of batons can be passed around by passing a single baton. 00128 */ 00129 typedef struct svn_wc_adm_access_t svn_wc_adm_access_t; 00130 00131 00132 /** 00133 * Return, in @a *adm_access, a pointer to a new access baton for the working 00134 * copy administrative area associated with the directory @a path. If 00135 * @a write_lock is TRUE the baton will include a write lock, otherwise the 00136 * baton can only be used for read access. If @a path refers to a directory 00137 * that is already write locked then the error @c SVN_ERR_WC_LOCKED will be 00138 * returned. The error @c SVN_ERR_WC_NOT_DIRECTORY will be returned if 00139 * @a path is not a versioned directory. 00140 * 00141 * If @a associated is an open access baton then @a adm_access will be added 00142 * to the set containing @a associated. @a associated can be @c NULL, in 00143 * which case @a adm_access is the start of a new set. 00144 * 00145 * @a levels_to_lock specifies how far to lock. Zero means just the specified 00146 * directory. Any negative value means to lock the entire working copy 00147 * directory hierarchy under @a path. A positive value indicates the number of 00148 * levels of directories to lock -- 1 means just immediate subdirectories, 2 00149 * means immediate subdirectories and their subdirectories, etc. All the 00150 * access batons will become part of the set containing @a adm_access. This 00151 * is an all-or-nothing option, if it is not possible to lock all the 00152 * requested directories then an error will be returned and @a adm_access will 00153 * be invalid, with the exception that subdirectories of @a path that are 00154 * missing from the physical filesystem will not be locked and will not cause 00155 * an error. The error @c SVN_ERR_WC_LOCKED will be returned if a 00156 * subdirectory of @a path is already write locked. 00157 * 00158 * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine 00159 * if the client has cancelled the operation. 00160 * 00161 * @a pool will be used to allocate memory for the baton and any subsequently 00162 * cached items. If @a adm_access has not been closed when the pool is 00163 * cleared, it will be closed automatically at that point, and removed from 00164 * its set. A baton closed in this way will not remove physical locks from 00165 * the working copy if cleanup is required. 00166 * 00167 * The first baton in a set, with @a associated passed as @c NULL, must have 00168 * the longest lifetime of all the batons in the set. This implies it must be 00169 * the root of the hierarchy. 00170 * 00171 * @since New in 1.2. 00172 */ 00173 svn_error_t * 00174 svn_wc_adm_open3(svn_wc_adm_access_t **adm_access, 00175 svn_wc_adm_access_t *associated, 00176 const char *path, 00177 svn_boolean_t write_lock, 00178 int levels_to_lock, 00179 svn_cancel_func_t cancel_func, 00180 void *cancel_baton, 00181 apr_pool_t *pool); 00182 00183 /** 00184 * Similar to svn_wc_adm_open3(), but without cancellation support. 00185 * 00186 * @deprecated Provided for backward compatibility with the 1.1 API. 00187 */ 00188 svn_error_t * 00189 svn_wc_adm_open2(svn_wc_adm_access_t **adm_access, 00190 svn_wc_adm_access_t *associated, 00191 const char *path, 00192 svn_boolean_t write_lock, 00193 int levels_to_lock, 00194 apr_pool_t *pool); 00195 00196 /** 00197 * Similar to svn_wc_adm_open2(), but with @a tree_lock instead of 00198 * @a levels_to_lock. @a levels_to_lock is set to -1 if @a tree_lock 00199 * is @c TRUE, else 0. 00200 * 00201 * @deprecated Provided for backward compatibility with the 1.0 API. 00202 */ 00203 svn_error_t * 00204 svn_wc_adm_open(svn_wc_adm_access_t **adm_access, 00205 svn_wc_adm_access_t *associated, 00206 const char *path, 00207 svn_boolean_t write_lock, 00208 svn_boolean_t tree_lock, 00209 apr_pool_t *pool); 00210 00211 /** 00212 * Checks the working copy to determine the node type of @a path. If 00213 * @a path is a versioned directory then the behaviour is like that of 00214 * svn_wc_adm_open3(), otherwise, if @a path is a file or does not 00215 * exist, then the behaviour is like that of svn_wc_adm_open3() with 00216 * @a path replaced by the parent directory of @a path. If @a path is 00217 * an unversioned directory, the behaviour is also like that of 00218 * svn_wc_adm_open3() on the parent, except that if the open fails, 00219 * then the returned SVN_ERR_WC_NOT_DIRECTORY error refers to @a path, 00220 * not to @a path's parent. 00221 * 00222 * @since New in 1.2. 00223 */ 00224 svn_error_t * 00225 svn_wc_adm_probe_open3(svn_wc_adm_access_t **adm_access, 00226 svn_wc_adm_access_t *associated, 00227 const char *path, 00228 svn_boolean_t write_lock, 00229 int levels_to_lock, 00230 svn_cancel_func_t cancel_func, 00231 void *cancel_baton, 00232 apr_pool_t *pool); 00233 00234 /** 00235 * Similar to svn_wc_adm_probe_open3() without the cancel 00236 * functionality. 00237 * 00238 * @deprecated Provided for backward compatibility with the 1.1 API. 00239 */ 00240 svn_error_t * 00241 svn_wc_adm_probe_open2(svn_wc_adm_access_t **adm_access, 00242 svn_wc_adm_access_t *associated, 00243 const char *path, 00244 svn_boolean_t write_lock, 00245 int levels_to_lock, 00246 apr_pool_t *pool); 00247 00248 /** 00249 * Similar to svn_wc_adm_probe_open2(), but with @a tree_lock instead of 00250 * @a levels_to_lock. @a levels_to_lock is set to -1 if @a tree_lock 00251 * is @c TRUE, else 0. 00252 * 00253 * @deprecated Provided for backward compatibility with the 1.0 API. 00254 */ 00255 svn_error_t * 00256 svn_wc_adm_probe_open(svn_wc_adm_access_t **adm_access, 00257 svn_wc_adm_access_t *associated, 00258 const char *path, 00259 svn_boolean_t write_lock, 00260 svn_boolean_t tree_lock, 00261 apr_pool_t *pool); 00262 00263 /** 00264 * Open access batons for @a path and return in @a *anchor_access and 00265 * @a *target the anchor and target required to drive an editor. Return 00266 * in @a *target_access the access baton for the target, which may be the 00267 * same as @a *anchor_access. All the access batons will be in the 00268 * @a *anchor_access set. 00269 * 00270 * @a levels_to_lock determines the levels_to_lock used when opening 00271 * @a path if @a path is a versioned directory, @a levels_to_lock is 00272 * ignored otherwise. If @a write_lock is @c TRUE the access batons 00273 * will hold write locks. 00274 * 00275 * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine 00276 * if the client has cancelled the operation. 00277 * 00278 * This function is essentially a combination of svn_wc_adm_open3() and 00279 * svn_wc_get_actual_target(), with the emphasis on reducing physical IO. 00280 * 00281 * @since New in 1.2. 00282 */ 00283 svn_error_t * 00284 svn_wc_adm_open_anchor(svn_wc_adm_access_t **anchor_access, 00285 svn_wc_adm_access_t **target_access, 00286 const char **target, 00287 const char *path, 00288 svn_boolean_t write_lock, 00289 int levels_to_lock, 00290 svn_cancel_func_t cancel_func, 00291 void *cancel_baton, 00292 apr_pool_t *pool); 00293 00294 /** Return, in @a *adm_access, a pointer to an existing access baton associated 00295 * with @a path. @a path must be a directory that is locked as part of the 00296 * set containing the @a associated access baton. 00297 * 00298 * If the requested access baton is marked as missing in, or is simply 00299 * absent from, @a associated, return SVN_ERR_WC_NOT_LOCKED. 00300 * 00301 * @a pool is used only for local processing, it is not used for the batons. 00302 */ 00303 svn_error_t * 00304 svn_wc_adm_retrieve(svn_wc_adm_access_t **adm_access, 00305 svn_wc_adm_access_t *associated, 00306 const char *path, 00307 apr_pool_t *pool); 00308 00309 /** Check the working copy to determine the node type of @a path. If 00310 * @a path is a versioned directory then the behaviour is like that of 00311 * svn_wc_adm_retrieve(), otherwise, if @a path is a file, an unversioned 00312 * directory, or does not exist, then the behaviour is like that of 00313 * svn_wc_adm_retrieve() with @a path replaced by the parent directory of 00314 * @a path. 00315 */ 00316 svn_error_t * 00317 svn_wc_adm_probe_retrieve(svn_wc_adm_access_t **adm_access, 00318 svn_wc_adm_access_t *associated, 00319 const char *path, 00320 apr_pool_t *pool); 00321 00322 /** 00323 * Try various ways to obtain an access baton for @a path. 00324 * 00325 * First, try to obtain @a *adm_access via svn_wc_adm_probe_retrieve(), 00326 * but if this fails because @a associated can't give a baton for 00327 * @a path or @a path's parent, then try svn_wc_adm_probe_open3(), 00328 * this time passing @a write_lock and @a levels_to_lock. If there is 00329 * still no access because @a path is not a versioned directory, then 00330 * just set @a *adm_access to NULL and return success. But if it is 00331 * because @a path is locked, then return the error @c SVN_ERR_WC_LOCKED, 00332 * and the effect on @a *adm_access is undefined. (Or if the attempt 00333 * fails for any other reason, return the corresponding error, and the 00334 * effect on @a *adm_access is also undefined.) 00335 * 00336 * If svn_wc_adm_probe_open3() succeeds, then add @a *adm_access to 00337 * @a associated. 00338 * 00339 * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine 00340 * if the client has cancelled the operation. 00341 * 00342 * Use @a pool only for local processing, not to allocate @a *adm_access. 00343 * 00344 * @since New in 1.2. 00345 */ 00346 svn_error_t * 00347 svn_wc_adm_probe_try3(svn_wc_adm_access_t **adm_access, 00348 svn_wc_adm_access_t *associated, 00349 const char *path, 00350 svn_boolean_t write_lock, 00351 int levels_to_lock, 00352 svn_cancel_func_t cancel_func, 00353 void *cancel_baton, 00354 apr_pool_t *pool); 00355 00356 /** 00357 * Similar to svn_wc_adm_probe_try3() without the cancel 00358 * functionality. 00359 * 00360 * @deprecated Provided for backward compatibility with the 1.1 API. 00361 */ 00362 svn_error_t * 00363 svn_wc_adm_probe_try2(svn_wc_adm_access_t **adm_access, 00364 svn_wc_adm_access_t *associated, 00365 const char *path, 00366 svn_boolean_t write_lock, 00367 int levels_to_lock, 00368 apr_pool_t *pool); 00369 00370 /** 00371 * Similar to svn_wc_adm_probe_try2(), but with @a tree_lock instead of 00372 * @a levels_to_lock. @a levels_to_lock is set to -1 if @a tree_lock 00373 * is @c TRUE, else 0. 00374 * 00375 * @deprecated Provided for backward compatibility with the 1.0 API. 00376 */ 00377 svn_error_t * 00378 svn_wc_adm_probe_try(svn_wc_adm_access_t **adm_access, 00379 svn_wc_adm_access_t *associated, 00380 const char *path, 00381 svn_boolean_t write_lock, 00382 svn_boolean_t tree_lock, 00383 apr_pool_t *pool); 00384 00385 00386 /** Give up the access baton @a adm_access, and its lock if any. This will 00387 * recursively close any batons in the same set that are direct 00388 * subdirectories of @a adm_access. Any physical locks will be removed from 00389 * the working copy. Lock removal is unconditional, there is no check to 00390 * determine if cleanup is required. 00391 */ 00392 svn_error_t *svn_wc_adm_close(svn_wc_adm_access_t *adm_access); 00393 00394 /** Return the path used to open the access baton @a adm_access */ 00395 const char *svn_wc_adm_access_path(svn_wc_adm_access_t *adm_access); 00396 00397 /** Return the pool used by access baton @a adm_access */ 00398 apr_pool_t *svn_wc_adm_access_pool(svn_wc_adm_access_t *adm_access); 00399 00400 /** Return @c TRUE is the access baton @a adm_access has a write lock, 00401 * @c FALSE otherwise. Compared to svn_wc_locked() this is a cheap, fast 00402 * function that doesn't access the filesystem. 00403 */ 00404 svn_boolean_t svn_wc_adm_locked(svn_wc_adm_access_t *adm_access); 00405 00406 /** Set @a *locked to non-zero if @a path is locked, else set it to zero. */ 00407 svn_error_t * 00408 svn_wc_locked(svn_boolean_t *locked, 00409 const char *path, 00410 apr_pool_t *pool); 00411 00412 00413 /** 00414 * Return @c TRUE if @a name is the name of the WC administrative 00415 * directory. Use @a pool for any temporary allocations. Only works 00416 * with base directory names, not paths or URIs. 00417 * 00418 * For compatibility, the default name (.svn) will always be treated 00419 * as an admin dir name, even if the working copy is actually using an 00420 * alternative name. 00421 * 00422 * @since New in 1.3. 00423 */ 00424 svn_boolean_t svn_wc_is_adm_dir(const char *name, apr_pool_t *pool); 00425 00426 00427 /** 00428 * Return the name of the administrative directory. 00429 * Use @a pool for any temporary allocations. 00430 * 00431 * The returned pointer will refer to either a statically allocated 00432 * string, or to a string allocated in @a pool. 00433 * 00434 * @since New in 1.3. 00435 */ 00436 const char *svn_wc_get_adm_dir(apr_pool_t *pool); 00437 00438 00439 /** 00440 * Use @a name for the administrative directory in the working copy. 00441 * Use @a pool for any temporary allocations. 00442 * 00443 * The list of valid names is limited. Currently only ".svn" (the 00444 * default) and "_svn" are allowed. 00445 * 00446 * @note This function changes global (per-process) state and must be 00447 * called in a single-threaded context during the initialization of a 00448 * Subversion client. 00449 * 00450 * @since New in 1.3. 00451 */ 00452 svn_error_t *svn_wc_set_adm_dir(const char *name, apr_pool_t *pool); 00453 00454 00455 00456 /** Traversal information is information gathered by a working copy 00457 * crawl or update. For example, the before and after values of the 00458 * svn:externals property are important after an update, and since 00459 * we're traversing the working tree anyway (a complete traversal 00460 * during the initial crawl, and a traversal of changed paths during 00461 * the checkout/update/switch), it makes sense to gather the 00462 * property's values then instead of making a second pass. 00463 */ 00464 typedef struct svn_wc_traversal_info_t svn_wc_traversal_info_t; 00465 00466 00467 /** Return a new, empty traversal info object, allocated in @a pool. */ 00468 svn_wc_traversal_info_t *svn_wc_init_traversal_info(apr_pool_t *pool); 00469 00470 00471 /** Set @a *externals_old and @a *externals_new to hash tables representing 00472 * changes to values of the svn:externals property on directories 00473 * traversed by @a traversal_info. 00474 * 00475 * @a traversal_info is obtained from svn_wc_init_traversal_info(), but is 00476 * only useful after it has been passed through another function, such 00477 * as svn_wc_crawl_revisions(), svn_wc_get_update_editor(), 00478 * svn_wc_get_switch_editor(), etc. 00479 * 00480 * Each hash maps <tt>const char *</tt> directory names onto 00481 * <tt>const char *</tt> values of the externals property for that directory. 00482 * The dir names are full paths -- that is, anchor plus target, not target 00483 * alone. The values are not parsed, they are simply copied raw, and are 00484 * never NULL: directories that acquired or lost the property are 00485 * simply omitted from the appropriate table. Directories whose value 00486 * of the property did not change show the same value in each hash. 00487 * 00488 * The hashes, keys, and values have the same lifetime as @a traversal_info. 00489 */ 00490 void 00491 svn_wc_edited_externals(apr_hash_t **externals_old, 00492 apr_hash_t **externals_new, 00493 svn_wc_traversal_info_t *traversal_info); 00494 00495 00496 /** Set @a *depths to a hash table mapping <tt>const char *</tt> 00497 * directory names (directories traversed by @a traversal_info) to 00498 * <tt>const char *</tt> values (the depths of those directories, as 00499 * converted by svn_depth_to_word()). 00500 * 00501 * @a traversal_info is obtained from svn_wc_init_traversal_info(), but is 00502 * only useful after it has been passed through another function, such 00503 * as svn_wc_crawl_revisions(), svn_wc_get_update_editor(), 00504 * svn_wc_get_switch_editor(), etc. 00505 * 00506 * The dir names are full paths -- that is, anchor plus target, not target 00507 * alone. The values are not allocated, they are static constant strings. 00508 * Although the values are never NULL, not all directories traversed 00509 * are necessarily listed. For example, directories which did not 00510 * have an svn:externals property set or modified are not included. 00511 * 00512 * The hashes and keys have the same lifetime as @a traversal_info. 00513 * 00514 * @since New in 1.5. 00515 */ 00516 void 00517 svn_wc_traversed_depths(apr_hash_t **depths, 00518 svn_wc_traversal_info_t *traversal_info); 00519 00520 00521 /** One external item. This usually represents one line from an 00522 * svn:externals description but with the path and URL 00523 * canonicalized. 00524 * 00525 * In order to avoid backwards compatibility problems clients should use 00526 * svn_wc_external_item_create() to allocate and intialize this structure 00527 * instead of doing so themselves. 00528 * 00529 * @since New in 1.5. 00530 */ 00531 typedef struct svn_wc_external_item2_t 00532 { 00533 /** The name of the subdirectory into which this external should be 00534 checked out. This is relative to the parent directory that 00535 holds this external item. (Note that these structs are often 00536 stored in hash tables with the target dirs as keys, so this 00537 field will often be redundant.) */ 00538 const char *target_dir; 00539 00540 /** Where to check out from. */ 00541 const char *url; 00542 00543 /** What revision to check out. The only valid kinds for this are 00544 svn_opt_revision_number, svn_opt_revision_date, and 00545 svn_opt_revision_head. */ 00546 svn_opt_revision_t revision; 00547 00548 /** The peg revision to use when checking out. The only valid kinds are 00549 svn_opt_revision_number, svn_opt_revision_date, and 00550 svn_opt_revision_head. */ 00551 svn_opt_revision_t peg_revision; 00552 00553 } svn_wc_external_item2_t; 00554 00555 /** 00556 * Initialize an external item. 00557 * Set @a *item to an external item object, allocated in @a pool. 00558 * 00559 * In order to avoid backwards compatibility problems, this function 00560 * is used to intialize and allocate the @c svn_wc_external_item2_t 00561 * structure rather than doing so explicitly, as the size of this 00562 * structure may change in the future. 00563 * 00564 * The current implementation never returns error, but callers should 00565 * still check for error, for compatibility with future versions. 00566 * 00567 * @since New in 1.5. 00568 */ 00569 svn_error_t * 00570 svn_wc_external_item_create(const svn_wc_external_item2_t **item, 00571 apr_pool_t *pool); 00572 00573 /** 00574 * Return a duplicate of @a item, allocated in @a pool. No part of the new 00575 * item will be shared with @a item. 00576 * 00577 * @since New in 1.5. 00578 */ 00579 svn_wc_external_item2_t * 00580 svn_wc_external_item2_dup(const svn_wc_external_item2_t *item, 00581 apr_pool_t *pool); 00582 00583 /** 00584 * One external item. Similar to svn_wc_external_item2_t, except 00585 * @a revision is interpreted as both the operational revision and the 00586 * peg revision. 00587 * 00588 * @deprecated Provided for backward compatibility with the 1.4 API. 00589 */ 00590 typedef struct svn_wc_external_item_t 00591 { 00592 /** Same as @c svn_wc_external_item2_t.target_dir */ 00593 const char *target_dir; 00594 00595 /** Same as @c svn_wc_external_item2_t.url */ 00596 const char *url; 00597 00598 /** Same as @c svn_wc_external_item2_t.revision */ 00599 svn_opt_revision_t revision; 00600 00601 } svn_wc_external_item_t; 00602 00603 /** 00604 * Return a duplicate of @a item, allocated in @a pool. No part of the new 00605 * item will be shared with @a item. 00606 * 00607 * @since New in 1.3. 00608 * 00609 * @deprecated Provided for backward compatibility with the 1.4 API. 00610 */ 00611 svn_wc_external_item_t * 00612 svn_wc_external_item_dup(const svn_wc_external_item_t *item, 00613 apr_pool_t *pool); 00614 00615 /** 00616 * If @a externals_p is non-NULL, set @a *externals_p to an array of 00617 * @c svn_wc_external_item2_t * objects based on @a desc. The @a url 00618 * member of the objects will be canonicalized if @a canonicalize_url 00619 * is @c TRUE. 00620 * 00621 * If the format of @a desc is invalid, don't touch @a *externals_p and 00622 * return @c SVN_ERR_CLIENT_INVALID_EXTERNALS_DESCRIPTION. Thus, if 00623 * you just want to check the validity of an externals description, 00624 * and don't care about the parsed result, pass NULL for @a externals_p. 00625 * 00626 * The format of @a desc is the same as for values of the directory 00627 * property @c SVN_PROP_EXTERNALS, which see. 00628 * 00629 * Allocate the table, keys, and values in @a pool. 00630 * 00631 * Use @a parent_directory only in constructing error strings. 00632 * 00633 * @since New in 1.5. 00634 */ 00635 svn_error_t * 00636 svn_wc_parse_externals_description3(apr_array_header_t **externals_p, 00637 const char *parent_directory, 00638 const char *desc, 00639 svn_boolean_t canonicalize_url, 00640 apr_pool_t *pool); 00641 00642 /** 00643 * Similar to svn_wc_parse_externals_description3() with @a 00644 * canonicalize_url set to @c TRUE, but returns an array of @c 00645 * svn_wc_external_item_t * objects instead of @c 00646 * svn_wc_external_item2_t * objects 00647 * 00648 * @since New in 1.1. 00649 * 00650 * @deprecated Provided for backward compatibility with the 1.4 API. 00651 */ 00652 svn_error_t * 00653 svn_wc_parse_externals_description2(apr_array_header_t **externals_p, 00654 const char *parent_directory, 00655 const char *desc, 00656 apr_pool_t *pool); 00657 00658 /** 00659 * Similar to svn_wc_parse_externals_description2(), but returns the 00660 * parsed externals in a hash instead of an array. This function 00661 * should not be used, as storing the externals in a hash causes their 00662 * order of evaluation to be not easily identifiable. 00663 * 00664 * @deprecated Provided for backward compatibility with the 1.0 API. 00665 */ 00666 svn_error_t * 00667 svn_wc_parse_externals_description(apr_hash_t **externals_p, 00668 const char *parent_directory, 00669 const char *desc, 00670 apr_pool_t *pool); 00671 00672 00673 00674 /* Notification/callback handling. */ 00675 00676 /** 00677 * @defgroup svn_wc_notifications Notification callback handling 00678 * @{ 00679 * 00680 * In many cases, the WC library will scan a working copy and make 00681 * changes. The caller usually wants to know when each of these changes 00682 * has been made, so that it can display some kind of notification to 00683 * the user. 00684 * 00685 * These notifications have a standard callback function type, which 00686 * takes the path of the file that was affected, and a caller- 00687 * supplied baton. 00688 * 00689 * Note that the callback is a 'void' return -- this is a simple 00690 * reporting mechanism, rather than an opportunity for the caller to 00691 * alter the operation of the WC library. 00692 * 00693 * Note also that some of the actions are used across several 00694 * different Subversion commands. For example, the update actions are 00695 * also used for checkouts, switches, and merges. 00696 */ 00697 00698 /** The type of action occurring. */ 00699 typedef enum svn_wc_notify_action_t 00700 { 00701 /** Adding a path to revision control. */ 00702 svn_wc_notify_add = 0, 00703 00704 /** Copying a versioned path. */ 00705 svn_wc_notify_copy, 00706 00707 /** Deleting a versioned path. */ 00708 svn_wc_notify_delete, 00709 00710 /** Restoring a missing path from the pristine text-base. */ 00711 svn_wc_notify_restore, 00712 00713 /** Reverting a modified path. */ 00714 svn_wc_notify_revert, 00715 00716 /** A revert operation has failed. */ 00717 svn_wc_notify_failed_revert, 00718 00719 /** Resolving a conflict. */ 00720 svn_wc_notify_resolved, 00721 00722 /** Skipping a path. */ 00723 svn_wc_notify_skip, 00724 00725 /** Got a delete in an update. */ 00726 svn_wc_notify_update_delete, 00727 00728 /** Got an add in an update. */ 00729 svn_wc_notify_update_add, 00730 00731 /** Got any other action in an update. */ 00732 svn_wc_notify_update_update, 00733 00734 /** The last notification in an update (including updates of externals). */ 00735 svn_wc_notify_update_completed, 00736 00737 /** Updating an external module. */ 00738 svn_wc_notify_update_external, 00739 00740 /** The last notification in a status (including status on externals). */ 00741 svn_wc_notify_status_completed, 00742 00743 /** Running status on an external module. */ 00744 svn_wc_notify_status_external, 00745 00746 /** Committing a modification. */ 00747 svn_wc_notify_commit_modified, 00748 00749 /** Committing an addition. */ 00750 svn_wc_notify_commit_added, 00751 00752 /** Committing a deletion. */ 00753 svn_wc_notify_commit_deleted, 00754 00755 /** Committing a replacement. */ 00756 svn_wc_notify_commit_replaced, 00757 00758 /** Transmitting post-fix text-delta data for a file. */ 00759 svn_wc_notify_commit_postfix_txdelta, 00760 00761 /** Processed a single revision's blame. */ 00762 svn_wc_notify_blame_revision, 00763 00764 /** Locking a path. @since New in 1.2. */ 00765 svn_wc_notify_locked, 00766 00767 /** Unlocking a path. @since New in 1.2. */ 00768 svn_wc_notify_unlocked, 00769 00770 /** Failed to lock a path. @since New in 1.2. */ 00771 svn_wc_notify_failed_lock, 00772 00773 /** Failed to unlock a path. @since New in 1.2. */ 00774 svn_wc_notify_failed_unlock, 00775 00776 /** Tried adding a path that already exists. @since New in 1.5. */ 00777 svn_wc_notify_exists, 00778 00779 /** Changelist name set. @since New in 1.5. */ 00780 svn_wc_notify_changelist_set, 00781 00782 /** Changelist name cleared. @since New in 1.5. */ 00783 svn_wc_notify_changelist_clear, 00784 00785 /** Warn user that a path has moved from one changelist to another. 00786 @since New in 1.5. */ 00787 svn_wc_notify_changelist_moved, 00788 00789 /** A merge operation (to path) has begun. See @c merge_range in 00790 @c svn_wc_notify_t. @since New in 1.5 */ 00791 svn_wc_notify_merge_begin, 00792 00793 /** A merge operation (to path) from a foreign repository has begun. 00794 See @c merge_range in @c svn_wc_notify_t. @since New in 1.5. */ 00795 svn_wc_notify_foreign_merge_begin, 00796 00797 /** Replace notification. @since New in 1.5. */ 00798 svn_wc_notify_update_replace 00799 00800 } svn_wc_notify_action_t; 00801 00802 00803 /** The type of notification that is occurring. */ 00804 typedef enum svn_wc_notify_state_t 00805 { 00806 svn_wc_notify_state_inapplicable = 0, 00807 00808 /** Notifier doesn't know or isn't saying. */ 00809 svn_wc_notify_state_unknown, 00810 00811 /** The state did not change. */ 00812 svn_wc_notify_state_unchanged, 00813 00814 /** The item wasn't present. */ 00815 svn_wc_notify_state_missing, 00816 00817 /** An unversioned item obstructed work. */ 00818 svn_wc_notify_state_obstructed, 00819 00820 /** Pristine state was modified. */ 00821 svn_wc_notify_state_changed, 00822 00823 /** Modified state had mods merged in. */ 00824 svn_wc_notify_state_merged, 00825 00826 /** Modified state got conflicting mods. */ 00827 svn_wc_notify_state_conflicted 00828 00829 } svn_wc_notify_state_t; 00830 00831 /** 00832 * What happened to a lock during an operation. 00833 * 00834 * @since New in 1.2. 00835 */ 00836 typedef enum svn_wc_notify_lock_state_t { 00837 svn_wc_notify_lock_state_inapplicable = 0, 00838 svn_wc_notify_lock_state_unknown, 00839 /** The lock wasn't changed. */ 00840 svn_wc_notify_lock_state_unchanged, 00841 /** The item was locked. */ 00842 svn_wc_notify_lock_state_locked, 00843 /** The item was unlocked. */ 00844 svn_wc_notify_lock_state_unlocked 00845 } svn_wc_notify_lock_state_t; 00846 00847 /** 00848 * Structure used in the @c svn_wc_notify_func2_t function. 00849 * 00850 * @c kind, @c content_state, @c prop_state and @c lock_state are from 00851 * after @c action, not before. 00852 * 00853 * @note If @c action is @c svn_wc_notify_update, then @c path has 00854 * already been installed, so it is legitimate for an implementation of 00855 * @c svn_wc_notify_func2_t to examine @c path in the working copy. 00856 * 00857 * @note The purpose of the @c kind, @c mime_type, @c content_state, and 00858 * @c prop_state fields is to provide "for free" information that an 00859 * implementation is likely to want, and which it would otherwise be 00860 * forced to deduce via expensive operations such as reading entries 00861 * and properties. However, if the caller does not have this 00862 * information, it will simply pass the corresponding `*_unknown' 00863 * values, and it is up to the implementation how to handle that 00864 * (i.e., whether to attempt deduction, or just to punt and 00865 * give a less informative notification). 00866 * 00867 * @note Callers of notification functions should use svn_wc_create_notify() 00868 * to create structures of this type to allow for extensibility. 00869 * 00870 * @since New in 1.2. 00871 */ 00872 typedef struct svn_wc_notify_t { 00873 /** Path, either absolute or relative to the current working directory 00874 * (i.e., not relative to an anchor). */ 00875 const char *path; 00876 /** Action that describes what happened to @c path. */ 00877 svn_wc_notify_action_t action; 00878 /** Node kind of @c path. */ 00879 svn_node_kind_t kind; 00880 /** If non-NULL, indicates the mime-type of @c path. 00881 * It is always @c NULL for directories. */ 00882 const char *mime_type; 00883 /** Points to the lock structure received from the repository when 00884 * @c action is @c svn_wc_notify_locked. For other actions, it is 00885 * @c NULL. */ 00886 const svn_lock_t *lock; 00887 /** Points to an error describing the reason for the failure when @c 00888 * action is @c svn_wc_notify_failed_lock or @c svn_wc_notify_failed_unlock. 00889 * Is @c NULL otherwise. */ 00890 svn_error_t *err; 00891 /** The type of notification that is occurring about node content. */ 00892 svn_wc_notify_state_t content_state; 00893 /** The type of notification that is occurring about node properties. */ 00894 svn_wc_notify_state_t prop_state; 00895 /** Reflects the addition or removal of a lock token in the working copy. */ 00896 svn_wc_notify_lock_state_t lock_state; 00897 /** When @c action is @c svn_wc_notify_update_completed, target revision 00898 * of the update, or @c SVN_INVALID_REVNUM if not available; when @c 00899 * action is @c svn_wc_notify_blame_revision, processed revision. 00900 * In all other cases, it is @c SVN_INVALID_REVNUM. */ 00901 svn_revnum_t revision; 00902 /** When @c action is @c svn_wc_notify_changelist_add or name. In all other 00903 * cases, it is @c NULL. */ 00904 const char *changelist_name; 00905 /** When @c action is @c svn_wc_notify_merge_begin, and both the 00906 left and right sides of the merge are from the same URL. In all 00907 other cases, it is @c NULL. */ 00908 svn_merge_range_t *merge_range; 00909 /* NOTE: Add new fields at the end to preserve binary compatibility. 00910 Also, if you add fields here, you have to update svn_wc_create_notify 00911 and svn_wc_dup_notify. */ 00912 } svn_wc_notify_t; 00913 00914 /** 00915 * Allocate an @c svn_wc_notify_t structure in @a pool, initialize and return 00916 * it. 00917 * 00918 * Set the @c path field of the created struct to @a path, and @c action to 00919 * @a action. Set all other fields to their @c _unknown, @c NULL or 00920 * invalid value, respectively. 00921 * 00922 * @since New in 1.2. 00923 */ 00924 svn_wc_notify_t * 00925 svn_wc_create_notify(const char *path, 00926 svn_wc_notify_action_t action, 00927 apr_pool_t *pool); 00928 00929 /** 00930 * Return a deep copy of @a notify, allocated in @a pool. 00931 * 00932 * @since New in 1.2. 00933 */ 00934 svn_wc_notify_t * 00935 svn_wc_dup_notify(const svn_wc_notify_t *notify, 00936 apr_pool_t *pool); 00937 00938 /** 00939 * Notify the world that @a notify->action has happened to @a notify->path. 00940 * 00941 * Recommendation: callers of @c svn_wc_notify_func2_t should avoid 00942 * invoking it multiple times on the same path within a given 00943 * operation, and implementations should not bother checking for such 00944 * duplicate calls. For example, in an update, the caller should not 00945 * invoke the notify func on receiving a prop change and then again 00946 * on receiving a text change. Instead, wait until all changes have 00947 * been received, and then invoke the notify func once (from within 00948 * an @c svn_delta_editor_t's close_file(), for example), passing 00949 * the appropriate @a notify->content_state and @a notify->prop_state flags. 00950 * 00951 * @since New in 1.2. 00952 */ 00953 typedef void (*svn_wc_notify_func2_t)(void *baton, 00954 const svn_wc_notify_t *notify, 00955 apr_pool_t *pool); 00956 00957 /** 00958 * Similar to @c svn_wc_notify_func2_t, but takes the information as arguments 00959 * instead of struct fields. 00960 * 00961 * @deprecated Provided for backward compatibility with the 1.1 API. 00962 */ 00963 typedef void (*svn_wc_notify_func_t)(void *baton, 00964 const char *path, 00965 svn_wc_notify_action_t action, 00966 svn_node_kind_t kind, 00967 const char *mime_type, 00968 svn_wc_notify_state_t content_state, 00969 svn_wc_notify_state_t prop_state, 00970 svn_revnum_t revision); 00971 00972 /** @} */ 00973 00974 00975 /** 00976 * A simple callback type to wrap svn_ra_get_file(); see that 00977 * docstring for more information. 00978 * 00979 * This technique allows libsvn_client to 'wrap' svn_ra_get_file() and 00980 * pass it down into libsvn_wc functions, thus allowing the WC layer 00981 * to legally call the RA function via (blind) callback. 00982 * 00983 * @since New in 1.5 00984 */ 00985 typedef svn_error_t *(*svn_wc_get_file_t)(void *baton, 00986 const char *path, 00987 svn_revnum_t revision, 00988 svn_stream_t *stream, 00989 svn_revnum_t *fetched_rev, 00990 apr_hash_t **props, 00991 apr_pool_t *pool); 00992 00993 00994 /** 00995 * Interactive conflict handling 00996 * 00997 * @defgroup svn_wc_conflict Conflict callback functionality 00998 * 00999 * @{ 01000 * 01001 * This API gives a Subversion client application the opportunity to 01002 * define a callback that allows the user to resolve conflicts 01003 * interactively during updates and merges. 01004 * 01005 * If a conflict is discovered, libsvn_wc invokes the callback with an 01006 * @c svn_wc_conflict_description_t. This structure describes the 01007 * path in conflict, whether it's a text or property conflict, and may 01008 * also present up to three files that can be used to resolve the 01009 * conflict (perhaps by launching an editor or 3rd-party merging 01010 * tool). The structure also provides a possible fourth file (@c 01011 * merged_file) which, if not NULL, represents libsvn_wc's attempt to 01012 * contextually merge the first three files. (Note that libsvn_wc 01013 * will not attempt to merge a file that it believes is binary, and it 01014 * will only attempt to merge property values it believes to be a 01015 * series of multi-line text.) 01016 * 01017 * When the callback is finished interacting with the user, it 01018 * responds by returning a @c svn_wc_conflict_result_t. This 01019 * structure indicates whether the user wants to postpone the conflict 01020 * for later (allowing libsvn_wc to mark the path "conflicted" as 01021 * usual), or whether the user wants libsvn_wc to use one of the four 01022 * files as the "final" state for resolving the conflict immediately. 01023 * 01024 * Note that the callback is at liberty (and encouraged) to merge the 01025 * three files itself. If it does so, it signals this to libsvn_wc by 01026 * returning a choice of @c svn_wc_conflict_choose_merged. To return 01027 * the 'final' merged file to libsvn_wc, the callback has the option of 01028 * either: 01029 * 01030 * - editing the original @c merged_file in-place 01031 * 01032 * or, if libsvn_wc never supplied a merged_file in the 01033 * description structure (i.e. passed NULL for that field), 01034 * 01035 * - return the merged file in the @c svn_wc_conflict_result_t. 01036 * 01037 */ 01038 01039 /** The type of action being attempted on an object. 01040 * 01041 * @since New in 1.5. 01042 */ 01043 typedef enum svn_wc_conflict_action_t 01044 { 01045 svn_wc_conflict_action_edit, /* attempting to change text or props */ 01046 svn_wc_conflict_action_add, /* attempting to add object */ 01047 svn_wc_conflict_action_delete /* attempting to delete object */ 01048 01049 } svn_wc_conflict_action_t; 01050 01051 01052 /** The pre-existing condition which is causing a state of conflict. 01053 * 01054 * @since New in 1.5. 01055 */ 01056 typedef enum svn_wc_conflict_reason_t 01057 { 01058 svn_wc_conflict_reason_edited, /* local edits are already present */ 01059 svn_wc_conflict_reason_obstructed, /* another object is in the way */ 01060 svn_wc_conflict_reason_deleted, /* object is already schedule-delete */ 01061 svn_wc_conflict_reason_missing, /* object is unknown or missing */ 01062 svn_wc_conflict_reason_unversioned /* object is unversioned */ 01063 01064 } svn_wc_conflict_reason_t; 01065 01066 01067 /** The type of conflict being described by an @c 01068 * svn_wc_conflict_description_t (see below). 01069 * 01070 * @since New in 1.5. 01071 */ 01072 typedef enum svn_wc_conflict_kind_t 01073 { 01074 svn_wc_conflict_kind_text, /* textual conflict (on a file) */ 01075 svn_wc_conflict_kind_property /* property conflict (on a file or dir) */ 01076 01077 /* ### Add future kinds here that represent "tree" conflicts. */ 01078 01079 } svn_wc_conflict_kind_t; 01080 01081 01082 /** A struct that describes a conflict that has occurred in the 01083 * working copy. Passed to @c svn_wc_conflict_resolver_func_t. 01084 * 01085 * @note Fields may be added to the end of this structure in future 01086 * versions. Therefore, to preserve binary compatibility, users 01087 * should not directly allocate structures of this type. 01088 * 01089 * @since New in 1.5. 01090 */ 01091 typedef struct svn_wc_conflict_description_t 01092 { 01093 /** The path that is being operated on */ 01094 const char *path; 01095 01096 /** The node type of the path being operated on */ 01097 svn_node_kind_t node_kind; 01098 01099 /** What sort of conflict are we describing? */ 01100 svn_wc_conflict_kind_t kind; 01101 01102 /** Only set if this is a property conflict. */ 01103 const char *property_name; 01104 01105 /** The following only apply to file objects: 01106 * - Whether svn thinks the object is a binary file. 01107 * - If available (non-NULL), the svn:mime-type property of the path */ 01108 svn_boolean_t is_binary; 01109 01110 /** mime-type of the object */ 01111 const char *mime_type; 01112 01113 /** If not NULL, an open working copy access baton to either the 01114 * path itself (if @c path is a directory), or to the parent 01115 * directory (if @c path is a file.) */ 01116 svn_wc_adm_access_t *access; 01117 01118 /** The action being attempted on @c path. */ 01119 svn_wc_conflict_action_t action; 01120 01121 /** The reason for the conflict. */ 01122 svn_wc_conflict_reason_t reason; 01123 01124 /** If this is text-conflict and involves the merging of two files 01125 * descended from a common ancestor, here are the paths of up to 01126 * four fulltext files that can be used to interactively resolve the 01127 * conflict. All four files will be in repository-normal form -- LF 01128 * line endings and contracted keywords. (If any of these files are 01129 * not available, they default to NULL.) 01130 * 01131 * On the other hand, if this is a property-conflict, then these 01132 * paths represent temporary files that contain the three different 01133 * property-values in conflict. The fourth path (@c merged_file) 01134 * may or may not be NULL; if set, it represents libsvn_wc's 01135 * attempt to merge the property values together. (Remember that 01136 * property values are technically binary values, and thus can't 01137 * always be merged.) 01138 */ 01139 const char *base_file; /* common ancestor of the two files being merged */ 01140 01141 /** their version of the file */ 01142 const char *their_file; 01143 01144 /** my locally-edited version of the file */ 01145 const char *my_file; 01146 01147 /** merged version; may contain conflict markers */ 01148 const char *merged_file; 01149 01150 } svn_wc_conflict_description_t; 01151 01152 01153 /** The way in which the conflict callback chooses a course of action. 01154 * 01155 * @since New in 1.5. 01156 */ 01157 typedef enum svn_wc_conflict_choice_t 01158 { 01159 /* Don't resolve the conflict now. Let libsvn_wc mark the path 01160 'conflicted', so user can run 'svn resolved' later. */ 01161 svn_wc_conflict_choose_postpone, 01162 01163 /* If their were files to choose from, select one as a way of 01164 resolving the conflict here and now. libsvn_wc will then do the 01165 work of "installing" the chosen file. 01166 */ 01167 svn_wc_conflict_choose_base, /* original version */ 01168 svn_wc_conflict_choose_theirs_full, /* incoming version */ 01169 svn_wc_conflict_choose_mine_full, /* own version */ 01170 svn_wc_conflict_choose_theirs_conflict, /* incoming (for conflicted hunks) */ 01171 svn_wc_conflict_choose_mine_conflict, /* own (for conflicted hunks) */ 01172 svn_wc_conflict_choose_merged /* merged version */ 01173 01174 } svn_wc_conflict_choice_t; 01175 01176 01177 /** The final result returned by @a svn_wc_conflict_resolver_func_t. 01178 * 01179 * @note Fields may be added to the end of this structure in future 01180 * versions. Therefore, to preserve binary compatibility, users 01181 * should not directly allocate structures of this type. Instead, 01182 * construct this structure using @c svn_wc_create_conflict_result() 01183 * below. 01184 * 01185 * @since New in 1.5. 01186 */ 01187 typedef struct svn_wc_conflict_result_t 01188 { 01189 /** A choice to either delay the conflict resolution or select a 01190 particular file to resolve the conflict. */ 01191 svn_wc_conflict_choice_t choice; 01192 01193 /** If not NULL, this is a path to a file which contains the client's 01194 (or more likely, the user's) merging of the three values in 01195 conflict. libsvn_wc accepts this file if (and only if) @c choice 01196 is set to @c svn_wc_conflict_choose_merged.*/ 01197 const char *merged_file; 01198 01199 } svn_wc_conflict_result_t; 01200 01201 01202 /** 01203 * Allocate an @c svn_wc_conflict_result_t structure in @a pool, 01204 * initialize and return it. 01205 * 01206 * Set the @c choice field of the structure to @a choice, and @c 01207 * merged_file to @a merged_file. Set all other fields to their @c 01208 * _unknown, @c NULL or invalid value, respectively. 01209 * 01210 * @since New in 1.5. 01211 */ 01212 svn_wc_conflict_result_t * 01213 svn_wc_create_conflict_result(svn_wc_conflict_choice_t choice, 01214 const char *merged_file, 01215 apr_pool_t *pool); 01216 01217 01218 /** A callback used in svn_client_merge3(), svn_client_update3(), and 01219 * svn_client_switch2() for resolving conflicts during the application 01220 * of a tree delta to a working copy. 01221 * 01222 * @a description describes the exact nature of the conflict, and 01223 * provides information to help resolve it. @a baton is a closure 01224 * object; it should be provided by the implementation, and passed by 01225 * the caller. All allocations should be performed in @a pool. When 01226 * finished, the callback signals its resolution by returning a 01227 * structure in @a *result. (See @c svn_wc_conflict_result_t.) 01228 * 01229 * Implementations of this callback are free to present the conflict 01230 * using any user interface. This may include simple contextual 01231 * conflicts in a file's text or properties, or more complex 01232 * 'tree'-based conflcts related to obstructed additions, deletions, 01233 * and edits. The callback implementation is free to decide which 01234 * sorts of conflicts to handle; it's also free to decide which types 01235 * of conflicts are automatically resolvable and which require user 01236 * interaction. 01237 * 01238 * @since New in 1.5. 01239 */ 01240 typedef svn_error_t *(*svn_wc_conflict_resolver_func_t) 01241 (svn_wc_conflict_result_t **result, 01242 const svn_wc_conflict_description_t *description, 01243 void *baton, 01244 apr_pool_t *pool); 01245 01246 /** @} */ 01247 01248 01249 01250 /** 01251 * A callback vtable invoked by our diff-editors, as they receive 01252 * diffs from the server. 'svn diff' and 'svn merge' both implement 01253 * their own versions of this table. 01254 * 01255 * @since New in 1.2. 01256 */ 01257 typedef struct svn_wc_diff_callbacks2_t 01258 { 01259 /** A file @a path has changed. If @a tmpfile2 is non-NULL, the 01260 * contents have changed and those changes can be seen by comparing 01261 * @a tmpfile1 and @a tmpfile2, which represent @a rev1 and @a rev2 of 01262 * the file, respectively. 01263 * 01264 * If known, the @c svn:mime-type value of each file is passed into 01265 * @a mimetype1 and @a mimetype2; either or both of the values can 01266 * be NULL. The implementor can use this information to decide if 01267 * (or how) to generate differences. 01268 * 01269 * @a propchanges is an array of (@c svn_prop_t) structures. If it has 01270 * any elements, the original list of properties is provided in 01271 * @a originalprops, which is a hash of @c svn_string_t values, keyed on the 01272 * property name. 01273 * 01274 * @a adm_access will be an access baton for the directory containing 01275 * @a path, or @c NULL if the diff editor is not using access batons. 01276 * 01277 * If @a contentstate is non-NULL, set @a *contentstate to the state of 01278 * the file contents after the operation has been performed. The same 01279 * applies for @a propstate regarding the property changes. (In 01280 * practice, this is only useful with merge, not diff; diff callbacks 01281 * will probably set @a *contentstate and @a *propstate to 01282 * @c svn_wc_notify_state_unknown, since they do not change the state and 01283 * therefore do not bother to know the state after the operation.) 01284 */ 01285 svn_error_t *(*file_changed)(svn_wc_adm_access_t *adm_access, 01286 svn_wc_notify_state_t *contentstate, 01287 svn_wc_notify_state_t *propstate, 01288 const char *path, 01289 const char *tmpfile1, 01290 const char *tmpfile2, 01291 svn_revnum_t rev1, 01292 svn_revnum_t rev2, 01293 const char *mimetype1, 01294 const char *mimetype2, 01295 const apr_array_header_t *propchanges, 01296 apr_hash_t *originalprops, 01297 void *diff_baton); 01298 01299 /** A file @a path was added. The contents can be seen by comparing 01300 * @a tmpfile1 and @a tmpfile2, which represent @a rev1 and @a rev2 01301 * of the file, respectively. (If either file is empty, the rev 01302 * will be 0.) 01303 * 01304 * If known, the @c svn:mime-type value of each file is passed into 01305 * @a mimetype1 and @a mimetype2; either or both of the values can 01306 * be NULL. The implementor can use this information to decide if 01307 * (or how) to generate differences. 01308 * 01309 * @a propchanges is an array of (@c svn_prop_t) structures. If it contains 01310 * any elements, the original list of properties is provided in 01311 * @a originalprops, which is a hash of @c svn_string_t values, keyed on the 01312 * property name. 01313 * 01314 * @a adm_access will be an access baton for the directory containing 01315 * @a path, or @c NULL if the diff editor is not using access batons. 01316 * 01317 * If @a contentstate is non-NULL, set @a *contentstate to the state of the 01318 * file contents after the operation has been performed. The same 01319 * applies for @a propstate regarding the property changes. (In practice, 01320 * this is only useful with merge, not diff; diff callbacks will 01321 * probably set @a *contentstate and *propstate to 01322 * @c svn_wc_notify_state_unknown, since they do not change the state 01323 * and therefore do not bother to know the state after the operation.) 01324 * 01325 */ 01326 svn_error_t *(*file_added)(svn_wc_adm_access_t *adm_access, 01327 svn_wc_notify_state_t *contentstate, 01328 svn_wc_notify_state_t *propstate, 01329 const char *path, 01330 const char *tmpfile1, 01331 const char *tmpfile2, 01332 svn_revnum_t rev1, 01333 svn_revnum_t rev2, 01334 const char *mimetype1, 01335 const char *mimetype2, 01336 const apr_array_header_t *propchanges, 01337 apr_hash_t *originalprops, 01338 void *diff_baton); 01339 01340 /** A file @a path was deleted. The [loss of] contents can be seen by 01341 * comparing @a tmpfile1 and @a tmpfile2. @a originalprops provides 01342 * the properties of the file. 01343 * 01344 * If known, the @c svn:mime-type value of each file is passed into 01345 * @a mimetype1 and @a mimetype2; either or both of the values can 01346 * be NULL. The implementor can use this information to decide if 01347 * (or how) to generate differences. 01348 * 01349 * @a adm_access will be an access baton for the directory containing 01350 * @a path, or @c NULL if the diff editor is not using access batons. 01351 * 01352 * If @a state is non-NULL, set @a *state to the state of the item 01353 * after the delete operation has been performed. (In practice, 01354 * this is only useful with merge, not diff; diff callbacks will 01355 * probably set @a *state to @c svn_wc_notify_state_unknown, since 01356 * they do not change the state and therefore do not bother to know 01357 * the state after the operation.) 01358 */ 01359 svn_error_t *(*file_deleted)(svn_wc_adm_access_t *adm_access, 01360 svn_wc_notify_state_t *state, 01361 const char *path, 01362 const char *tmpfile1, 01363 const char *tmpfile2, 01364 const char *mimetype1, 01365 const char *mimetype2, 01366 apr_hash_t *originalprops, 01367 void *diff_baton); 01368 01369 /** A directory @a path was added. @a rev is the revision that the 01370 * directory came from. 01371 * 01372 * @a adm_access will be an access baton for the directory containing 01373 * @a path, or @c NULL if the diff editor is not using access batons. 01374 */ 01375 svn_error_t *(*dir_added)(svn_wc_adm_access_t *adm_access, 01376 svn_wc_notify_state_t *state, 01377 const char *path, 01378 svn_revnum_t rev, 01379 void *diff_baton); 01380 01381 /** A directory @a path was deleted. 01382 * 01383 * @a adm_access will be an access baton for the directory containing 01384 * @a path, or @c NULL if the diff editor is not using access batons. 01385 * 01386 * If @a state is non-NULL, set @a *state to the state of the item 01387 * after the delete operation has been performed. (In practice, 01388 * this is only useful with merge, not diff; diff callbacks will 01389 * probably set @a *state to @c svn_wc_notify_state_unknown, since 01390 * they do not change the state and therefore do not bother to know 01391 * the state after the operation.) 01392 */ 01393 svn_error_t *(*dir_deleted)(svn_wc_adm_access_t *adm_access, 01394 svn_wc_notify_state_t *state, 01395 const char *path, 01396 void *diff_baton); 01397 01398 /** A list of property changes (@a propchanges) was applied to the 01399 * directory @a path. 01400 * 01401 * The array is a list of (@c svn_prop_t) structures. 01402 * 01403 * The original list of properties is provided in @a original_props, 01404 * which is a hash of @c svn_string_t values, keyed on the property 01405 * name. 01406 * 01407 * @a adm_access will be an access baton for the directory containing 01408 * @a path, or @c NULL if the diff editor is not using access batons. 01409 * 01410 * If @a state is non-NULL, set @a *state to the state of the properties 01411 * after the operation has been performed. (In practice, this is only 01412 * useful with merge, not diff; diff callbacks will probably set @a *state 01413 * to @c svn_wc_notify_state_unknown, since they do not change the state 01414 * and therefore do not bother to know the state after the operation.) 01415 */ 01416 svn_error_t *(*dir_props_changed)(svn_wc_adm_access_t *adm_access, 01417 svn_wc_notify_state_t *state, 01418 const char *path, 01419 const apr_array_header_t *propchanges, 01420 apr_hash_t *original_props, 01421 void *diff_baton); 01422 01423 } svn_wc_diff_callbacks2_t; 01424 01425 /** 01426 * Similar to @c svn_wc_diff_callbacks2_t, but with file additions/content 01427 * changes and property changes split into different functions. 01428 * 01429 * @deprecated Provided for backward compatibility with the 1.1 API. 01430 */ 01431 typedef struct svn_wc_diff_callbacks_t 01432 { 01433 /** Similar to @c file_changed in @c svn_wc_diff_callbacks2_t, but without 01434 * property change information. @a tmpfile2 is never NULL. @a state applies 01435 * to the file contents. */ 01436 svn_error_t *(*file_changed)(svn_wc_adm_access_t *adm_access, 01437 svn_wc_notify_state_t *state, 01438 const char *path, 01439 const char *tmpfile1, 01440 const char *tmpfile2, 01441 svn_revnum_t rev1, 01442 svn_revnum_t rev2, 01443 const char *mimetype1, 01444 const char *mimetype2, 01445 void *diff_baton); 01446 01447 /** Similar to @c file_added in @c svn_wc_diff_callbacks2_t, but without 01448 * property change information. @a *state applies to the file contents. */ 01449 svn_error_t *(*file_added)(svn_wc_adm_access_t *adm_access, 01450 svn_wc_notify_state_t *state, 01451 const char *path, 01452 const char *tmpfile1, 01453 const char *tmpfile2, 01454 svn_revnum_t rev1, 01455 svn_revnum_t rev2, 01456 const char *mimetype1, 01457 const char *mimetype2, 01458 void *diff_baton); 01459 01460 /** Similar to @c file_deleted in @c svn_wc_diff_callbacks2_t, but without 01461 * the properties. */ 01462 svn_error_t *(*file_deleted)(svn_wc_adm_access_t *adm_access, 01463 svn_wc_notify_state_t *state, 01464 const char *path, 01465 const char *tmpfile1, 01466 const char *tmpfile2, 01467 const char *mimetype1, 01468 const char *mimetype2, 01469 void *diff_baton); 01470 01471 /** The same as @c dir_added in @c svn_wc_diff_callbacks2_t. */ 01472 svn_error_t *(*dir_added)(svn_wc_adm_access_t *adm_access, 01473 svn_wc_notify_state_t *state, 01474 const char *path, 01475 svn_revnum_t rev, 01476 void *diff_baton); 01477 01478 /** The same as @c dir_deleted in @c svn_wc_diff_callbacks2_t. */ 01479 svn_error_t *(*dir_deleted)(svn_wc_adm_access_t *adm_access, 01480 svn_wc_notify_state_t *state, 01481 const char *path, 01482 void *diff_baton); 01483 01484 /** Similar to @c dir_props_changed in @c svn_wc_diff_callbacks2_t, but this 01485 * function is called for files as well as directories. */ 01486 svn_error_t *(*props_changed)(svn_wc_adm_access_t *adm_access, 01487 svn_wc_notify_state_t *state, 01488 const char *path, 01489 const apr_array_header_t *propchanges, 01490 apr_hash_t *original_props, 01491 void *diff_baton); 01492 01493 } svn_wc_diff_callbacks_t; 01494 01495 01496 /* Asking questions about a working copy. */ 01497 01498 /** Set @a *wc_format to @a path's working copy format version number if 01499 * @a path is a valid working copy directory, else set it to 0. 01500 * Return error @c APR_ENOENT if @a path does not exist at all. 01501 */ 01502 svn_error_t * 01503 svn_wc_check_wc(const char *path, 01504 int *wc_format, 01505 apr_pool_t *pool); 01506 01507 01508 /** Set @a *has_binary_prop to @c TRUE iff @a path has been marked 01509 * with a property indicating that it is non-text (in other words, binary). 01510 * @a adm_access is an access baton set that contains @a path. 01511 */ 01512 svn_error_t * 01513 svn_wc_has_binary_prop(svn_boolean_t *has_binary_prop, 01514 const char *path, 01515 svn_wc_adm_access_t *adm_access, 01516 apr_pool_t *pool); 01517 01518 01519 /* Detecting modification. */ 01520 01521 /** Set @a *modified_p to non-zero if @a filename's text is modified 01522 * with regard to the base revision, else set @a *modified_p to zero. 01523 * @a filename is a path to the file, not just a basename. @a adm_access 01524 * must be an access baton for @a filename. 01525 * 01526 * If @a force_comparison is @c TRUE, this function will not allow 01527 * early return mechanisms that avoid actual content comparison. 01528 * Instead, if there is a text base, a full byte-by-byte comparison 01529 * will be done, and the entry checksum verified as well. (This means 01530 * that if the text base is much longer than the working file, every 01531 * byte of the text base will still be examined.) 01532 * 01533 * If @a filename does not exist, consider it unmodified. If it exists 01534 * but is not under revision control (not even scheduled for 01535 * addition), return the error @c SVN_ERR_ENTRY_NOT_FOUND. 01536 * 01537 * If @a filename is unmodified but has a timestamp variation then this 01538 * function may "repair" @a filename's text-time by setting it to 01539 * @a filename's last modification time. 01540 */ 01541 svn_error_t * 01542 svn_wc_text_modified_p(svn_boolean_t *modified_p, 01543 const char *filename, 01544 svn_boolean_t force_comparison, 01545 svn_wc_adm_access_t *adm_access, 01546 apr_pool_t *pool); 01547 01548 01549 /** Set @a *modified_p to non-zero if @a path's properties are modified 01550 * with regard to the base revision, else set @a modified_p to zero. 01551 * @a adm_access must be an access baton for @a path. 01552 */ 01553 svn_error_t * 01554 svn_wc_props_modified_p(svn_boolean_t *modified_p, 01555 const char *path, 01556 svn_wc_adm_access_t *adm_access, 01557 apr_pool_t *pool); 01558 01559 01560 01561 01562 /** Administrative subdir. 01563 * 01564 * Ideally, this would be completely private to wc internals (in fact, 01565 * it used to be that adm_subdir() in adm_files.c was the only function 01566 * who knew the adm subdir's name). However, import wants to protect 01567 * against importing administrative subdirs, so now the name is a 01568 * matter of public record. 01569 * 01570 * @deprecated Provided for backward compatibility with the 1.2 API. 01571 */ 01572 #define SVN_WC_ADM_DIR_NAME ".svn" 01573 01574 01575 01576 /* Entries and status. */ 01577 01578 /** The schedule states an entry can be in. */ 01579 typedef enum svn_wc_schedule_t 01580 { 01581 /** Nothing special here */ 01582 svn_wc_schedule_normal, 01583 01584 /** Slated for addition */ 01585 svn_wc_schedule_add, 01586 01587 /** Slated for deletion */ 01588 svn_wc_schedule_delete, 01589 01590 /** Slated for replacement (delete + add) */ 01591 svn_wc_schedule_replace 01592 01593 } svn_wc_schedule_t; 01594 01595 01596 /** 01597 * Values for the working_size field in svn_wc_entry_t 01598 * when it isn't set to the actual size value of the unchanged 01599 * working file. 01600 * 01601 * @defgroup svn_wc_entry_working_size_constants Working size constants 01602 * 01603 * @{ 01604 */ 01605 01606 /** The value of the working size is unknown (hasn't been 01607 * calculated and stored in the past for whatever reason). 01608 * 01609 * @since New in 1.5 01610 */ 01611 #define SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN -1 01612 01613 /** @} */ 01614 01615 /** A working copy entry -- that is, revision control information about 01616 * one versioned entity. 01617 */ 01618 typedef struct svn_wc_entry_t 01619 { 01620 /* IMPORTANT: If you extend this structure, add new fields to the end. */ 01621 01622 /* General Attributes */ 01623 01624 /** entry's name */ 01625 const char *name; 01626 01627 /** base revision */ 01628 svn_revnum_t revision; 01629 01630 /** url in repository */ 01631 const char *url; 01632 01633 /** canonical repository URL or NULL if not known */ 01634 const char *repos; 01635 01636 /** repository uuid */ 01637 const char *uuid; 01638 01639 /** node kind (file, dir, ...) */ 01640 svn_node_kind_t kind; 01641 01642 /* State information */ 01643 01644 /** scheduling (add, delete, replace ...) */ 01645 svn_wc_schedule_t schedule; 01646 01647 /** in a copied state (possibly because the entry is a child of a 01648 path that is @c svn_wc_schedule_add or @c svn_wc_schedule_replace, 01649 when the entry itself is @c svn_wc_schedule_normal) */ 01650 svn_boolean_t copied; 01651 01652 /** deleted, but parent rev lags behind */ 01653 svn_boolean_t deleted; 01654 01655 /** absent -- we know an entry of this name exists, but that's all 01656 (usually this happens because of authz restrictions) */ 01657 svn_boolean_t absent; 01658 01659 /** for THIS_DIR entry, implies whole entries file is incomplete */ 01660 svn_boolean_t incomplete; 01661 01662 /** copyfrom location */ 01663 const char *copyfrom_url; 01664 01665 /** copyfrom revision */ 01666 svn_revnum_t copyfrom_rev; 01667 01668 /** old version of conflicted file */ 01669 const char *conflict_old; 01670 01671 /** new version of conflicted file */ 01672 const char *conflict_new; 01673 01674 /** working version of conflicted file */ 01675 const char *conflict_wrk; 01676 01677 /** property reject file */ 01678 const char *prejfile; 01679 01680 /** last up-to-date time for text contents (0 means no information available) 01681 */ 01682 apr_time_t text_time; 01683 01684 /** last up-to-date time for properties (0 means no information available) */ 01685 apr_time_t prop_time; 01686 01687 /** Hex MD5 checksum for the untranslated text base file, 01688 * can be @c NULL for backwards compatibility. 01689 */ 01690 const char *checksum; 01691 01692 /* "Entry props" */ 01693 01694 /** last revision this was changed */ 01695 svn_revnum_t cmt_rev; 01696 01697 /** last date this was changed */ 01698 apr_time_t cmt_date; 01699 01700 /** last commit author of this item */ 01701 const char *cmt_author; 01702 01703 /** lock token or NULL if path not locked in this WC 01704 * @since New in 1.2. 01705 */ 01706 const char *lock_token; 01707 /** lock owner, or NULL if not locked in this WC 01708 * @since New in 1.2. 01709 */ 01710 const char *lock_owner; 01711 /** lock comment or NULL if not locked in this WC or no comment 01712 * @since New in 1.2. 01713 */ 01714 const char *lock_comment; 01715 /** Lock creation date or 0 if not locked in this WC 01716 * @since New in 1.2. 01717 */ 01718 apr_time_t lock_creation_date; 01719 01720 /** Whether this entry has any working properties. 01721 * False if this information is not stored in the entry. 01722 * 01723 * @since New in 1.4. */ 01724 svn_boolean_t has_props; 01725 01726 /** Whether this entry has property modifications. 01727 * 01728 * @note For working copies in older formats, this flag is not valid. 01729 * 01730 * @see svn_wc_props_modified_p(). 01731 * 01732 * @since New in 1.4. */ 01733 svn_boolean_t has_prop_mods; 01734 01735 /** A space-separated list of all properties whose presence/absence is cached 01736 * in this entry. 01737 * 01738 * @see @c present_props. 01739 * 01740 * @since New in 1.4. */ 01741 const char *cachable_props; 01742 01743 /** Cached property existence for this entry. 01744 * This is a space-separated list of property names. If a name exists in 01745 * @c cachable_props but not in this list, this entry does not have that 01746 * property. If a name exists in both lists, the property is present on this 01747 * entry. 01748 * 01749 * @since New in 1.4. */ 01750 const char *present_props; 01751 01752 /** which changelist this item is part of, or NULL if not part of any. 01753 * @since New in 1.5. 01754 */ 01755 const char *changelist; 01756 01757 /** Size of the file after being translated into local 01758 * representation, or @c SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN if 01759 * unknown. 01760 * 01761 * @since New in 1.5. 01762 */ 01763 apr_off_t working_size; 01764 01765 /** Whether a local copy of this entry should be kept in the working copy 01766 * after a deletion has been committed, Only valid for the this-dir entry 01767 * when it is scheduled for deletion. 01768 * 01769 * @since New in 1.5. */ 01770 svn_boolean_t keep_local; 01771 01772 /** The depth of this entry. 01773 * 01774 * ### It's a bit annoying that we only use this on this_dir 01775 * ### entries, yet it will exist (with value svn_depth_infinity) on 01776 * ### all entries. Maybe some future extensibility would make this 01777 * ### field meaningful on entries besides this_dir. 01778 * 01779 * @since New in 1.5. */ 01780 svn_depth_t depth; 01781 01782 /* IMPORTANT: If you extend this structure, check the following functions in 01783 * subversion/libsvn_wc/entries.c, to see if you need to extend them as well. 01784 * 01785 * svn_wc__atts_to_entry() 01786 * svn_wc_entry_dup() 01787 * alloc_entry() 01788 * read_entry() 01789 * write_entry() 01790 * fold_entry() 01791 * 01792 */ 01793 } svn_wc_entry_t; 01794 01795 01796 /** How an entries file's owner dir is named in the entries file. */ 01797 #define SVN_WC_ENTRY_THIS_DIR "" 01798 01799 01800 /** Set @a *entry to an entry for @a path, allocated in the access baton 01801 * pool. If @a show_hidden is TRUE, return the entry even if it's in 01802 * 'deleted' or 'absent' state. If @a path is not under revision 01803 * control, or if entry is hidden, not scheduled for re-addition, 01804 * and @a show_hidden is @c FALSE, then set @a *entry to @c NULL. 01805 * 01806 * @a *entry should not be modified, since doing so modifies the entries 01807 * cache in @a adm_access without changing the entries file on disk. 01808 * 01809 * If @a path is not a directory then @a adm_access must be an access baton 01810 * for the parent directory of @a path. To avoid needing to know whether 01811 * @a path is a directory or not, if @a path is a directory @a adm_access 01812 * can still be an access baton for the parent of @a path so long as the 01813 * access baton for @a path itself is in the same access baton set. 01814 * 01815 * @a path can be relative or absolute but must share the same base used 01816 * to open @a adm_access. 01817 * 01818 * Note that it is possible for @a path to be absent from disk but still 01819 * under revision control; and conversely, it is possible for @a path to 01820 * be present, but not under revision control. 01821 * 01822 * Use @a pool only for local processing. 01823 */ 01824 svn_error_t * 01825 svn_wc_entry(const svn_wc_entry_t **entry, 01826 const char *path, 01827 svn_wc_adm_access_t *adm_access, 01828 svn_boolean_t show_hidden, 01829 apr_pool_t *pool); 01830 01831 01832 /** Parse the `entries' file for @a adm_access and return a hash @a entries, 01833 * whose keys are (<tt>const char *</tt>) entry names and values are 01834 * (<tt>svn_wc_entry_t *</tt>). The hash @a entries, and its keys and 01835 * values, are allocated from the pool used to open the @a adm_access 01836 * baton (that's how the entries caching works). @a pool is used for 01837 * transient allocations. 01838 * 01839 * Entries that are in a 'deleted' or 'absent' state (and not 01840 * scheduled for re-addition) are not returned in the hash, unless 01841 * @a show_hidden is TRUE. 01842 * 01843 * @par Important: 01844 * The @a entries hash is the entries cache in @a adm_access 01845 * and so usually the hash itself, the keys and the values should be treated 01846 * as read-only. If any of these are modified then it is the caller's 01847 * responsibility to ensure that the entries file on disk is updated. Treat 01848 * the hash values as type (<tt>const svn_wc_entry_t *</tt>) if you wish to 01849 * avoid accidental modification. Modifying the schedule member is a 01850 * particularly bad idea, as the entries writing process relies on having 01851 * access to the original schedule. Use a duplicate entry to modify the 01852 * schedule. 01853 * 01854 * @par Important: 01855 * Only the entry structures representing files and 01856 * @c SVN_WC_ENTRY_THIS_DIR contain complete information. The entry 01857 * structures representing subdirs have only the `kind' and `state' 01858 * fields filled in. If you want info on a subdir, you must use this 01859 * routine to open its @a path and read the @c SVN_WC_ENTRY_THIS_DIR 01860 * structure, or call svn_wc_entry() on its @a path. 01861 */ 01862 svn_error_t * 01863 svn_wc_entries_read(apr_hash_t **entries, 01864 svn_wc_adm_access_t *adm_access, 01865 svn_boolean_t show_hidden, 01866 apr_pool_t *pool); 01867 01868 01869 /** Return a duplicate of @a entry, allocated in @a pool. No part of the new 01870 * entry will be shared with @a entry. 01871 */ 01872 svn_wc_entry_t * 01873 svn_wc_entry_dup(const svn_wc_entry_t *entry, 01874 apr_pool_t *pool); 01875 01876 01877 /** Given a @a dir_path under version control, decide if one of its 01878 * entries (@a entry) is in state of conflict; return the answers in 01879 * @a text_conflicted_p and @a prop_conflicted_p. 01880 * 01881 * (If the entry mentions that a .rej or .prej exist, but they are 01882 * both removed, assume the conflict has been resolved by the user.) 01883 */ 01884 svn_error_t * 01885 svn_wc_conflicted_p(svn_boolean_t *text_conflicted_p, 01886 svn_boolean_t *prop_conflicted_p, 01887 const char *dir_path, 01888 const svn_wc_entry_t *entry, 01889 apr_pool_t *pool); 01890 01891 /** Set @a *url and @a *rev to the ancestor URL and revision for @a path, 01892 * allocating in @a pool. @a adm_access must be an access baton for @a path. 01893 * 01894 * If @a url or @a rev is NULL, then ignore it (just don't return the 01895 * corresponding information). 01896 */ 01897 svn_error_t * 01898 svn_wc_get_ancestry(char **url, 01899 svn_revnum_t *rev, 01900 const char *path, 01901 svn_wc_adm_access_t *adm_access, 01902 apr_pool_t *pool); 01903 01904 01905 /** A callback vtable invoked by the generic entry-walker function. 01906 * @since New in 1.5. 01907 */ 01908 typedef struct svn_wc_entry_callbacks2_t 01909 { 01910 /** An @a entry was found at @a path. */ 01911 svn_error_t *(*found_entry)(const char *path, 01912 const svn_wc_entry_t *entry, 01913 void *walk_baton, 01914 apr_pool_t *pool); 01915 01916 /** Handle the error @a err encountered while processing @a path. 01917 * Wrap or squelch @a err as desired, and return an @c svn_error_t 01918 * *, or @c SVN_NO_ERROR. 01919 */ 01920 svn_error_t *(*handle_error)(const char *path, 01921 svn_error_t *err, 01922 void *walk_baton, 01923 apr_pool_t *pool); 01924 01925 } svn_wc_entry_callbacks2_t; 01926 01927 /** @deprecated Provided for backward compatibility with the 1.4 API. */ 01928 typedef struct svn_wc_entry_callbacks_t 01929 { 01930 /** An @a entry was found at @a path. */ 01931 svn_error_t *(*found_entry)(const char *path, 01932 const svn_wc_entry_t *entry, 01933 void *walk_baton, 01934 apr_pool_t *pool); 01935 01936 } svn_wc_entry_callbacks_t; 01937 01938 /** 01939 * A generic entry-walker. 01940 * 01941 * Do a potentially recursive depth-first entry-walk beginning on 01942 * @a path, which can be a file or dir. Call callbacks in 01943 * @a walk_callbacks, passing @a walk_baton to each. Use @a pool for 01944 * looping, recursion, and to allocate all entries returned. 01945 * @a adm_access must be an access baton for @a path. 01946 * 01947 * If @a depth is @c svn_depth_empty, invoke the callbacks on @a path 01948 * and return without recursing further. If @c svn_depth_files, do 01949 * the same and invoke the callbacks on file children (if any) of 01950 * @a path, then return. If @c svn_depth_immediates, do the preceding 01951 * but also invoke callbacks on immediate subdirectories, then return. 01952 * If @c svn_depth_infinity, recurse fully starting from @a path. 01953 * 01954 * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine 01955 * if the client has cancelled the operation. 01956 * 01957 * Like our other entries interfaces, entries that are in a 'deleted' 01958 * or 'absent' state (and not scheduled for re-addition) are not 01959 * discovered, unless @a show_hidden is TRUE. 01960 * 01961 * When a new directory is entered, @c SVN_WC_ENTRY_THIS_DIR will always 01962 * be returned first. 01963 * 01964 * @note Callers should be aware that each directory will be 01965 * returned *twice*: first as an entry within its parent, and 01966 * subsequently as the '.' entry within itself. The two calls can be 01967 * distinguished by looking for @c SVN_WC_ENTRY_THIS_DIR in the 'name' 01968 * field of the entry. 01969 * 01970 * @since New in 1.5. 01971 */ 01972 svn_error_t * 01973 svn_wc_walk_entries3(const char *path, 01974 svn_wc_adm_access_t *adm_access, 01975 const svn_wc_entry_callbacks2_t 01976 *walk_callbacks, 01977 void *walk_baton, 01978 svn_depth_t depth, 01979 svn_boolean_t show_hidden, 01980 svn_cancel_func_t cancel_func, 01981 void *cancel_baton, 01982 apr_pool_t *pool); 01983 01984 /** 01985 * Similar to svn_wc_walk_entries3(), but without cancellation support 01986 * or error handling from @a walk_callbacks, and with @a depth always 01987 * set to @c svn_depth_infinity. 01988 * 01989 * @deprecated Provided for backward compatibility with the 1.4 API. 01990 */ 01991 svn_error_t * 01992 svn_wc_walk_entries2(const char *path, 01993 svn_wc_adm_access_t *adm_access, 01994 const svn_wc_entry_callbacks_t 01995 *walk_callbacks, 01996 void *walk_baton, 01997 svn_boolean_t show_hidden, 01998 svn_cancel_func_t cancel_func, 01999 void *cancel_baton, 02000 apr_pool_t *pool); 02001 02002 /** 02003 * Similar to svn_wc_walk_entries2(), but without cancellation support. 02004 * 02005 * @deprecated Provided for backward compatibility with the 1.0 API. 02006 */ 02007 svn_error_t * 02008 svn_wc_walk_entries(const char *path, 02009 svn_wc_adm_access_t *adm_access, 02010 const svn_wc_entry_callbacks_t 02011 *walk_callbacks, 02012 void *walk_baton, 02013 svn_boolean_t show_hidden, 02014 apr_pool_t *pool); 02015 02016 02017 /** Mark missing @a path as 'deleted' in its @a parent's list of entries. 02018 * 02019 * Return @c SVN_ERR_WC_PATH_FOUND if @a path isn't actually missing. 02020 */ 02021 svn_error_t * 02022 svn_wc_mark_missing_deleted(const char *path, 02023 svn_wc_adm_access_t *parent, 02024 apr_pool_t *pool); 02025 02026 02027 /** Ensure that an administrative area exists for @a path, so that @a 02028 * path is a working copy subdir based on @a url at @a revision, with 02029 * depth @a depth, and with repository UUID @a uuid and repository 02030 * root URL @a repos. 02031 * 02032 * @a depth must be a definite depth, it cannot be @c svn_depth_unknown. 02033 * @a uuid and @a repos may be @c NULL. If non-@c NULL, @a repos must 02034 * be a prefix of @a url. 02035 * 02036 * If the administrative area does not exist, then create it and 02037 * initialize it to an unlocked state. 02038 * 02039 * If the administrative area already exists then the given @a url 02040 * must match the URL in the administrative area and the given 02041 * @a revision must match the BASE of the working copy dir unless 02042 * the admin directory is scheduled for deletion or the 02043 * SVN_ERR_WC_OBSTRUCTED_UPDATE error will be returned. 02044 * 02045 * Do not ensure existence of @a path itself; if @a path does not 02046 * exist, return error. 02047 * 02048 * @since New in 1.5. 02049 */ 02050 svn_error_t * 02051 svn_wc_ensure_adm3(const char *path, 02052 const char *uuid, 02053 const char *url, 02054 const char *repos, 02055 svn_revnum_t revision, 02056 svn_depth_t depth, 02057 apr_pool_t *pool); 02058 02059 02060 /** 02061 * Similar to svn_wc_ensure_adm3(), but with @a depth set to 02062 * @c svn_depth_infinity. 02063 * 02064 * @deprecated Provided for backwards compatibility with the 1.4 API. 02065 * 02066 * @since New in 1.3. 02067 */ 02068 svn_error_t * 02069 svn_wc_ensure_adm2(const char *path, 02070 const char *uuid, 02071 const char *url, 02072 const char *repos, 02073 svn_revnum_t revision, 02074 apr_pool_t *pool); 02075 02076 02077 /** 02078 * Similar to svn_wc_ensure_adm2(), but with @a repos set to @c NULL. 02079 * 02080 * @deprecated Provided for backwards compatibility with the 1.2 API. 02081 */ 02082 svn_error_t * 02083 svn_wc_ensure_adm(const char *path, 02084 const char *uuid, 02085 const char *url, 02086 svn_revnum_t revision, 02087 apr_pool_t *pool); 02088 02089 02090 /** Set the repository root URL of @a path to @a repos, if possible. 02091 * 02092 * @a adm_access must contain @a path and be write-locked, if @a path 02093 * is versioned. Return no error if path is missing or unversioned. 02094 * Use @a pool for temporary allocations. 02095 * 02096 * @note In some circumstances, the repository root can't be set 02097 * without making the working copy corrupt. In such cases, this 02098 * function just returns no error, without modifying the @a path entry. 02099 * 02100 * @note This function exists to make it possible to try to set the repository 02101 * root in old working copies; new working copies normally get this set at 02102 * creation time. 02103 * 02104 * @since New in 1.3. 02105 */ 02106 svn_error_t * 02107 svn_wc_maybe_set_repos_root(svn_wc_adm_access_t *adm_access, 02108 const char *path, 02109 const char *repos, 02110 apr_pool_t *pool); 02111 02112 02113 /** 02114 * @defgroup svn_wc_status Working copy status. 02115 * @{ 02116 * 02117 * We have two functions for getting working copy status: one function 02118 * for getting the status of exactly one thing, and another for 02119 * getting the statuses of (potentially) multiple things. 02120 * 02121 * The concept of depth, as explained in the documentation for 02122 * svn_depth_t, may be useful in understanding this. Suppose we're 02123 * getting the status of directory D: 02124 * 02125 * To offer all three levels, we could have one unified function, 02126 * taking a `depth' parameter. Unfortunately, because this function 02127 * would have to handle multiple return values as well as the single 02128 * return value case, getting the status of just one entity would 02129 * become cumbersome: you'd have to roll through a hash to find one 02130 * lone status. 02131 * 02132 * So we have svn_wc_status() for depth-empty (just D itself), and 02133 * svn_wc_get_status_editor() for depth-immediates and depth-infinity, 02134 * since the latter two involve multiple return values. 02135 * 02136 * @note The status structures may contain a @c NULL ->entry field. 02137 * This indicates an item that is not versioned in the working copy. 02138 */ 02139 02140 /** The type of status for the working copy. */ 02141 enum svn_wc_status_kind 02142 { 02143 /** does not exist */ 02144 svn_wc_status_none = 1, 02145 02146 /** is not a versioned thing in this wc */ 02147 svn_wc_status_unversioned, 02148 02149 /** exists, but uninteresting */ 02150 svn_wc_status_normal, 02151 02152 /** is scheduled for addition */ 02153 svn_wc_status_added, 02154 02155 /** under v.c., but is missing */ 02156 svn_wc_status_missing, 02157 02158 /** scheduled for deletion */ 02159 svn_wc_status_deleted, 02160 02161 /** was deleted and then re-added */ 02162 svn_wc_status_replaced, 02163 02164 /** text or props have been modified */ 02165 svn_wc_status_modified, 02166 02167 /** local mods received repos mods */ 02168 svn_wc_status_merged, 02169 02170 /** local mods received conflicting repos mods */ 02171 svn_wc_status_conflicted, 02172 02173 /** is unversioned but configured to be ignored */ 02174 svn_wc_status_ignored, 02175 02176 /** an unversioned resource is in the way of the versioned resource */ 02177 svn_wc_status_obstructed, 02178 02179 /** an unversioned path populated by an svn:externals property */ 02180 svn_wc_status_external, 02181 02182 /** a directory doesn't contain a complete entries list */ 02183 svn_wc_status_incomplete 02184 }; 02185 02186 /** 02187 * Structure for holding the "status" of a working copy item. 02188 * 02189 * The item's entry data is in @a entry, augmented and possibly shadowed 02190 * by the other fields. @a entry is @c NULL if this item is not under 02191 * version control. 02192 * 02193 * @note Fields may be added to the end of this structure in future 02194 * versions. Therefore, to preserve binary compatibility, users 02195 * should not directly allocate structures of this type. 02196 * 02197 * @since New in 1.2. 02198 */ 02199 typedef struct svn_wc_status2_t 02200 { 02201 /** Can be @c NULL if not under version control. */ 02202 svn_wc_entry_t *entry; 02203 02204 /** The status of the entries text. */ 02205 enum svn_wc_status_kind text_status; 02206 02207 /** The status of the entries properties. */ 02208 enum svn_wc_status_kind prop_status; 02209 02210 /** a directory can be 'locked' if a working copy update was interrupted. */ 02211 svn_boolean_t locked; 02212 02213 /** a file or directory can be 'copied' if it's scheduled for 02214 * addition-with-history (or part of a subtree that is scheduled as such.). 02215 */ 02216 svn_boolean_t copied; 02217 02218 /** a file or directory can be 'switched' if the switch command has been 02219 * used. 02220 */ 02221 svn_boolean_t switched; 02222 02223 /** The entry's text status in the repository. */ 02224 enum svn_wc_status_kind repos_text_status; 02225 02226 /** The entry's property status in the repository. */ 02227 enum svn_wc_status_kind repos_prop_status; 02228 02229 /** The entry's lock in the repository, if any. */ 02230 svn_lock_t *repos_lock; 02231 02232 /** Set to the URI (actual or expected) of the item. 02233 * @since New in 1.3 02234 */ 02235 const char *url; 02236 02237 /** 02238 * @defgroup svn_wc_status_ood WC out-of-date info from the repository 02239 * @{ 02240 * 02241 * When the working copy item is out-of-date compared to the 02242 * repository, the following fields represent the state of the 02243 * youngest revision of the item in the repository. If the working 02244 * copy is not out of date, the fields are initialized as described 02245 * below. 02246 */ 02247 02248 /** Set to the youngest committed revision, or @c SVN_INVALID_REVNUM 02249 * if not out of date. 02250 * @since New in 1.3 02251 */ 02252 svn_revnum_t ood_last_cmt_rev; 02253 02254 /** Set to the most recent commit date, or @c 0 if not out of date. 02255 * @since New in 1.3 02256 */ 02257 apr_time_t ood_last_cmt_date; 02258 02259 /** Set to the node kind of the youngest commit, or @c svn_node_none 02260 * if not out of date. 02261 * @since New in 1.3 02262 */ 02263 svn_node_kind_t ood_kind; 02264 02265 /** Set to the user name of the youngest commit, or @c NULL if not 02266 * out of date or non-existent. Because a non-existent @c 02267 * svn:author property has the same behavior as an out-of-date 02268 * working copy, examine @c ood_last_cmt_rev to determine whether 02269 * the working copy is out of date. 02270 * @since New in 1.3 02271 */ 02272 const char *ood_last_cmt_author; 02273 02274 /** @} */ 02275 02276 /* NOTE! Please update svn_wc_dup_status2() when adding new fields here. */ 02277 } svn_wc_status2_t; 02278 02279 02280 02281 /** 02282 * Same as @c svn_wc_status2_t, but without the svn_lock_t 'repos_lock' field. 02283 * 02284 * @deprecated Provided for backward compatibility with the 1.1 API. 02285 */ 02286 typedef struct svn_wc_status_t 02287 { 02288 /** Can be @c NULL if not under version control. */ 02289 svn_wc_entry_t *entry; 02290 02291 /** The status of the entries text. */ 02292 enum svn_wc_status_kind text_status; 02293 02294 /** The status of the entries properties. */ 02295 enum svn_wc_status_kind prop_status; 02296 02297 /** a directory can be 'locked' if a working copy update was interrupted. */ 02298 svn_boolean_t locked; 02299 02300 /** a file or directory can be 'copied' if it's scheduled for 02301 * addition-with-history (or part of a subtree that is scheduled as such.). 02302 */ 02303 svn_boolean_t copied; 02304 02305 /** a file or directory can be 'switched' if the switch command has been 02306 * used. 02307 */ 02308 svn_boolean_t switched; 02309 02310 /** The entry's text status in the repository. */ 02311 enum svn_wc_status_kind repos_text_status; 02312 02313 /** The entry's property status in the repository. */ 02314 enum svn_wc_status_kind repos_prop_status; 02315 02316 } svn_wc_status_t; 02317 02318 02319 02320 /** 02321 * Return a deep copy of the @a orig_stat status structure, allocated 02322 * in @a pool. 02323 * 02324 * @since New in 1.2. 02325 */ 02326 svn_wc_status2_t * 02327 svn_wc_dup_status2(svn_wc_status2_t *orig_stat, 02328 apr_pool_t *pool); 02329 02330 02331 /** 02332 * Same as svn_wc_dup_status2(), but for older svn_wc_status_t structures. 02333 * 02334 * @deprecated Provided for backward compatibility with the 1.1 API. 02335 */ 02336 svn_wc_status_t * 02337 svn_wc_dup_status(svn_wc_status_t *orig_stat, 02338 apr_pool_t *pool); 02339 02340 02341 /** 02342 * Fill @a *status for @a path, allocating in @a pool. 02343 * @a adm_access must be an access baton for @a path. 02344 * 02345 * Here are some things to note about the returned structure. A quick 02346 * examination of the @c status->text_status after a successful return of 02347 * this function can reveal the following things: 02348 * 02349 * - @c svn_wc_status_none : @a path is not versioned, and is either not 02350 * present on disk, or is ignored by svn's 02351 * default ignore regular expressions or the 02352 * svn:ignore property setting for @a path's 02353 * parent directory. 02354 * 02355 * - @c svn_wc_status_missing : @a path is versioned, but is missing from 02356 * the working copy. 02357 * 02358 * - @c svn_wc_status_unversioned : @a path is not versioned, but is 02359 * present on disk and not being 02360 * ignored (see above). 02361 * 02362 * The other available results for the @c text_status field are more 02363 * straightforward in their meanings. See the comments on the 02364 * @c svn_wc_status_kind structure for some hints. 02365 * 02366 * @since New in 1.2. 02367 */ 02368 svn_error_t * 02369 svn_wc_status2(svn_wc_status2_t **status, 02370 const char *path, 02371 svn_wc_adm_access_t *adm_access, 02372 apr_pool_t *pool); 02373 02374 02375 /** 02376 * Same as svn_wc_status2(), but for older svn_wc_status_t structures. 02377 * 02378 * @deprecated Provided for backward compatibility with the 1.1 API. 02379 */ 02380 svn_error_t * 02381 svn_wc_status(svn_wc_status_t **status, 02382 const char *path, 02383 svn_wc_adm_access_t *adm_access, 02384 apr_pool_t *pool); 02385 02386 02387 02388 02389 /** 02390 * A callback for reporting a @a status about @a path. 02391 * 02392 * @a baton is a closure object; it should be provided by the 02393 * implementation, and passed by the caller. 02394 * 02395 * @since New in 1.2. 02396 */ 02397 typedef void (*svn_wc_status_func2_t)(void *baton, 02398 const char *path, 02399 svn_wc_status2_t *status); 02400 02401 /** 02402 * Same as svn_wc_status_func2_t(), but for older svn_wc_status_t structures. 02403 * 02404 * @deprecated Provided for backward compatibility with the 1.1 API. 02405 */ 02406 typedef void (*svn_wc_status_func_t)(void *baton, 02407 const char *path, 02408 svn_wc_status_t *status); 02409 02410 02411 /** 02412 * Set @a *editor and @a *edit_baton to an editor that generates @c 02413 * svn_wc_status2_t structures and sends them through @a status_func / 02414 * @a status_baton. @a anchor is an access baton, with a tree lock, 02415 * for the local path to the working copy which will be used as the 02416 * root of our editor. If @a target is not empty, it represents an 02417 * entry in the @a anchor path which is the subject of the editor 02418 * drive (otherwise, the @a anchor is the subject). 02419 * 02420 * If @a set_locks_baton is non-@c NULL, it will be set to a baton that can 02421 * be used in a call to the svn_wc_status_set_repos_locks() function. 02422 * 02423 * Callers drive this editor to describe working copy out-of-dateness 02424 * with respect to the repository. If this information is not 02425 * available or not desired, callers should simply call the 02426 * close_edit() function of the @a editor vtable. 02427 * 02428 * If the editor driver calls @a editor's set_target_revision() vtable 02429 * function, then when the edit drive is completed, @a *edit_revision 02430 * will contain the revision delivered via that interface. 02431 * 02432 * Assuming the target is a directory, then: 02433 * 02434 * - If @a get_all is FALSE, then only locally-modified entries will be 02435 * returned. If TRUE, then all entries will be returned. 02436 * 02437 * - If @a depth is @c svn_depth_empty, a status structure will 02438 * be returned for the target only; if @c svn_depth_files, for the 02439 * target and its immediate file children; if 02440 * @c svn_depth_immediates, for the target and its immediate 02441 * children; if @c svn_depth_infinity, for the target and 02442 * everything underneath it, fully recursively. 02443 * 02444 * If @a depth is @c svn_depth_unknown, take depths from the 02445 * working copy and behave as above in each directory's case. 02446 * 02447 * If the given @a depth is incompatible with the depth found in a 02448 * working copy directory, the found depth always governs. 02449 * 02450 * If @a no_ignore is set, statuses that would typically be ignored 02451 * will instead be reported. 02452 * 02453 * @a ignore_patterns is an array of file patterns matching 02454 * unversioned files to ignore for the purposes of status reporting, 02455 * or @c NULL if the default set of ignorable file patterns should be used. 02456 * 02457 * If @a cancel_func is non-NULL, call it with @a cancel_baton while building 02458 * the @a statushash to determine if the client has cancelled the operation. 02459 * 02460 * If @a traversal_info is non-NULL, then record pre-update traversal 02461 * state in it. (Caller should obtain @a traversal_info from 02462 * svn_wc_init_traversal_info().) 02463 * 02464 * Allocate the editor itself in @a pool, but the editor does temporary 02465 * allocations in a subpool of @a pool. 02466 * 02467 * @since New in 1.5. 02468 */ 02469 svn_error_t * 02470 svn_wc_get_status_editor3(const svn_delta_editor_t **editor, 02471 void **edit_baton, 02472 void **set_locks_baton, 02473 svn_revnum_t *edit_revision, 02474 svn_wc_adm_access_t *anchor, 02475 const char *target, 02476 svn_depth_t depth, 02477 svn_boolean_t get_all, 02478 svn_boolean_t no_ignore, 02479 apr_array_header_t *ignore_patterns, 02480 svn_wc_status_func2_t status_func, 02481 void *status_baton, 02482 svn_cancel_func_t cancel_func, 02483 void *cancel_baton, 02484 svn_wc_traversal_info_t *traversal_info, 02485 apr_pool_t *pool); 02486 02487 /** 02488 * Like svn_wc_get_status_editor3(), but with @a ignore_patterns 02489 * provided from the corresponding value in @a config, and @a recurse 02490 * instead of @a depth. If @a recurse is TRUE, behave as if for @c 02491 * svn_depth_infinity; else if @a recurse is FALSE, behave as if for 02492 * @c svn_depth_immediates. 02493 * 02494 * @since New in 1.2. 02495 * @deprecated Provided for backward compatibility with the 1.4 API. 02496 */ 02497 svn_error_t * 02498 svn_wc_get_status_editor2(const svn_delta_editor_t **editor, 02499 void **edit_baton, 02500 void **set_locks_baton, 02501 svn_revnum_t *edit_revision, 02502 svn_wc_adm_access_t *anchor, 02503 const char *target, 02504 apr_hash_t *config, 02505 svn_boolean_t recurse, 02506 svn_boolean_t get_all, 02507 svn_boolean_t no_ignore, 02508 svn_wc_status_func2_t status_func, 02509 void *status_baton, 02510 svn_cancel_func_t cancel_func, 02511 void *cancel_baton, 02512 svn_wc_traversal_info_t *traversal_info, 02513 apr_pool_t *pool); 02514 02515 /** 02516 * Same as svn_wc_get_status_editor2(), but with @a set_locks_baton set 02517 * to @c NULL, and taking a deprecated svn_wc_status_func_t argument. 02518 * 02519 * @deprecated Provided for backward compatibility with the 1.1 API. 02520 */ 02521 svn_error_t * 02522 svn_wc_get_status_editor(const svn_delta_editor_t **editor, 02523 void **edit_baton, 02524 svn_revnum_t *edit_revision, 02525 svn_wc_adm_access_t *anchor, 02526 const char *target, 02527 apr_hash_t *config, 02528 svn_boolean_t recurse, 02529 svn_boolean_t get_all, 02530 svn_boolean_t no_ignore, 02531 svn_wc_status_func_t status_func, 02532 void *status_baton, 02533 svn_cancel_func_t cancel_func, 02534 void *cancel_baton, 02535 svn_wc_traversal_info_t *traversal_info, 02536 apr_pool_t *pool); 02537 02538 02539 /** 02540 * Associate @a locks, a hash table mapping <tt>const char*</tt> 02541 * absolute repository paths to <tt>svn_lock_t</tt> objects, with a 02542 * @a set_locks_baton returned by an earlier call to 02543 * svn_wc_get_status_editor3(). @a repos_root is the repository root URL. 02544 * Perform all allocations in @a pool. 02545 * 02546 * @note @a locks will not be copied, so it must be valid throughout the 02547 * edit. @a pool must also not be destroyed or cleared before the edit is 02548 * finished. 02549 * 02550 * @since New in 1.2. 02551 */ 02552 svn_error_t * 02553 svn_wc_status_set_repos_locks(void *set_locks_baton, 02554 apr_hash_t *locks, 02555 const char *repos_root, 02556 apr_pool_t *pool); 02557 02558 /** @} */ 02559 02560 02561 /** 02562 * Copy @a src to @a dst_basename in @a dst_parent, and schedule 02563 * @a dst_basename for addition to the repository, remembering the copy 02564 * history. 02565 * 02566 * @a src must be a file or directory under version control; @a dst_parent 02567 * must be a directory under version control in the same working copy; 02568 * @a dst_basename will be the name of the copied item, and it must not 02569 * exist already. 02570 * 02571 * If @a cancel_func is non-NULL, call it with @a cancel_baton at 02572 * various points during the operation. If it returns an error 02573 * (typically @c SVN_ERR_CANCELLED), return that error immediately. 02574 * 02575 * For each file or directory copied, @a notify_func will be called 02576 * with its path and the @a notify_baton. @a notify_func may be @c NULL 02577 * if you are not interested in this information. 02578 * 02579 * @par Important: 02580 * This is a variant of svn_wc_add(). No changes will happen 02581 * to the repository until a commit occurs. This scheduling can be 02582 * removed with svn_client_revert2(). 02583 * 02584 * @since New in 1.2. 02585 */ 02586 svn_error_t * 02587 svn_wc_copy2(const char *src, 02588 svn_wc_adm_access_t *dst_parent, 02589 const char *dst_basename, 02590 svn_cancel_func_t cancel_func, 02591 void *cancel_baton, 02592 svn_wc_notify_func2_t notify_func, 02593 void *notify_baton, 02594 apr_pool_t *pool); 02595 02596 /** 02597 * Similar to svn_wc_copy2(), but takes an @c svn_wc_notify_func_t instead. 02598 * 02599 * @deprecated Provided for backward compatibility with the 1.1 API. 02600 */ 02601 svn_error_t * 02602 svn_wc_copy(const char *src, 02603 svn_wc_adm_access_t *dst_parent, 02604 const char *dst_basename, 02605 svn_cancel_func_t cancel_func, 02606 void *cancel_baton, 02607 svn_wc_notify_func_t notify_func, 02608 void *notify_baton, 02609 apr_pool_t *pool); 02610 02611 /** 02612 * Schedule @a path for deletion, it will be deleted from the repository on 02613 * the next commit. If @a path refers to a directory, then a recursive 02614 * deletion will occur. @a adm_access must hold a write lock for the parent 02615 * of @a path. 02616 * 02617 * If @a keep_local is FALSE, this function immediately deletes all files, 02618 * modified and unmodified, versioned and unversioned from the working copy. 02619 * It also immediately deletes unversioned directories and directories that 02620 * are scheduled to be added. Only versioned directories will remain in the 02621 * working copy, these get deleted by the update following the commit. 02622 * 02623 * If @a keep_local is TRUE, all files and directories will be kept in the 02624 * working copy (and will become unversioned on the next commit). 02625 * 02626 * If @a cancel_func is non-NULL, call it with @a cancel_baton at 02627 * various points during the operation. If it returns an error 02628 * (typically @c SVN_ERR_CANCELLED), return that error immediately. 02629 * 02630 * For each path marked for deletion, @a notify_func will be called with 02631 * the @a notify_baton and that path. The @a notify_func callback may be 02632 * @c NULL if notification is not needed. 02633 * 02634 * @since New in 1.5. 02635 */ 02636 svn_error_t * 02637 svn_wc_delete3(const char *path, 02638 svn_wc_adm_access_t *adm_access, 02639 svn_cancel_func_t cancel_func, 02640 void *cancel_baton, 02641 svn_wc_notify_func2_t notify_func, 02642 void *notify_baton, 02643 svn_boolean_t keep_local, 02644 apr_pool_t *pool); 02645 02646 /** 02647 * Similar to svn_wc_delete3(), but with @a keep_local always set to FALSE. 02648 * 02649 * @deprecated Provided for backward compatibility with the 1.4 API. 02650 */ 02651 svn_error_t * 02652 svn_wc_delete2(const char *path, 02653 svn_wc_adm_access_t *adm_access, 02654 svn_cancel_func_t cancel_func, 02655 void *cancel_baton, 02656 svn_wc_notify_func2_t notify_func, 02657 void *notify_baton, 02658 apr_pool_t *pool); 02659 02660 /** 02661 * Similar to svn_wc_delete2(), but takes an @c svn_wc_notify_func_t instead. 02662 * 02663 * @deprecated Provided for backward compatibility with the 1.1 API. 02664 */ 02665 svn_error_t * 02666 svn_wc_delete(const char *path, 02667 svn_wc_adm_access_t *adm_access, 02668 svn_cancel_func_t cancel_func, 02669 void *cancel_baton, 02670 svn_wc_notify_func_t notify_func, 02671 void *notify_baton, 02672 apr_pool_t *pool); 02673 02674 02675 /** 02676 * Put @a path under version control by adding an entry in its parent, 02677 * and, if @a path is a directory, adding an administrative area. The 02678 * new entry and anything under it is scheduled for addition to the 02679 * repository. @a parent_access should hold a write lock for the parent 02680 * directory of @a path. If @a path is a directory then an access baton 02681 * for @a path will be added to the set containing @a parent_access. 02682 * 02683 * If @a path does not exist, return @c SVN_ERR_WC_PATH_NOT_FOUND. 02684 * 02685 * If @a copyfrom_url is non-NULL, it and @a copyfrom_rev are used as 02686 * `copyfrom' args. This is for copy operations, where one wants 02687 * to schedule @a path for addition with a particular history. 02688 * 02689 * If @a cancel_func is non-NULL, call it with @a cancel_baton at 02690 * various points during the operation. If it returns an error 02691 * (typically @c SVN_ERR_CANCELLED), return that error immediately. 02692 * 02693 * When the @a path has been added, then @a notify_func will be called 02694 * (if it is not @c NULL) with the @a notify_baton and the path. 02695 * 02696 * Return @c SVN_ERR_WC_NODE_KIND_CHANGE if @a path is both an unversioned 02697 * directory and a file that is scheduled for deletion or in state deleted. 02698 * 02699 *<pre> ### This function currently does double duty -- it is also 02700 * ### responsible for "switching" a working copy directory over to a 02701 * ### new copyfrom ancestry and scheduling it for addition. Here is 02702 * ### the old doc string from Ben, lightly edited to bring it 02703 * ### up-to-date, explaining the TRUE, secret life of this function:</pre> 02704 * 02705 * Given a @a path within a working copy of type KIND, follow this algorithm: 02706 * 02707 * - if @a path is not under version control: 02708 * - Place it under version control and schedule for addition; 02709 * if @a copyfrom_url is non-NULL, use it and @a copyfrom_rev as 02710 * 'copyfrom' history 02711 * 02712 * - if @a path is already under version control: 02713 * (This can only happen when a directory is copied, in which 02714 * case ancestry must have been supplied as well.) 02715 * 02716 * - Schedule the directory itself for addition with copyfrom history. 02717 * - Mark all its children with a 'copied' flag 02718 * - Rewrite all the URLs to what they will be after a commit. 02719 * - ### @todo Remove old wcprops too, see the '###' below. 02720 * 02721 *<pre> ### I think possibly the "switchover" functionality should be 02722 * ### broken out into a separate function, but its all intertwined in 02723 * ### the code right now. Ben, thoughts? Hard? Easy? Mauve?</pre> 02724 * 02725 * ### Update: see "###" comment in svn_wc_add_repos_file()'s doc 02726 * string about this. 02727 * 02728 * @since New in 1.2. 02729 */ 02730 svn_error_t * 02731 svn_wc_add2(const char *path, 02732 svn_wc_adm_access_t *parent_access, 02733 const char *copyfrom_url, 02734 svn_revnum_t copyfrom_rev, 02735 svn_cancel_func_t cancel_func, 02736 void *cancel_baton, 02737 svn_wc_notify_func2_t notify_func, 02738 void *notify_baton, 02739 apr_pool_t *pool); 02740 02741 /** 02742 * Similar to svn_wc_add2(), but takes an @c svn_wc_notify_func_t instead. 02743 * 02744 * @deprecated Provided for backward compatibility with the 1.1 API. 02745 */ 02746 svn_error_t * 02747 svn_wc_add(const char *path, 02748 svn_wc_adm_access_t *parent_access, 02749 const char *copyfrom_url, 02750 svn_revnum_t copyfrom_rev, 02751 svn_cancel_func_t cancel_func, 02752 void *cancel_baton, 02753 svn_wc_notify_func_t notify_func, 02754 void *notify_baton, 02755 apr_pool_t *pool); 02756 02757 /** Add a file to a working copy at @a dst_path, obtaining the text-base's 02758 * contents from @a new_text_base_path, the wc file's content from 02759 * @a new_text_path, its base properties from @a new_base_props and 02760 * wc properties from @a new_props. 02761 * The base text and props normally come from the repository file 02762 * represented by the copyfrom args, see below. The new file will 02763 * be scheduled for addition with history. 02764 * 02765 * Automatically remove @a new_text_base_path and @a new_text_path 02766 * upon successful completion. 02767 * 02768 * @a new_text_path and @a new_props may be NULL, in which case 02769 * the working copy text and props are taken from the base files with 02770 * appropriate translation of the file's content. 02771 * 02772 * @a adm_access, or an access baton in its associated set, must 02773 * contain a write lock for the parent of @a dst_path. 02774 * 02775 * If @a copyfrom_url is non-NULL, then @a copyfrom_rev must be a 02776 * valid revision number, and together they are the copyfrom history 02777 * for the new file. 02778 * 02779 * Use @a pool for temporary allocations. 02780 * 02781 * ### This function is very redundant with svn_wc_add(). Ideally, 02782 * we'd merge them, so that svn_wc_add() would just take optional 02783 * new_props and optional copyfrom information. That way it could be 02784 * used for both 'svn add somefilesittingonmydisk' and for adding 02785 * files from repositories, with or without copyfrom history. 02786 * 02787 * The problem with this Ideal Plan is that svn_wc_add() also takes 02788 * care of recursive URL-rewriting. There's a whole comment in its 02789 * doc string about how that's really weird, outside its core mission, 02790 * etc, etc. So another part of the Ideal Plan is that that 02791 * functionality of svn_wc_add() would move into a separate function. 02792 * 02793 * @since New in 1.4 02794 */ 02795 svn_error_t * 02796 svn_wc_add_repos_file2(const char *dst_path, 02797 svn_wc_adm_access_t *adm_access, 02798 const char *new_text_base_path, 02799 const char *new_text_path, 02800 apr_hash_t *new_base_props, 02801 apr_hash_t *new_props, 02802 const char *copyfrom_url, 02803 svn_revnum_t copyfrom_rev, 02804 apr_pool_t *pool); 02805 02806 /** Same as svn_wc_add_repos_file2(), except that it doesn't have the 02807 * new_text_base_path and new_base_props arguments. 02808 * 02809 * @deprecated Provided for compatibility with the 1.3 API 02810 * 02811 */ 02812 02813 svn_error_t * 02814 svn_wc_add_repos_file(const char *dst_path, 02815 svn_wc_adm_access_t *adm_access, 02816 const char *new_text_path, 02817 apr_hash_t *new_props, 02818 const char *copyfrom_url, 02819 svn_revnum_t copyfrom_rev, 02820 apr_pool_t *pool); 02821 02822 02823 /** Remove entry @a name in @a adm_access from revision control. @a name 02824 * must be either a file or @c SVN_WC_ENTRY_THIS_DIR. @a adm_access must 02825 * hold a write lock. 02826 * 02827 * If @a name is a file, all its info will be removed from @a adm_access's 02828 * administrative directory. If @a name is @c SVN_WC_ENTRY_THIS_DIR, then 02829 * @a adm_access's entire administrative area will be deleted, along with 02830 * *all* the administrative areas anywhere in the tree below @a adm_access. 02831 * 02832 * Normally, only administrative data is removed. However, if 02833 * @a destroy_wf is TRUE, then all working file(s) and dirs are deleted 02834 * from disk as well. When called with @a destroy_wf, any locally 02835 * modified files will *not* be deleted, and the special error 02836 * @c SVN_ERR_WC_LEFT_LOCAL_MOD might be returned. (Callers only need to 02837 * check for this special return value if @a destroy_wf is TRUE.) 02838 * 02839 * If @a instant_error is TRUE, then return @c 02840 * SVN_ERR_WC_LEFT_LOCAL_MOD the instant a locally modified file is 02841 * encountered. Otherwise, leave locally modified files in place and 02842 * return the error only after all the recursion is complete. 02843 * 02844 * If @a cancel_func is non-NULL, call it with @a cancel_baton at 02845 * various points during the removal. If it returns an error 02846 * (typically @c SVN_ERR_CANCELLED), return that error immediately. 02847 * 02848 * WARNING: This routine is exported for careful, measured use by 02849 * libsvn_client. Do *not* call this routine unless you really 02850 * understand what the heck you're doing. 02851 */ 02852 svn_error_t * 02853 svn_wc_remove_from_revision_control(svn_wc_adm_access_t *adm_access, 02854 const char *name, 02855 svn_boolean_t destroy_wf, 02856 svn_boolean_t instant_error, 02857 svn_cancel_func_t cancel_func, 02858 void *cancel_baton, 02859 apr_pool_t *pool); 02860 02861 02862 /** 02863 * Assuming @a path is under version control and in a state of conflict, 02864 * then take @a path *out* of this state. If @a resolve_text is TRUE then 02865 * any text conflict is resolved, if @a resolve_props is TRUE then any 02866 * property conflicts are resolved. 02867 * 02868 * If @a depth is @c svn_depth_empty, act only on @a path; if 02869 * @c svn_depth_files, resolve @a path and its conflicted file 02870 * children (if any); if @c svn_depth_immediates, resolve @a path and 02871 * all its immediate conflicted children (both files and directories, 02872 * if any); if @c svn_depth_infinity, resolve @a path and every 02873 * conflicted file or directory anywhere beneath it. 02874 * 02875 * If @a conflict_choice is @c svn_wc_conflict_choose_base, resolve the 02876 * conflict with the old file contents; if 02877 * @c svn_wc_conflict_choose_mine_full, use the original working contents; 02878 * if @c svn_wc_conflict_choose_theirs_full, the new contents; and if 02879 * @c svn_wc_conflict_choose_merged, don't change the contents at all, 02880 * just remove the conflict status, which is the pre-1.5 behavior. 02881 * 02882 * (@c svn_wc_conflict_choose_theirs_conflict and 02883 * @c svn_wc_conflict_choose_mine_conflict are not yet implemented; 02884 * the effect of passing one of those values as @a conflict_choice is 02885 * currently undefined, which may or may not be an underhanded way of 02886 * allowing real behaviors to be added for them later without revving 02887 * this interface.) 02888 * 02889 * @a adm_access is an access baton, with a write lock, for @a path. 02890 * 02891 * Needless to say, this function doesn't touch conflict markers or 02892 * anything of that sort -- only a human can semantically resolve a 02893 * conflict. Instead, this function simply marks a file as "having 02894 * been resolved", clearing the way for a commit. 02895 * 02896 * The implementation details are opaque, as our "conflicted" criteria 02897 * might change over time. (At the moment, this routine removes the 02898 * three fulltext 'backup' files and any .prej file created in a conflict, 02899 * and modifies @a path's entry.) 02900 * 02901 * If @a path is not under version control, return @c SVN_ERR_ENTRY_NOT_FOUND. 02902 * If @a path isn't in a state of conflict to begin with, do nothing, and 02903 * return @c SVN_NO_ERROR. 02904 * 02905 * If @c path was successfully taken out of a state of conflict, report this 02906 * information to @c notify_func (if non-@c NULL.) If only text or only 02907 * property conflict resolution was requested, and it was successful, then 02908 * success gets reported. 02909 * 02910 * @since New in 1.5. 02911 */ 02912 svn_error_t * 02913 svn_wc_resolved_conflict3(const char *path, 02914 svn_wc_adm_access_t *adm_access, 02915 svn_boolean_t resolve_text, 02916 svn_boolean_t resolve_props, 02917 svn_depth_t depth, 02918 svn_wc_conflict_choice_t conflict_choice, 02919 svn_wc_notify_func2_t notify_func, 02920 void *notify_baton, 02921 svn_cancel_func_t cancel_func, 02922 void *cancel_baton, 02923 apr_pool_t *pool); 02924 02925 02926 /** 02927 * Similar to svn_wc_resolved_conflict3(), but without automatic conflict 02928 * resolution support, and with @a depth set according to @a recurse: 02929 * if @a recurse is TRUE, @a depth is @c svn_depth_infinity, else it is 02930 * @c svn_depth_files. 02931 * 02932 * @deprecated Provided for backward compatibility with the 1.4 API. 02933 */ 02934 svn_error_t * 02935 svn_wc_resolved_conflict2(const char *path, 02936 svn_wc_adm_access_t *adm_access, 02937 svn_boolean_t resolve_text, 02938 svn_boolean_t resolve_props, 02939 svn_boolean_t recurse, 02940 svn_wc_notify_func2_t notify_func, 02941 void *notify_baton, 02942 svn_cancel_func_t cancel_func, 02943 void *cancel_baton, 02944 apr_pool_t *pool); 02945 02946 /** 02947 * Similar to svn_wc_resolved_conflict2(), but takes an 02948 * svn_wc_notify_func_t and doesn't have cancellation support. 02949 * 02950 * @deprecated Provided for backward compatibility with the 1.0 API. 02951 */ 02952 svn_error_t * 02953 svn_wc_resolved_conflict(const char *path, 02954 svn_wc_adm_access_t *adm_access, 02955 svn_boolean_t resolve_text, 02956 svn_boolean_t resolve_props, 02957 svn_boolean_t recurse, 02958 svn_wc_notify_func_t notify_func, 02959 void *notify_baton, 02960 apr_pool_t *pool); 02961 02962 02963 /* Commits. */ 02964 02965 02966 /** 02967 * Storage type for queued post-commit data. 02968 * 02969 * @since New in 1.5. 02970 */ 02971 typedef struct svn_wc_committed_queue_t svn_wc_committed_queue_t; 02972 02973 02974 /** 02975 * Create a queue for use with svn_wc_queue_committed() and 02976 * svn_wc_process_committed_queue(). 02977 * 02978 * The returned queue and all further 02979 * allocations required for queueing new items will also be done 02980 * from @a pool. 02981 * 02982 * @since New in 1.5. 02983 */ 02984 svn_wc_committed_queue_t * 02985 svn_wc_committed_queue_create(apr_pool_t *pool); 02986 02987 02988 02989 /** 02990 * Queue committed items to be processed later by 02991 * svn_wc_process_committed_queue(). 02992 * 02993 * The first time this function is called, @a *queue should 02994 * be @c NULL to signal that initialization is required. 02995 * 02996 * All pointer data passed to this function 02997 * (@a path, @a adm_access, @a wcprop_changes 02998 * and @a digest) should remain valid until the queue has been 02999 * processed by svn_wc_process_committed_queue(). 03000 * 03001 * The parameters have the same meaning as those 03002 * for svn_wc_process_committed4(). 03003 * 03004 * @since New in 1.5. 03005 */ 03006 svn_error_t * 03007 svn_wc_queue_committed(svn_wc_committed_queue_t **queue, 03008 const char *path, 03009 svn_wc_adm_access_t *adm_access, 03010 svn_boolean_t recurse, 03011 apr_array_header_t *wcprop_changes, 03012 svn_boolean_t remove_lock, 03013 svn_boolean_t remove_changelist, 03014 const unsigned char *digest, 03015 apr_pool_t *pool); 03016 03017 03018 /** 03019 * Like svn_wc_process_committed4(), but batch processes 03020 * items queued with svn_wc_queue_committed(). 03021 * 03022 * @since New in 1.5. 03023 */ 03024 svn_error_t * 03025 svn_wc_process_committed_queue(svn_wc_committed_queue_t *queue, 03026 svn_wc_adm_access_t *adm_access, 03027 svn_revnum_t new_revnum, 03028 const char *rev_date, 03029 const char *rev_author, 03030 apr_pool_t *pool); 03031 03032 03033 /** 03034 * Bump a successfully committed absolute @a path to @a new_revnum after a 03035 * commit succeeds. @a rev_date and @a rev_author are the (server-side) 03036 * date and author of the new revision; one or both may be @c NULL. 03037 * @a adm_access must hold a write lock appropriate for @a path. 03038 * 03039 * If non-NULL, @a wcprop_changes is an array of <tt>svn_prop_t *</tt> 03040 * changes to wc properties; if an @c svn_prop_t->value is NULL, then 03041 * that property is deleted. 03042 * 03043 * If @a remove_lock is @c TRUE, any entryprops related to a repository 03044 * lock will be removed. 03045 * 03046 * If @a remove_changelist is @c TRUE, any association with a 03047 * changelist will be removed. 03048 * 03049 * If @a path is a member of a changelist, remove that association. 03050 * 03051 * If @a path is a file and @a digest is non-NULL, use @a digest as 03052 * the checksum for the new text base. Else, calculate the checksum 03053 * if needed. 03054 * 03055 * If @a recurse is TRUE and @a path is a directory, then bump every 03056 * versioned object at or under @a path. This is usually done for 03057 * copied trees. 03058 * 03059 * @since New in 1.5. 03060 */ 03061 svn_error_t * 03062 svn_wc_process_committed4(const char *path, 03063 svn_wc_adm_access_t *adm_access, 03064 svn_boolean_t recurse, 03065 svn_revnum_t new_revnum, 03066 const char *rev_date, 03067 const char *rev_author, 03068 apr_array_header_t *wcprop_changes, 03069 svn_boolean_t remove_lock, 03070 svn_boolean_t remove_changelist, 03071 const unsigned char *digest, 03072 apr_pool_t *pool); 03073 03074 /** Similar to svn_wc_process_committed4(), but with @a 03075 * remove_changelist set to FALSE. 03076 * 03077 * @since New in 1.4. 03078 * 03079 * @deprecated Provided for backwards compatibility with the 1.4 API. 03080 */ 03081 svn_error_t * 03082 svn_wc_process_committed3(const char *path, 03083 svn_wc_adm_access_t *adm_access, 03084 svn_boolean_t recurse, 03085 svn_revnum_t new_revnum, 03086 const char *rev_date, 03087 const char *rev_author, 03088 apr_array_header_t *wcprop_changes, 03089 svn_boolean_t remove_lock, 03090 const unsigned char *digest, 03091 apr_pool_t *pool); 03092 03093 /** Similar to svn_wc_process_committed3(), but with @a digest set to 03094 * NULL. 03095 * 03096 * @since New in 1.2. 03097 * 03098 * @deprecated Provided for backwards compatibility with the 1.3 API. 03099 */ 03100 svn_error_t * 03101 svn_wc_process_committed2(const char *path, 03102 svn_wc_adm_access_t *adm_access, 03103 svn_boolean_t recurse, 03104 svn_revnum_t new_revnum, 03105 const char *rev_date, 03106 const char *rev_author, 03107 apr_array_header_t *wcprop_changes, 03108 svn_boolean_t remove_lock, 03109 apr_pool_t *pool); 03110 03111 /** 03112 * Similar to svn_wc_process_committed2(), but with @a remove_lock set to 03113 * @c FALSE. 03114 * 03115 * @deprecated Provided for backward compatibility with the 1.1 API. 03116 */ 03117 svn_error_t * 03118 svn_wc_process_committed(const char *path, 03119 svn_wc_adm_access_t *adm_access, 03120 svn_boolean_t recurse, 03121 svn_revnum_t new_revnum, 03122 const char *rev_date, 03123 const char *rev_author, 03124 apr_array_header_t *wcprop_changes, 03125 apr_pool_t *pool); 03126 03127 03128 03129 03130 03131 /** 03132 * Do a depth-first crawl in a working copy, beginning at @a path. 03133 * 03134 * Communicate the `state' of the working copy's revisions and depths 03135 * to @a reporter/@a report_baton. Obviously, if @a path is a file 03136 * instead of a directory, this depth-first crawl will be a short one. 03137 * 03138 * No locks are or logs are created, nor are any animals harmed in the 03139 * process. No cleanup is necessary. @a adm_access must be an access 03140 * baton for the @a path hierarchy, it does not require a write lock. 03141 * 03142 * After all revisions are reported, @a reporter->finish_report() is 03143 * called, which immediately causes the RA layer to update the working 03144 * copy. Thus the return value may very well reflect the result of 03145 * the update! 03146 * 03147 * If @a depth is @c svn_depth_empty, then report state only for 03148 * @a path itself. If @c svn_depth_files, do the same and include 03149 * immediate file children of @a path. If @c svn_depth_immediates, 03150 * then behave as if for @c svn_depth_files but also report the 03151 * property states of immediate subdirectories. If @a depth is 03152 * @c svn_depth_infinity, then report state fully recursively. All 03153 * descents are only as deep as @a path's own depth permits, of 03154 * course. If @a depth is @c svn_depth_unknown, then just use 03155 * @c svn_depth_infinity, which in practice means depth of @a path. 03156 * 03157 * Iff @a depth_compatibility_trick is TRUE, then set the @c start_empty 03158 * flag on @a reporter->set_path() and @a reporter->link_path() calls 03159 * as necessary to trick a pre-1.5 (i.e., depth-unaware) server into 03160 * sending back all the items the client might need to upgrade a 03161 * working copy from a shallower depth to a deeper one. 03162 * 03163 * If @a restore_files is TRUE, then unexpectedly missing working files 03164 * will be restored from the administrative directory's cache. For each 03165 * file restored, the @a notify_func function will be called with the 03166 * @a notify_baton and the path of the restored file. @a notify_func may 03167 * be @c NULL if this notification is not required. If @a 03168 * use_commit_times is TRUE, then set restored files' timestamps to 03169 * their last-commit-times. 03170 * 03171 * If @a traversal_info is non-NULL, then record pre-update traversal 03172 * state in it. (Caller should obtain @a traversal_info from 03173 * svn_wc_init_traversal_info().) 03174 * 03175 * @since New in 1.5. 03176 */ 03177 svn_error_t * 03178 svn_wc_crawl_revisions3(const char *path, 03179 svn_wc_adm_access_t *adm_access, 03180 const svn_ra_reporter3_t *reporter, 03181 void *report_baton, 03182 svn_boolean_t restore_files, 03183 svn_depth_t depth, 03184 svn_boolean_t depth_compatibility_trick, 03185 svn_boolean_t use_commit_times, 03186 svn_wc_notify_func2_t notify_func, 03187 void *notify_baton, 03188 svn_wc_traversal_info_t *traversal_info, 03189 apr_pool_t *pool); 03190 03191 /** 03192 * Similar to svn_wc_crawl_revisions3, but taking svn_ra_reporter2_t 03193 * instead of svn_ra_reporter3_t, and therefore only able to report @c 03194 * svn_depth_infinity for depths; and taking @a recurse instead of @a 03195 * depth; and with @a depth_compatibility_trick always false. 03196 * 03197 * @deprecated Provided for compatibility with the 1.4 API. 03198 */ 03199 svn_error_t * 03200 svn_wc_crawl_revisions2(const char *path, 03201 svn_wc_adm_access_t *adm_access, 03202 const svn_ra_reporter2_t *reporter, 03203 void *report_baton, 03204 svn_boolean_t restore_files, 03205 svn_boolean_t recurse, 03206 svn_boolean_t use_commit_times, 03207 svn_wc_notify_func2_t notify_func, 03208 void *notify_baton, 03209 svn_wc_traversal_info_t *traversal_info, 03210 apr_pool_t *pool); 03211 03212 /** 03213 * Similar to svn_wc_crawl_revisions2(), but takes an svn_wc_notify_func_t 03214 * and a @c svn_reporter_t instead. 03215 * 03216 * @deprecated Provided for backward compatibility with the 1.1 API. 03217 */ 03218 svn_error_t * 03219 svn_wc_crawl_revisions(const char *path, 03220 svn_wc_adm_access_t *adm_access, 03221 const svn_ra_reporter_t *reporter, 03222 void *report_baton, 03223 svn_boolean_t restore_files, 03224 svn_boolean_t recurse, 03225 svn_boolean_t use_commit_times, 03226 svn_wc_notify_func_t notify_func, 03227 void *notify_baton, 03228 svn_wc_traversal_info_t *traversal_info, 03229 apr_pool_t *pool); 03230 03231 03232 /* Updates. */ 03233 03234 /** Set @a *wc_root to @c TRUE if @a path represents a "working copy root", 03235 * @c FALSE otherwise. Use @a pool for any intermediate allocations. 03236 * 03237 * If @a path is not found, return the error @c SVN_ERR_ENTRY_NOT_FOUND. 03238 * 03239 * @note Due to the way in which "WC-root-ness" is calculated, passing 03240 * a @a path of `.' to this function will always return @c TRUE. 03241 */ 03242 svn_error_t * 03243 svn_wc_is_wc_root(svn_boolean_t *wc_root, 03244 const char *path, 03245 svn_wc_adm_access_t *adm_access, 03246 apr_pool_t *pool); 03247 03248 03249 /** Conditionally split @a path into an @a anchor and @a target for the 03250 * purpose of updating and committing. 03251 * 03252 * @a anchor is the directory at which the update or commit editor 03253 * should be rooted. 03254 * 03255 * @a target is the actual subject (relative to the @a anchor) of the 03256 * update/commit, or "" if the @a anchor itself is the subject. 03257 * 03258 * Allocate @a anchor and @a target in @a pool. 03259 */ 03260 svn_error_t * 03261 svn_wc_get_actual_target(const char *path, 03262 const char **anchor, 03263 const char **target, 03264 apr_pool_t *pool); 03265 03266 03267 03268 /* Update and update-like functionality. */ 03269 03270 /** 03271 * Set @a *editor and @a *edit_baton to an editor and baton for updating a 03272 * working copy. 03273 * 03274 * If @a ti is non-NULL, record traversal info in @a ti, for use by 03275 * post-traversal accessors such as svn_wc_edited_externals(). 03276 * 03277 * @a anchor is an access baton, with a write lock, for the local path to the 03278 * working copy which will be used as the root of our editor. Further 03279 * locks will be acquired if the update creates new directories. All 03280 * locks, both those in @a anchor and newly acquired ones, will be released 03281 * when the editor driver calls @c close_edit. 03282 * 03283 * @a target is the entry in @a anchor that will actually be updated, or 03284 * empty if all of @a anchor should be updated. 03285 * 03286 * The editor invokes @a notify_func with @a notify_baton as the update 03287 * progresses, if @a notify_func is non-NULL. 03288 * 03289 * If @a cancel_func is non-NULL, the editor will invoke @a cancel_func with 03290 * @a cancel_baton as the update progresses to see if it should continue. 03291 * 03292 * If @a conflict_func is non-NULL, then invoke it with @a 03293 * conflict_baton whenever a conflict is encountered, giving the 03294 * callback a chance to resolve the conflict before the editor takes 03295 * more drastic measures (such as marking a file conflicted, or 03296 * bailing out of the update). 03297 * 03298 * If @a fetch_func is non-NULL, then use it (with @a fetch_baton) as 03299 * a fallback for retrieving repository files whenever 'copyfrom' args 03300 * are sent into editor->add_file(). 03301 * 03302 * If @a diff3_cmd is non-NULL, then use it as the diff3 command for 03303 * any merging; otherwise, use the built-in merge code. 03304 * 03305 * @a preserved_exts is an array of filename patterns which, when 03306 * matched against the extensions of versioned files, determine for 03307 * which such files any related generated conflict files will preserve 03308 * the original file's extension as their own. If a file's extension 03309 * does not match any of the patterns in @a preserved_exts (which is 03310 * certainly the case if @a preserved_exts is @c NULL or empty), 03311 * generated conflict files will carry Subversion's custom extensions. 03312 * 03313 * @a target_revision is a pointer to a revision location which, after 03314 * successful completion of the drive of this editor, will be 03315 * populated with the revision to which the working copy was updated. 03316 * 03317 * If @a use_commit_times is TRUE, then all edited/added files will 03318 * have their working timestamp set to the last-committed-time. If 03319 * FALSE, the working files will be touched with the 'now' time. 03320 * 03321 * If @a allow_unver_obstructions is TRUE, then allow unversioned 03322 * obstructions when adding a path. 03323 * 03324 * If @a depth is @c svn_depth_infinity, update fully recursively. 03325 * Else if it is @c svn_depth_immediates, update the uppermost 03326 * directory, its file entries, and the presence or absence of 03327 * subdirectories (but do not descend into the subdirectories). 03328 * Else if it is @c svn_depth_files, update the uppermost directory 03329 * and its immediate file entries, but not subdirectories. 03330 * Else if it is @c svn_depth_empty, update exactly the uppermost 03331 * target, and don't touch its entries. 03332 * 03333 * If @a depth_is_sticky is set and @a depth is not @c 03334 * svn_depth_unknown, then in addition to updating PATHS, also set 03335 * their sticky ambient depth value to @a depth. 03336 * 03337 * @since New in 1.5. 03338 */ 03339 svn_error_t * 03340 svn_wc_get_update_editor3(svn_revnum_t *target_revision, 03341 svn_wc_adm_access_t *anchor, 03342 const char *target, 03343 svn_boolean_t use_commit_times, 03344 svn_depth_t depth, 03345 svn_boolean_t depth_is_sticky, 03346 svn_boolean_t allow_unver_obstructions, 03347 svn_wc_notify_func2_t notify_func, 03348 void *notify_baton, 03349 svn_cancel_func_t cancel_func, 03350 void *cancel_baton, 03351 svn_wc_conflict_resolver_func_t conflict_func, 03352 void *conflict_baton, 03353 svn_wc_get_file_t fetch_func, 03354 void *fetch_baton, 03355 const char *diff3_cmd, 03356 apr_array_header_t *preserved_exts, 03357 const svn_delta_editor_t **editor, 03358 void **edit_baton, 03359 svn_wc_traversal_info_t *ti, 03360 apr_pool_t *pool); 03361 03362 03363 /** 03364 * Similar to svn_wc_get_update_editor3() but with the @a 03365 * allow_unver_obstructions parameter always set to FALSE, @a 03366 * conflict_func and baton set to NULL, @a fetch_func and baton set to 03367 * NULL, @a preserved_exts set to NULL, @a depth_is_sticky set to 03368 * FALSE, and @a depth set according to @a recurse: if @a recurse is 03369 * TRUE, pass @c svn_depth_infinity, if FALSE, pass @c 03370 * svn_depth_files. 03371 * 03372 * @deprecated Provided for backward compatibility with the 1.4 API. 03373 */ 03374 svn_error_t * 03375 svn_wc_get_update_editor2(svn_revnum_t *target_revision, 03376 svn_wc_adm_access_t *anchor, 03377 const char *target, 03378 svn_boolean_t use_commit_times, 03379 svn_boolean_t recurse, 03380 svn_wc_notify_func2_t notify_func, 03381 void *notify_baton, 03382 svn_cancel_func_t cancel_func, 03383 void *cancel_baton, 03384 const char *diff3_cmd, 03385 const svn_delta_editor_t **editor, 03386 void **edit_baton, 03387 svn_wc_traversal_info_t *ti, 03388 apr_pool_t *pool); 03389 03390 /** 03391 * Similar to svn_wc_get_update_editor2(), but takes an svn_wc_notify_func_t 03392 * instead. 03393 * 03394 * @deprecated Provided for backward compatibility with the 1.1 API. 03395 */ 03396 svn_error_t * 03397 svn_wc_get_update_editor(svn_revnum_t *target_revision, 03398 svn_wc_adm_access_t *anchor, 03399 const char *target, 03400 svn_boolean_t use_commit_times, 03401 svn_boolean_t recurse, 03402 svn_wc_notify_func_t notify_func, 03403 void *notify_baton, 03404 svn_cancel_func_t cancel_func, 03405 void *cancel_baton, 03406 const char *diff3_cmd, 03407 const svn_delta_editor_t **editor, 03408 void **edit_baton, 03409 svn_wc_traversal_info_t *ti, 03410 apr_pool_t *pool); 03411 03412 /** 03413 * A variant of svn_wc_get_update_editor(). 03414 * 03415 * Set @a *editor and @a *edit_baton to an editor and baton for "switching" 03416 * a working copy to a new @a switch_url. (Right now, this URL must be 03417 * within the same repository that the working copy already comes 03418 * from.) @a switch_url must not be @c NULL. 03419 * 03420 * If @a ti is non-NULL, record traversal info in @a ti, for use by 03421 * post-traversal accessors such as svn_wc_edited_externals(). 03422 * 03423 * @a anchor is an access baton, with a write lock, for the local path to the 03424 * working copy which will be used as the root of our editor. Further 03425 * locks will be acquired if the switch creates new directories. All 03426 * locks, both those in @a anchor and newly acquired ones, will be released 03427 * when the editor driver calls @c close_edit. 03428 * 03429 * @a target is the entry in @a anchor that will actually be updated, or 03430 * empty if all of @a anchor should be updated. 03431 * 03432 * The editor invokes @a notify_func with @a notify_baton as the switch 03433 * progresses, if @a notify_func is non-NULL. 03434 * 03435 * If @a cancel_func is non-NULL, it will be called with @a cancel_baton as 03436 * the switch progresses to determine if it should continue. 03437 * 03438 * If @a conflict_func is non-NULL, then invoke it with @a 03439 * conflict_baton whenever a conflict is encountered, giving the 03440 * callback a chance to resolve the conflict before the editor takes 03441 * more drastic measures (such as marking a file conflicted, or 03442 * bailing out of the switch). 03443 * 03444 * If @a diff3_cmd is non-NULL, then use it as the diff3 command for 03445 * any merging; otherwise, use the built-in merge code. 03446 * 03447 * @a preserved_exts is an array of filename patterns which, when 03448 * matched against the extensions of versioned files, determine for 03449 * which such files any related generated conflict files will preserve 03450 * the original file's extension as their own. If a file's extension 03451 * does not match any of the patterns in @a preserved_exts (which is 03452 * certainly the case if @a preserved_exts is @c NULL or empty), 03453 * generated conflict files will carry Subversion's custom extensions. 03454 * 03455 * @a target_revision is a pointer to a revision location which, after 03456 * successful completion of the drive of this editor, will be 03457 * populated with the revision to which the working copy was updated. 03458 * 03459 * If @a use_commit_times is TRUE, then all edited/added files will 03460 * have their working timestamp set to the last-committed-time. If 03461 * FALSE, the working files will be touched with the 'now' time. 03462 * 03463 * @a depth and @a depth_is_sticky behave as for svn_wc_get_update_editor3(). 03464 * 03465 * If @a allow_unver_obstructions is TRUE, then allow unversioned 03466 * obstructions when adding a path. 03467 * 03468 * @since New in 1.5. 03469 */ 03470 svn_error_t * 03471 svn_wc_get_switch_editor3(svn_revnum_t *target_revision, 03472 svn_wc_adm_access_t *anchor, 03473 const char *target, 03474 const char *switch_url, 03475 svn_boolean_t use_commit_times, 03476 svn_depth_t depth, 03477 svn_boolean_t depth_is_sticky, 03478 svn_boolean_t allow_unver_obstructions, 03479 svn_wc_notify_func2_t notify_func, 03480 void *notify_baton, 03481 svn_cancel_func_t cancel_func, 03482 void *cancel_baton, 03483 svn_wc_conflict_resolver_func_t conflict_func, 03484 void *conflict_baton, 03485 const char *diff3_cmd, 03486 apr_array_header_t *preserved_exts, 03487 const svn_delta_editor_t **editor, 03488 void **edit_baton, 03489 svn_wc_traversal_info_t *ti, 03490 apr_pool_t *pool); 03491 03492 /** 03493 * Similar to svn_wc_get_switch_editor3() but with the 03494 * @a allow_unver_obstructions parameter always set to FALSE, 03495 * @a preserved_exts set to NULL, @a conflict_func and baton set to NULL, 03496 * @a depth_is_sticky set to FALSE, and @a depth set according to @a 03497 * recurse: if @a recurse is TRUE, pass @c svn_depth_infinity, if 03498 * FALSE, pass @c svn_depth_files. 03499 * 03500 * @deprecated Provided for backward compatibility with the 1.4 API. 03501 */ 03502 svn_error_t * 03503 svn_wc_get_switch_editor2(svn_revnum_t *target_revision, 03504 svn_wc_adm_access_t *anchor, 03505 const char *target, 03506 const char *switch_url, 03507 svn_boolean_t use_commit_times, 03508 svn_boolean_t recurse, 03509 svn_wc_notify_func2_t notify_func, 03510 void *notify_baton, 03511 svn_cancel_func_t cancel_func, 03512 void *cancel_baton, 03513 const char *diff3_cmd, 03514 const svn_delta_editor_t **editor, 03515 void **edit_baton, 03516 svn_wc_traversal_info_t *ti, 03517 apr_pool_t *pool); 03518 03519 /** 03520 * Similar to svn_wc_get_switch_editor2(), but takes an 03521 * @c svn_wc_notify_func_t instead. 03522 * 03523 * @deprecated Provided for backward compatibility with the 1.1 API. 03524 */ 03525 svn_error_t * 03526 svn_wc_get_switch_editor(svn_revnum_t *target_revision, 03527 svn_wc_adm_access_t *anchor, 03528 const char *target, 03529 const char *switch_url, 03530 svn_boolean_t use_commit_times, 03531 svn_boolean_t recurse, 03532 svn_wc_notify_func_t notify_func, 03533 void *notify_baton, 03534 svn_cancel_func_t cancel_func, 03535 void *cancel_baton, 03536 const char *diff3_cmd, 03537 const svn_delta_editor_t **editor, 03538 void **edit_baton, 03539 svn_wc_traversal_info_t *ti, 03540 apr_pool_t *pool); 03541 03542 03543 03544 /* A word about the implementation of working copy property storage: 03545 * 03546 * Since properties are key/val pairs, you'd think we store them in 03547 * some sort of Berkeley DB-ish format, and even store pending changes 03548 * to them that way too. 03549 * 03550 * However, we already have libsvn_subr/hashdump.c working, and it 03551 * uses a human-readable format. That will be very handy when we're 03552 * debugging, and presumably we will not be dealing with any huge 03553 * properties or property lists initially. Therefore, we will 03554 * continue to use hashdump as the internal mechanism for storing and 03555 * reading from property lists, but note that the interface here is 03556 * _not_ dependent on that. We can swap in a DB-based implementation 03557 * at any time and users of this library will never know the 03558 * difference. 03559 */ 03560 03561 /** Set @a *props to a hash table mapping <tt>char *</tt> names onto 03562 * <tt>svn_string_t *</tt> values for all the regular properties of 03563 * @a path. Allocate the table, names, and values in @a pool. If 03564 * the node has no properties, or does not exist in the working copy, 03565 * then an empty hash is returned. @a adm_access is an access baton 03566 * set that contains @a path. 03567 */ 03568 svn_error_t * 03569 svn_wc_prop_list(apr_hash_t **props, 03570 const char *path, 03571 svn_wc_adm_access_t *adm_access, 03572 apr_pool_t *pool); 03573 03574 03575 /** Set @a *value to the value of property @a name for @a path, allocating 03576 * @a *value in @a pool. If no such prop, set @a *value to @c NULL. 03577 * @a name may be a regular or wc property; if it is an entry property, 03578 * return the error @c SVN_ERR_BAD_PROP_KIND. @a adm_access is an access 03579 * baton set that contains @a path. 03580 */ 03581 svn_error_t * 03582 svn_wc_prop_get(const svn_string_t **value, 03583 const char *name, 03584 const char *path, 03585 svn_wc_adm_access_t *adm_access, 03586 apr_pool_t *pool); 03587 03588 /** 03589 * Set property @a name to @a value for @a path, or if @a value is 03590 * NULL, remove property @a name from @a path. @a adm_access is an 03591 * access baton with a write lock for @a path. 03592 * 03593 * If @a skip_checks is TRUE, do no validity checking. But if @a 03594 * skip_checks is FALSE, and @a name is not a valid property for @a 03595 * path, return an error, either @c SVN_ERR_ILLEGAL_TARGET (if the 03596 * property is not appropriate for @a path), or @c 03597 * SVN_ERR_BAD_MIME_TYPE (if @a name is "svn:mime-type", but @a value 03598 * is not a valid mime-type). 03599 * 03600 * @a name may be a wc property or a regular property; but if it is an 03601 * entry property, return the error @c SVN_ERR_BAD_PROP_KIND, even if 03602 * @a skip_checks is TRUE. 03603 * 03604 * Use @a pool for temporary allocation. 03605 * 03606 * @since New in 1.2. 03607 */ 03608 svn_error_t * 03609 svn_wc_prop_set2(const char *name, 03610 const svn_string_t *value, 03611 const char *path, 03612 svn_wc_adm_access_t *adm_access, 03613 svn_boolean_t skip_checks, 03614 apr_pool_t *pool); 03615 03616 03617 /** 03618 * Like svn_wc_prop_set2(), but with @a skip_checks always FALSE. 03619 * 03620 * @deprecated Provided for backward compatibility with the 1.1 API. 03621 */ 03622 svn_error_t * 03623 svn_wc_prop_set(const char *name, 03624 const svn_string_t *value, 03625 const char *path, 03626 svn_wc_adm_access_t *adm_access, 03627 apr_pool_t *pool); 03628 03629 03630 /** Return TRUE iff @a name is a 'normal' property name. 'Normal' is 03631 * defined as a user-visible and user-tweakable property that shows up 03632 * when you fetch a proplist. 03633 * 03634 * The function currently parses the namespace like so: 03635 * 03636 * - 'svn:wc:' ==> a wcprop, stored/accessed separately via different API. 03637 * 03638 * - 'svn:entry:' ==> an "entry" prop, shunted into the 'entries' file. 03639 * 03640 * If these patterns aren't found, then the property is assumed to be 03641 * Normal. 03642 */ 03643 svn_boolean_t svn_wc_is_normal_prop(const char *name); 03644 03645 03646 03647 /** Return TRUE iff @a name is a 'wc' property name. */ 03648 svn_boolean_t svn_wc_is_wc_prop(const char *name); 03649 03650 /** Return TRUE iff @a name is a 'entry' property name. */ 03651 svn_boolean_t svn_wc_is_entry_prop(const char *name); 03652 03653 /** Callback type used by @c svn_wc_canonicalize_svn_prop. 03654 * 03655 * If @a mime_type is non-null, it sets @a *mime_type to the value of 03656 * @a SVN_PROP_MIME_TYPE for the path passed to @c 03657 * svn_wc_canonicalize_svn_prop (allocated from @a pool). If @a 03658 * stream is non-null, it writes the contents of the file to @a 03659 * stream. 03660 * 03661 * (Currently, this is used if you are attempting to set the @a 03662 * SVN_PROP_EOL_STYLE property, to make sure that the value matches 03663 * the mime type and contents.) 03664 */ 03665 typedef svn_error_t *(*svn_wc_canonicalize_svn_prop_get_file_t) 03666 (const svn_string_t **mime_type, 03667 svn_stream_t *stream, 03668 void *baton, 03669 apr_pool_t *pool); 03670 03671 03672 /** Canonicalize the value of an svn:* property @a propname with 03673 * value @a propval. 03674 * 03675 * If the property is not appropriate for a node of kind @a kind, or 03676 * is otherwise invalid, throw an error. Otherwise, set @a *propval_p 03677 * to a canonicalized version of the property value. If @a 03678 * skip_some_checks is TRUE, only some validity checks are taken. 03679 * 03680 * Some validity checks require access to the contents and MIME type 03681 * of the target if it is a file; they will call @a prop_getter with @a 03682 * getter_baton, which then needs to set the MIME type and print the 03683 * contents of the file to the given stream. 03684 * 03685 * @a path should be the path of the file in question; it is only used 03686 * for error messages. 03687 * 03688 * ### This is not actually related to the WC, but it does need to call 03689 * ### svn_wc_parse_externals_description2. 03690 */ 03691 svn_error_t * 03692 svn_wc_canonicalize_svn_prop(const svn_string_t **propval_p, 03693 const char *propname, 03694 const svn_string_t *propval, 03695 const char *path, 03696 svn_node_kind_t kind, 03697 svn_boolean_t skip_some_checks, 03698 svn_wc_canonicalize_svn_prop_get_file_t prop_getter, 03699 void *getter_baton, 03700 apr_pool_t *pool); 03701 03702 03703 03704 /* Diffs */ 03705 03706 03707 /** 03708 * Return an @a editor/@a edit_baton for diffing a working copy against the 03709 * repository. 03710 * 03711 * @a anchor/@a target represent the base of the hierarchy to be compared. 03712 * 03713 * @a callbacks/@a callback_baton is the callback table to use when two 03714 * files are to be compared. 03715 * 03716 * If @a depth is @c svn_depth_empty, just diff exactly @a target or 03717 * @a anchor if @a target is empty. If @c svn_depth_files then do the same 03718 * and for top-level file entries as well (if any). If 03719 * @c svn_depth_immediates, do the same as @c svn_depth_files but also diff 03720 * top-level subdirectories at @c svn_depth_empty. If @c svn_depth_infinity, 03721 * then diff fully recursively. In the latter case, @a anchor should be part 03722 * of an access baton set for the @a target hierarchy. 03723 * 03724 * @a ignore_ancestry determines whether paths that have discontinuous node 03725 * ancestry are treated as delete/add or as simple modifications. If 03726 * @a ignore_ancestry is @c FALSE, then any discontinuous node ancestry will 03727 * result in the diff given as a full delete followed by an add. 03728 * 03729 * If @a use_text_base is TRUE, then compare the repository against 03730 * the working copy's text-base files, rather than the working files. 03731 * 03732 * Normally, the difference from repository->working_copy is shown. 03733 * If @a reverse_order is TRUE, then show working_copy->repository diffs. 03734 * 03735 * If @a cancel_func is non-NULL, it will be used along with @a cancel_baton 03736 * to periodically check if the client has canceled the operation. 03737 * 03738 * @a changelists is an array of <tt>const char *</tt> changelist 03739 * names, used as a restrictive filter on items whose differences are 03740 * reported; that is, don't generate diffs about any item unless 03741 * it's a member of one of those changelists. If @a changelists is 03742 * empty (or altogether @c NULL), no changelist filtering occurs. 03743 * 03744 * @since New in 1.5. 03745 */ 03746 svn_error_t * 03747 svn_wc_get_diff_editor4(svn_wc_adm_access_t *anchor, 03748 const char *target, 03749 const svn_wc_diff_callbacks2_t *callbacks, 03750 void *callback_baton, 03751 svn_depth_t depth, 03752 svn_boolean_t ignore_ancestry, 03753 svn_boolean_t use_text_base, 03754 svn_boolean_t reverse_order, 03755 svn_cancel_func_t cancel_func, 03756 void *cancel_baton, 03757 const apr_array_header_t *changelists, 03758 const svn_delta_editor_t **editor, 03759 void **edit_baton, 03760 apr_pool_t *pool); 03761 03762 /** 03763 * Similar to svn_wc_get_diff_editor4(), but with @a changelists 03764 * passed as @c NULL, and @a depth set to @c svn_depth_infinity if @a 03765 * recurse is TRUE, or @a svn_depth_files if @a recurse is FALSE. 03766 * 03767 * @deprecated Provided for backward compatibility with the 1.4 API. 03768 03769 * @since New in 1.2. 03770 */ 03771 svn_error_t * 03772 svn_wc_get_diff_editor3(svn_wc_adm_access_t *anchor, 03773 const char *target, 03774 const svn_wc_diff_callbacks2_t *callbacks, 03775 void *callback_baton, 03776 svn_boolean_t recurse, 03777 svn_boolean_t ignore_ancestry, 03778 svn_boolean_t use_text_base, 03779 svn_boolean_t reverse_order, 03780 svn_cancel_func_t cancel_func, 03781 void *cancel_baton, 03782 const svn_delta_editor_t **editor, 03783 void **edit_baton, 03784 apr_pool_t *pool); 03785 03786 03787 /** 03788 * Similar to svn_wc_get_diff_editor3(), but with an 03789 * @c svn_wc_diff_callbacks_t instead of @c svn_wc_diff_callbacks2_t. 03790 * 03791 * @deprecated Provided for backward compatibility with the 1.1 API. 03792 */ 03793 svn_error_t * 03794 svn_wc_get_diff_editor2(svn_wc_adm_access_t *anchor, 03795 const char *target, 03796 const svn_wc_diff_callbacks_t *callbacks, 03797 void *callback_baton, 03798 svn_boolean_t recurse, 03799 svn_boolean_t ignore_ancestry, 03800 svn_boolean_t use_text_base, 03801 svn_boolean_t reverse_order, 03802 svn_cancel_func_t cancel_func, 03803 void *cancel_baton, 03804 const svn_delta_editor_t **editor, 03805 void **edit_baton, 03806 apr_pool_t *pool); 03807 03808 03809 /** 03810 * Similar to svn_wc_get_diff_editor2(), but with @a ignore_ancestry 03811 * always set to @c FALSE. 03812 * 03813 * @deprecated Provided for backward compatibility with the 1.0 API. 03814 */ 03815 svn_error_t * 03816 svn_wc_get_diff_editor(svn_wc_adm_access_t *anchor, 03817 const char *target, 03818 const svn_wc_diff_callbacks_t *callbacks, 03819 void *callback_baton, 03820 svn_boolean_t recurse, 03821 svn_boolean_t use_text_base, 03822 svn_boolean_t reverse_order, 03823 svn_cancel_func_t cancel_func, 03824 void *cancel_baton, 03825 const svn_delta_editor_t **editor, 03826 void **edit_baton, 03827 apr_pool_t *pool); 03828 03829 03830 /** 03831 * Compare working copy against the text-base. 03832 * 03833 * @a anchor/@a target represent the base of the hierarchy to be compared. 03834 * 03835 * @a callbacks/@a callback_baton is the callback table to use when two 03836 * files are to be compared. 03837 * 03838 * If @a depth is @c svn_depth_empty, just diff exactly @a target or 03839 * @a anchor if @a target is empty. If @c svn_depth_files then do the same 03840 * and for top-level file entries as well (if any). If 03841 * @c svn_depth_immediates, do the same as @c svn_depth_files but also diff 03842 * top-level subdirectories at @c svn_depth_empty. If @c svn_depth_infinity, 03843 * then diff fully recursively. In the latter case, @a anchor should be part 03844 * of an access baton set for the @a target hierarchy. 03845 * 03846 * @a ignore_ancestry determines whether paths that have discontinuous node 03847 * ancestry are treated as delete/add or as simple modifications. If 03848 * @a ignore_ancestry is @c FALSE, then any discontinuous node ancestry will 03849 * result in the diff given as a full delete followed by an add. 03850 * 03851 * @a changelists is an array of <tt>const char *</tt> changelist 03852 * names, used as a restrictive filter on items whose differences are 03853 * reported; that is, don't generate diffs about any item unless 03854 * it's a member of one of those changelists. If @a changelists is 03855 * empty (or altogether @c NULL), no changelist filtering occurs. 03856 * 03857 * @since New in 1.5. 03858 */ 03859 svn_error_t * 03860 svn_wc_diff4(svn_wc_adm_access_t *anchor, 03861 const char *target, 03862 const svn_wc_diff_callbacks2_t *callbacks, 03863 void *callback_baton, 03864 svn_depth_t depth, 03865 svn_boolean_t ignore_ancestry, 03866 const apr_array_header_t *changelists, 03867 apr_pool_t *pool); 03868 03869 03870 /** 03871 * Similar to svn_wc_diff4(), but with @a changelists passed @c NULL, 03872 * and @a depth set to @c svn_depth_infinity if @a recurse is TRUE, or 03873 * @a svn_depth_files if @a recurse is FALSE. 03874 * 03875 * @deprecated Provided for backward compatibility with the 1.2 API. 03876 */ 03877 svn_error_t * 03878 svn_wc_diff3(svn_wc_adm_access_t *anchor, 03879 const char *target, 03880 const svn_wc_diff_callbacks2_t *callbacks, 03881 void *callback_baton, 03882 svn_boolean_t recurse, 03883 svn_boolean_t ignore_ancestry, 03884 apr_pool_t *pool); 03885 03886 /** 03887 * Similar to svn_wc_diff3(), but with a @c svn_wc_diff_callbacks_t argument 03888 * instead of @c svn_wc_diff_callbacks2_t. 03889 * 03890 * @deprecated Provided for backward compatibility with the 1.1 API. 03891 */ 03892 svn_error_t * 03893 svn_wc_diff2(svn_wc_adm_access_t *anchor, 03894 const char *target, 03895 const svn_wc_diff_callbacks_t *callbacks, 03896 void *callback_baton, 03897 svn_boolean_t recurse, 03898 svn_boolean_t ignore_ancestry, 03899 apr_pool_t *pool); 03900 03901 /** 03902 * Similar to svn_wc_diff2(), but with @a ignore_ancestry always set 03903 * to @c FALSE. 03904 * 03905 * @deprecated Provided for backward compatibility with the 1.0 API. 03906 */ 03907 svn_error_t * 03908 svn_wc_diff(svn_wc_adm_access_t *anchor, 03909 const char *target, 03910 const svn_wc_diff_callbacks_t *callbacks, 03911 void *callback_baton, 03912 svn_boolean_t recurse, 03913 apr_pool_t *pool); 03914 03915 03916 /** Given a @a path to a file or directory under version control, discover 03917 * any local changes made to properties and/or the set of 'pristine' 03918 * properties. @a adm_access is an access baton set for @a path. 03919 * 03920 * If @a propchanges is non-@c NULL, return these changes as an array of 03921 * @c svn_prop_t structures stored in @a *propchanges. The structures and 03922 * array will be allocated in @a pool. If there are no local property 03923 * modifications on @a path, then set @a *propchanges to @c NULL. 03924 * 03925 * If @a original_props is non-@c NULL, then set @a *original_props to 03926 * hashtable (<tt>const char *name</tt> -> <tt>const svn_string_t *value</tt>) 03927 * that represents the 'pristine' property list of @a path. This hashtable is 03928 * allocated in @a pool, and can be used to compare old and new values of 03929 * properties. 03930 */ 03931 svn_error_t * 03932 svn_wc_get_prop_diffs(apr_array_header_t **propchanges, 03933 apr_hash_t **original_props, 03934 const char *path, 03935 svn_wc_adm_access_t *adm_access, 03936 apr_pool_t *pool); 03937 03938 03939 /** The outcome of a merge carried out (or tried as a dry-run) by 03940 * svn_wc_merge() 03941 */ 03942 typedef enum svn_wc_merge_outcome_t 03943 { 03944 /** The working copy is (or would be) unchanged. The changes to be 03945 * merged were already present in the working copy 03946 */ 03947 svn_wc_merge_unchanged, 03948 03949 /** The working copy has been (or would be) changed. */ 03950 svn_wc_merge_merged, 03951 03952 /** The working copy has been (or would be) changed, but there was (or 03953 * would be) a conflict 03954 */ 03955 svn_wc_merge_conflict, 03956 03957 /** No merge was performed, probably because the target file was 03958 * either absent or not under version control. 03959 */ 03960 svn_wc_merge_no_merge 03961 03962 } svn_wc_merge_outcome_t; 03963 03964 /** Given paths to three fulltexts, merge the differences between @a left 03965 * and @a right into @a merge_target. (It may help to know that @a left, 03966 * @a right, and @a merge_target correspond to "OLDER", "YOURS", and "MINE", 03967 * respectively, in the diff3 documentation.) Use @a pool for any 03968 * temporary allocation. 03969 * 03970 * @a adm_access is an access baton with a write lock for the directory 03971 * containing @a merge_target. 03972 * 03973 * This function assumes that @a left and @a right are in repository-normal 03974 * form (linefeeds, with keywords contracted); if necessary, 03975 * @a merge_target is temporarily converted to this form to receive the 03976 * changes, then translated back again. 03977 * 03978 * If @a merge_target is absent, or present but not under version 03979 * control, then set @a *merge_outcome to @c svn_wc_merge_no_merge and 03980 * return success without merging anything. (The reasoning is that if 03981 * the file is not versioned, then it is probably unrelated to the 03982 * changes being considered, so they should not be merged into it.) 03983 * 03984 * @a dry_run determines whether the working copy is modified. When it 03985 * is @c FALSE the merge will cause @a merge_target to be modified, when it 03986 * is @c TRUE the merge will be carried out to determine the result but 03987 * @a merge_target will not be modified. 03988 * 03989 * If @a diff3_cmd is non-NULL, then use it as the diff3 command for 03990 * any merging; otherwise, use the built-in merge code. If @a 03991 * merge_options is non-NULL, either pass its elements to @a diff3_cmd or 03992 * parse it and use as options to the internal merge code (@see 03993 * svn_diff_file_options_parse()). @a merge_options must contain 03994 * <tt>const char *</tt> elements. 03995 * 03996 * The outcome of the merge is returned in @a *merge_outcome. If there 03997 * is a conflict and @a dry_run is @c FALSE, then attempt to call @a 03998 * conflict_func with @a conflict_baton (if non-NULL). If the 03999 * conflict callback cannot resolve the conflict, then: 04000 * 04001 * * Put conflict markers around the conflicting regions in 04002 * @a merge_target, labeled with @a left_label, @a right_label, and 04003 * @a target_label. (If any of these labels are @c NULL, default 04004 * values will be used.) 04005 * 04006 * * Copy @a left, @a right, and the original @a merge_target to unique 04007 * names in the same directory as @a merge_target, ending with the 04008 * suffixes ".LEFT_LABEL", ".RIGHT_LABEL", and ".TARGET_LABEL" 04009 * respectively. 04010 * 04011 * * Mark the entry for @a merge_target as "conflicted", and track the 04012 * above mentioned backup files in the entry as well. 04013 * 04014 * Binary case: 04015 * 04016 * If @a merge_target is a binary file, then no merging is attempted, 04017 * the merge is deemed to be a conflict. If @a dry_run is @c FALSE the 04018 * working @a merge_target is untouched, and copies of @a left and 04019 * @a right are created next to it using @a left_label and @a right_label. 04020 * @a merge_target's entry is marked as "conflicted", and begins 04021 * tracking the two backup files. If @a dry_run is @c TRUE no files are 04022 * changed. The outcome of the merge is returned in @a *merge_outcome. 04023 * 04024 * @since New in 1.5. 04025 */ 04026 svn_error_t * 04027 svn_wc_merge3(enum svn_wc_merge_outcome_t *merge_outcome, 04028 const char *left, 04029 const char *right, 04030 const char *merge_target, 04031 svn_wc_adm_access_t *adm_access, 04032 const char *left_label, 04033 const char *right_label, 04034 const char *target_label, 04035 svn_boolean_t dry_run, 04036 const char *diff3_cmd, 04037 const apr_array_header_t *merge_options, 04038 const apr_array_header_t *prop_diff, 04039 svn_wc_conflict_resolver_func_t conflict_func, 04040 void *conflict_baton, 04041 apr_pool_t *pool); 04042 04043 /** Similar to svn_wc_merge3(), but with @a prop_diff, @a 04044 * conflict_func, @a conflict_baton set to NULL. 04045 * 04046 * @deprecated Provided for backwards compatibility with the 1.4 API. 04047 */ 04048 svn_error_t * 04049 svn_wc_merge2(enum svn_wc_merge_outcome_t *merge_outcome, 04050 const char *left, 04051 const char *right, 04052 const char *merge_target, 04053 svn_wc_adm_access_t *adm_access, 04054 const char *left_label, 04055 const char *right_label, 04056 const char *target_label, 04057 svn_boolean_t dry_run, 04058 const char *diff3_cmd, 04059 const apr_array_header_t *merge_options, 04060 apr_pool_t *pool); 04061 04062 04063 /** Similar to svn_wc_merge2(), but with @a merge_options set to NULL. 04064 * 04065 * @deprecated Provided for backwards compatibility with the 1.3 API. 04066 */ 04067 svn_error_t * 04068 svn_wc_merge(const char *left, 04069 const char *right, 04070 const char *merge_target, 04071 svn_wc_adm_access_t *adm_access, 04072 const char *left_label, 04073 const char *right_label, 04074 const char *target_label, 04075 svn_boolean_t dry_run, 04076 enum svn_wc_merge_outcome_t *merge_outcome, 04077 const char *diff3_cmd, 04078 apr_pool_t *pool); 04079 04080 04081 /** Given a @a path under version control, merge an array of @a 04082 * propchanges into the path's existing properties. @a propchanges is 04083 * an array of @c svn_prop_t objects, and @a baseprops is a hash 04084 * representing the original set of properties that @a propchanges is 04085 * working against. @a adm_access is an access baton for the directory 04086 * containing @a path. 04087 * 04088 * If @a base_merge is @c FALSE only the working properties will be changed, 04089 * if it is @c TRUE both the base and working properties will be changed. 04090 * 04091 * If @a state is non-NULL, set @a *state to the state of the properties 04092 * after the merge. 04093 * 04094 * If conflicts are found when merging working properties, they are 04095 * described in a temporary .prej file (or appended to an already-existing 04096 * .prej file), and the entry is marked "conflicted". Base properties 04097 * are changed unconditionally, if @a base_merge is @c TRUE, they never result 04098 * in a conflict. 04099 * 04100 * If @a path is not under version control, return the error 04101 * SVN_ERR_UNVERSIONED_RESOURCE and don't touch anyone's properties. 04102 * 04103 * @since New in 1.5. 04104 */ 04105 svn_error_t * 04106 svn_wc_merge_props2(svn_wc_notify_state_t *state, 04107 const char *path, 04108 svn_wc_adm_access_t *adm_access, 04109 apr_hash_t *baseprops, 04110 const apr_array_header_t *propchanges, 04111 svn_boolean_t base_merge, 04112 svn_boolean_t dry_run, 04113 svn_wc_conflict_resolver_func_t conflict_func, 04114 void *conflict_baton, 04115 apr_pool_t *pool); 04116 04117 04118 /** 04119 * Same as svn_wc_merge_props2(), but with a @a conflict_func (and 04120 * baton) of NULL. 04121 * 04122 * @deprecated Provided for backward compatibility with the 1.3 API. 04123 * 04124 */ 04125 svn_error_t * 04126 svn_wc_merge_props(svn_wc_notify_state_t *state, 04127 const char *path, 04128 svn_wc_adm_access_t *adm_access, 04129 apr_hash_t *baseprops, 04130 const apr_array_header_t *propchanges, 04131 svn_boolean_t base_merge, 04132 svn_boolean_t dry_run, 04133 apr_pool_t *pool); 04134 04135 04136 /** 04137 * Similar to svn_wc_merge_props(), but no baseprops are given. 04138 * Instead, it's assumed that the incoming propchanges are based 04139 * against the working copy's own baseprops. While this assumption is 04140 * correct for 'svn update', it's incorrect for 'svn merge', and can 04141 * cause flawed behavior. (See issue #2035.) 04142 * 04143 * @deprecated Provided for backward compatibility with the 1.2 API. 04144 */ 04145 svn_error_t * 04146 svn_wc_merge_prop_diffs(svn_wc_notify_state_t *state, 04147 const char *path, 04148 svn_wc_adm_access_t *adm_access, 04149 const apr_array_header_t *propchanges, 04150 svn_boolean_t base_merge, 04151 svn_boolean_t dry_run, 04152 apr_pool_t *pool); 04153 04154 04155 04156 /** Given a @a path to a wc file, return a @a pristine_path which points to a 04157 * pristine version of the file. This is needed so clients can do 04158 * diffs. If the WC has no text-base, return a @c NULL instead of a 04159 * path. 04160 */ 04161 svn_error_t * 04162 svn_wc_get_pristine_copy_path(const char *path, 04163 const char **pristine_path, 04164 apr_pool_t *pool); 04165 04166 04167 /** 04168 * Recurse from @a path, cleaning up unfinished log business. Perform 04169 * necessary allocations in @a pool. Any working copy locks under @a path 04170 * will be taken over and then cleared by this function. If @a diff3_cmd 04171 * is non-NULL, then use it as the diff3 command for any merging; otherwise, 04172 * use the built-in merge code. 04173 * 04174 * WARNING: there is no mechanism that will protect locks that are still 04175 * being used. 04176 * 04177 * If @a cancel_func is non-NULL, invoke it with @a cancel_baton at 04178 * various points during the operation. If it returns an error 04179 * (typically @c SVN_ERR_CANCELLED), return that error immediately. 04180 * 04181 * @since New in 1.2. 04182 */ 04183 svn_error_t * 04184 svn_wc_cleanup2(const char *path, 04185 const char *diff3_cmd, 04186 svn_cancel_func_t cancel_func, 04187 void *cancel_baton, 04188 apr_pool_t *pool); 04189 04190 /** 04191 * Similar to svn_wc_cleanup2(). @a optional_adm_access is an historic 04192 * relic and not used, it may be NULL. 04193 * 04194 * @deprecated Provided for backward compatibility with the 1.1 API. 04195 */ 04196 svn_error_t * 04197 svn_wc_cleanup(const char *path, 04198 svn_wc_adm_access_t *optional_adm_access, 04199 const char *diff3_cmd, 04200 svn_cancel_func_t cancel_func, 04201 void *cancel_baton, 04202 apr_pool_t *pool); 04203 04204 04205 /** Relocation validation callback typedef. 04206 * 04207 * Called for each relocated file/directory. @a uuid, if non-NULL, contains 04208 * the expected repository UUID, @a url contains the tentative URL. 04209 * 04210 * @a baton is a closure object; it should be provided by the 04211 * implementation, and passed by the caller. 04212 * 04213 * If @a root is TRUE, then the implementation should make sure that @a url 04214 * is the repository root. Else, it can be an URL inside the repository. 04215 * @a pool may be used for temporary allocations. 04216 * 04217 * @since New in 1.5. 04218 */ 04219 typedef svn_error_t *(*svn_wc_relocation_validator3_t)(void *baton, 04220 const char *uuid, 04221 const char *url, 04222 const char *root_url, 04223 apr_pool_t *pool); 04224 04225 /** Similar to @c svn_wc_relocation_validator3_t, but without 04226 * the @a root_url arguments. 04227 * 04228 * @deprecated Provided for backwards compatibility with the 1.4 API. 04229 */ 04230 typedef svn_error_t *(*svn_wc_relocation_validator2_t)(void *baton, 04231 const char *uuid, 04232 const char *url, 04233 svn_boolean_t root, 04234 apr_pool_t *pool); 04235 04236 /** Similar to @c svn_wc_relocation_validator2_t, but without 04237 * the @a root and @a pool arguments. @a uuid will not be NULL in this version 04238 * of the function. 04239 * 04240 * @deprecated Provided for backwards compatibility with the 1.3 API. 04241 */ 04242 typedef svn_error_t *(*svn_wc_relocation_validator_t)(void *baton, 04243 const char *uuid, 04244 const char *url); 04245 04246 /** Change repository references at @a path that begin with @a from 04247 * to begin with @a to instead. Perform necessary allocations in @a pool. 04248 * If @a recurse is TRUE, do so. @a validator (and its baton, 04249 * @a validator_baton), will be called for each newly generated URL. 04250 * 04251 * @a adm_access is an access baton for the directory containing 04252 * @a path. 04253 * 04254 * @since New in 1.5. 04255 */ 04256 svn_error_t * 04257 svn_wc_relocate3(const char *path, 04258 svn_wc_adm_access_t *adm_access, 04259 const char *from, 04260 const char *to, 04261 svn_boolean_t recurse, 04262 svn_wc_relocation_validator3_t validator, 04263 void *validator_baton, 04264 apr_pool_t *pool); 04265 04266 /** Similar to svn_wc_relocate3(), but uses @c svn_wc_relocation_validator2_t. 04267 * 04268 * @deprecated Provided for backwards compatibility with the 1.4 API. */ 04269 svn_error_t * 04270 svn_wc_relocate2(const char *path, 04271 svn_wc_adm_access_t *adm_access, 04272 const char *from, 04273 const char *to, 04274 svn_boolean_t recurse, 04275 svn_wc_relocation_validator2_t validator, 04276 void *validator_baton, 04277 apr_pool_t *pool); 04278 04279 /** Similar to svn_wc_relocate2(), but uses @c svn_wc_relocation_validator_t. 04280 * 04281 * @deprecated Provided for backwards compatibility with the 1.3 API. */ 04282 svn_error_t * 04283 svn_wc_relocate(const char *path, 04284 svn_wc_adm_access_t *adm_access, 04285 const char *from, 04286 const char *to, 04287 svn_boolean_t recurse, 04288 svn_wc_relocation_validator_t validator, 04289 void *validator_baton, 04290 apr_pool_t *pool); 04291 04292 04293 /** 04294 * Revert changes to @a path. Perform necessary allocations in @a pool. 04295 * 04296 * @a parent_access is an access baton for the directory containing @a 04297 * path, unless @a path is a working copy root (as determined by @c 04298 * svn_wc_is_wc_root), in which case @a parent_access refers to @a 04299 * path itself. 04300 * 04301 * If @a depth is @c svn_depth_empty, revert just @a path (if a 04302 * directory, then revert just the properties on that directory). 04303 * Else if @c svn_depth_files, revert @a path and any files 04304 * directly under @a path if it is directory. Else if 04305 * @c svn_depth_immediates, revert all of the preceding plus 04306 * properties on immediate subdirectories; else if @c svn_depth_infinity, 04307 * revert path and everything under it fully recursively. 04308 * 04309 * @a changelists is an array of <tt>const char *</tt> changelist 04310 * names, used as a restrictive filter on items reverted; that is, 04311 * don't revert any item unless it's a member of one of those 04312 * changelists. If @a changelists is empty (or altogether @c NULL), 04313 * no changelist filtering occurs. 04314 * 04315 * If @a cancel_func is non-NULL, call it with @a cancel_baton at 04316 * various points during the reversion process. If it returns an 04317 * error (typically @c SVN_ERR_CANCELLED), return that error 04318 * immediately. 04319 * 04320 * If @a use_commit_times is TRUE, then all reverted working-files 04321 * will have their timestamp set to the last-committed-time. If 04322 * FALSE, the reverted working-files will be touched with the 'now' time. 04323 * 04324 * For each item reverted, @a notify_func will be called with @a notify_baton 04325 * and the path of the reverted item. @a notify_func may be @c NULL if this 04326 * notification is not needed. 04327 * 04328 * If @a path is not under version control, return the error 04329 * SVN_ERR_UNVERSIONED_RESOURCE. 04330 * 04331 * @since New in 1.5. 04332 */ 04333 svn_error_t * 04334 svn_wc_revert3(const char *path, 04335 svn_wc_adm_access_t *parent_access, 04336 svn_depth_t depth, 04337 svn_boolean_t use_commit_times, 04338 const apr_array_header_t *changelists, 04339 svn_cancel_func_t cancel_func, 04340 void *cancel_baton, 04341 svn_wc_notify_func2_t notify_func, 04342 void *notify_baton, 04343 apr_pool_t *pool); 04344 04345 /** 04346 * Similar to svn_wc_revert3(), but with @a changelists passed as @c 04347 * NULL, and @a depth set according to @a recursive: if @a recursive 04348 * is TRUE, @a depth is @c svn_depth_infinity; if FALSE, @a depth is 04349 * @c svn_depth_empty. 04350 * 04351 * @note Most APIs map @a recurse==FALSE to @a depth==svn_depth_files; 04352 * revert is deliberately different. 04353 * 04354 * @deprecated Provided for backward compatibility with the 1.2 API. 04355 */ 04356 svn_error_t * 04357 svn_wc_revert2(const char *path, 04358 svn_wc_adm_access_t *parent_access, 04359 svn_boolean_t recursive, 04360 svn_boolean_t use_commit_times, 04361 svn_cancel_func_t cancel_func, 04362 void *cancel_baton, 04363 svn_wc_notify_func2_t notify_func, 04364 void *notify_baton, 04365 apr_pool_t *pool); 04366 04367 /** 04368 * Similar to svn_wc_revert2(), but takes an @c svn_wc_notify_func_t instead. 04369 * 04370 * @deprecated Provided for backward compatibility with the 1.1 API. 04371 */ 04372 svn_error_t * 04373 svn_wc_revert(const char *path, 04374 svn_wc_adm_access_t *parent_access, 04375 svn_boolean_t recursive, 04376 svn_boolean_t use_commit_times, 04377 svn_cancel_func_t cancel_func, 04378 void *cancel_baton, 04379 svn_wc_notify_func_t notify_func, 04380 void *notify_baton, 04381 apr_pool_t *pool); 04382 04383 04384 /* Tmp files */ 04385 04386 /** Create a unique temporary file in administrative tmp/ area of 04387 * directory @a path. Return a handle in @a *fp and the path 04388 * in @a *new_name. Either @a fp or @a new_name can be NULL. 04389 * 04390 * The flags will be <tt>APR_WRITE | APR_CREATE | APR_EXCL</tt> and 04391 * optionally @c APR_DELONCLOSE (if the @a delete_when argument is 04392 * set to @c svn_io_file_del_on_close). 04393 * 04394 * This means that as soon as @a fp is closed, the tmp file will vanish. 04395 * 04396 * @since New in 1.4 04397 */ 04398 svn_error_t * 04399 svn_wc_create_tmp_file2(apr_file_t **fp, 04400 const char **new_name, 04401 const char *path, 04402 svn_io_file_del_t delete_when, 04403 apr_pool_t *pool); 04404 04405 04406 /** Same as svn_wc_create_tmp_file2(), but with @a new_name set to @c NULL, 04407 * and without the ability to delete the file on pool cleanup. 04408 * 04409 * @deprecated For compatibility with 1.3 API 04410 */ 04411 svn_error_t * 04412 svn_wc_create_tmp_file(apr_file_t **fp, 04413 const char *path, 04414 svn_boolean_t delete_on_close, 04415 apr_pool_t *pool); 04416 04417 04418 04419 /* EOL conversion and keyword expansion. */ 04420 04421 /** Set @a xlated_path to a translated copy of @a src 04422 * or to @a src itself if no translation is necessary. 04423 * That is, if @a versioned_file's properties indicate newline conversion or 04424 * keyword expansion, point @a *xlated_path to a copy of @a src 04425 * whose newlines and keywords are converted using the translation 04426 * as requested by @a flags. 04427 * 04428 * When translating to the normal form, inconsistent eol styles will be 04429 * repaired when appropriate for the given setting. When translating 04430 * from normal form, no EOL repair is performed (consistency is assumed). 04431 * This behaviour can be overridden by specifying 04432 * @c SVN_WC_TRANSLATE_FORCE_EOL_REPAIR. 04433 * 04434 * The caller can explicitly request a new file to be returned by setting the 04435 * @c SVN_WC_TRANSLATE_FORCE_COPY flag in @a flags. 04436 * 04437 * This function is generally used to get a file that can be compared 04438 * meaningfully against @a versioned_file's text base, if 04439 * @c SVN_WC_TRANSLATE_TO_NF is specified, against @a versioned_file itself 04440 * if @c SVN_WC_TRANSLATE_FROM_NF is specified. 04441 * 04442 * Output files are created in the temp file area belonging to 04443 * @a versioned_file. By default they will be deleted at pool cleanup. 04444 * 04445 * If @c SVN_WC_TRANSLATE_NO_OUTPUT_CLEANUP is specified, the default 04446 * pool cleanup handler to remove @a *xlated_path is not registered. 04447 * 04448 * If an error is returned, the effect on @a *xlated_path is undefined. 04449 * 04450 * @since New in 1.4 04451 */ 04452 svn_error_t * 04453 svn_wc_translated_file2(const char **xlated_path, 04454 const char *src, 04455 const char *versioned_file, 04456 svn_wc_adm_access_t *adm_access, 04457 apr_uint32_t flags, 04458 apr_pool_t *pool); 04459 04460 04461 /** Same as svn_wc_translated_file2, but will never clean up 04462 * temporary files. 04463 * 04464 * @deprecated Provided for compatibility with the 1.3 API 04465 */ 04466 svn_error_t * 04467 svn_wc_translated_file(const char **xlated_p, 04468 const char *vfile, 04469 svn_wc_adm_access_t *adm_access, 04470 svn_boolean_t force_repair, 04471 apr_pool_t *pool); 04472 04473 04474 /** Returns a @a stream allocated in @a pool with access to the given 04475 * @a path taking the file properties from @a versioned_file using 04476 * @a adm_access. 04477 * 04478 * When translation from normal form is requested 04479 * (@c SVN_WC_TRANSLATE_FROM_NF is specified in @a flags), @a path 04480 * is used as target path and stream read operations are not supported. 04481 * Conversely, if translation to normal form is requested 04482 * (@c SVN_WC_TRANSLATE_TO_NF is specified in @a flags), @a path is 04483 * used as source path and stream write operations are not supported. 04484 * 04485 * The @a flags are the same constants as those used for 04486 * svn_wc_translated_file(). 04487 * 04488 * @since New in 1.5. 04489 */ 04490 svn_error_t * 04491 svn_wc_translated_stream(svn_stream_t **stream, 04492 const char *path, 04493 const char *versioned_file, 04494 svn_wc_adm_access_t *adm_access, 04495 apr_uint32_t flags, 04496 apr_pool_t *pool); 04497 04498 04499 /* Text/Prop Deltas Using an Editor */ 04500 04501 04502 /** Send the local modifications for versioned file @a path (with 04503 * matching @a file_baton) through @a editor, then close @a file_baton 04504 * afterwards. Use @a pool for any temporary allocation and 04505 * @a adm_access as an access baton for @a path. 04506 * 04507 * This process creates a copy of @a path with keywords and eol 04508 * untranslated. If @a tempfile is non-NULL, set @a *tempfile to the 04509 * path to this copy. Do not clean up the copy; caller can do that. 04510 * If @a digest is non-NULL, put the MD5 checksum of the 04511 * temporary file into @a digest, which must point to @c APR_MD5_DIGESTSIZE 04512 * bytes of storage. (The purpose of handing back the tmp copy is that 04513 * it is usually about to become the new text base anyway, but the 04514 * installation of the new text base is outside the scope of this 04515 * function.) 04516 * 04517 * If @a fulltext, send the untranslated copy of @a path through @a editor 04518 * as full-text; else send it as svndiff against the current text base. 04519 * 04520 * If sending a diff, and the recorded checksum for @a path's text-base 04521 * does not match the current actual checksum, then remove the tmp 04522 * copy (and set @a *tempfile to NULL if appropriate), and return the 04523 * error @c SVN_ERR_WC_CORRUPT_TEXT_BASE. 04524 * 04525 * @note This is intended for use with both infix and postfix 04526 * text-delta styled editor drivers. 04527 * 04528 * @since New in 1.4. 04529 */ 04530 svn_error_t * 04531 svn_wc_transmit_text_deltas2(const char **tempfile, 04532 unsigned char digest[], 04533 const char *path, 04534 svn_wc_adm_access_t *adm_access, 04535 svn_boolean_t fulltext, 04536 const svn_delta_editor_t *editor, 04537 void *file_baton, 04538 apr_pool_t *pool); 04539 04540 /** Similar to svn_wc_transmit_text_deltas2(), but with @a digest set to NULL. 04541 * 04542 * @deprecated Provided for backwards compatibility with the 1.3 API. 04543 */ 04544 svn_error_t * 04545 svn_wc_transmit_text_deltas(const char *path, 04546 svn_wc_adm_access_t *adm_access, 04547 svn_boolean_t fulltext, 04548 const svn_delta_editor_t *editor, 04549 void *file_baton, 04550 const char **tempfile, 04551 apr_pool_t *pool); 04552 04553 04554 /** Given a @a path with its accompanying @a entry, transmit all local 04555 * property modifications using the appropriate @a editor method (in 04556 * conjunction with @a baton). @a adm_access is an access baton set 04557 * that contains @a path. Use @a pool for all allocations. 04558 * 04559 * If a temporary file remains after this function is finished, the 04560 * path to that file is returned in @a *tempfile (so the caller can 04561 * clean this up if it wishes to do so). 04562 * 04563 * @note Starting version 1.5, no tempfile will ever be returned 04564 * anymore. If @a *tempfile is passed, its value is set to @c NULL. 04565 */ 04566 svn_error_t * 04567 svn_wc_transmit_prop_deltas(const char *path, 04568 svn_wc_adm_access_t *adm_access, 04569 const svn_wc_entry_t *entry, 04570 const svn_delta_editor_t *editor, 04571 void *baton, 04572 const char **tempfile, 04573 apr_pool_t *pool); 04574 04575 04576 /** Get the run-time configured list of ignore patterns from the 04577 * @c svn_config_t's in the @a config hash, and store them in @a *patterns. 04578 * Allocate @a *patterns and its contents in @a pool. 04579 */ 04580 svn_error_t * 04581 svn_wc_get_default_ignores(apr_array_header_t **patterns, 04582 apr_hash_t *config, 04583 apr_pool_t *pool); 04584 04585 /** Get the list of ignore patterns from the @c svn_config_t's in the 04586 * @a config hash and the local ignore patterns from the directory 04587 * in @a adm_access, and store them in @a *patterns. 04588 * Allocate @a *patterns and its contents in @a pool. 04589 * 04590 * @since New in 1.3. 04591 */ 04592 svn_error_t * 04593 svn_wc_get_ignores(apr_array_header_t **patterns, 04594 apr_hash_t *config, 04595 svn_wc_adm_access_t *adm_access, 04596 apr_pool_t *pool); 04597 04598 /** Return TRUE iff @a str matches any of the elements of @a list, a 04599 * list of zero or more ignore patterns. 04600 * 04601 * @since New in 1.5. 04602 */ 04603 svn_boolean_t 04604 svn_wc_match_ignore_list(const char *str, 04605 apr_array_header_t *list, 04606 apr_pool_t *pool); 04607 04608 04609 /** Add @a lock to the working copy for @a path. @a adm_access must contain 04610 * a write lock for @a path. If @a path is read-only, due to locking 04611 * properties, make it writable. Perform temporary allocations in @a 04612 * pool. */ 04613 svn_error_t * 04614 svn_wc_add_lock(const char *path, 04615 const svn_lock_t *lock, 04616 svn_wc_adm_access_t *adm_access, 04617 apr_pool_t *pool); 04618 04619 /** Remove any lock from @a path. @a adm_access must contain a 04620 * write-lock for @a path. If @a path has a lock and the locking 04621 * so specifies, make the file read-only. Don't return an error if @a 04622 * path didn't have a lock. Perform temporary allocations in @a pool. */ 04623 svn_error_t * 04624 svn_wc_remove_lock(const char *path, 04625 svn_wc_adm_access_t *adm_access, 04626 apr_pool_t *pool); 04627 04628 04629 /** A structure to report a summary of a working copy, including the 04630 * mix of revisions found within it, whether any parts are switched or 04631 * locally modified, and whether it is a sparse checkout. 04632 * 04633 * @note Fields may be added to the end of this structure in future 04634 * versions. Therefore, to preserve binary compatibility, users 04635 * should not directly allocate structures of this type. 04636 * 04637 * @since New in 1.4 04638 */ 04639 typedef struct svn_wc_revision_status_t 04640 { 04641 svn_revnum_t min_rev; /**< Lowest revision found */ 04642 svn_revnum_t max_rev; /**< Highest revision found */ 04643 04644 svn_boolean_t switched; /**< Is anything switched? */ 04645 svn_boolean_t modified; /**< Is anything modified? */ 04646 04647 /** Whether any WC paths are at a depth other than @c svn_depth_infinity. 04648 * @since New in 1.5. 04649 */ 04650 svn_boolean_t sparse_checkout; 04651 } 04652 svn_wc_revision_status_t; 04653 04654 /** Set @a *result_p to point to a new @c svn_wc_revision_status_t structure 04655 * containing a summary of the revision range and status of the working copy 04656 * at @a wc_path (not including "externals"). 04657 * 04658 * Set @a (*result_p)->min_rev and @a (*result_p)->max_rev respectively to the 04659 * lowest and highest revision numbers in the working copy. If @a committed 04660 * is TRUE, summarize the last-changed revisions, else the base revisions. 04661 * 04662 * Set @a (*result_p)->switched to indicate whether any item in the WC is 04663 * switched relative to its parent. If @a trail_url is non-NULL, use it to 04664 * determine if @a wc_path itself is switched. It should be any trailing 04665 * portion of @a wc_path's expected URL, long enough to include any parts 04666 * that the caller considers might be changed by a switch. If it does not 04667 * match the end of @a wc_path's actual URL, then report a "switched" 04668 * status. 04669 * 04670 * Set @a (*result_p)->modified to indicate whether any item is locally 04671 * modified. 04672 * 04673 * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine 04674 * if the client has cancelled the operation. 04675 * 04676 * Allocate *result_p in @a pool. 04677 * 04678 * @since New in 1.4 04679 */ 04680 svn_error_t * 04681 svn_wc_revision_status(svn_wc_revision_status_t **result_p, 04682 const char *wc_path, 04683 const char *trail_url, 04684 svn_boolean_t committed, 04685 svn_cancel_func_t cancel_func, 04686 void *cancel_baton, 04687 apr_pool_t *pool); 04688 04689 04690 /** 04691 * Set @a path's entry's 'changelist' attribute to @a changelist iff 04692 * @a changelist is not @c NULL; otherwise, remove any current 04693 * changelist assignment from @a path. @a adm_access is an access 04694 * baton set that contains @a path. 04695 * 04696 * If @a cancel_func is not @c NULL, call it with @a cancel_baton to 04697 * determine if the client has cancelled the operation. 04698 * 04699 * If @a notify_func is not @c NULL, call it with @a notify_baton to 04700 * report the change (using notification types @c 04701 * svn_wc_notify_changelist_set and @c svn_wc_notify_changelist_clear). 04702 * 04703 * @note For now, directories are NOT allowed to be associated with 04704 * changelists; there is confusion about whether they should behave 04705 * as depth-0 or depth-infinity objects. If @a path is a directory, 04706 * return @c SVN_ERR_UNSUPPORTED_FEATURE. 04707 * 04708 * @note This metadata is purely a client-side "bookkeeping" 04709 * convenience, and is entirely managed by the working copy. 04710 * 04711 * @since New in 1.5. 04712 */ 04713 svn_error_t * 04714 svn_wc_set_changelist(const char *path, 04715 const char *changelist, 04716 svn_wc_adm_access_t *adm_access, 04717 svn_cancel_func_t cancel_func, 04718 void *cancel_baton, 04719 svn_wc_notify_func2_t notify_func, 04720 void *notify_baton, 04721 apr_pool_t *pool); 04722 04723 /** @} */ 04724 04725 04726 #ifdef __cplusplus 04727 } 04728 #endif /* __cplusplus */ 04729 04730 #endif /* SVN_WC_H */