3 * ====================================================================
4 * Copyright (c) 2000-2007 CollabNet. All rights reserved.
6 * This software is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at http://subversion.tigris.org/license-1.html.
9 * If newer versions of this license are posted there, you may use a
10 * newer version instead, at your option.
12 * This software consists of voluntary contributions made by many
13 * individuals. For exact contribution history, see the revision
14 * history and logs, available at http://subversion.tigris.org/.
15 * ====================================================================
19 * @brief Subversion's working copy library
25 * - Ability to manipulate working copy's versioned data.
26 * - Ability to manipulate working copy's administrative files.
37 #include <apr_pools.h>
38 #include <apr_tables.h>
41 #include "svn_types.h"
42 #include "svn_string.h"
43 #include "svn_delta.h"
44 #include "svn_error.h"
46 #include "svn_ra.h" /* for svn_ra_reporter_t type */
50 #endif /* __cplusplus */
54 * Get libsvn_wc version information.
58 const svn_version_t
*svn_wc_version(void);
61 * @defgroup svn_wc Working copy management
65 /** Flags for use with svn_wc_translated_file2
67 * @defgroup translate_flags Translation flags
72 /** Translate from Normal Form.
74 * The working copy text bases and repository files are stored
75 * in normal form. Some files' contents - or ever representation -
76 * differs between the working copy and the normal form. This flag
77 * specifies to take the latter form as input and transform it
80 * Either this flag or @c SVN_WC_TRANSLATE_TO_NF should be specified,
83 #define SVN_WC_TRANSLATE_FROM_NF 0x00000000
85 /** Translate to Normal Form.
87 * Either this flag or @c SVN_WC_TRANSLATE_FROM_NF should be specified,
90 #define SVN_WC_TRANSLATE_TO_NF 0x00000001
92 /** Force repair of eol styles, making sure the output file consistently
93 * contains the one eol style as specified by the svn:eol-style
94 * property and the required translation direction.
97 #define SVN_WC_TRANSLATE_FORCE_EOL_REPAIR 0x00000002
99 /** Don't register a pool cleanup to delete the output file */
100 #define SVN_WC_TRANSLATE_NO_OUTPUT_CLEANUP 0x00000004
102 /** Guarantee a new file is created on successful return.
103 * The default shortcuts translation by returning the path
104 * of the untranslated file when no translation is required.
106 #define SVN_WC_TRANSLATE_FORCE_COPY 0x00000008
108 /** Use a non-wc-local tmp directory for creating output files,
109 * instead of in the working copy admin tmp area which is the default.
113 #define SVN_WC_TRANSLATE_USE_GLOBAL_TMP 0x00000010
118 /* Locking/Opening/Closing */
120 /** Baton for access to a working copy administrative area.
122 * One day all such access will require a baton, we're not there yet.
124 * Access batons can be grouped into sets, by passing an existing open
125 * baton when opening a new baton. Given one baton in a set, other batons
126 * may be retrieved. This allows an entire hierarchy to be locked, and
127 * then the set of batons can be passed around by passing a single baton.
129 typedef struct svn_wc_adm_access_t svn_wc_adm_access_t
;
133 * Return, in @a *adm_access, a pointer to a new access baton for the working
134 * copy administrative area associated with the directory @a path. If
135 * @a write_lock is TRUE the baton will include a write lock, otherwise the
136 * baton can only be used for read access. If @a path refers to a directory
137 * that is already write locked then the error @c SVN_ERR_WC_LOCKED will be
138 * returned. The error @c SVN_ERR_WC_NOT_DIRECTORY will be returned if
139 * @a path is not a versioned directory.
141 * If @a associated is an open access baton then @a adm_access will be added
142 * to the set containing @a associated. @a associated can be @c NULL, in
143 * which case @a adm_access is the start of a new set.
145 * @a levels_to_lock specifies how far to lock. Zero means just the specified
146 * directory. Any negative value means to lock the entire working copy
147 * directory hierarchy under @a path. A positive value indicates the number of
148 * levels of directories to lock -- 1 means just immediate subdirectories, 2
149 * means immediate subdirectories and their subdirectories, etc. All the
150 * access batons will become part of the set containing @a adm_access. This
151 * is an all-or-nothing option, if it is not possible to lock all the
152 * requested directories then an error will be returned and @a adm_access will
153 * be invalid, with the exception that subdirectories of @a path that are
154 * missing from the physical filesystem will not be locked and will not cause
155 * an error. The error @c SVN_ERR_WC_LOCKED will be returned if a
156 * subdirectory of @a path is already write locked.
158 * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
159 * if the client has cancelled the operation.
161 * @a pool will be used to allocate memory for the baton and any subsequently
162 * cached items. If @a adm_access has not been closed when the pool is
163 * cleared, it will be closed automatically at that point, and removed from
164 * its set. A baton closed in this way will not remove physical locks from
165 * the working copy if cleanup is required.
167 * The first baton in a set, with @a associated passed as @c NULL, must have
168 * the longest lifetime of all the batons in the set. This implies it must be
169 * the root of the hierarchy.
173 svn_error_t
*svn_wc_adm_open3(svn_wc_adm_access_t
**adm_access
,
174 svn_wc_adm_access_t
*associated
,
176 svn_boolean_t write_lock
,
178 svn_cancel_func_t cancel_func
,
183 * Similar to svn_wc_adm_open3(), but without cancellation support.
185 * @deprecated Provided for backward compatibility with the 1.1 API.
187 svn_error_t
*svn_wc_adm_open2(svn_wc_adm_access_t
**adm_access
,
188 svn_wc_adm_access_t
*associated
,
190 svn_boolean_t write_lock
,
195 * Similar to svn_wc_adm_open2(), but with @a tree_lock instead of
196 * @a levels_to_lock. @a levels_to_lock is set to -1 if @a tree_lock
197 * is @c TRUE, else 0.
199 * @deprecated Provided for backward compatibility with the 1.0 API.
201 svn_error_t
*svn_wc_adm_open(svn_wc_adm_access_t
**adm_access
,
202 svn_wc_adm_access_t
*associated
,
204 svn_boolean_t write_lock
,
205 svn_boolean_t tree_lock
,
209 * Checks the working copy to determine the node type of @a path. If
210 * @a path is a versioned directory then the behaviour is like that of
211 * svn_wc_adm_open3(), otherwise, if @a path is a file or does not
212 * exist, then the behaviour is like that of svn_wc_adm_open3() with
213 * @a path replaced by the parent directory of @a path. If @a path is
214 * an unversioned directory, the behaviour is also like that of
215 * svn_wc_adm_open3() on the parent, except that if the open fails,
216 * then the returned SVN_ERR_WC_NOT_DIRECTORY error refers to @a path,
217 * not to @a path's parent.
221 svn_error_t
*svn_wc_adm_probe_open3(svn_wc_adm_access_t
**adm_access
,
222 svn_wc_adm_access_t
*associated
,
224 svn_boolean_t write_lock
,
226 svn_cancel_func_t cancel_func
,
231 * Similar to svn_wc_adm_probe_open3() without the cancel
234 * @deprecated Provided for backward compatibility with the 1.1 API.
236 svn_error_t
*svn_wc_adm_probe_open2(svn_wc_adm_access_t
**adm_access
,
237 svn_wc_adm_access_t
*associated
,
239 svn_boolean_t write_lock
,
244 * Similar to svn_wc_adm_probe_open2(), but with @a tree_lock instead of
245 * @a levels_to_lock. @a levels_to_lock is set to -1 if @a tree_lock
246 * is @c TRUE, else 0.
248 * @deprecated Provided for backward compatibility with the 1.0 API.
250 svn_error_t
*svn_wc_adm_probe_open(svn_wc_adm_access_t
**adm_access
,
251 svn_wc_adm_access_t
*associated
,
253 svn_boolean_t write_lock
,
254 svn_boolean_t tree_lock
,
258 * Open access batons for @a path and return in @a *anchor_access and
259 * @a *target the anchor and target required to drive an editor. Return
260 * in @a *target_access the access baton for the target, which may be the
261 * same as @a *anchor_access. All the access batons will be in the
262 * @a *anchor_access set.
264 * @a levels_to_lock determines the levels_to_lock used when opening
265 * @a path if @a path is a versioned directory, @a levels_to_lock is
266 * ignored otherwise. If @a write_lock is @c TRUE the access batons
267 * will hold write locks.
269 * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
270 * if the client has cancelled the operation.
272 * This function is essentially a combination of svn_wc_adm_open3() and
273 * svn_wc_get_actual_target(), with the emphasis on reducing physical IO.
278 svn_wc_adm_open_anchor(svn_wc_adm_access_t
**anchor_access
,
279 svn_wc_adm_access_t
**target_access
,
282 svn_boolean_t write_lock
,
284 svn_cancel_func_t cancel_func
,
288 /** Return, in @a *adm_access, a pointer to an existing access baton associated
289 * with @a path. @a path must be a directory that is locked as part of the
290 * set containing the @a associated access baton.
292 * If the requested access baton is marked as missing in, or is simply
293 * absent from, @a associated, return SVN_ERR_WC_NOT_LOCKED.
295 * @a pool is used only for local processing, it is not used for the batons.
297 svn_error_t
*svn_wc_adm_retrieve(svn_wc_adm_access_t
**adm_access
,
298 svn_wc_adm_access_t
*associated
,
302 /** Check the working copy to determine the node type of @a path. If
303 * @a path is a versioned directory then the behaviour is like that of
304 * svn_wc_adm_retrieve(), otherwise, if @a path is a file, an unversioned
305 * directory, or does not exist, then the behaviour is like that of
306 * svn_wc_adm_retrieve() with @a path replaced by the parent directory of
309 svn_error_t
*svn_wc_adm_probe_retrieve(svn_wc_adm_access_t
**adm_access
,
310 svn_wc_adm_access_t
*associated
,
315 * Try various ways to obtain an access baton for @a path.
317 * First, try to obtain @a *adm_access via svn_wc_adm_probe_retrieve(),
318 * but if this fails because @a associated can't give a baton for
319 * @a path or @a path's parent, then try svn_wc_adm_probe_open3(),
320 * this time passing @a write_lock and @a levels_to_lock. If there is
321 * still no access because @a path is not a versioned directory, then
322 * just set @a *adm_access to NULL and return success. But if it is
323 * because @a path is locked, then return the error @c SVN_ERR_WC_LOCKED,
324 * and the effect on @a *adm_access is undefined. (Or if the attempt
325 * fails for any other reason, return the corresponding error, and the
326 * effect on @a *adm_access is also undefined.)
328 * If svn_wc_adm_probe_open3() succeeds, then add @a *adm_access to
331 * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
332 * if the client has cancelled the operation.
334 * Use @a pool only for local processing, not to allocate @a *adm_access.
338 svn_error_t
*svn_wc_adm_probe_try3(svn_wc_adm_access_t
**adm_access
,
339 svn_wc_adm_access_t
*associated
,
341 svn_boolean_t write_lock
,
343 svn_cancel_func_t cancel_func
,
348 * Similar to svn_wc_adm_probe_try3() without the cancel
351 * @deprecated Provided for backward compatibility with the 1.1 API.
353 svn_error_t
*svn_wc_adm_probe_try2(svn_wc_adm_access_t
**adm_access
,
354 svn_wc_adm_access_t
*associated
,
356 svn_boolean_t write_lock
,
361 * Similar to svn_wc_adm_probe_try2(), but with @a tree_lock instead of
362 * @a levels_to_lock. @a levels_to_lock is set to -1 if @a tree_lock
363 * is @c TRUE, else 0.
365 * @deprecated Provided for backward compatibility with the 1.0 API.
367 svn_error_t
*svn_wc_adm_probe_try(svn_wc_adm_access_t
**adm_access
,
368 svn_wc_adm_access_t
*associated
,
370 svn_boolean_t write_lock
,
371 svn_boolean_t tree_lock
,
375 /** Give up the access baton @a adm_access, and its lock if any. This will
376 * recursively close any batons in the same set that are direct
377 * subdirectories of @a adm_access. Any physical locks will be removed from
378 * the working copy. Lock removal is unconditional, there is no check to
379 * determine if cleanup is required.
381 svn_error_t
*svn_wc_adm_close(svn_wc_adm_access_t
*adm_access
);
383 /** Return the path used to open the access baton @a adm_access */
384 const char *svn_wc_adm_access_path(svn_wc_adm_access_t
*adm_access
);
386 /** Return the pool used by access baton @a adm_access */
387 apr_pool_t
*svn_wc_adm_access_pool(svn_wc_adm_access_t
*adm_access
);
389 /** Return @c TRUE is the access baton @a adm_access has a write lock,
390 * @c FALSE otherwise. Compared to svn_wc_locked() this is a cheap, fast
391 * function that doesn't access the filesystem.
393 svn_boolean_t
svn_wc_adm_locked(svn_wc_adm_access_t
*adm_access
);
395 /** Set @a *locked to non-zero if @a path is locked, else set it to zero. */
396 svn_error_t
*svn_wc_locked(svn_boolean_t
*locked
,
402 * Return @c TRUE if @a name is the name of the WC administrative
403 * directory. Use @a pool for any temporary allocations. Only works
404 * with base directory names, not paths or URIs.
406 * For compatibility, the default name (.svn) will always be treated
407 * as an admin dir name, even if the working copy is actually using an
412 svn_boolean_t
svn_wc_is_adm_dir(const char *name
, apr_pool_t
*pool
);
416 * Return the name of the administrative directory.
417 * Use @a pool for any temporary allocations.
419 * The returned pointer will refer to either a statically allocated
420 * string, or to a string allocated in @a pool.
424 const char *svn_wc_get_adm_dir(apr_pool_t
*pool
);
428 * Use @a name for the administrative directory in the working copy.
429 * Use @a pool for any temporary allocations.
431 * The list of valid names is limited. Currently only ".svn" (the
432 * default) and "_svn" are allowed.
434 * @note This function changes global (per-process) state and must be
435 * called in a single-threaded context during the initialization of a
440 svn_error_t
*svn_wc_set_adm_dir(const char *name
, apr_pool_t
*pool
);
444 /** Traversal information is information gathered by a working copy
445 * crawl or update. For example, the before and after values of the
446 * svn:externals property are important after an update, and since
447 * we're traversing the working tree anyway (a complete traversal
448 * during the initial crawl, and a traversal of changed paths during
449 * the checkout/update/switch), it makes sense to gather the
450 * property's values then instead of making a second pass.
452 typedef struct svn_wc_traversal_info_t svn_wc_traversal_info_t
;
455 /** Return a new, empty traversal info object, allocated in @a pool. */
456 svn_wc_traversal_info_t
*svn_wc_init_traversal_info(apr_pool_t
*pool
);
459 /** Set @a *externals_old and @a *externals_new to hash tables representing
460 * changes to values of the svn:externals property on directories
461 * traversed by @a traversal_info.
463 * @a traversal_info is obtained from svn_wc_init_traversal_info(), but is
464 * only useful after it has been passed through another function, such
465 * as svn_wc_crawl_revisions(), svn_wc_get_update_editor(),
466 * svn_wc_get_switch_editor(), etc.
468 * Each hash maps <tt>const char *</tt> directory names onto
469 * <tt>const char *</tt> values of the externals property for that directory.
470 * The dir names are full paths -- that is, anchor plus target, not target
471 * alone. The values are not parsed, they are simply copied raw, and are
472 * never NULL: directories that acquired or lost the property are
473 * simply omitted from the appropriate table. Directories whose value
474 * of the property did not change show the same value in each hash.
476 * The hashes, keys, and values have the same lifetime as @a traversal_info.
478 void svn_wc_edited_externals(apr_hash_t
**externals_old
,
479 apr_hash_t
**externals_new
,
480 svn_wc_traversal_info_t
*traversal_info
);
483 /** Set @a *depths to a hash table mapping <tt>const char *</tt>
484 * directory names (directories traversed by @a traversal_info) to
485 * <tt>const char *</tt> values (the depths of those directories, as
486 * converted by svn_depth_to_word()).
488 * @a traversal_info is obtained from svn_wc_init_traversal_info(), but is
489 * only useful after it has been passed through another function, such
490 * as svn_wc_crawl_revisions(), svn_wc_get_update_editor(),
491 * svn_wc_get_switch_editor(), etc.
493 * The dir names are full paths -- that is, anchor plus target, not target
494 * alone. The values are not allocated, they are static constant strings.
495 * Although the values are never NULL, not all directories traversed
496 * are necessarily listed. For example, directories which did not
497 * have an svn:externals property set or modified are not included.
499 * The hashes and keys have the same lifetime as @a traversal_info.
503 void svn_wc_traversed_depths(apr_hash_t
**depths
,
504 svn_wc_traversal_info_t
*traversal_info
);
507 /** One external item. This usually represents one line from an
508 * svn:externals description but with the path and URL
511 * In order to avoid backwards compatibility problems clients should use
512 * svn_wc_external_item_create() to allocate and intialize this structure
513 * instead of doing so themselves.
517 typedef struct svn_wc_external_item2_t
519 /** The name of the subdirectory into which this external should be
520 checked out. This is relative to the parent directory that
521 holds this external item. (Note that these structs are often
522 stored in hash tables with the target dirs as keys, so this
523 field will often be redundant.) */
524 const char *target_dir
;
526 /** Where to check out from. */
529 /** What revision to check out. The only valid kinds for this are
530 svn_opt_revision_number, svn_opt_revision_date, and
531 svn_opt_revision_head. */
532 svn_opt_revision_t revision
;
534 /** The peg revision to use when checking out. The only valid kinds are
535 svn_opt_revision_number, svn_opt_revision_date, and
536 svn_opt_revision_head. */
537 svn_opt_revision_t peg_revision
;
539 } svn_wc_external_item2_t
;
542 * Initialize an external item.
543 * Set @a *item to an external item object, allocated in @a pool.
545 * In order to avoid backwards compatibility problems, this function
546 * is used to intialize and allocate the @c svn_wc_external_item2_t
547 * structure rather than doing so explicitly, as the size of this
548 * structure may change in the future.
550 * The current implementation never returns error, but callers should
551 * still check for error, for compatibility with future versions.
556 svn_wc_external_item_create(const svn_wc_external_item2_t
**item
,
560 * Return a duplicate of @a item, allocated in @a pool. No part of the new
561 * item will be shared with @a item.
565 svn_wc_external_item2_t
*
566 svn_wc_external_item2_dup(const svn_wc_external_item2_t
*item
,
570 * One external item. Similar to svn_wc_external_item2_t, except
571 * @a revision is interpreted as both the operational revision and the
574 * @deprecated Provided for backward compatibility with the 1.4 API.
576 typedef struct svn_wc_external_item_t
578 /** Same as @c svn_wc_external_item2_t.target_dir */
579 const char *target_dir
;
581 /** Same as @c svn_wc_external_item2_t.url */
584 /** Same as @c svn_wc_external_item2_t.revision */
585 svn_opt_revision_t revision
;
587 } svn_wc_external_item_t
;
590 * Return a duplicate of @a item, allocated in @a pool. No part of the new
591 * item will be shared with @a item.
595 * @deprecated Provided for backward compatibility with the 1.4 API.
597 svn_wc_external_item_t
*
598 svn_wc_external_item_dup(const svn_wc_external_item_t
*item
,
602 * If @a externals_p is non-NULL, set @a *externals_p to an array of
603 * @c svn_wc_external_item2_t * objects based on @a desc. The @a url
604 * member of the objects will be canonicalized if @a canonicalize_url
607 * If the format of @a desc is invalid, don't touch @a *externals_p and
608 * return @c SVN_ERR_CLIENT_INVALID_EXTERNALS_DESCRIPTION. Thus, if
609 * you just want to check the validity of an externals description,
610 * and don't care about the parsed result, pass NULL for @a externals_p.
612 * The format of @a desc is the same as for values of the directory
613 * property @c SVN_PROP_EXTERNALS, which see.
615 * Allocate the table, keys, and values in @a pool.
617 * Use @a parent_directory only in constructing error strings.
622 svn_wc_parse_externals_description3(apr_array_header_t
**externals_p
,
623 const char *parent_directory
,
625 svn_boolean_t canonicalize_url
,
629 * Similar to svn_wc_parse_externals_description3() with @a
630 * canonicalize_url set to @c TRUE, but returns an array of @c
631 * svn_wc_external_item_t * objects instead of @c
632 * svn_wc_external_item2_t * objects
636 * @deprecated Provided for backward compatibility with the 1.4 API.
639 svn_wc_parse_externals_description2(apr_array_header_t
**externals_p
,
640 const char *parent_directory
,
645 * Similar to svn_wc_parse_externals_description2(), but returns the
646 * parsed externals in a hash instead of an array. This function
647 * should not be used, as storing the externals in a hash causes their
648 * order of evaluation to be not easily identifiable.
650 * @deprecated Provided for backward compatibility with the 1.0 API.
653 svn_wc_parse_externals_description(apr_hash_t
**externals_p
,
654 const char *parent_directory
,
660 /* Notification/callback handling. */
663 * @defgroup svn_wc_notifications Notification callback handling
666 * In many cases, the WC library will scan a working copy and make
667 * changes. The caller usually wants to know when each of these changes
668 * has been made, so that it can display some kind of notification to
671 * These notifications have a standard callback function type, which
672 * takes the path of the file that was affected, and a caller-
675 * Note that the callback is a 'void' return -- this is a simple
676 * reporting mechanism, rather than an opportunity for the caller to
677 * alter the operation of the WC library.
679 * Note also that some of the actions are used across several
680 * different Subversion commands. For example, the update actions are
681 * also used for checkouts, switches, and merges.
684 /** The type of action occurring. */
685 typedef enum svn_wc_notify_action_t
687 /** Adding a path to revision control. */
688 svn_wc_notify_add
= 0,
690 /** Copying a versioned path. */
693 /** Deleting a versioned path. */
694 svn_wc_notify_delete
,
696 /** Restoring a missing path from the pristine text-base. */
697 svn_wc_notify_restore
,
699 /** Reverting a modified path. */
700 svn_wc_notify_revert
,
702 /** A revert operation has failed. */
703 svn_wc_notify_failed_revert
,
705 /** Resolving a conflict. */
706 svn_wc_notify_resolved
,
708 /** Skipping a path. */
711 /** Got a delete in an update. */
712 svn_wc_notify_update_delete
,
714 /** Got an add in an update. */
715 svn_wc_notify_update_add
,
717 /** Got any other action in an update. */
718 svn_wc_notify_update_update
,
720 /** The last notification in an update (including updates of externals). */
721 svn_wc_notify_update_completed
,
723 /** Updating an external module. */
724 svn_wc_notify_update_external
,
726 /** The last notification in a status (including status on externals). */
727 svn_wc_notify_status_completed
,
729 /** Running status on an external module. */
730 svn_wc_notify_status_external
,
732 /** Committing a modification. */
733 svn_wc_notify_commit_modified
,
735 /** Committing an addition. */
736 svn_wc_notify_commit_added
,
738 /** Committing a deletion. */
739 svn_wc_notify_commit_deleted
,
741 /** Committing a replacement. */
742 svn_wc_notify_commit_replaced
,
744 /** Transmitting post-fix text-delta data for a file. */
745 svn_wc_notify_commit_postfix_txdelta
,
747 /** Processed a single revision's blame. */
748 svn_wc_notify_blame_revision
,
750 /** Locking a path. @since New in 1.2. */
751 svn_wc_notify_locked
,
753 /** Unlocking a path. @since New in 1.2. */
754 svn_wc_notify_unlocked
,
756 /** Failed to lock a path. @since New in 1.2. */
757 svn_wc_notify_failed_lock
,
759 /** Failed to unlock a path. @since New in 1.2. */
760 svn_wc_notify_failed_unlock
,
762 /** Tried adding a path that already exists. @since New in 1.5. */
763 svn_wc_notify_exists
,
765 /** Changelist name set. @since New in 1.5. */
766 svn_wc_notify_changelist_set
,
768 /** Changelist name cleared. @since New in 1.5. */
769 svn_wc_notify_changelist_clear
,
771 /** Failed to update a path's changelist association. @since New in 1.5. */
772 svn_wc_notify_changelist_failed
,
774 /** Warn user that a path has moved from one changelist to another.
775 @since New in 1.5. */
776 svn_wc_notify_changelist_moved
,
778 /** A merge operation (to path) has begun. See @c merge_range in
779 @c svn_wc_notify_t. @since New in 1.5 */
780 svn_wc_notify_merge_begin
,
782 /** Replace notification. */
783 svn_wc_notify_update_replace
785 } svn_wc_notify_action_t
;
788 /** The type of notification that is occurring. */
789 typedef enum svn_wc_notify_state_t
791 svn_wc_notify_state_inapplicable
= 0,
793 /** Notifier doesn't know or isn't saying. */
794 svn_wc_notify_state_unknown
,
796 /** The state did not change. */
797 svn_wc_notify_state_unchanged
,
799 /** The item wasn't present. */
800 svn_wc_notify_state_missing
,
802 /** An unversioned item obstructed work. */
803 svn_wc_notify_state_obstructed
,
805 /** Pristine state was modified. */
806 svn_wc_notify_state_changed
,
808 /** Modified state had mods merged in. */
809 svn_wc_notify_state_merged
,
811 /** Modified state got conflicting mods. */
812 svn_wc_notify_state_conflicted
814 } svn_wc_notify_state_t
;
817 * What happened to a lock during an operation.
821 typedef enum svn_wc_notify_lock_state_t
{
822 svn_wc_notify_lock_state_inapplicable
= 0,
823 svn_wc_notify_lock_state_unknown
,
824 /** The lock wasn't changed. */
825 svn_wc_notify_lock_state_unchanged
,
826 /** The item was locked. */
827 svn_wc_notify_lock_state_locked
,
828 /** The item was unlocked. */
829 svn_wc_notify_lock_state_unlocked
830 } svn_wc_notify_lock_state_t
;
833 * Structure used in the @c svn_wc_notify_func2_t function.
835 * @c kind, @c content_state, @c prop_state and @c lock_state are from
836 * after @c action, not before.
838 * @note If @c action is @c svn_wc_notify_update, then @c path has
839 * already been installed, so it is legitimate for an implementation of
840 * @c svn_wc_notify_func2_t to examine @c path in the working copy.
842 * @note The purpose of the @c kind, @c mime_type, @c content_state, and
843 * @c prop_state fields is to provide "for free" information that an
844 * implementation is likely to want, and which it would otherwise be
845 * forced to deduce via expensive operations such as reading entries
846 * and properties. However, if the caller does not have this
847 * information, it will simply pass the corresponding `*_unknown'
848 * values, and it is up to the implementation how to handle that
849 * (i.e., whether to attempt deduction, or just to punt and
850 * give a less informative notification).
852 * @note Callers of notification functions should use svn_wc_create_notify()
853 * to create structures of this type to allow for extensibility.
857 typedef struct svn_wc_notify_t
{
858 /** Path, either absolute or relative to the current working directory
859 * (i.e., not relative to an anchor). */
861 /** Action that describes what happened to @c path. */
862 svn_wc_notify_action_t action
;
863 /** Node kind of @c path. */
864 svn_node_kind_t kind
;
865 /** If non-NULL, indicates the mime-type of @c path.
866 * It is always @c NULL for directories. */
867 const char *mime_type
;
868 /** Points to the lock structure received from the repository when
869 * @c action is @c svn_wc_notify_locked. For other actions, it is
871 const svn_lock_t
*lock
;
872 /** Points to an error describing the reason for the failure when @c
873 * action is @c svn_wc_notify_failed_lock or @c svn_wc_notify_failed_unlock.
874 * Is @c NULL otherwise. */
876 /** The type of notification that is occurring about node content. */
877 svn_wc_notify_state_t content_state
;
878 /** The type of notification that is occurring about node properties. */
879 svn_wc_notify_state_t prop_state
;
880 /** Reflects the addition or removal of a lock token in the working copy. */
881 svn_wc_notify_lock_state_t lock_state
;
882 /** When @c action is @c svn_wc_notify_update_completed, target revision
883 * of the update, or @c SVN_INVALID_REVNUM if not available; when @c
884 * action is @c svn_wc_notify_blame_revision, processed revision.
885 * In all other cases, it is @c SVN_INVALID_REVNUM. */
886 svn_revnum_t revision
;
887 /** When @c action is @c svn_wc_notify_changelist_add or name. In all other
888 * cases, it is @c NULL. */
889 const char *changelist_name
;
890 /** When @c action is @c svn_wc_notify_merge_begin, and both the
891 left and right sides of the merge are from the same URL. In all
892 other cases, it is @c NULL. */
893 svn_merge_range_t
*merge_range
;
894 /* NOTE: Add new fields at the end to preserve binary compatibility.
895 Also, if you add fields here, you have to update svn_wc_create_notify
896 and svn_wc_dup_notify. */
900 * Allocate an @c svn_wc_notify_t structure in @a pool, initialize and return
903 * Set the @c path field of the created struct to @a path, and @c action to
904 * @a action. Set all other fields to their @c _unknown, @c NULL or
905 * invalid value, respectively.
910 svn_wc_create_notify(const char *path
, svn_wc_notify_action_t action
,
914 * Return a deep copy of @a notify, allocated in @a pool.
919 svn_wc_dup_notify(const svn_wc_notify_t
*notify
, apr_pool_t
*pool
);
922 * Notify the world that @a notify->action has happened to @a notify->path.
924 * Recommendation: callers of @c svn_wc_notify_func2_t should avoid
925 * invoking it multiple times on the same path within a given
926 * operation, and implementations should not bother checking for such
927 * duplicate calls. For example, in an update, the caller should not
928 * invoke the notify func on receiving a prop change and then again
929 * on receiving a text change. Instead, wait until all changes have
930 * been received, and then invoke the notify func once (from within
931 * an @c svn_delta_editor_t's close_file(), for example), passing
932 * the appropriate @a notify->content_state and @a notify->prop_state flags.
936 typedef void (*svn_wc_notify_func2_t
)(void *baton
,
937 const svn_wc_notify_t
*notify
,
941 * Similar to @c svn_wc_notify_func2_t, but takes the information as arguments
942 * instead of struct fields.
944 * @deprecated Provided for backward compatibility with the 1.1 API.
946 typedef void (*svn_wc_notify_func_t
)(void *baton
,
948 svn_wc_notify_action_t action
,
949 svn_node_kind_t kind
,
950 const char *mime_type
,
951 svn_wc_notify_state_t content_state
,
952 svn_wc_notify_state_t prop_state
,
953 svn_revnum_t revision
);
959 * A simple callback type to wrap svn_ra_get_file(); see that
960 * docstring for more information.
962 * This technique allows libsvn_client to 'wrap' svn_ra_get_file() and
963 * pass it down into libsvn_wc functions, thus allowing the WC layer
964 * to legally call the RA function via (blind) callback.
968 typedef svn_error_t
*(*svn_wc_get_file_t
)(void *baton
,
970 svn_revnum_t revision
,
971 svn_stream_t
*stream
,
972 svn_revnum_t
*fetched_rev
,
978 * Interactive conflict handling
980 * @defgroup svn_wc_conflict Conflict callback functionality
984 * This API gives a Subversion client application the opportunity to
985 * define a callback that allows the user to resolve conflicts
986 * interactively during updates and merges.
988 * If a conflict is discovered, libsvn_wc invokes the callback with an
989 * @c svn_wc_conflict_description_t. This structure describes the
990 * path in conflict, whether it's a text or property conflict, and may
991 * also present up to three files that can be used to resolve the
992 * conflict (perhaps by launching an editor or 3rd-party merging
993 * tool). The structure also provides a possible fourth file (@c
994 * merged_file) which, if not NULL, represents libsvn_wc's attempt to
995 * contextually merge the first three files. (Note that libsvn_wc
996 * will not attempt to merge a file that it believes is binary, and it
997 * will only attempt to merge property values it believes to be a
998 * series of multi-line text.)
1000 * When the callback is finished interacting with the user, it
1001 * responds by returning a @c svn_wc_conflict_result_t. This
1002 * structure indicates whether the user wants to postpone the conflict
1003 * for later (allowing libsvn_wc to mark the path "conflicted" as
1004 * usual), or whether the user wants libsvn_wc to use one of the four
1005 * files as the "final" state for resolving the conflict immediately.
1007 * Note that the callback is at liberty (and encouraged) to merge the
1008 * three files itself. If it does so, it signals this to libsvn_wc by
1009 * returning a choice of @c svn_wc_conflict_choose_merged. To return
1010 * the 'final' merged file to libsvn_wc, the callback has the option of
1013 * - editing the original @c merged_file in-place
1015 * or, if libsvn_wc never supplied a merged_file in the
1016 * description structure (i.e. passed NULL for that field),
1018 * - return the merged file in the @c svn_wc_conflict_result_t.
1022 /** The type of action being attempted on an object.
1024 * @since New in 1.5.
1026 typedef enum svn_wc_conflict_action_t
1028 svn_wc_conflict_action_edit
, /* attempting to change text or props */
1029 svn_wc_conflict_action_add
, /* attempting to add object */
1030 svn_wc_conflict_action_delete
/* attempting to delete object */
1032 } svn_wc_conflict_action_t
;
1035 /** The pre-existing condition which is causing a state of conflict.
1037 * @since New in 1.5.
1039 typedef enum svn_wc_conflict_reason_t
1041 svn_wc_conflict_reason_edited
, /* local edits are already present */
1042 svn_wc_conflict_reason_obstructed
, /* another object is in the way */
1043 svn_wc_conflict_reason_deleted
, /* object is already schedule-delete */
1044 svn_wc_conflict_reason_missing
, /* object is unknown or missing */
1045 svn_wc_conflict_reason_unversioned
/* object is unversioned */
1047 } svn_wc_conflict_reason_t
;
1050 /** The type of conflict being described by an @c
1051 * svn_wc_conflict_description_t (see below).
1053 * @since New in 1.5.
1055 typedef enum svn_wc_conflict_kind_t
1057 svn_wc_conflict_kind_text
, /* textual conflict (on a file) */
1058 svn_wc_conflict_kind_property
/* property conflict (on a file or dir) */
1060 /* ### Add future kinds here that represent "tree" conflicts. */
1062 } svn_wc_conflict_kind_t
;
1065 /** A struct that describes a conflict that has occurred in the
1066 * working copy. Passed to @c svn_wc_conflict_resolver_func_t.
1068 * @note Fields may be added to the end of this structure in future
1069 * versions. Therefore, to preserve binary compatibility, users
1070 * should not directly allocate structures of this type.
1072 * @since New in 1.5.
1074 typedef struct svn_wc_conflict_description_t
1076 /** The path that is being operated on */
1079 /** The node type of the path being operated on */
1080 svn_node_kind_t node_kind
;
1082 /** What sort of conflict are we describing? */
1083 svn_wc_conflict_kind_t kind
;
1085 /** Only set if this is a property conflict. */
1086 const char *property_name
;
1088 /** The following only apply to file objects:
1089 * - Whether svn thinks the object is a binary file.
1090 * - If available (non-NULL), the svn:mime-type property of the path */
1091 svn_boolean_t is_binary
;
1093 /** mime-type of the object */
1094 const char *mime_type
;
1096 /** If not NULL, an open working copy access baton to either the
1097 * path itself (if @c path is a directory), or to the parent
1098 * directory (if @c path is a file.) */
1099 svn_wc_adm_access_t
*access
;
1101 /** The action being attempted on @c path. */
1102 svn_wc_conflict_action_t action
;
1104 /** The reason for the conflict. */
1105 svn_wc_conflict_reason_t reason
;
1107 /** If this is text-conflict and involves the merging of two files
1108 * descended from a common ancestor, here are the paths of up to
1109 * four fulltext files that can be used to interactively resolve the
1110 * conflict. All four files will be in repository-normal form -- LF
1111 * line endings and contracted keywords. (If any of these files are
1112 * not available, they default to NULL.)
1114 * On the other hand, if this is a property-conflict, then these
1115 * paths represent temporary files that contain the three different
1116 * property-values in conflict. The fourth path (@c merged_file)
1117 * may or may not be NULL; if set, it represents libsvn_wc's
1118 * attempt to merge the property values together. (Remember that
1119 * property values are technically binary values, and thus can't
1120 * always be merged.)
1122 const char *base_file
; /* common ancestor of the two files being merged */
1124 /** their version of the file */
1125 const char *their_file
;
1127 /** my locally-edited version of the file */
1128 const char *my_file
;
1130 /** merged version; may contain conflict markers */
1131 const char *merged_file
;
1133 } svn_wc_conflict_description_t
;
1136 /** The way in which the conflict callback chooses a course of action.
1138 * @since New in 1.5.
1140 typedef enum svn_wc_conflict_choice_t
1142 /* Don't resolve the conflict now. Let libsvn_wc mark the path
1143 'conflicted', so user can run 'svn resolved' later. */
1144 svn_wc_conflict_choose_postpone
,
1146 /* If their were files to choose from, select one as a way of
1147 resolving the conflict here and now. libsvn_wc will then do the
1148 work of "installing" the chosen file.
1150 svn_wc_conflict_choose_base
, /* user chooses the original version */
1151 svn_wc_conflict_choose_theirs
, /* user chooses incoming version */
1152 svn_wc_conflict_choose_mine
, /* user chooses his/her own version */
1153 svn_wc_conflict_choose_merged
/* user chooses the merged version */
1155 } svn_wc_conflict_choice_t
;
1158 /** The final result returned by @a svn_wc_conflict_resolver_func_t.
1160 * @note Fields may be added to the end of this structure in future
1161 * versions. Therefore, to preserve binary compatibility, users
1162 * should not directly allocate structures of this type. Instead,
1163 * construct this structure using @c svn_wc_create_conflict_result()
1166 * @since New in 1.5.
1168 typedef struct svn_wc_conflict_result_t
1170 /** A choice to either delay the conflict resolution or select a
1171 particular file to resolve the conflict. */
1172 svn_wc_conflict_choice_t choice
;
1174 /** If not NULL, this is a path to a file which contains the client's
1175 (or more likely, the user's) merging of the three values in
1176 conflict. libsvn_wc accepts this file if (and only if) @c choice
1177 is set to @c svn_wc_conflict_choose_merged.*/
1178 const char *merged_file
;
1180 } svn_wc_conflict_result_t
;
1184 * Allocate an @c svn_wc_conflict_result_t structure in @a pool,
1185 * initialize and return it.
1187 * Set the @c choice field of the structure to @a choice, and @c
1188 * merged_file to @a merged_file. Set all other fields to their @c
1189 * _unknown, @c NULL or invalid value, respectively.
1191 * @since New in 1.5.
1193 svn_wc_conflict_result_t
*
1194 svn_wc_create_conflict_result(svn_wc_conflict_choice_t choice
,
1195 const char *merged_file
,
1199 /** A callback used in svn_client_merge3(), svn_client_update3(), and
1200 * svn_client_switch2() for resolving conflicts during the application
1201 * of a tree delta to a working copy.
1203 * @a description describes the exact nature of the conflict, and
1204 * provides information to help resolve it. @a baton is a closure
1205 * object; it should be provided by the implementation, and passed by
1206 * the caller. All allocations should be performed in @a pool. When
1207 * finished, the callback signals its resolution by returning a
1208 * structure in @a *result. (See @c svn_wc_conflict_result_t.)
1210 * Implementations of this callback are free to present the conflict
1211 * using any user interface. This may include simple contextual
1212 * conflicts in a file's text or properties, or more complex
1213 * 'tree'-based conflcts related to obstructed additions, deletions,
1214 * and edits. The callback implementation is free to decide which
1215 * sorts of conflicts to handle; it's also free to decide which types
1216 * of conflicts are automatically resolvable and which require user
1219 * @since New in 1.5.
1221 typedef svn_error_t
*(*svn_wc_conflict_resolver_func_t
)
1222 (svn_wc_conflict_result_t
**result
,
1223 const svn_wc_conflict_description_t
*description
,
1232 * A callback vtable invoked by our diff-editors, as they receive
1233 * diffs from the server. 'svn diff' and 'svn merge' both implement
1234 * their own versions of this table.
1236 * @since New in 1.2.
1238 typedef struct svn_wc_diff_callbacks2_t
1240 /** A file @a path has changed. If @a tmpfile2 is non-NULL, the
1241 * contents have changed and those changes can be seen by comparing
1242 * @a tmpfile1 and @a tmpfile2, which represent @a rev1 and @a rev2 of
1243 * the file, respectively.
1245 * If known, the @c svn:mime-type value of each file is passed into
1246 * @a mimetype1 and @a mimetype2; either or both of the values can
1247 * be NULL. The implementor can use this information to decide if
1248 * (or how) to generate differences.
1250 * @a propchanges is an array of (@c svn_prop_t) structures. If it has
1251 * any elements, the original list of properties is provided in
1252 * @a originalprops, which is a hash of @c svn_string_t values, keyed on the
1255 * @a adm_access will be an access baton for the directory containing
1256 * @a path, or @c NULL if the diff editor is not using access batons.
1258 * If @a contentstate is non-NULL, set @a *contentstate to the state of
1259 * the file contents after the operation has been performed. The same
1260 * applies for @a propstate regarding the property changes. (In
1261 * practice, this is only useful with merge, not diff; diff callbacks
1262 * will probably set @a *contentstate and @a *propstate to
1263 * @c svn_wc_notify_state_unknown, since they do not change the state and
1264 * therefore do not bother to know the state after the operation.)
1266 svn_error_t
*(*file_changed
)(svn_wc_adm_access_t
*adm_access
,
1267 svn_wc_notify_state_t
*contentstate
,
1268 svn_wc_notify_state_t
*propstate
,
1270 const char *tmpfile1
,
1271 const char *tmpfile2
,
1274 const char *mimetype1
,
1275 const char *mimetype2
,
1276 const apr_array_header_t
*propchanges
,
1277 apr_hash_t
*originalprops
,
1280 /** A file @a path was added. The contents can be seen by comparing
1281 * @a tmpfile1 and @a tmpfile2, which represent @a rev1 and @a rev2
1282 * of the file, respectively. (If either file is empty, the rev
1285 * If known, the @c svn:mime-type value of each file is passed into
1286 * @a mimetype1 and @a mimetype2; either or both of the values can
1287 * be NULL. The implementor can use this information to decide if
1288 * (or how) to generate differences.
1290 * @a propchanges is an array of (@c svn_prop_t) structures. If it contains
1291 * any elements, the original list of properties is provided in
1292 * @a originalprops, which is a hash of @c svn_string_t values, keyed on the
1295 * @a adm_access will be an access baton for the directory containing
1296 * @a path, or @c NULL if the diff editor is not using access batons.
1298 * If @a contentstate is non-NULL, set @a *contentstate to the state of the
1299 * file contents after the operation has been performed. The same
1300 * applies for @a propstate regarding the property changes. (In practice,
1301 * this is only useful with merge, not diff; diff callbacks will
1302 * probably set @a *contentstate and *propstate to
1303 * @c svn_wc_notify_state_unknown, since they do not change the state
1304 * and therefore do not bother to know the state after the operation.)
1307 svn_error_t
*(*file_added
)(svn_wc_adm_access_t
*adm_access
,
1308 svn_wc_notify_state_t
*contentstate
,
1309 svn_wc_notify_state_t
*propstate
,
1311 const char *tmpfile1
,
1312 const char *tmpfile2
,
1315 const char *mimetype1
,
1316 const char *mimetype2
,
1317 const apr_array_header_t
*propchanges
,
1318 apr_hash_t
*originalprops
,
1321 /** A file @a path was deleted. The [loss of] contents can be seen by
1322 * comparing @a tmpfile1 and @a tmpfile2. @a originalprops provides
1323 * the properties of the file.
1325 * If known, the @c svn:mime-type value of each file is passed into
1326 * @a mimetype1 and @a mimetype2; either or both of the values can
1327 * be NULL. The implementor can use this information to decide if
1328 * (or how) to generate differences.
1330 * @a adm_access will be an access baton for the directory containing
1331 * @a path, or @c NULL if the diff editor is not using access batons.
1333 * If @a state is non-NULL, set @a *state to the state of the item
1334 * after the delete operation has been performed. (In practice,
1335 * this is only useful with merge, not diff; diff callbacks will
1336 * probably set @a *state to @c svn_wc_notify_state_unknown, since
1337 * they do not change the state and therefore do not bother to know
1338 * the state after the operation.)
1340 svn_error_t
*(*file_deleted
)(svn_wc_adm_access_t
*adm_access
,
1341 svn_wc_notify_state_t
*state
,
1343 const char *tmpfile1
,
1344 const char *tmpfile2
,
1345 const char *mimetype1
,
1346 const char *mimetype2
,
1347 apr_hash_t
*originalprops
,
1350 /** A directory @a path was added. @a rev is the revision that the
1351 * directory came from.
1353 * @a adm_access will be an access baton for the directory containing
1354 * @a path, or @c NULL if the diff editor is not using access batons.
1356 svn_error_t
*(*dir_added
)(svn_wc_adm_access_t
*adm_access
,
1357 svn_wc_notify_state_t
*state
,
1362 /** A directory @a path was deleted.
1364 * @a adm_access will be an access baton for the directory containing
1365 * @a path, or @c NULL if the diff editor is not using access batons.
1367 * If @a state is non-NULL, set @a *state to the state of the item
1368 * after the delete operation has been performed. (In practice,
1369 * this is only useful with merge, not diff; diff callbacks will
1370 * probably set @a *state to @c svn_wc_notify_state_unknown, since
1371 * they do not change the state and therefore do not bother to know
1372 * the state after the operation.)
1374 svn_error_t
*(*dir_deleted
)(svn_wc_adm_access_t
*adm_access
,
1375 svn_wc_notify_state_t
*state
,
1379 /** A list of property changes (@a propchanges) was applied to the
1380 * directory @a path.
1382 * The array is a list of (@c svn_prop_t) structures.
1384 * The original list of properties is provided in @a original_props,
1385 * which is a hash of @c svn_string_t values, keyed on the property
1388 * @a adm_access will be an access baton for the directory containing
1389 * @a path, or @c NULL if the diff editor is not using access batons.
1391 * If @a state is non-NULL, set @a *state to the state of the properties
1392 * after the operation has been performed. (In practice, this is only
1393 * useful with merge, not diff; diff callbacks will probably set @a *state
1394 * to @c svn_wc_notify_state_unknown, since they do not change the state
1395 * and therefore do not bother to know the state after the operation.)
1397 svn_error_t
*(*dir_props_changed
)(svn_wc_adm_access_t
*adm_access
,
1398 svn_wc_notify_state_t
*state
,
1400 const apr_array_header_t
*propchanges
,
1401 apr_hash_t
*original_props
,
1404 } svn_wc_diff_callbacks2_t
;
1407 * Similar to @c svn_wc_diff_callbacks2_t, but with file additions/content
1408 * changes and property changes split into different functions.
1410 * @deprecated Provided for backward compatibility with the 1.1 API.
1412 typedef struct svn_wc_diff_callbacks_t
1414 /** Similar to @c file_changed in @c svn_wc_diff_callbacks2_t, but without
1415 * property change information. @a tmpfile2 is never NULL. @a state applies
1416 * to the file contents. */
1417 svn_error_t
*(*file_changed
)(svn_wc_adm_access_t
*adm_access
,
1418 svn_wc_notify_state_t
*state
,
1420 const char *tmpfile1
,
1421 const char *tmpfile2
,
1424 const char *mimetype1
,
1425 const char *mimetype2
,
1428 /** Similar to @c file_added in @c svn_wc_diff_callbacks2_t, but without
1429 * property change information. @a *state applies to the file contents. */
1430 svn_error_t
*(*file_added
)(svn_wc_adm_access_t
*adm_access
,
1431 svn_wc_notify_state_t
*state
,
1433 const char *tmpfile1
,
1434 const char *tmpfile2
,
1437 const char *mimetype1
,
1438 const char *mimetype2
,
1441 /** Similar to @c file_deleted in @c svn_wc_diff_callbacks2_t, but without
1442 * the properties. */
1443 svn_error_t
*(*file_deleted
)(svn_wc_adm_access_t
*adm_access
,
1444 svn_wc_notify_state_t
*state
,
1446 const char *tmpfile1
,
1447 const char *tmpfile2
,
1448 const char *mimetype1
,
1449 const char *mimetype2
,
1452 /** The same as @c dir_added in @c svn_wc_diff_callbacks2_t. */
1453 svn_error_t
*(*dir_added
)(svn_wc_adm_access_t
*adm_access
,
1454 svn_wc_notify_state_t
*state
,
1459 /** The same as @c dir_deleted in @c svn_wc_diff_callbacks2_t. */
1460 svn_error_t
*(*dir_deleted
)(svn_wc_adm_access_t
*adm_access
,
1461 svn_wc_notify_state_t
*state
,
1465 /** Similar to @c dir_props_changed in @c svn_wc_diff_callbacks2_t, but this
1466 * function is called for files as well as directories. */
1467 svn_error_t
*(*props_changed
)(svn_wc_adm_access_t
*adm_access
,
1468 svn_wc_notify_state_t
*state
,
1470 const apr_array_header_t
*propchanges
,
1471 apr_hash_t
*original_props
,
1474 } svn_wc_diff_callbacks_t
;
1477 /* Asking questions about a working copy. */
1479 /** Set @a *wc_format to @a path's working copy format version number if
1480 * @a path is a valid working copy directory, else set it to 0.
1481 * Return error @c APR_ENOENT if @a path does not exist at all.
1483 svn_error_t
*svn_wc_check_wc(const char *path
,
1488 /** Set @a *has_binary_prop to @c TRUE iff @a path has been marked
1489 * with a property indicating that it is non-text (in other words, binary).
1490 * @a adm_access is an access baton set that contains @a path.
1492 svn_error_t
*svn_wc_has_binary_prop(svn_boolean_t
*has_binary_prop
,
1494 svn_wc_adm_access_t
*adm_access
,
1498 /* Detecting modification. */
1500 /** Set @a *modified_p to non-zero if @a filename's text is modified
1501 * with regard to the base revision, else set @a *modified_p to zero.
1502 * @a filename is a path to the file, not just a basename. @a adm_access
1503 * must be an access baton for @a filename.
1505 * If @a force_comparison is @c TRUE, this function will not allow
1506 * early return mechanisms that avoid actual content comparison.
1507 * Instead, if there is a text base, a full byte-by-byte comparison
1508 * will be done, and the entry checksum verified as well. (This means
1509 * that if the text base is much longer than the working file, every
1510 * byte of the text base will still be examined.)
1512 * If @a filename does not exist, consider it unmodified. If it exists
1513 * but is not under revision control (not even scheduled for
1514 * addition), return the error @c SVN_ERR_ENTRY_NOT_FOUND.
1516 * If @a filename is unmodified but has a timestamp variation then this
1517 * function may "repair" @a filename's text-time by setting it to
1518 * @a filename's last modification time.
1520 svn_error_t
*svn_wc_text_modified_p(svn_boolean_t
*modified_p
,
1521 const char *filename
,
1522 svn_boolean_t force_comparison
,
1523 svn_wc_adm_access_t
*adm_access
,
1527 /** Set @a *modified_p to non-zero if @a path's properties are modified
1528 * with regard to the base revision, else set @a modified_p to zero.
1529 * @a adm_access must be an access baton for @a path.
1531 svn_error_t
*svn_wc_props_modified_p(svn_boolean_t
*modified_p
,
1533 svn_wc_adm_access_t
*adm_access
,
1539 /** Administrative subdir.
1541 * Ideally, this would be completely private to wc internals (in fact,
1542 * it used to be that adm_subdir() in adm_files.c was the only function
1543 * who knew the adm subdir's name). However, import wants to protect
1544 * against importing administrative subdirs, so now the name is a
1545 * matter of public record.
1547 * @deprecated Provided for backward compatibility with the 1.2 API.
1549 #define SVN_WC_ADM_DIR_NAME ".svn"
1553 /* Entries and status. */
1555 /** The schedule states an entry can be in. */
1556 typedef enum svn_wc_schedule_t
1558 /** Nothing special here */
1559 svn_wc_schedule_normal
,
1561 /** Slated for addition */
1562 svn_wc_schedule_add
,
1564 /** Slated for deletion */
1565 svn_wc_schedule_delete
,
1567 /** Slated for replacement (delete + add) */
1568 svn_wc_schedule_replace
1570 } svn_wc_schedule_t
;
1574 * Values for the working_size field in svn_wc_entry_t
1575 * when it isn't set to the actual size value of the unchanged
1578 * @defgroup svn_wc_entry_working_size_constants Working size constants
1583 /** The value of the working size is unknown (hasn't been
1584 * calculated and stored in the past for whatever reason).
1588 #define SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN -1
1592 /** A working copy entry -- that is, revision control information about
1593 * one versioned entity.
1595 typedef struct svn_wc_entry_t
1597 /* IMPORTANT: If you extend this structure, add new fields to the end. */
1599 /* General Attributes */
1604 /** base revision */
1605 svn_revnum_t revision
;
1607 /** url in repository */
1610 /** canonical repository URL or NULL if not known */
1613 /** repository uuid */
1616 /** node kind (file, dir, ...) */
1617 svn_node_kind_t kind
;
1619 /* State information */
1621 /** scheduling (add, delete, replace ...) */
1622 svn_wc_schedule_t schedule
;
1624 /** in a copied state (possibly because the entry is a child of a
1625 path that is @c svn_wc_schedule_add or @c svn_wc_schedule_replace,
1626 when the entry itself is @c svn_wc_schedule_normal) */
1627 svn_boolean_t copied
;
1629 /** deleted, but parent rev lags behind */
1630 svn_boolean_t deleted
;
1632 /** absent -- we know an entry of this name exists, but that's all
1633 (usually this happens because of authz restrictions) */
1634 svn_boolean_t absent
;
1636 /** for THIS_DIR entry, implies whole entries file is incomplete */
1637 svn_boolean_t incomplete
;
1639 /** copyfrom location */
1640 const char *copyfrom_url
;
1642 /** copyfrom revision */
1643 svn_revnum_t copyfrom_rev
;
1645 /** old version of conflicted file */
1646 const char *conflict_old
;
1648 /** new version of conflicted file */
1649 const char *conflict_new
;
1651 /** working version of conflicted file */
1652 const char *conflict_wrk
;
1654 /** property reject file */
1655 const char *prejfile
;
1657 /** last up-to-date time for text contents (0 means no information available)
1659 apr_time_t text_time
;
1661 /** last up-to-date time for properties (0 means no information available) */
1662 apr_time_t prop_time
;
1664 /** Hex MD5 checksum for the untranslated text base file,
1665 * can be @c NULL for backwards compatibility.
1667 const char *checksum
;
1671 /** last revision this was changed */
1672 svn_revnum_t cmt_rev
;
1674 /** last date this was changed */
1675 apr_time_t cmt_date
;
1677 /** last commit author of this item */
1678 const char *cmt_author
;
1680 /** lock token or NULL if path not locked in this WC
1681 * @since New in 1.2.
1683 const char *lock_token
;
1684 /** lock owner, or NULL if not locked in this WC
1685 * @since New in 1.2.
1687 const char *lock_owner
;
1688 /** lock comment or NULL if not locked in this WC or no comment
1689 * @since New in 1.2.
1691 const char *lock_comment
;
1692 /** Lock creation date or 0 if not locked in this WC
1693 * @since New in 1.2.
1695 apr_time_t lock_creation_date
;
1697 /** Whether this entry has any working properties.
1698 * False if this information is not stored in the entry.
1700 * @since New in 1.4. */
1701 svn_boolean_t has_props
;
1703 /** Whether this entry has property modifications.
1705 * @note For working copies in older formats, this flag is not valid.
1707 * @see svn_wc_props_modified_p().
1709 * @since New in 1.4. */
1710 svn_boolean_t has_prop_mods
;
1712 /** A space-separated list of all properties whose presence/absence is cached
1715 * @see @c present_props.
1717 * @since New in 1.4. */
1718 const char *cachable_props
;
1720 /** Cached property existence for this entry.
1721 * This is a space-separated list of property names. If a name exists in
1722 * @c cachable_props but not in this list, this entry does not have that
1723 * property. If a name exists in both lists, the property is present on this
1726 * @since New in 1.4. */
1727 const char *present_props
;
1729 /** which changelist this item is part of, or NULL if not part of any.
1730 * @since New in 1.5.
1732 const char *changelist
;
1734 /** Size of the file after being translated into local
1735 * representation, or @c SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN if
1738 * @since New in 1.5.
1740 apr_off_t working_size
;
1742 /** Whether a local copy of this entry should be kept in the working copy
1743 * after a deletion has been committed, Only valid for the this-dir entry
1744 * when it is scheduled for deletion.
1746 * @since New in 1.5. */
1747 svn_boolean_t keep_local
;
1749 /** The depth of this entry.
1751 * ### It's a bit annoying that we only use this on this_dir
1752 * ### entries, yet it will exist (with value svn_depth_infinity) on
1753 * ### all entries. Maybe some future extensibility would make this
1754 * ### field meaningful on entries besides this_dir.
1756 * @since New in 1.5. */
1759 /* IMPORTANT: If you extend this structure, check the following functions in
1760 * subversion/libsvn_wc/entries.c, to see if you need to extend them as well.
1762 * svn_wc_entry_dup()
1772 /** How an entries file's owner dir is named in the entries file. */
1773 #define SVN_WC_ENTRY_THIS_DIR ""
1776 /** Set @a *entry to an entry for @a path, allocated in the access baton
1777 * pool. If @a show_hidden is TRUE, return the entry even if it's in
1778 * 'deleted' or 'absent' state. If @a path is not under revision
1779 * control, or if entry is hidden, not scheduled for re-addition,
1780 * and @a show_hidden is @c FALSE, then set @a *entry to @c NULL.
1782 * @a *entry should not be modified, since doing so modifies the entries
1783 * cache in @a adm_access without changing the entries file on disk.
1785 * If @a path is not a directory then @a adm_access must be an access baton
1786 * for the parent directory of @a path. To avoid needing to know whether
1787 * @a path is a directory or not, if @a path is a directory @a adm_access
1788 * can still be an access baton for the parent of @a path so long as the
1789 * access baton for @a path itself is in the same access baton set.
1791 * @a path can be relative or absolute but must share the same base used
1792 * to open @a adm_access.
1794 * Note that it is possible for @a path to be absent from disk but still
1795 * under revision control; and conversely, it is possible for @a path to
1796 * be present, but not under revision control.
1798 * Use @a pool only for local processing.
1800 svn_error_t
*svn_wc_entry(const svn_wc_entry_t
**entry
,
1802 svn_wc_adm_access_t
*adm_access
,
1803 svn_boolean_t show_hidden
,
1807 /** Parse the `entries' file for @a adm_access and return a hash @a entries,
1808 * whose keys are (<tt>const char *</tt>) entry names and values are
1809 * (<tt>svn_wc_entry_t *</tt>). The hash @a entries, and its keys and
1810 * values, are allocated from the pool used to open the @a adm_access
1811 * baton (that's how the entries caching works). @a pool is used for
1812 * transient allocations.
1814 * Entries that are in a 'deleted' or 'absent' state (and not
1815 * scheduled for re-addition) are not returned in the hash, unless
1816 * @a show_hidden is TRUE.
1819 * The @a entries hash is the entries cache in @a adm_access
1820 * and so usually the hash itself, the keys and the values should be treated
1821 * as read-only. If any of these are modified then it is the caller's
1822 * responsibility to ensure that the entries file on disk is updated. Treat
1823 * the hash values as type (<tt>const svn_wc_entry_t *</tt>) if you wish to
1824 * avoid accidental modification. Modifying the schedule member is a
1825 * particularly bad idea, as the entries writing process relies on having
1826 * access to the original schedule. Use a duplicate entry to modify the
1830 * Only the entry structures representing files and
1831 * @c SVN_WC_ENTRY_THIS_DIR contain complete information. The entry
1832 * structures representing subdirs have only the `kind' and `state'
1833 * fields filled in. If you want info on a subdir, you must use this
1834 * routine to open its @a path and read the @c SVN_WC_ENTRY_THIS_DIR
1835 * structure, or call svn_wc_entry() on its @a path.
1837 svn_error_t
*svn_wc_entries_read(apr_hash_t
**entries
,
1838 svn_wc_adm_access_t
*adm_access
,
1839 svn_boolean_t show_hidden
,
1843 /** Return a duplicate of @a entry, allocated in @a pool. No part of the new
1844 * entry will be shared with @a entry.
1846 svn_wc_entry_t
*svn_wc_entry_dup(const svn_wc_entry_t
*entry
,
1850 /** Given a @a dir_path under version control, decide if one of its
1851 * entries (@a entry) is in state of conflict; return the answers in
1852 * @a text_conflicted_p and @a prop_conflicted_p.
1854 * (If the entry mentions that a .rej or .prej exist, but they are
1855 * both removed, assume the conflict has been resolved by the user.)
1857 svn_error_t
*svn_wc_conflicted_p(svn_boolean_t
*text_conflicted_p
,
1858 svn_boolean_t
*prop_conflicted_p
,
1859 const char *dir_path
,
1860 const svn_wc_entry_t
*entry
,
1863 /** Set @a *url and @a *rev to the ancestor URL and revision for @a path,
1864 * allocating in @a pool. @a adm_access must be an access baton for @a path.
1866 * If @a url or @a rev is NULL, then ignore it (just don't return the
1867 * corresponding information).
1869 svn_error_t
*svn_wc_get_ancestry(char **url
,
1872 svn_wc_adm_access_t
*adm_access
,
1876 /** A callback vtable invoked by the generic entry-walker function.
1877 * @since New in 1.5.
1879 typedef struct svn_wc_entry_callbacks2_t
1881 /** An @a entry was found at @a path. */
1882 svn_error_t
*(*found_entry
)(const char *path
,
1883 const svn_wc_entry_t
*entry
,
1887 /** Handle the error @a err encountered while processing @a path.
1888 * Wrap or squelch @a err as desired, and return an @c svn_error_t
1889 * *, or @c SVN_NO_ERROR.
1891 svn_error_t
*(*handle_error
)(const char *path
,
1896 } svn_wc_entry_callbacks2_t
;
1898 /** @deprecated Provided for backward compatibility with the 1.4 API. */
1899 typedef struct svn_wc_entry_callbacks_t
1901 /** An @a entry was found at @a path. */
1902 svn_error_t
*(*found_entry
)(const char *path
,
1903 const svn_wc_entry_t
*entry
,
1907 } svn_wc_entry_callbacks_t
;
1910 * A generic entry-walker.
1912 * Do a potentially recursive depth-first entry-walk beginning on
1913 * @a path, which can be a file or dir. Call callbacks in
1914 * @a walk_callbacks, passing @a walk_baton to each. Use @a pool for
1915 * looping, recursion, and to allocate all entries returned.
1916 * @a adm_access must be an access baton for @a path.
1918 * If @a depth is @c svn_depth_empty, invoke the callbacks on @a path
1919 * and return without recursing further. If @c svn_depth_files, do
1920 * the same and invoke the callbacks on file children (if any) of
1921 * @a path, then return. If @c svn_depth_immediates, do the preceding
1922 * but also invoke callbacks on immediate subdirectories, then return.
1923 * If @c svn_depth_infinity, recurse fully starting from @a path.
1925 * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
1926 * if the client has cancelled the operation.
1928 * Like our other entries interfaces, entries that are in a 'deleted'
1929 * or 'absent' state (and not scheduled for re-addition) are not
1930 * discovered, unless @a show_hidden is TRUE.
1932 * When a new directory is entered, @c SVN_WC_ENTRY_THIS_DIR will always
1933 * be returned first.
1935 * @note Callers should be aware that each directory will be
1936 * returned *twice*: first as an entry within its parent, and
1937 * subsequently as the '.' entry within itself. The two calls can be
1938 * distinguished by looking for @c SVN_WC_ENTRY_THIS_DIR in the 'name'
1939 * field of the entry.
1941 * @since New in 1.5.
1943 svn_error_t
*svn_wc_walk_entries3(const char *path
,
1944 svn_wc_adm_access_t
*adm_access
,
1945 const svn_wc_entry_callbacks2_t
1949 svn_boolean_t show_hidden
,
1950 svn_cancel_func_t cancel_func
,
1955 * Similar to svn_wc_walk_entries3(), but without cancellation support
1956 * or error handling from @a walk_callbacks, and with @a depth always
1957 * set to @c svn_depth_infinity.
1959 * @deprecated Provided for backward compatibility with the 1.4 API.
1961 svn_error_t
*svn_wc_walk_entries2(const char *path
,
1962 svn_wc_adm_access_t
*adm_access
,
1963 const svn_wc_entry_callbacks_t
1966 svn_boolean_t show_hidden
,
1967 svn_cancel_func_t cancel_func
,
1972 * Similar to svn_wc_walk_entries2(), but without cancellation support.
1974 * @deprecated Provided for backward compatibility with the 1.0 API.
1976 svn_error_t
*svn_wc_walk_entries(const char *path
,
1977 svn_wc_adm_access_t
*adm_access
,
1978 const svn_wc_entry_callbacks_t
1981 svn_boolean_t show_hidden
,
1985 /** Mark missing @a path as 'deleted' in its @a parent's list of entries.
1987 * Return @c SVN_ERR_WC_PATH_FOUND if @a path isn't actually missing.
1989 svn_error_t
*svn_wc_mark_missing_deleted(const char *path
,
1990 svn_wc_adm_access_t
*parent
,
1994 /** Ensure that an administrative area exists for @a path, so that @a
1995 * path is a working copy subdir based on @a url at @a revision, with
1996 * depth @a depth, and with repository UUID @a uuid and repository
1997 * root URL @a repos.
1999 * @a depth must be a definite depth, it cannot be @c svn_depth_unknown.
2000 * @a uuid and @a repos may be @c NULL. If non-@c NULL, @a repos must
2001 * be a prefix of @a url.
2003 * If the administrative area does not exist, then create it and
2004 * initialize it to an unlocked state.
2006 * If the administrative area already exists then the given @a url
2007 * must match the URL in the administrative area and the given
2008 * @a revision must match the BASE of the working copy dir unless
2009 * the admin directory is scheduled for deletion or the
2010 * SVN_ERR_WC_OBSTRUCTED_UPDATE error will be returned.
2012 * Do not ensure existence of @a path itself; if @a path does not
2013 * exist, return error.
2015 * @since New in 1.5.
2017 svn_error_t
*svn_wc_ensure_adm3(const char *path
,
2021 svn_revnum_t revision
,
2027 * Similar to svn_wc_ensure_adm3(), but with @a depth set to
2028 * @c svn_depth_infinity.
2030 * @deprecated Provided for backwards compatibility with the 1.4 API.
2032 * @since New in 1.3.
2034 svn_error_t
*svn_wc_ensure_adm2(const char *path
,
2038 svn_revnum_t revision
,
2043 * Similar to svn_wc_ensure_adm2(), but with @a repos set to @c NULL.
2045 * @deprecated Provided for backwards compatibility with the 1.2 API.
2047 svn_error_t
*svn_wc_ensure_adm(const char *path
,
2050 svn_revnum_t revision
,
2054 /** Set the repository root URL of @a path to @a repos, if possible.
2056 * @a adm_access must contain @a path and be write-locked, if @a path
2057 * is versioned. Return no error if path is missing or unversioned.
2058 * Use @a pool for temporary allocations.
2060 * @note In some circumstances, the repository root can't be set
2061 * without making the working copy corrupt. In such cases, this
2062 * function just returns no error, without modifying the @a path entry.
2064 * @note This function exists to make it possible to try to set the repository
2065 * root in old working copies; new working copies normally get this set at
2068 * @since New in 1.3.
2071 svn_wc_maybe_set_repos_root(svn_wc_adm_access_t
*adm_access
,
2072 const char *path
, const char *repos
,
2077 * @defgroup svn_wc_status Working copy status.
2080 * We have two functions for getting working copy status: one function
2081 * for getting the status of exactly one thing, and another for
2082 * getting the statuses of (potentially) multiple things.
2084 * The concept of depth, as explained in the documentation for
2085 * svn_depth_t, may be useful in understanding this. Suppose we're
2086 * getting the status of directory D:
2088 * To offer all three levels, we could have one unified function,
2089 * taking a `depth' parameter. Unfortunately, because this function
2090 * would have to handle multiple return values as well as the single
2091 * return value case, getting the status of just one entity would
2092 * become cumbersome: you'd have to roll through a hash to find one
2095 * So we have svn_wc_status() for depth-empty (just D itself), and
2096 * svn_wc_get_status_editor() for depth-immediates and depth-infinity,
2097 * since the latter two involve multiple return values.
2099 * @note The status structures may contain a @c NULL ->entry field.
2100 * This indicates an item that is not versioned in the working copy.
2103 /** The type of status for the working copy. */
2104 enum svn_wc_status_kind
2106 /** does not exist */
2107 svn_wc_status_none
= 1,
2109 /** is not a versioned thing in this wc */
2110 svn_wc_status_unversioned
,
2112 /** exists, but uninteresting */
2113 svn_wc_status_normal
,
2115 /** is scheduled for addition */
2116 svn_wc_status_added
,
2118 /** under v.c., but is missing */
2119 svn_wc_status_missing
,
2121 /** scheduled for deletion */
2122 svn_wc_status_deleted
,
2124 /** was deleted and then re-added */
2125 svn_wc_status_replaced
,
2127 /** text or props have been modified */
2128 svn_wc_status_modified
,
2130 /** local mods received repos mods */
2131 svn_wc_status_merged
,
2133 /** local mods received conflicting repos mods */
2134 svn_wc_status_conflicted
,
2136 /** is unversioned but configured to be ignored */
2137 svn_wc_status_ignored
,
2139 /** an unversioned resource is in the way of the versioned resource */
2140 svn_wc_status_obstructed
,
2142 /** an unversioned path populated by an svn:externals property */
2143 svn_wc_status_external
,
2145 /** a directory doesn't contain a complete entries list */
2146 svn_wc_status_incomplete
2150 * Structure for holding the "status" of a working copy item.
2152 * The item's entry data is in @a entry, augmented and possibly shadowed
2153 * by the other fields. @a entry is @c NULL if this item is not under
2156 * @note Fields may be added to the end of this structure in future
2157 * versions. Therefore, to preserve binary compatibility, users
2158 * should not directly allocate structures of this type.
2160 * @since New in 1.2.
2162 typedef struct svn_wc_status2_t
2164 /** Can be @c NULL if not under version control. */
2165 svn_wc_entry_t
*entry
;
2167 /** The status of the entries text. */
2168 enum svn_wc_status_kind text_status
;
2170 /** The status of the entries properties. */
2171 enum svn_wc_status_kind prop_status
;
2173 /** a directory can be 'locked' if a working copy update was interrupted. */
2174 svn_boolean_t locked
;
2176 /** a file or directory can be 'copied' if it's scheduled for
2177 * addition-with-history (or part of a subtree that is scheduled as such.).
2179 svn_boolean_t copied
;
2181 /** a file or directory can be 'switched' if the switch command has been
2184 svn_boolean_t switched
;
2186 /** The entry's text status in the repository. */
2187 enum svn_wc_status_kind repos_text_status
;
2189 /** The entry's property status in the repository. */
2190 enum svn_wc_status_kind repos_prop_status
;
2192 /** The entry's lock in the repository, if any. */
2193 svn_lock_t
*repos_lock
;
2195 /** Set to the URI (actual or expected) of the item.
2201 * @defgroup svn_wc_status_ood WC out-of-date info from the repository
2204 * When the working copy item is out-of-date compared to the
2205 * repository, the following fields represent the state of the
2206 * youngest revision of the item in the repository. If the working
2207 * copy is not out of date, the fields are initialized as described
2211 /** Set to the youngest committed revision, or @c SVN_INVALID_REVNUM
2212 * if not out of date.
2215 svn_revnum_t ood_last_cmt_rev
;
2217 /** Set to the most recent commit date, or @c 0 if not out of date.
2220 apr_time_t ood_last_cmt_date
;
2222 /** Set to the node kind of the youngest commit, or @c svn_node_none
2223 * if not out of date.
2226 svn_node_kind_t ood_kind
;
2228 /** Set to the user name of the youngest commit, or @c NULL if not
2229 * out of date or non-existent. Because a non-existent @c
2230 * svn:author property has the same behavior as an out-of-date
2231 * working copy, examine @c ood_last_cmt_rev to determine whether
2232 * the working copy is out of date.
2235 const char *ood_last_cmt_author
;
2239 /* NOTE! Please update svn_wc_dup_status2() when adding new fields here. */
2245 * Same as @c svn_wc_status2_t, but without the svn_lock_t 'repos_lock' field.
2247 * @deprecated Provided for backward compatibility with the 1.1 API.
2249 typedef struct svn_wc_status_t
2251 /** Can be @c NULL if not under version control. */
2252 svn_wc_entry_t
*entry
;
2254 /** The status of the entries text. */
2255 enum svn_wc_status_kind text_status
;
2257 /** The status of the entries properties. */
2258 enum svn_wc_status_kind prop_status
;
2260 /** a directory can be 'locked' if a working copy update was interrupted. */
2261 svn_boolean_t locked
;
2263 /** a file or directory can be 'copied' if it's scheduled for
2264 * addition-with-history (or part of a subtree that is scheduled as such.).
2266 svn_boolean_t copied
;
2268 /** a file or directory can be 'switched' if the switch command has been
2271 svn_boolean_t switched
;
2273 /** The entry's text status in the repository. */
2274 enum svn_wc_status_kind repos_text_status
;
2276 /** The entry's property status in the repository. */
2277 enum svn_wc_status_kind repos_prop_status
;
2284 * Return a deep copy of the @a orig_stat status structure, allocated
2287 * @since New in 1.2.
2289 svn_wc_status2_t
*svn_wc_dup_status2(svn_wc_status2_t
*orig_stat
,
2294 * Same as svn_wc_dup_status2(), but for older svn_wc_status_t structures.
2296 * @deprecated Provided for backward compatibility with the 1.1 API.
2298 svn_wc_status_t
*svn_wc_dup_status(svn_wc_status_t
*orig_stat
,
2303 * Fill @a *status for @a path, allocating in @a pool.
2304 * @a adm_access must be an access baton for @a path.
2306 * Here are some things to note about the returned structure. A quick
2307 * examination of the @c status->text_status after a successful return of
2308 * this function can reveal the following things:
2310 * - @c svn_wc_status_none : @a path is not versioned, and is either not
2311 * present on disk, or is ignored by svn's
2312 * default ignore regular expressions or the
2313 * svn:ignore property setting for @a path's
2316 * - @c svn_wc_status_missing : @a path is versioned, but is missing from
2319 * - @c svn_wc_status_unversioned : @a path is not versioned, but is
2320 * present on disk and not being
2321 * ignored (see above).
2323 * The other available results for the @c text_status field are more
2324 * straightforward in their meanings. See the comments on the
2325 * @c svn_wc_status_kind structure for some hints.
2327 * @since New in 1.2.
2329 svn_error_t
*svn_wc_status2(svn_wc_status2_t
**status
,
2331 svn_wc_adm_access_t
*adm_access
,
2336 * Same as svn_wc_status2(), but for older svn_wc_status_t structures.
2338 * @deprecated Provided for backward compatibility with the 1.1 API.
2340 svn_error_t
*svn_wc_status(svn_wc_status_t
**status
,
2342 svn_wc_adm_access_t
*adm_access
,
2349 * A callback for reporting a @a status about @a path.
2351 * @a baton is a closure object; it should be provided by the
2352 * implementation, and passed by the caller.
2354 * @since New in 1.2.
2356 typedef void (*svn_wc_status_func2_t
)(void *baton
,
2358 svn_wc_status2_t
*status
);
2361 * Same as svn_wc_status_func2_t(), but for older svn_wc_status_t structures.
2363 * @deprecated Provided for backward compatibility with the 1.1 API.
2365 typedef void (*svn_wc_status_func_t
)(void *baton
,
2367 svn_wc_status_t
*status
);
2371 * Set @a *editor and @a *edit_baton to an editor that generates @c
2372 * svn_wc_status2_t structures and sends them through @a status_func /
2373 * @a status_baton. @a anchor is an access baton, with a tree lock,
2374 * for the local path to the working copy which will be used as the
2375 * root of our editor. If @a target is not empty, it represents an
2376 * entry in the @a anchor path which is the subject of the editor
2377 * drive (otherwise, the @a anchor is the subject).
2379 * If @a set_locks_baton is non-@c NULL, it will be set to a baton that can
2380 * be used in a call to the svn_wc_status_set_repos_locks() function.
2382 * Callers drive this editor to describe working copy out-of-dateness
2383 * with respect to the repository. If this information is not
2384 * available or not desired, callers should simply call the
2385 * close_edit() function of the @a editor vtable.
2387 * If the editor driver calls @a editor's set_target_revision() vtable
2388 * function, then when the edit drive is completed, @a *edit_revision
2389 * will contain the revision delivered via that interface.
2391 * Assuming the target is a directory, then:
2393 * - If @a get_all is FALSE, then only locally-modified entries will be
2394 * returned. If TRUE, then all entries will be returned.
2396 * - If @a depth is @c svn_depth_empty, a status structure will
2397 * be returned for the target only; if @c svn_depth_files, for the
2398 * target and its immediate file children; if
2399 * @c svn_depth_immediates, for the target and its immediate
2400 * children; if @c svn_depth_infinity, for the target and
2401 * everything underneath it, fully recursively.
2403 * If @a depth is @c svn_depth_unknown, take depths from the
2404 * working copy and behave as above in each directory's case.
2406 * If the given @a depth is incompatible with the depth found in a
2407 * working copy directory, the found depth always governs.
2409 * If @a no_ignore is set, statuses that would typically be ignored
2410 * will instead be reported.
2412 * @a ignore_patterns is an array of file patterns matching
2413 * unversioned files to ignore for the purposes of status reporting,
2414 * or @c NULL if the default set of ignorable file patterns should be used.
2416 * If @a cancel_func is non-NULL, call it with @a cancel_baton while building
2417 * the @a statushash to determine if the client has cancelled the operation.
2419 * If @a traversal_info is non-NULL, then record pre-update traversal
2420 * state in it. (Caller should obtain @a traversal_info from
2421 * svn_wc_init_traversal_info().)
2423 * Allocate the editor itself in @a pool, but the editor does temporary
2424 * allocations in a subpool of @a pool.
2426 * @since New in 1.5.
2428 svn_error_t
*svn_wc_get_status_editor3(const svn_delta_editor_t
**editor
,
2430 void **set_locks_baton
,
2431 svn_revnum_t
*edit_revision
,
2432 svn_wc_adm_access_t
*anchor
,
2435 svn_boolean_t get_all
,
2436 svn_boolean_t no_ignore
,
2437 apr_array_header_t
*ignore_patterns
,
2438 svn_wc_status_func2_t status_func
,
2440 svn_cancel_func_t cancel_func
,
2442 svn_wc_traversal_info_t
*traversal_info
,
2446 * Like svn_wc_get_status_editor3(), but with @a ignore_patterns
2447 * provided from the corresponding value in @a config, and @a recurse
2448 * instead of @a depth. If @a recurse is TRUE, behave as if for @c
2449 * svn_depth_infinity; else if @a recurse is FALSE, behave as if for
2450 * @c svn_depth_immediates.
2452 * @since New in 1.2.
2453 * @deprecated Provided for backward compatibility with the 1.4 API.
2455 svn_error_t
*svn_wc_get_status_editor2(const svn_delta_editor_t
**editor
,
2457 void **set_locks_baton
,
2458 svn_revnum_t
*edit_revision
,
2459 svn_wc_adm_access_t
*anchor
,
2462 svn_boolean_t recurse
,
2463 svn_boolean_t get_all
,
2464 svn_boolean_t no_ignore
,
2465 svn_wc_status_func2_t status_func
,
2467 svn_cancel_func_t cancel_func
,
2469 svn_wc_traversal_info_t
*traversal_info
,
2473 * Same as svn_wc_get_status_editor2(), but with @a set_locks_baton set
2474 * to @c NULL, and taking a deprecated svn_wc_status_func_t argument.
2476 * @deprecated Provided for backward compatibility with the 1.1 API.
2478 svn_error_t
*svn_wc_get_status_editor(const svn_delta_editor_t
**editor
,
2480 svn_revnum_t
*edit_revision
,
2481 svn_wc_adm_access_t
*anchor
,
2484 svn_boolean_t recurse
,
2485 svn_boolean_t get_all
,
2486 svn_boolean_t no_ignore
,
2487 svn_wc_status_func_t status_func
,
2489 svn_cancel_func_t cancel_func
,
2491 svn_wc_traversal_info_t
*traversal_info
,
2496 * Associate @a locks, a hash table mapping <tt>const char*</tt>
2497 * absolute repository paths to <tt>svn_lock_t</tt> objects, with a
2498 * @a set_locks_baton returned by an earlier call to
2499 * svn_wc_get_status_editor3(). @a repos_root is the repository root URL.
2500 * Perform all allocations in @a pool.
2502 * @note @a locks will not be copied, so it must be valid throughout the
2503 * edit. @a pool must also not be destroyed or cleared before the edit is
2506 * @since New in 1.2.
2509 svn_wc_status_set_repos_locks(void *set_locks_baton
,
2511 const char *repos_root
,
2518 * Copy @a src to @a dst_basename in @a dst_parent, and schedule
2519 * @a dst_basename for addition to the repository, remembering the copy
2522 * @a src must be a file or directory under version control; @a dst_parent
2523 * must be a directory under version control in the same working copy;
2524 * @a dst_basename will be the name of the copied item, and it must not
2527 * If @a cancel_func is non-NULL, call it with @a cancel_baton at
2528 * various points during the operation. If it returns an error
2529 * (typically @c SVN_ERR_CANCELLED), return that error immediately.
2531 * For each file or directory copied, @a notify_func will be called
2532 * with its path and the @a notify_baton. @a notify_func may be @c NULL
2533 * if you are not interested in this information.
2536 * This is a variant of svn_wc_add(). No changes will happen
2537 * to the repository until a commit occurs. This scheduling can be
2538 * removed with svn_client_revert2().
2540 * @since New in 1.2.
2542 svn_error_t
*svn_wc_copy2(const char *src
,
2543 svn_wc_adm_access_t
*dst_parent
,
2544 const char *dst_basename
,
2545 svn_cancel_func_t cancel_func
,
2547 svn_wc_notify_func2_t notify_func
,
2552 * Similar to svn_wc_copy2(), but takes an @c svn_wc_notify_func_t instead.
2554 * @deprecated Provided for backward compatibility with the 1.1 API.
2556 svn_error_t
*svn_wc_copy(const char *src
,
2557 svn_wc_adm_access_t
*dst_parent
,
2558 const char *dst_basename
,
2559 svn_cancel_func_t cancel_func
,
2561 svn_wc_notify_func_t notify_func
,
2566 * Schedule @a path for deletion, it will be deleted from the repository on
2567 * the next commit. If @a path refers to a directory, then a recursive
2568 * deletion will occur. @a adm_access must hold a write lock for the parent
2571 * If @a keep_local is FALSE, this function immediately deletes all files,
2572 * modified and unmodified, versioned and unversioned from the working copy.
2573 * It also immediately deletes unversioned directories and directories that
2574 * are scheduled to be added. Only versioned directories will remain in the
2575 * working copy, these get deleted by the update following the commit.
2577 * If @a keep_local is TRUE, all files and directories will be kept in the
2578 * working copy (and will become unversioned on the next commit).
2580 * If @a cancel_func is non-NULL, call it with @a cancel_baton at
2581 * various points during the operation. If it returns an error
2582 * (typically @c SVN_ERR_CANCELLED), return that error immediately.
2584 * For each path marked for deletion, @a notify_func will be called with
2585 * the @a notify_baton and that path. The @a notify_func callback may be
2586 * @c NULL if notification is not needed.
2588 * @since New in 1.5.
2590 svn_error_t
*svn_wc_delete3(const char *path
,
2591 svn_wc_adm_access_t
*adm_access
,
2592 svn_cancel_func_t cancel_func
,
2594 svn_wc_notify_func2_t notify_func
,
2596 svn_boolean_t keep_local
,
2600 * Similar to svn_wc_delete3(), but with @a keep_local always set to FALSE.
2602 * @deprecated Provided for backward compatibility with the 1.4 API.
2604 svn_error_t
*svn_wc_delete2(const char *path
,
2605 svn_wc_adm_access_t
*adm_access
,
2606 svn_cancel_func_t cancel_func
,
2608 svn_wc_notify_func2_t notify_func
,
2613 * Similar to svn_wc_delete2(), but takes an @c svn_wc_notify_func_t instead.
2615 * @deprecated Provided for backward compatibility with the 1.1 API.
2617 svn_error_t
*svn_wc_delete(const char *path
,
2618 svn_wc_adm_access_t
*adm_access
,
2619 svn_cancel_func_t cancel_func
,
2621 svn_wc_notify_func_t notify_func
,
2627 * Put @a path under version control by adding an entry in its parent,
2628 * and, if @a path is a directory, adding an administrative area. The
2629 * new entry and anything under it is scheduled for addition to the
2630 * repository. @a parent_access should hold a write lock for the parent
2631 * directory of @a path. If @a path is a directory then an access baton
2632 * for @a path will be added to the set containing @a parent_access.
2634 * If @a path does not exist, return @c SVN_ERR_WC_PATH_NOT_FOUND.
2636 * If @a copyfrom_url is non-NULL, it and @a copyfrom_rev are used as
2637 * `copyfrom' args. This is for copy operations, where one wants
2638 * to schedule @a path for addition with a particular history.
2640 * If @a cancel_func is non-NULL, call it with @a cancel_baton at
2641 * various points during the operation. If it returns an error
2642 * (typically @c SVN_ERR_CANCELLED), return that error immediately.
2644 * When the @a path has been added, then @a notify_func will be called
2645 * (if it is not @c NULL) with the @a notify_baton and the path.
2647 * Return @c SVN_ERR_WC_NODE_KIND_CHANGE if @a path is both an unversioned
2648 * directory and a file that is scheduled for deletion or in state deleted.
2650 *<pre> ### This function currently does double duty -- it is also
2651 * ### responsible for "switching" a working copy directory over to a
2652 * ### new copyfrom ancestry and scheduling it for addition. Here is
2653 * ### the old doc string from Ben, lightly edited to bring it
2654 * ### up-to-date, explaining the TRUE, secret life of this function:</pre>
2656 * Given a @a path within a working copy of type KIND, follow this algorithm:
2658 * - if @a path is not under version control:
2659 * - Place it under version control and schedule for addition;
2660 * if @a copyfrom_url is non-NULL, use it and @a copyfrom_rev as
2661 * 'copyfrom' history
2663 * - if @a path is already under version control:
2664 * (This can only happen when a directory is copied, in which
2665 * case ancestry must have been supplied as well.)
2667 * - Schedule the directory itself for addition with copyfrom history.
2668 * - Mark all its children with a 'copied' flag
2669 * - Rewrite all the URLs to what they will be after a commit.
2670 * - ### @todo Remove old wcprops too, see the '###' below.
2672 *<pre> ### I think possibly the "switchover" functionality should be
2673 * ### broken out into a separate function, but its all intertwined in
2674 * ### the code right now. Ben, thoughts? Hard? Easy? Mauve?</pre>
2676 * ### Update: see "###" comment in svn_wc_add_repos_file()'s doc
2677 * string about this.
2679 * @since New in 1.2.
2681 svn_error_t
*svn_wc_add2(const char *path
,
2682 svn_wc_adm_access_t
*parent_access
,
2683 const char *copyfrom_url
,
2684 svn_revnum_t copyfrom_rev
,
2685 svn_cancel_func_t cancel_func
,
2687 svn_wc_notify_func2_t notify_func
,
2692 * Similar to svn_wc_add2(), but takes an @c svn_wc_notify_func_t instead.
2694 * @deprecated Provided for backward compatibility with the 1.1 API.
2696 svn_error_t
*svn_wc_add(const char *path
,
2697 svn_wc_adm_access_t
*parent_access
,
2698 const char *copyfrom_url
,
2699 svn_revnum_t copyfrom_rev
,
2700 svn_cancel_func_t cancel_func
,
2702 svn_wc_notify_func_t notify_func
,
2706 /** Add a file to a working copy at @a dst_path, obtaining the text-base's
2707 * contents from @a new_text_base_path, the wc file's content from
2708 * @a new_text_path, its base properties from @a new_base_props and
2709 * wc properties from @a new_props.
2710 * The base text and props normally come from the repository file
2711 * represented by the copyfrom args, see below. The new file will
2712 * be scheduled for addition with history.
2714 * Automatically remove @a new_text_base_path and @a new_text_path
2715 * upon successful completion.
2717 * @a new_text_path and @a new_props may be NULL, in which case
2718 * the working copy text and props are taken from the base files with
2719 * appropriate translation of the file's content.
2721 * @a adm_access, or an access baton in its associated set, must
2722 * contain a write lock for the parent of @a dst_path.
2724 * If @a copyfrom_url is non-NULL, then @a copyfrom_rev must be a
2725 * valid revision number, and together they are the copyfrom history
2728 * Use @a pool for temporary allocations.
2730 * ### This function is very redundant with svn_wc_add(). Ideally,
2731 * we'd merge them, so that svn_wc_add() would just take optional
2732 * new_props and optional copyfrom information. That way it could be
2733 * used for both 'svn add somefilesittingonmydisk' and for adding
2734 * files from repositories, with or without copyfrom history.
2736 * The problem with this Ideal Plan is that svn_wc_add() also takes
2737 * care of recursive URL-rewriting. There's a whole comment in its
2738 * doc string about how that's really weird, outside its core mission,
2739 * etc, etc. So another part of the Ideal Plan is that that
2740 * functionality of svn_wc_add() would move into a separate function.
2744 svn_error_t
*svn_wc_add_repos_file2(const char *dst_path
,
2745 svn_wc_adm_access_t
*adm_access
,
2746 const char *new_text_base_path
,
2747 const char *new_text_path
,
2748 apr_hash_t
*new_base_props
,
2749 apr_hash_t
*new_props
,
2750 const char *copyfrom_url
,
2751 svn_revnum_t copyfrom_rev
,
2754 /** Same as svn_wc_add_repos_file2(), except that it doesn't have the
2755 * new_text_base_path and new_base_props arguments.
2757 * @deprecated Provided for compatibility with the 1.3 API
2761 svn_error_t
*svn_wc_add_repos_file(const char *dst_path
,
2762 svn_wc_adm_access_t
*adm_access
,
2763 const char *new_text_path
,
2764 apr_hash_t
*new_props
,
2765 const char *copyfrom_url
,
2766 svn_revnum_t copyfrom_rev
,
2770 /** Remove entry @a name in @a adm_access from revision control. @a name
2771 * must be either a file or @c SVN_WC_ENTRY_THIS_DIR. @a adm_access must
2772 * hold a write lock.
2774 * If @a name is a file, all its info will be removed from @a adm_access's
2775 * administrative directory. If @a name is @c SVN_WC_ENTRY_THIS_DIR, then
2776 * @a adm_access's entire administrative area will be deleted, along with
2777 * *all* the administrative areas anywhere in the tree below @a adm_access.
2779 * Normally, only administrative data is removed. However, if
2780 * @a destroy_wf is TRUE, then all working file(s) and dirs are deleted
2781 * from disk as well. When called with @a destroy_wf, any locally
2782 * modified files will *not* be deleted, and the special error
2783 * @c SVN_ERR_WC_LEFT_LOCAL_MOD might be returned. (Callers only need to
2784 * check for this special return value if @a destroy_wf is TRUE.)
2786 * If @a instant_error is TRUE, then return @c
2787 * SVN_ERR_WC_LEFT_LOCAL_MOD the instant a locally modified file is
2788 * encountered. Otherwise, leave locally modified files in place and
2789 * return the error only after all the recursion is complete.
2791 * If @a cancel_func is non-NULL, call it with @a cancel_baton at
2792 * various points during the removal. If it returns an error
2793 * (typically @c SVN_ERR_CANCELLED), return that error immediately.
2795 * WARNING: This routine is exported for careful, measured use by
2796 * libsvn_client. Do *not* call this routine unless you really
2797 * understand what the heck you're doing.
2800 svn_wc_remove_from_revision_control(svn_wc_adm_access_t
*adm_access
,
2802 svn_boolean_t destroy_wf
,
2803 svn_boolean_t instant_error
,
2804 svn_cancel_func_t cancel_func
,
2810 * Assuming @a path is under version control and in a state of conflict,
2811 * then take @a path *out* of this state. If @a resolve_text is TRUE then
2812 * any text conflict is resolved, if @a resolve_props is TRUE then any
2813 * property conflicts are resolved.
2815 * If @a depth is @c svn_depth_empty, act only on @a path; if
2816 * @c svn_depth_files, resolve @a path and its conflicted file
2817 * children (if any); if @c svn_depth_immediates, resolve @a path and
2818 * all its immediate conflicted children (both files and directories,
2819 * if any); if @c svn_depth_infinity, resolve @a path and every
2820 * conflicted file or directory anywhere beneath it.
2822 * If @a conflict_choice is svn_wc_conflict_choose_base, resolve the
2823 * conflict with the old file contents; if
2824 * svn_wc_conflict_choose_mine, use the original working contents;
2825 * if svn_wc_conflict_choose_theirs, the new contents; and if
2826 * svn_wc_conflict_choose_merged, don't change the contents at all,
2827 * just remove the conflict status (i.e. pre-1.5 behavior).
2829 * @a adm_access is an access baton, with a write lock, for @a path.
2831 * Needless to say, this function doesn't touch conflict markers or
2832 * anything of that sort -- only a human can semantically resolve a
2833 * conflict. Instead, this function simply marks a file as "having
2834 * been resolved", clearing the way for a commit.
2836 * The implementation details are opaque, as our "conflicted" criteria
2837 * might change over time. (At the moment, this routine removes the
2838 * three fulltext 'backup' files and any .prej file created in a conflict,
2839 * and modifies @a path's entry.)
2841 * If @a path is not under version control, return @c SVN_ERR_ENTRY_NOT_FOUND.
2842 * If @a path isn't in a state of conflict to begin with, do nothing, and
2843 * return @c SVN_NO_ERROR.
2845 * If @c path was successfully taken out of a state of conflict, report this
2846 * information to @c notify_func (if non-@c NULL.) If only text or only
2847 * property conflict resolution was requested, and it was successful, then
2848 * success gets reported.
2850 * @since New in 1.5.
2852 svn_error_t
*svn_wc_resolved_conflict3(const char *path
,
2853 svn_wc_adm_access_t
*adm_access
,
2854 svn_boolean_t resolve_text
,
2855 svn_boolean_t resolve_props
,
2857 svn_wc_conflict_choice_t conflict_choice
,
2858 svn_wc_notify_func2_t notify_func
,
2860 svn_cancel_func_t cancel_func
,
2866 * Similar to svn_wc_resolved_conflict3(), but without automatic conflict
2867 * resolution support, and with @a depth set according to @a recurse:
2868 * if @a recurse is TRUE, @a depth is @c svn_depth_infinity, else it is
2869 * @c svn_depth_files.
2871 * @deprecated Provided for backward compatibility with the 1.4 API.
2873 svn_error_t
*svn_wc_resolved_conflict2(const char *path
,
2874 svn_wc_adm_access_t
*adm_access
,
2875 svn_boolean_t resolve_text
,
2876 svn_boolean_t resolve_props
,
2877 svn_boolean_t recurse
,
2878 svn_wc_notify_func2_t notify_func
,
2880 svn_cancel_func_t cancel_func
,
2885 * Similar to svn_wc_resolved_conflict2(), but takes an
2886 * svn_wc_notify_func_t and doesn't have cancellation support.
2888 * @deprecated Provided for backward compatibility with the 1.0 API.
2890 svn_error_t
*svn_wc_resolved_conflict(const char *path
,
2891 svn_wc_adm_access_t
*adm_access
,
2892 svn_boolean_t resolve_text
,
2893 svn_boolean_t resolve_props
,
2894 svn_boolean_t recurse
,
2895 svn_wc_notify_func_t notify_func
,
2904 * Storage type for queued post-commit data.
2906 * @since New in 1.5.
2908 typedef struct svn_wc_committed_queue_t svn_wc_committed_queue_t
;
2912 * Create a queue for use with svn_wc_queue_committed() and
2913 * svn_wc_process_committed_queue().
2915 * The returned queue and all further
2916 * allocations required for queueing new items will also be done
2919 * @since New in 1.5.
2921 svn_wc_committed_queue_t
*
2922 svn_wc_committed_queue_create(apr_pool_t
*pool
);
2927 * Queue committed items to be processed later by
2928 * svn_wc_process_committed_queue().
2930 * The first time this function is called, @a *queue should
2931 * be @c NULL to signal that initialization is required.
2933 * All pointer data passed to this function
2934 * (@a path, @a adm_access, @a wcprop_changes
2935 * and @a digest) should remain valid until the queue has been
2936 * processed by svn_wc_process_committed_queue().
2938 * The parameters have the same meaning as those
2939 * for svn_wc_process_committed4().
2941 * @since New in 1.5.
2944 svn_wc_queue_committed(svn_wc_committed_queue_t
**queue
,
2946 svn_wc_adm_access_t
*adm_access
,
2947 svn_boolean_t recurse
,
2948 apr_array_header_t
*wcprop_changes
,
2949 svn_boolean_t remove_lock
,
2950 svn_boolean_t remove_changelist
,
2951 const unsigned char *digest
,
2956 * Like svn_wc_process_committed4(), but batch processes
2957 * items queued with svn_wc_queue_committed().
2959 * @since New in 1.5.
2962 svn_wc_process_committed_queue(svn_wc_committed_queue_t
*queue
,
2963 svn_wc_adm_access_t
*adm_access
,
2964 svn_revnum_t new_revnum
,
2965 const char *rev_date
,
2966 const char *rev_author
,
2971 * Bump a successfully committed absolute @a path to @a new_revnum after a
2972 * commit succeeds. @a rev_date and @a rev_author are the (server-side)
2973 * date and author of the new revision; one or both may be @c NULL.
2974 * @a adm_access must hold a write lock appropriate for @a path.
2976 * If non-NULL, @a wcprop_changes is an array of <tt>svn_prop_t *</tt>
2977 * changes to wc properties; if an @c svn_prop_t->value is NULL, then
2978 * that property is deleted.
2980 * If @a remove_lock is @c TRUE, any entryprops related to a repository
2981 * lock will be removed.
2983 * If @a remove_changelist is @c TRUE, any association with a
2984 * changelist will be removed.
2986 * If @a path is a member of a changelist, remove that association.
2988 * If @a path is a file and @a digest is non-NULL, use @a digest as
2989 * the checksum for the new text base. Else, calculate the checksum
2992 * If @a recurse is TRUE and @a path is a directory, then bump every
2993 * versioned object at or under @a path. This is usually done for
2996 * @since New in 1.5.
2998 svn_error_t
*svn_wc_process_committed4(const char *path
,
2999 svn_wc_adm_access_t
*adm_access
,
3000 svn_boolean_t recurse
,
3001 svn_revnum_t new_revnum
,
3002 const char *rev_date
,
3003 const char *rev_author
,
3004 apr_array_header_t
*wcprop_changes
,
3005 svn_boolean_t remove_lock
,
3006 svn_boolean_t remove_changelist
,
3007 const unsigned char *digest
,
3010 /** Similar to svn_wc_process_committed4(), but with @a
3011 * remove_changelist set to FALSE.
3013 * @since New in 1.4.
3015 * @deprecated Provided for backwards compatibility with the 1.4 API.
3017 svn_error_t
*svn_wc_process_committed3(const char *path
,
3018 svn_wc_adm_access_t
*adm_access
,
3019 svn_boolean_t recurse
,
3020 svn_revnum_t new_revnum
,
3021 const char *rev_date
,
3022 const char *rev_author
,
3023 apr_array_header_t
*wcprop_changes
,
3024 svn_boolean_t remove_lock
,
3025 const unsigned char *digest
,
3028 /** Similar to svn_wc_process_committed3(), but with @a digest set to
3031 * @since New in 1.2.
3033 * @deprecated Provided for backwards compatibility with the 1.3 API.
3035 svn_error_t
*svn_wc_process_committed2(const char *path
,
3036 svn_wc_adm_access_t
*adm_access
,
3037 svn_boolean_t recurse
,
3038 svn_revnum_t new_revnum
,
3039 const char *rev_date
,
3040 const char *rev_author
,
3041 apr_array_header_t
*wcprop_changes
,
3042 svn_boolean_t remove_lock
,
3046 * Similar to svn_wc_process_committed2(), but with @a remove_lock set to
3049 * @deprecated Provided for backward compatibility with the 1.1 API.
3051 svn_error_t
*svn_wc_process_committed(const char *path
,
3052 svn_wc_adm_access_t
*adm_access
,
3053 svn_boolean_t recurse
,
3054 svn_revnum_t new_revnum
,
3055 const char *rev_date
,
3056 const char *rev_author
,
3057 apr_array_header_t
*wcprop_changes
,
3065 * Do a depth-first crawl in a working copy, beginning at @a path.
3067 * Communicate the `state' of the working copy's revisions and depths
3068 * to @a reporter/@a report_baton. Obviously, if @a path is a file
3069 * instead of a directory, this depth-first crawl will be a short one.
3071 * No locks are or logs are created, nor are any animals harmed in the
3072 * process. No cleanup is necessary. @a adm_access must be an access
3073 * baton for the @a path hierarchy, it does not require a write lock.
3075 * After all revisions are reported, @a reporter->finish_report() is
3076 * called, which immediately causes the RA layer to update the working
3077 * copy. Thus the return value may very well reflect the result of
3080 * If @a depth is @c svn_depth_empty, then report state only for
3081 * @a path itself. If @c svn_depth_files, do the same and include
3082 * immediate file children of @a path. If @c svn_depth_immediates,
3083 * then behave as if for @c svn_depth_files but also report the
3084 * property states of immediate subdirectories. If @a depth is
3085 * @c svn_depth_infinity, then report state fully recursively. All
3086 * descents are only as deep as @a path's own depth permits, of
3087 * course. If @a depth is @c svn_depth_unknown, then just use
3088 * @c svn_depth_infinity, which in practice means depth of @a path.
3090 * Iff @a depth_compatibility_trick is TRUE, then set the @c start_empty
3091 * flag on @a reporter->set_path() and @a reporter->link_path() calls
3092 * as necessary to trick a pre-1.5 (i.e., depth-unaware) server into
3093 * sending back all the items the client might need to upgrade a
3094 * working copy from a shallower depth to a deeper one.
3096 * If @a restore_files is TRUE, then unexpectedly missing working files
3097 * will be restored from the administrative directory's cache. For each
3098 * file restored, the @a notify_func function will be called with the
3099 * @a notify_baton and the path of the restored file. @a notify_func may
3100 * be @c NULL if this notification is not required. If @a
3101 * use_commit_times is TRUE, then set restored files' timestamps to
3102 * their last-commit-times.
3104 * If @a traversal_info is non-NULL, then record pre-update traversal
3105 * state in it. (Caller should obtain @a traversal_info from
3106 * svn_wc_init_traversal_info().)
3108 * @since New in 1.5.
3111 svn_wc_crawl_revisions3(const char *path
,
3112 svn_wc_adm_access_t
*adm_access
,
3113 const svn_ra_reporter3_t
*reporter
,
3115 svn_boolean_t restore_files
,
3117 svn_boolean_t depth_compatibility_trick
,
3118 svn_boolean_t use_commit_times
,
3119 svn_wc_notify_func2_t notify_func
,
3121 svn_wc_traversal_info_t
*traversal_info
,
3125 * Similar to svn_wc_crawl_revisions3, but taking svn_ra_reporter2_t
3126 * instead of svn_ra_reporter3_t, and therefore only able to report @c
3127 * svn_depth_infinity for depths; and taking @a recurse instead of @a
3128 * depth; and with @a depth_compatibility_trick always false.
3130 * @deprecated Provided for compatibility with the 1.4 API.
3133 svn_wc_crawl_revisions2(const char *path
,
3134 svn_wc_adm_access_t
*adm_access
,
3135 const svn_ra_reporter2_t
*reporter
,
3137 svn_boolean_t restore_files
,
3138 svn_boolean_t recurse
,
3139 svn_boolean_t use_commit_times
,
3140 svn_wc_notify_func2_t notify_func
,
3142 svn_wc_traversal_info_t
*traversal_info
,
3146 * Similar to svn_wc_crawl_revisions2(), but takes an svn_wc_notify_func_t
3147 * and a @c svn_reporter_t instead.
3149 * @deprecated Provided for backward compatibility with the 1.1 API.
3152 svn_wc_crawl_revisions(const char *path
,
3153 svn_wc_adm_access_t
*adm_access
,
3154 const svn_ra_reporter_t
*reporter
,
3156 svn_boolean_t restore_files
,
3157 svn_boolean_t recurse
,
3158 svn_boolean_t use_commit_times
,
3159 svn_wc_notify_func_t notify_func
,
3161 svn_wc_traversal_info_t
*traversal_info
,
3167 /** Set @a *wc_root to @c TRUE if @a path represents a "working copy root",
3168 * @c FALSE otherwise. Use @a pool for any intermediate allocations.
3170 * If @a path is not found, return the error @c SVN_ERR_ENTRY_NOT_FOUND.
3172 * @note Due to the way in which "WC-root-ness" is calculated, passing
3173 * a @a path of `.' to this function will always return @c TRUE.
3175 svn_error_t
*svn_wc_is_wc_root(svn_boolean_t
*wc_root
,
3177 svn_wc_adm_access_t
*adm_access
,
3181 /** Conditionally split @a path into an @a anchor and @a target for the
3182 * purpose of updating and committing.
3184 * @a anchor is the directory at which the update or commit editor
3187 * @a target is the actual subject (relative to the @a anchor) of the
3188 * update/commit, or "" if the @a anchor itself is the subject.
3190 * Allocate @a anchor and @a target in @a pool.
3192 svn_error_t
*svn_wc_get_actual_target(const char *path
,
3193 const char **anchor
,
3194 const char **target
,
3199 /* Update and update-like functionality. */
3202 * Set @a *editor and @a *edit_baton to an editor and baton for updating a
3205 * If @a ti is non-NULL, record traversal info in @a ti, for use by
3206 * post-traversal accessors such as svn_wc_edited_externals().
3208 * @a anchor is an access baton, with a write lock, for the local path to the
3209 * working copy which will be used as the root of our editor. Further
3210 * locks will be acquired if the update creates new directories. All
3211 * locks, both those in @a anchor and newly acquired ones, will be released
3212 * when the editor driver calls @c close_edit.
3214 * @a target is the entry in @a anchor that will actually be updated, or
3215 * empty if all of @a anchor should be updated.
3217 * The editor invokes @a notify_func with @a notify_baton as the update
3218 * progresses, if @a notify_func is non-NULL.
3220 * If @a cancel_func is non-NULL, the editor will invoke @a cancel_func with
3221 * @a cancel_baton as the update progresses to see if it should continue.
3223 * If @a conflict_func is non-NULL, then invoke it with @a
3224 * conflict_baton whenever a conflict is encountered, giving the
3225 * callback a chance to resolve the conflict before the editor takes
3226 * more drastic measures (such as marking a file conflicted, or
3227 * bailing out of the update).
3229 * If @a fetch_func is non-NULL, then use it (with @a fetch_baton) as
3230 * a fallback for retrieving repository files whenever 'copyfrom' args
3231 * are sent into editor->add_file().
3233 * If @a diff3_cmd is non-NULL, then use it as the diff3 command for
3234 * any merging; otherwise, use the built-in merge code.
3236 * @a preserved_exts is an array of filename patterns which, when
3237 * matched against the extensions of versioned files, determine for
3238 * which such files any related generated conflict files will preserve
3239 * the original file's extension as their own. If a file's extension
3240 * does not match any of the patterns in @a preserved_exts (which is
3241 * certainly the case if @a preserved_exts is @c NULL or empty),
3242 * generated conflict files will carry Subversion's custom extensions.
3244 * @a target_revision is a pointer to a revision location which, after
3245 * successful completion of the drive of this editor, will be
3246 * populated with the revision to which the working copy was updated.
3248 * If @a use_commit_times is TRUE, then all edited/added files will
3249 * have their working timestamp set to the last-committed-time. If
3250 * FALSE, the working files will be touched with the 'now' time.
3252 * If @a allow_unver_obstructions is TRUE, then allow unversioned
3253 * obstructions when adding a path.
3255 * If @a depth is @c svn_depth_infinity, update fully recursively.
3256 * Else if it is @c svn_depth_immediates, update the uppermost
3257 * directory, its file entries, and the presence or absence of
3258 * subdirectories (but do not descend into the subdirectories).
3259 * Else if it is @c svn_depth_files, update the uppermost directory
3260 * and its immediate file entries, but not subdirectories.
3261 * Else if it is @c svn_depth_empty, update exactly the uppermost
3262 * target, and don't touch its entries.
3264 * @note @a depth overrides whatever depth is already set in @a anchor
3265 * or @a target. To use those depths, the caller should detect them
3266 * and set @a depth accordingly.
3268 * @since New in 1.5.
3270 svn_error_t
*svn_wc_get_update_editor3(svn_revnum_t
*target_revision
,
3271 svn_wc_adm_access_t
*anchor
,
3273 svn_boolean_t use_commit_times
,
3275 svn_boolean_t allow_unver_obstructions
,
3276 svn_wc_notify_func2_t notify_func
,
3278 svn_cancel_func_t cancel_func
,
3280 svn_wc_conflict_resolver_func_t
3282 void *conflict_baton
,
3283 svn_wc_get_file_t fetch_func
,
3285 const char *diff3_cmd
,
3286 apr_array_header_t
*preserved_exts
,
3287 const svn_delta_editor_t
**editor
,
3289 svn_wc_traversal_info_t
*ti
,
3294 * Similar to svn_wc_get_update_editor3() but with the @a
3295 * allow_unver_obstructions parameter always set to FALSE, @a
3296 * conflict_func and baton set to NULL, @a fetch_func and baton set to
3297 * NULL, @a preserved_exts set to NULL, and @a depth set according to
3298 * @a recurse: if @a recurse is TRUE, pass @c svn_depth_infinity, if
3299 * FALSE, pass @c svn_depth_files.
3301 * @deprecated Provided for backward compatibility with the 1.4 API.
3303 svn_error_t
*svn_wc_get_update_editor2(svn_revnum_t
*target_revision
,
3304 svn_wc_adm_access_t
*anchor
,
3306 svn_boolean_t use_commit_times
,
3307 svn_boolean_t recurse
,
3308 svn_wc_notify_func2_t notify_func
,
3310 svn_cancel_func_t cancel_func
,
3312 const char *diff3_cmd
,
3313 const svn_delta_editor_t
**editor
,
3315 svn_wc_traversal_info_t
*ti
,
3319 * Similar to svn_wc_get_update_editor2(), but takes an svn_wc_notify_func_t
3322 * @deprecated Provided for backward compatibility with the 1.1 API.
3324 svn_error_t
*svn_wc_get_update_editor(svn_revnum_t
*target_revision
,
3325 svn_wc_adm_access_t
*anchor
,
3327 svn_boolean_t use_commit_times
,
3328 svn_boolean_t recurse
,
3329 svn_wc_notify_func_t notify_func
,
3331 svn_cancel_func_t cancel_func
,
3333 const char *diff3_cmd
,
3334 const svn_delta_editor_t
**editor
,
3336 svn_wc_traversal_info_t
*ti
,
3340 * A variant of svn_wc_get_update_editor().
3342 * Set @a *editor and @a *edit_baton to an editor and baton for "switching"
3343 * a working copy to a new @a switch_url. (Right now, this URL must be
3344 * within the same repository that the working copy already comes
3345 * from.) @a switch_url must not be @c NULL.
3347 * If @a ti is non-NULL, record traversal info in @a ti, for use by
3348 * post-traversal accessors such as svn_wc_edited_externals().
3350 * @a anchor is an access baton, with a write lock, for the local path to the
3351 * working copy which will be used as the root of our editor. Further
3352 * locks will be acquired if the switch creates new directories. All
3353 * locks, both those in @a anchor and newly acquired ones, will be released
3354 * when the editor driver calls @c close_edit.
3356 * @a target is the entry in @a anchor that will actually be updated, or
3357 * empty if all of @a anchor should be updated.
3359 * The editor invokes @a notify_func with @a notify_baton as the switch
3360 * progresses, if @a notify_func is non-NULL.
3362 * If @a cancel_func is non-NULL, it will be called with @a cancel_baton as
3363 * the switch progresses to determine if it should continue.
3365 * If @a conflict_func is non-NULL, then invoke it with @a
3366 * conflict_baton whenever a conflict is encountered, giving the
3367 * callback a chance to resolve the conflict before the editor takes
3368 * more drastic measures (such as marking a file conflicted, or
3369 * bailing out of the switch).
3371 * If @a diff3_cmd is non-NULL, then use it as the diff3 command for
3372 * any merging; otherwise, use the built-in merge code.
3374 * @a preserved_exts is an array of filename patterns which, when
3375 * matched against the extensions of versioned files, determine for
3376 * which such files any related generated conflict files will preserve
3377 * the original file's extension as their own. If a file's extension
3378 * does not match any of the patterns in @a preserved_exts (which is
3379 * certainly the case if @a preserved_exts is @c NULL or empty),
3380 * generated conflict files will carry Subversion's custom extensions.
3382 * @a target_revision is a pointer to a revision location which, after
3383 * successful completion of the drive of this editor, will be
3384 * populated with the revision to which the working copy was updated.
3386 * If @a use_commit_times is TRUE, then all edited/added files will
3387 * have their working timestamp set to the last-committed-time. If
3388 * FALSE, the working files will be touched with the 'now' time.
3390 * @a depth behaves as for svn_wc_get_update_editor3().
3392 * If @a allow_unver_obstructions is TRUE, then allow unversioned
3393 * obstructions when adding a path.
3395 * @since New in 1.5.
3397 svn_error_t
*svn_wc_get_switch_editor3(svn_revnum_t
*target_revision
,
3398 svn_wc_adm_access_t
*anchor
,
3400 const char *switch_url
,
3401 svn_boolean_t use_commit_times
,
3403 svn_boolean_t allow_unver_obstructions
,
3404 svn_wc_notify_func2_t notify_func
,
3406 svn_cancel_func_t cancel_func
,
3408 svn_wc_conflict_resolver_func_t conflict_func
,
3409 void *conflict_baton
,
3410 const char *diff3_cmd
,
3411 apr_array_header_t
*preserved_exts
,
3412 const svn_delta_editor_t
**editor
,
3414 svn_wc_traversal_info_t
*ti
,
3418 * Similar to svn_wc_get_switch_editor3() but with the
3419 * @a allow_unver_obstructions parameter always set to FALSE,
3420 * @a preserved_exts set to NULL, @a conflict_func and baton set to NULL,
3421 * and @a depth set according to @a recurse: if @a recurse is TRUE, pass @c
3422 * svn_depth_infinity, if FALSE, pass @c svn_depth_files.
3424 * @deprecated Provided for backward compatibility with the 1.4 API.
3426 svn_error_t
*svn_wc_get_switch_editor2(svn_revnum_t
*target_revision
,
3427 svn_wc_adm_access_t
*anchor
,
3429 const char *switch_url
,
3430 svn_boolean_t use_commit_times
,
3431 svn_boolean_t recurse
,
3432 svn_wc_notify_func2_t notify_func
,
3434 svn_cancel_func_t cancel_func
,
3436 const char *diff3_cmd
,
3437 const svn_delta_editor_t
**editor
,
3439 svn_wc_traversal_info_t
*ti
,
3443 * Similar to svn_wc_get_switch_editor2(), but takes an
3444 * @c svn_wc_notify_func_t instead.
3446 * @deprecated Provided for backward compatibility with the 1.1 API.
3448 svn_error_t
*svn_wc_get_switch_editor(svn_revnum_t
*target_revision
,
3449 svn_wc_adm_access_t
*anchor
,
3451 const char *switch_url
,
3452 svn_boolean_t use_commit_times
,
3453 svn_boolean_t recurse
,
3454 svn_wc_notify_func_t notify_func
,
3456 svn_cancel_func_t cancel_func
,
3458 const char *diff3_cmd
,
3459 const svn_delta_editor_t
**editor
,
3461 svn_wc_traversal_info_t
*ti
,
3466 /* A word about the implementation of working copy property storage:
3468 * Since properties are key/val pairs, you'd think we store them in
3469 * some sort of Berkeley DB-ish format, and even store pending changes
3470 * to them that way too.
3472 * However, we already have libsvn_subr/hashdump.c working, and it
3473 * uses a human-readable format. That will be very handy when we're
3474 * debugging, and presumably we will not be dealing with any huge
3475 * properties or property lists initially. Therefore, we will
3476 * continue to use hashdump as the internal mechanism for storing and
3477 * reading from property lists, but note that the interface here is
3478 * _not_ dependent on that. We can swap in a DB-based implementation
3479 * at any time and users of this library will never know the
3483 /** Set @a *props to a hash table mapping <tt>char *</tt> names onto
3484 * <tt>svn_string_t *</tt> values for all the regular properties of
3485 * @a path. Allocate the table, names, and values in @a pool. If
3486 * the node has no properties, or does not exist in the working copy,
3487 * then an empty hash is returned. @a adm_access is an access baton
3488 * set that contains @a path.
3490 svn_error_t
*svn_wc_prop_list(apr_hash_t
**props
,
3492 svn_wc_adm_access_t
*adm_access
,
3496 /** Set @a *value to the value of property @a name for @a path, allocating
3497 * @a *value in @a pool. If no such prop, set @a *value to @c NULL.
3498 * @a name may be a regular or wc property; if it is an entry property,
3499 * return the error @c SVN_ERR_BAD_PROP_KIND. @a adm_access is an access
3500 * baton set that contains @a path.
3502 svn_error_t
*svn_wc_prop_get(const svn_string_t
**value
,
3505 svn_wc_adm_access_t
*adm_access
,
3509 * Set property @a name to @a value for @a path, or if @a value is
3510 * NULL, remove property @a name from @a path. @a adm_access is an
3511 * access baton with a write lock for @a path.
3513 * If @a skip_checks is TRUE, do no validity checking. But if @a
3514 * skip_checks is FALSE, and @a name is not a valid property for @a
3515 * path, return an error, either @c SVN_ERR_ILLEGAL_TARGET (if the
3516 * property is not appropriate for @a path), or @c
3517 * SVN_ERR_BAD_MIME_TYPE (if @a name is "svn:mime-type", but @a value
3518 * is not a valid mime-type).
3520 * @a name may be a wc property or a regular property; but if it is an
3521 * entry property, return the error @c SVN_ERR_BAD_PROP_KIND, even if
3522 * @a skip_checks is TRUE.
3524 * Use @a pool for temporary allocation.
3526 * @since New in 1.2.
3528 svn_error_t
*svn_wc_prop_set2(const char *name
,
3529 const svn_string_t
*value
,
3531 svn_wc_adm_access_t
*adm_access
,
3532 svn_boolean_t skip_checks
,
3537 * Like svn_wc_prop_set2(), but with @a skip_checks always FALSE.
3539 * @deprecated Provided for backward compatibility with the 1.1 API.
3541 svn_error_t
*svn_wc_prop_set(const char *name
,
3542 const svn_string_t
*value
,
3544 svn_wc_adm_access_t
*adm_access
,
3548 /** Return TRUE iff @a name is a 'normal' property name. 'Normal' is
3549 * defined as a user-visible and user-tweakable property that shows up
3550 * when you fetch a proplist.
3552 * The function currently parses the namespace like so:
3554 * - 'svn:wc:' ==> a wcprop, stored/accessed separately via different API.
3556 * - 'svn:entry:' ==> an "entry" prop, shunted into the 'entries' file.
3558 * If these patterns aren't found, then the property is assumed to be
3561 svn_boolean_t
svn_wc_is_normal_prop(const char *name
);
3565 /** Return TRUE iff @a name is a 'wc' property name. */
3566 svn_boolean_t
svn_wc_is_wc_prop(const char *name
);
3568 /** Return TRUE iff @a name is a 'entry' property name. */
3569 svn_boolean_t
svn_wc_is_entry_prop(const char *name
);
3571 /** Callback type used by @c svn_wc_canonicalize_svn_prop.
3573 * It should set @a mime_type to the value of @a SVN_PROP_MIME_TYPE
3574 * for the path passed to @c svn_wc_canonicalize_svn_prop (allocated
3575 * from @a pool), and then write the contents of the file to @a
3578 * (Currently, this is used if you are attempting to set the @a
3579 * SVN_PROP_EOL_STYLE property, to make sure that the value matches
3580 * the mime type and contents.)
3582 typedef svn_error_t
*(*svn_wc_canonicalize_svn_prop_get_file_t
)
3583 (const svn_string_t
**mime_type
,
3584 svn_stream_t
*stream
,
3589 /** Canonicalize the value of an svn:* property @a propname with
3592 * If the property is not appropriate for a node of kind @a kind, or
3593 * is otherwise invalid, throw an error. Otherwise, set @a *propval_p
3594 * to a canonicalized version of the property value. If @a
3595 * skip_some_checks is TRUE, only some validity checks are taken.
3597 * Some validity checks require access to the contents and MIME type
3598 * of the target if it is a file; they will call @a prop_getter with @a
3599 * getter_baton, which then needs to set the MIME type and print the
3600 * contents of the file to the given stream.
3602 * @a path should be the path of the file in question; it is only used
3603 * for error messages.
3605 * ### This is not actually related to the WC, but it does need to call
3606 * ### svn_wc_parse_externals_description2.
3608 svn_error_t
*svn_wc_canonicalize_svn_prop(const svn_string_t
**propval_p
,
3609 const char *propname
,
3610 const svn_string_t
*propval
,
3612 svn_node_kind_t kind
,
3613 svn_boolean_t skip_some_checks
,
3614 svn_wc_canonicalize_svn_prop_get_file_t prop_getter
,
3624 * Return an @a editor/@a edit_baton for diffing a working copy against the
3627 * @a anchor/@a target represent the base of the hierarchy to be compared.
3629 * @a callbacks/@a callback_baton is the callback table to use when two
3630 * files are to be compared.
3632 * If @a depth is @c svn_depth_empty, just diff exactly @a target or
3633 * @a anchor if @a target is empty. If @c svn_depth_files then do the same
3634 * and for top-level file entries as well (if any). If
3635 * @c svn_depth_immediates, do the same as @c svn_depth_files but also diff
3636 * top-level subdirectories at @c svn_depth_empty. If @c svn_depth_infinity,
3637 * then diff fully recursively. In the latter case, @a anchor should be part
3638 * of an access baton set for the @a target hierarchy.
3640 * @a ignore_ancestry determines whether paths that have discontinuous node
3641 * ancestry are treated as delete/add or as simple modifications. If
3642 * @a ignore_ancestry is @c FALSE, then any discontinuous node ancestry will
3643 * result in the diff given as a full delete followed by an add.
3645 * If @a use_text_base is TRUE, then compare the repository against
3646 * the working copy's text-base files, rather than the working files.
3648 * Normally, the difference from repository->working_copy is shown.
3649 * If @a reverse_order is TRUE, then show working_copy->repository diffs.
3651 * If @a cancel_func is non-NULL, it will be used along with @a cancel_baton
3652 * to periodically check if the client has canceled the operation.
3654 * @since New in 1.5.
3656 svn_error_t
*svn_wc_get_diff_editor4(svn_wc_adm_access_t
*anchor
,
3658 const svn_wc_diff_callbacks2_t
*callbacks
,
3659 void *callback_baton
,
3661 svn_boolean_t ignore_ancestry
,
3662 svn_boolean_t use_text_base
,
3663 svn_boolean_t reverse_order
,
3664 svn_cancel_func_t cancel_func
,
3666 const svn_delta_editor_t
**editor
,
3670 * Similar to svn_wc_get_diff_editor4(), but with @a depth set to
3671 * @c svn_depth_infinity if @a recurse is TRUE, or @a svn_depth_files
3672 * if @a recurse is FALSE.
3674 * @deprecated Provided for backward compatibility with the 1.4 API.
3676 * @since New in 1.2.
3678 svn_error_t
*svn_wc_get_diff_editor3(svn_wc_adm_access_t
*anchor
,
3680 const svn_wc_diff_callbacks2_t
*callbacks
,
3681 void *callback_baton
,
3682 svn_boolean_t recurse
,
3683 svn_boolean_t ignore_ancestry
,
3684 svn_boolean_t use_text_base
,
3685 svn_boolean_t reverse_order
,
3686 svn_cancel_func_t cancel_func
,
3688 const svn_delta_editor_t
**editor
,
3694 * Similar to svn_wc_get_diff_editor3(), but with an
3695 * @c svn_wc_diff_callbacks_t instead of @c svn_wc_diff_callbacks2_t.
3697 * @deprecated Provided for backward compatibility with the 1.1 API.
3699 svn_error_t
*svn_wc_get_diff_editor2(svn_wc_adm_access_t
*anchor
,
3701 const svn_wc_diff_callbacks_t
*callbacks
,
3702 void *callback_baton
,
3703 svn_boolean_t recurse
,
3704 svn_boolean_t ignore_ancestry
,
3705 svn_boolean_t use_text_base
,
3706 svn_boolean_t reverse_order
,
3707 svn_cancel_func_t cancel_func
,
3709 const svn_delta_editor_t
**editor
,
3715 * Similar to svn_wc_get_diff_editor2(), but with @a ignore_ancestry
3716 * always set to @c FALSE.
3718 * @deprecated Provided for backward compatibility with the 1.0 API.
3720 svn_error_t
*svn_wc_get_diff_editor(svn_wc_adm_access_t
*anchor
,
3722 const svn_wc_diff_callbacks_t
*callbacks
,
3723 void *callback_baton
,
3724 svn_boolean_t recurse
,
3725 svn_boolean_t use_text_base
,
3726 svn_boolean_t reverse_order
,
3727 svn_cancel_func_t cancel_func
,
3729 const svn_delta_editor_t
**editor
,
3735 * Compare working copy against the text-base.
3737 * @a anchor/@a target represent the base of the hierarchy to be compared.
3739 * @a callbacks/@a callback_baton is the callback table to use when two
3740 * files are to be compared.
3742 * If @a depth is @c svn_depth_empty, just diff exactly @a target or
3743 * @a anchor if @a target is empty. If @c svn_depth_files then do the same
3744 * and for top-level file entries as well (if any). If
3745 * @c svn_depth_immediates, do the same as @c svn_depth_files but also diff
3746 * top-level subdirectories at @c svn_depth_empty. If @c svn_depth_infinity,
3747 * then diff fully recursively. In the latter case, @a anchor should be part
3748 * of an access baton set for the @a target hierarchy.
3750 * @a ignore_ancestry determines whether paths that have discontinuous node
3751 * ancestry are treated as delete/add or as simple modifications. If
3752 * @a ignore_ancestry is @c FALSE, then any discontinuous node ancestry will
3753 * result in the diff given as a full delete followed by an add.
3755 * @since New in 1.5.
3757 svn_error_t
*svn_wc_diff4(svn_wc_adm_access_t
*anchor
,
3759 const svn_wc_diff_callbacks2_t
*callbacks
,
3760 void *callback_baton
,
3762 svn_boolean_t ignore_ancestry
,
3767 * Similar to svn_wc_diff4(), but with @a depth set to
3768 * @c svn_depth_infinity if @a recurse is TRUE, or @a svn_depth_files
3769 * if @a recurse is FALSE.
3771 * @deprecated Provided for backward compatibility with the 1.2 API.
3773 svn_error_t
*svn_wc_diff3(svn_wc_adm_access_t
*anchor
,
3775 const svn_wc_diff_callbacks2_t
*callbacks
,
3776 void *callback_baton
,
3777 svn_boolean_t recurse
,
3778 svn_boolean_t ignore_ancestry
,
3782 * Similar to svn_wc_diff3(), but with a @c svn_wc_diff_callbacks_t argument
3783 * instead of @c svn_wc_diff_callbacks2_t.
3785 * @deprecated Provided for backward compatibility with the 1.1 API.
3787 svn_error_t
*svn_wc_diff2(svn_wc_adm_access_t
*anchor
,
3789 const svn_wc_diff_callbacks_t
*callbacks
,
3790 void *callback_baton
,
3791 svn_boolean_t recurse
,
3792 svn_boolean_t ignore_ancestry
,
3796 * Similar to svn_wc_diff2(), but with @a ignore_ancestry always set
3799 * @deprecated Provided for backward compatibility with the 1.0 API.
3801 svn_error_t
*svn_wc_diff(svn_wc_adm_access_t
*anchor
,
3803 const svn_wc_diff_callbacks_t
*callbacks
,
3804 void *callback_baton
,
3805 svn_boolean_t recurse
,
3809 /** Given a @a path to a file or directory under version control, discover
3810 * any local changes made to properties and/or the set of 'pristine'
3811 * properties. @a adm_access is an access baton set for @a path.
3813 * If @a propchanges is non-@c NULL, return these changes as an array of
3814 * @c svn_prop_t structures stored in @a *propchanges. The structures and
3815 * array will be allocated in @a pool. If there are no local property
3816 * modifications on @a path, then set @a *propchanges to @c NULL.
3818 * If @a original_props is non-@c NULL, then set @a *original_props to
3819 * hashtable (<tt>const char *name</tt> -> <tt>const svn_string_t *value</tt>)
3820 * that represents the 'pristine' property list of @a path. This hashtable is
3821 * allocated in @a pool, and can be used to compare old and new values of
3824 svn_error_t
*svn_wc_get_prop_diffs(apr_array_header_t
**propchanges
,
3825 apr_hash_t
**original_props
,
3827 svn_wc_adm_access_t
*adm_access
,
3831 /** The outcome of a merge carried out (or tried as a dry-run) by
3834 typedef enum svn_wc_merge_outcome_t
3836 /** The working copy is (or would be) unchanged. The changes to be
3837 * merged were already present in the working copy
3839 svn_wc_merge_unchanged
,
3841 /** The working copy has been (or would be) changed. */
3842 svn_wc_merge_merged
,
3844 /** The working copy has been (or would be) changed, but there was (or
3845 * would be) a conflict
3847 svn_wc_merge_conflict
,
3849 /** No merge was performed, probably because the target file was
3850 * either absent or not under version control.
3852 svn_wc_merge_no_merge
3854 } svn_wc_merge_outcome_t
;
3856 /** Given paths to three fulltexts, merge the differences between @a left
3857 * and @a right into @a merge_target. (It may help to know that @a left,
3858 * @a right, and @a merge_target correspond to "OLDER", "YOURS", and "MINE",
3859 * respectively, in the diff3 documentation.) Use @a pool for any
3860 * temporary allocation.
3862 * @a adm_access is an access baton with a write lock for the directory
3863 * containing @a merge_target.
3865 * This function assumes that @a left and @a right are in repository-normal
3866 * form (linefeeds, with keywords contracted); if necessary,
3867 * @a merge_target is temporarily converted to this form to receive the
3868 * changes, then translated back again.
3870 * If @a merge_target is absent, or present but not under version
3871 * control, then set @a *merge_outcome to @c svn_wc_merge_no_merge and
3872 * return success without merging anything. (The reasoning is that if
3873 * the file is not versioned, then it is probably unrelated to the
3874 * changes being considered, so they should not be merged into it.)
3876 * @a dry_run determines whether the working copy is modified. When it
3877 * is @c FALSE the merge will cause @a merge_target to be modified, when it
3878 * is @c TRUE the merge will be carried out to determine the result but
3879 * @a merge_target will not be modified.
3881 * If @a diff3_cmd is non-NULL, then use it as the diff3 command for
3882 * any merging; otherwise, use the built-in merge code. If @a
3883 * merge_options is non-NULL, either pass its elements to @a diff3_cmd or
3884 * parse it and use as options to the internal merge code (@see
3885 * svn_diff_file_options_parse()). @a merge_options must contain
3886 * <tt>const char *</tt> elements.
3888 * The outcome of the merge is returned in @a *merge_outcome. If there
3889 * is a conflict and @a dry_run is @c FALSE, then attempt to call @a
3890 * conflict_func with @a conflict_baton (if non-NULL). If the
3891 * conflict callback cannot resolve the conflict, then:
3893 * * Put conflict markers around the conflicting regions in
3894 * @a merge_target, labeled with @a left_label, @a right_label, and
3895 * @a target_label. (If any of these labels are @c NULL, default
3896 * values will be used.)
3898 * * Copy @a left, @a right, and the original @a merge_target to unique
3899 * names in the same directory as @a merge_target, ending with the
3900 * suffixes ".LEFT_LABEL", ".RIGHT_LABEL", and ".TARGET_LABEL"
3903 * * Mark the entry for @a merge_target as "conflicted", and track the
3904 * above mentioned backup files in the entry as well.
3908 * If @a merge_target is a binary file, then no merging is attempted,
3909 * the merge is deemed to be a conflict. If @a dry_run is @c FALSE the
3910 * working @a merge_target is untouched, and copies of @a left and
3911 * @a right are created next to it using @a left_label and @a right_label.
3912 * @a merge_target's entry is marked as "conflicted", and begins
3913 * tracking the two backup files. If @a dry_run is @c TRUE no files are
3914 * changed. The outcome of the merge is returned in @a *merge_outcome.
3916 * @since New in 1.5.
3918 svn_error_t
*svn_wc_merge3(enum svn_wc_merge_outcome_t
*merge_outcome
,
3921 const char *merge_target
,
3922 svn_wc_adm_access_t
*adm_access
,
3923 const char *left_label
,
3924 const char *right_label
,
3925 const char *target_label
,
3926 svn_boolean_t dry_run
,
3927 const char *diff3_cmd
,
3928 const apr_array_header_t
*merge_options
,
3929 const apr_array_header_t
*prop_diff
,
3930 svn_wc_conflict_resolver_func_t conflict_func
,
3931 void *conflict_baton
,
3934 /** Similar to svn_wc_merge3(), but with @a prop_diff, @a
3935 * conflict_func, @a conflict_baton set to NULL.
3937 * @deprecated Provided for backwards compatibility with the 1.4 API.
3939 svn_error_t
*svn_wc_merge2(enum svn_wc_merge_outcome_t
*merge_outcome
,
3942 const char *merge_target
,
3943 svn_wc_adm_access_t
*adm_access
,
3944 const char *left_label
,
3945 const char *right_label
,
3946 const char *target_label
,
3947 svn_boolean_t dry_run
,
3948 const char *diff3_cmd
,
3949 const apr_array_header_t
*merge_options
,
3953 /** Similar to svn_wc_merge2(), but with @a merge_options set to NULL.
3955 * @deprecated Provided for backwards compatibility with the 1.3 API.
3957 svn_error_t
*svn_wc_merge(const char *left
,
3959 const char *merge_target
,
3960 svn_wc_adm_access_t
*adm_access
,
3961 const char *left_label
,
3962 const char *right_label
,
3963 const char *target_label
,
3964 svn_boolean_t dry_run
,
3965 enum svn_wc_merge_outcome_t
*merge_outcome
,
3966 const char *diff3_cmd
,
3970 /** Given a @a path under version control, merge an array of @a
3971 * propchanges into the path's existing properties. @a propchanges is
3972 * an array of @c svn_prop_t objects, and @a baseprops is a hash
3973 * representing the original set of properties that @a propchanges is
3974 * working against. @a adm_access is an access baton for the directory
3975 * containing @a path.
3977 * If @a base_merge is @c FALSE only the working properties will be changed,
3978 * if it is @c TRUE both the base and working properties will be changed.
3980 * If @a state is non-NULL, set @a *state to the state of the properties
3983 * If conflicts are found when merging working properties, they are
3984 * described in a temporary .prej file (or appended to an already-existing
3985 * .prej file), and the entry is marked "conflicted". Base properties
3986 * are changed unconditionally, if @a base_merge is @c TRUE, they never result
3989 * If @a path is not under version control, return the error
3990 * SVN_ERR_UNVERSIONED_RESOURCE and don't touch anyone's properties.
3992 * @since New in 1.5.
3995 svn_wc_merge_props2(svn_wc_notify_state_t
*state
,
3997 svn_wc_adm_access_t
*adm_access
,
3998 apr_hash_t
*baseprops
,
3999 const apr_array_header_t
*propchanges
,
4000 svn_boolean_t base_merge
,
4001 svn_boolean_t dry_run
,
4002 svn_wc_conflict_resolver_func_t conflict_func
,
4003 void *conflict_baton
,
4008 * Same as svn_wc_merge_props2(), but with a @a conflict_func (and
4011 * @deprecated Provided for backward compatibility with the 1.3 API.
4015 svn_wc_merge_props(svn_wc_notify_state_t
*state
,
4017 svn_wc_adm_access_t
*adm_access
,
4018 apr_hash_t
*baseprops
,
4019 const apr_array_header_t
*propchanges
,
4020 svn_boolean_t base_merge
,
4021 svn_boolean_t dry_run
,
4026 * Similar to svn_wc_merge_props(), but no baseprops are given.
4027 * Instead, it's assumed that the incoming propchanges are based
4028 * against the working copy's own baseprops. While this assumption is
4029 * correct for 'svn update', it's incorrect for 'svn merge', and can
4030 * cause flawed behavior. (See issue #2035.)
4032 * @deprecated Provided for backward compatibility with the 1.2 API.
4035 svn_wc_merge_prop_diffs(svn_wc_notify_state_t
*state
,
4037 svn_wc_adm_access_t
*adm_access
,
4038 const apr_array_header_t
*propchanges
,
4039 svn_boolean_t base_merge
,
4040 svn_boolean_t dry_run
,
4045 /** Given a @a path to a wc file, return a @a pristine_path which points to a
4046 * pristine version of the file. This is needed so clients can do
4047 * diffs. If the WC has no text-base, return a @c NULL instead of a
4050 svn_error_t
*svn_wc_get_pristine_copy_path(const char *path
,
4051 const char **pristine_path
,
4056 * Recurse from @a path, cleaning up unfinished log business. Perform
4057 * necessary allocations in @a pool. Any working copy locks under @a path
4058 * will be taken over and then cleared by this function. If @a diff3_cmd
4059 * is non-NULL, then use it as the diff3 command for any merging; otherwise,
4060 * use the built-in merge code.
4062 * WARNING: there is no mechanism that will protect locks that are still
4065 * If @a cancel_func is non-NULL, invoke it with @a cancel_baton at
4066 * various points during the operation. If it returns an error
4067 * (typically @c SVN_ERR_CANCELLED), return that error immediately.
4069 * @since New in 1.2.
4072 svn_wc_cleanup2(const char *path
,
4073 const char *diff3_cmd
,
4074 svn_cancel_func_t cancel_func
,
4079 * Similar to svn_wc_cleanup2(). @a optional_adm_access is an historic
4080 * relic and not used, it may be NULL.
4082 * @deprecated Provided for backward compatibility with the 1.1 API.
4085 svn_wc_cleanup(const char *path
,
4086 svn_wc_adm_access_t
*optional_adm_access
,
4087 const char *diff3_cmd
,
4088 svn_cancel_func_t cancel_func
,
4093 /** Relocation validation callback typedef.
4095 * Called for each relocated file/directory. @a uuid, if non-NULL, contains
4096 * the expected repository UUID, @a url contains the tentative URL.
4098 * @a baton is a closure object; it should be provided by the
4099 * implementation, and passed by the caller.
4101 * If @a root is TRUE, then the implementation should make sure that @a url
4102 * is the repository root. Else, it can be an URL inside the repository.
4103 * @a pool may be used for temporary allocations.
4105 * @since New in 1.5.
4107 typedef svn_error_t
*(*svn_wc_relocation_validator3_t
)(void *baton
,
4110 const char *root_url
,
4113 /** Similar to @c svn_wc_relocation_validator3_t, but without
4114 * the @a root_url arguments.
4116 * @deprecated Provided for backwards compatibility with the 1.4 API.
4118 typedef svn_error_t
*(*svn_wc_relocation_validator2_t
)(void *baton
,
4124 /** Similar to @c svn_wc_relocation_validator2_t, but without
4125 * the @a root and @a pool arguments. @a uuid will not be NULL in this version
4128 * @deprecated Provided for backwards compatibility with the 1.3 API.
4130 typedef svn_error_t
*(*svn_wc_relocation_validator_t
)(void *baton
,
4134 /** Change repository references at @a path that begin with @a from
4135 * to begin with @a to instead. Perform necessary allocations in @a pool.
4136 * If @a recurse is TRUE, do so. @a validator (and its baton,
4137 * @a validator_baton), will be called for each newly generated URL.
4139 * @a adm_access is an access baton for the directory containing
4142 * @since New in 1.5.
4145 svn_wc_relocate3(const char *path
,
4146 svn_wc_adm_access_t
*adm_access
,
4149 svn_boolean_t recurse
,
4150 svn_wc_relocation_validator3_t validator
,
4151 void *validator_baton
,
4154 /** Similar to svn_wc_relocate3(), but uses @c svn_wc_relocation_validator2_t.
4156 * @deprecated Provided for backwards compatibility with the 1.4 API. */
4158 svn_wc_relocate2(const char *path
,
4159 svn_wc_adm_access_t
*adm_access
,
4162 svn_boolean_t recurse
,
4163 svn_wc_relocation_validator2_t validator
,
4164 void *validator_baton
,
4167 /** Similar to svn_wc_relocate2(), but uses @c svn_wc_relocation_validator_t.
4169 * @deprecated Provided for backwards compatibility with the 1.3 API. */
4171 svn_wc_relocate(const char *path
,
4172 svn_wc_adm_access_t
*adm_access
,
4175 svn_boolean_t recurse
,
4176 svn_wc_relocation_validator_t validator
,
4177 void *validator_baton
,
4182 * Revert changes to @a path. Perform necessary allocations in @a pool.
4184 * @a parent_access is an access baton for the directory containing @a path,
4185 * unless @a path is a wc root, in which case @a parent_access refers to
4188 * If @a depth is @c svn_depth_empty, revert just @a path (if a
4189 * directory, then revert just the properties on that directory).
4190 * Else if @c svn_depth_files, revert @a path and any files
4191 * directly under @a path if it is directory. Else if
4192 * @c svn_depth_immediates, revert all of the preceding plus
4193 * properties on immediate subdirectories; else if @c svn_depth_infinity,
4194 * revert path and everything under it fully recursively.
4196 * If @a cancel_func is non-NULL, call it with @a cancel_baton at
4197 * various points during the reversion process. If it returns an
4198 * error (typically @c SVN_ERR_CANCELLED), return that error
4201 * If @a use_commit_times is TRUE, then all reverted working-files
4202 * will have their timestamp set to the last-committed-time. If
4203 * FALSE, the reverted working-files will be touched with the 'now' time.
4205 * For each item reverted, @a notify_func will be called with @a notify_baton
4206 * and the path of the reverted item. @a notify_func may be @c NULL if this
4207 * notification is not needed.
4209 * If @a path is not under version control, return the error
4210 * SVN_ERR_UNVERSIONED_RESOURCE.
4212 * @since New in 1.5.
4215 svn_wc_revert3(const char *path
,
4216 svn_wc_adm_access_t
*parent_access
,
4218 svn_boolean_t use_commit_times
,
4219 svn_cancel_func_t cancel_func
,
4221 svn_wc_notify_func2_t notify_func
,
4226 * Similar to svn_wc_revert3(), but with @a depth set according to
4227 * @a recursive: if @a recursive is TRUE, @a depth is
4228 * @c svn_depth_infinity; if FALSE, @a depth is @c svn_depth_empty.
4230 * @note Most APIs map @a recurse==FALSE to @a depth==svn_depth_files;
4231 * revert is deliberately different.
4233 * @deprecated Provided for backward compatibility with the 1.2 API.
4236 svn_wc_revert2(const char *path
,
4237 svn_wc_adm_access_t
*parent_access
,
4238 svn_boolean_t recursive
,
4239 svn_boolean_t use_commit_times
,
4240 svn_cancel_func_t cancel_func
,
4242 svn_wc_notify_func2_t notify_func
,
4247 * Similar to svn_wc_revert2(), but takes an @c svn_wc_notify_func_t instead.
4249 * @deprecated Provided for backward compatibility with the 1.1 API.
4252 svn_wc_revert(const char *path
,
4253 svn_wc_adm_access_t
*parent_access
,
4254 svn_boolean_t recursive
,
4255 svn_boolean_t use_commit_times
,
4256 svn_cancel_func_t cancel_func
,
4258 svn_wc_notify_func_t notify_func
,
4265 /** Create a unique temporary file in administrative tmp/ area of
4266 * directory @a path. Return a handle in @a *fp and the path
4267 * in @a *new_name. Either @a fp or @a new_name can be NULL.
4269 * The flags will be <tt>APR_WRITE | APR_CREATE | APR_EXCL</tt> and
4270 * optionally @c APR_DELONCLOSE (if the @a delete_when argument is
4271 * set to @c svn_io_file_del_on_close).
4273 * This means that as soon as @a fp is closed, the tmp file will vanish.
4278 svn_wc_create_tmp_file2(apr_file_t
**fp
,
4279 const char **new_name
,
4281 svn_io_file_del_t delete_when
,
4285 /** Same as svn_wc_create_tmp_file2(), but with @a new_name set to @c NULL,
4286 * and without the ability to delete the file on pool cleanup.
4288 * @deprecated For compatibility with 1.3 API
4291 svn_wc_create_tmp_file(apr_file_t
**fp
,
4293 svn_boolean_t delete_on_close
,
4298 /* EOL conversion and keyword expansion. */
4300 /** Set @a xlated_path to a translated copy of @a src
4301 * or to @a src itself if no translation is necessary.
4302 * That is, if @a versioned_file's properties indicate newline conversion or
4303 * keyword expansion, point @a *xlated_path to a copy of @a src
4304 * whose newlines and keywords are converted using the translation
4305 * as requested by @a flags.
4307 * When translating to the normal form, inconsistent eol styles will be
4308 * repaired when appropriate for the given setting. When translating
4309 * from normal form, no EOL repair is performed (consistency is assumed).
4310 * This behaviour can be overridden by specifying
4311 * @c SVN_WC_TRANSLATE_FORCE_EOL_REPAIR.
4313 * The caller can explicitly request a new file to be returned by setting the
4314 * @c SVN_WC_TRANSLATE_FORCE_COPY flag in @a flags.
4316 * This function is generally used to get a file that can be compared
4317 * meaningfully against @a versioned_file's text base, if
4318 * @c SVN_WC_TRANSLATE_TO_NF is specified, against @a versioned_file itself
4319 * if @c SVN_WC_TRANSLATE_FROM_NF is specified.
4321 * Output files are created in the temp file area belonging to
4322 * @a versioned_file. By default they will be deleted at pool cleanup.
4324 * If @c SVN_WC_TRANSLATE_NO_OUTPUT_CLEANUP is specified, the default
4325 * pool cleanup handler to remove @a *xlated_path is not registered.
4327 * If an error is returned, the effect on @a *xlated_path is undefined.
4332 svn_wc_translated_file2(const char **xlated_path
,
4334 const char *versioned_file
,
4335 svn_wc_adm_access_t
*adm_access
,
4340 /** Same as svn_wc_translated_file2, but will never clean up
4343 * @deprecated Provided for compatibility with the 1.3 API
4345 svn_error_t
*svn_wc_translated_file(const char **xlated_p
,
4347 svn_wc_adm_access_t
*adm_access
,
4348 svn_boolean_t force_repair
,
4352 /** Returns a @a stream allocated in @a pool with access to the given
4353 * @a path taking the file properties from @a versioned_file using
4356 * When translation from normal form is requested
4357 * (@c SVN_WC_TRANSLATE_FROM_NF is specified in @a flags), @a path
4358 * is used as target path and stream read operations are not supported.
4359 * Conversely, if translation to normal form is requested
4360 * (@c SVN_WC_TRANSLATE_TO_NF is specified in @a flags), @a path is
4361 * used as source path and stream write operations are not supported.
4363 * The @a flags are the same constants as those used for
4364 * svn_wc_translated_file().
4366 * @since New in 1.5.
4369 svn_wc_translated_stream(svn_stream_t
**stream
,
4371 const char *versioned_file
,
4372 svn_wc_adm_access_t
*adm_access
,
4377 /* Text/Prop Deltas Using an Editor */
4380 /** Send the local modifications for versioned file @a path (with
4381 * matching @a file_baton) through @a editor, then close @a file_baton
4382 * afterwards. Use @a pool for any temporary allocation and
4383 * @a adm_access as an access baton for @a path.
4385 * This process creates a copy of @a path with keywords and eol
4386 * untranslated. If @a tempfile is non-NULL, set @a *tempfile to the
4387 * path to this copy. Do not clean up the copy; caller can do that.
4388 * If @a digest is non-NULL, put the MD5 checksum of the
4389 * temporary file into @a digest, which must point to @c APR_MD5_DIGESTSIZE
4390 * bytes of storage. (The purpose of handing back the tmp copy is that
4391 * it is usually about to become the new text base anyway, but the
4392 * installation of the new text base is outside the scope of this
4395 * If @a fulltext, send the untranslated copy of @a path through @a editor
4396 * as full-text; else send it as svndiff against the current text base.
4398 * If sending a diff, and the recorded checksum for @a path's text-base
4399 * does not match the current actual checksum, then remove the tmp
4400 * copy (and set @a *tempfile to NULL if appropriate), and return the
4401 * error @c SVN_ERR_WC_CORRUPT_TEXT_BASE.
4403 * @note This is intended for use with both infix and postfix
4404 * text-delta styled editor drivers.
4406 * @since New in 1.4.
4408 svn_error_t
*svn_wc_transmit_text_deltas2(const char **tempfile
,
4409 unsigned char digest
[],
4411 svn_wc_adm_access_t
*adm_access
,
4412 svn_boolean_t fulltext
,
4413 const svn_delta_editor_t
*editor
,
4417 /** Similar to svn_wc_transmit_text_deltas2(), but with @a digest set to NULL.
4419 * @deprecated Provided for backwards compatibility with the 1.3 API.
4421 svn_error_t
*svn_wc_transmit_text_deltas(const char *path
,
4422 svn_wc_adm_access_t
*adm_access
,
4423 svn_boolean_t fulltext
,
4424 const svn_delta_editor_t
*editor
,
4426 const char **tempfile
,
4430 /** Given a @a path with its accompanying @a entry, transmit all local
4431 * property modifications using the appropriate @a editor method (in
4432 * conjunction with @a baton). @a adm_access is an access baton set
4433 * that contains @a path. Use @a pool for all allocations.
4435 * If a temporary file remains after this function is finished, the
4436 * path to that file is returned in @a *tempfile (so the caller can
4437 * clean this up if it wishes to do so).
4439 * @note Starting version 1.5, no tempfile will ever be returned
4440 * anymore. If @a *tempfile is passed, its value is set to @c NULL.
4442 svn_error_t
*svn_wc_transmit_prop_deltas(const char *path
,
4443 svn_wc_adm_access_t
*adm_access
,
4444 const svn_wc_entry_t
*entry
,
4445 const svn_delta_editor_t
*editor
,
4447 const char **tempfile
,
4451 /** Get the run-time configured list of ignore patterns from the
4452 * @c svn_config_t's in the @a config hash, and store them in @a *patterns.
4453 * Allocate @a *patterns and its contents in @a pool.
4455 svn_error_t
*svn_wc_get_default_ignores(apr_array_header_t
**patterns
,
4459 /** Get the list of ignore patterns from the @c svn_config_t's in the
4460 * @a config hash and the local ignore patterns from the directory
4461 * in @a adm_access, and store them in @a *patterns.
4462 * Allocate @a *patterns and its contents in @a pool.
4464 * @since New in 1.3.
4466 svn_error_t
*svn_wc_get_ignores(apr_array_header_t
**patterns
,
4468 svn_wc_adm_access_t
*adm_access
,
4471 /** Return TRUE iff @a str matches any of the elements of @a list, a
4472 * list of zero or more ignore patterns.
4474 * @since New in 1.5.
4477 svn_wc_match_ignore_list(const char *str
, apr_array_header_t
*list
,
4481 /** Add @a lock to the working copy for @a path. @a adm_access must contain
4482 * a write lock for @a path. If @a path is read-only, due to locking
4483 * properties, make it writable. Perform temporary allocations in @a
4485 svn_error_t
*svn_wc_add_lock(const char *path
, const svn_lock_t
*lock
,
4486 svn_wc_adm_access_t
*adm_access
,
4489 /** Remove any lock from @a path. @a adm_access must contain a
4490 * write-lock for @a path. If @a path has a lock and the locking
4491 * so specifies, make the file read-only. Don't return an error if @a
4492 * path didn't have a lock. Perform temporary allocations in @a pool. */
4493 svn_error_t
*svn_wc_remove_lock(const char *path
,
4494 svn_wc_adm_access_t
*adm_access
,
4498 /** A structure to report a summary of a working copy, including the
4499 * mix of revisions found within it, whether any parts are switched or
4500 * locally modified, and whether it is a sparse checkout.
4502 * @note Fields may be added to the end of this structure in future
4503 * versions. Therefore, to preserve binary compatibility, users
4504 * should not directly allocate structures of this type.
4508 typedef struct svn_wc_revision_status_t
4510 svn_revnum_t min_rev
; /**< Lowest revision found */
4511 svn_revnum_t max_rev
; /**< Highest revision found */
4513 svn_boolean_t switched
; /**< Is anything switched? */
4514 svn_boolean_t modified
; /**< Is anything modified? */
4516 /** Whether any WC paths are at a depth other than @c svn_depth_infinity.
4517 * @since New in 1.5.
4519 svn_boolean_t sparse_checkout
;
4521 svn_wc_revision_status_t
;
4523 /** Set @a *result_p to point to a new @c svn_wc_revision_status_t structure
4524 * containing a summary of the revision range and status of the working copy
4525 * at @a wc_path (not including "externals").
4527 * Set @a (*result_p)->min_rev and @a (*result_p)->max_rev respectively to the
4528 * lowest and highest revision numbers in the working copy. If @a committed
4529 * is TRUE, summarize the last-changed revisions, else the base revisions.
4531 * Set @a (*result_p)->switched to indicate whether any item in the WC is
4532 * switched relative to its parent. If @a trail_url is non-NULL, use it to
4533 * determine if @a wc_path itself is switched. It should be any trailing
4534 * portion of @a wc_path's expected URL, long enough to include any parts
4535 * that the caller considers might be changed by a switch. If it does not
4536 * match the end of @a wc_path's actual URL, then report a "switched"
4539 * Set @a (*result_p)->modified to indicate whether any item is locally
4542 * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
4543 * if the client has cancelled the operation.
4545 * Allocate *result_p in @a pool.
4550 svn_wc_revision_status(svn_wc_revision_status_t
**result_p
,
4551 const char *wc_path
,
4552 const char *trail_url
,
4553 svn_boolean_t committed
,
4554 svn_cancel_func_t cancel_func
,
4560 * For each path in @a paths, set its entry's 'changelist' attribute
4561 * to @a changelist. (If @a changelist is NULL, then path is no
4562 * longer a member of any changelist).
4564 * NOTE: for now, directories are NOT allowed to be associated with
4565 * changelists; there is confusion about whether they should/do
4566 * behave as depth-0 or depth-infinity objects.
4568 * If @a matching_changelist is not NULL, then enforce that each
4569 * path's existing entry->changelist field matches @a
4570 * matching_changelist; if the path is part of some other changelist,
4571 * skip it path and try to throw @a svn_wc_notify_changelist_failure
4572 * notification. If @a matching_changelist is NULL, then be lax and
4573 * don't enforce any matching, just write the new entry->changelist
4574 * value unconditionally.
4576 * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
4577 * if the client has cancelled the operation.
4579 * If @a notify_func is non-NULL, it will be called with @a
4580 * notify_baton, the each path for changelist association, and the
4581 * notification type (@c svn_wc_notify_changelist_set or @c
4582 * svn_wc_notify_changelist_clear).
4584 * @note This metadata is purely a client-side "bookkeeping"
4585 * convenience, and is entirely managed by the working copy.
4587 * @since New in 1.5.
4590 svn_wc_set_changelist(const apr_array_header_t
*paths
,
4591 const char *changelist
,
4592 const char *matching_changelist
,
4593 svn_cancel_func_t cancel_func
,
4595 svn_wc_notify_func2_t notify_func
,
4604 #endif /* __cplusplus */
4606 #endif /* SVN_WC_H */