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.
174 svn_wc_adm_open3(svn_wc_adm_access_t
**adm_access
,
175 svn_wc_adm_access_t
*associated
,
177 svn_boolean_t write_lock
,
179 svn_cancel_func_t cancel_func
,
184 * Similar to svn_wc_adm_open3(), but without cancellation support.
186 * @deprecated Provided for backward compatibility with the 1.1 API.
189 svn_wc_adm_open2(svn_wc_adm_access_t
**adm_access
,
190 svn_wc_adm_access_t
*associated
,
192 svn_boolean_t write_lock
,
197 * Similar to svn_wc_adm_open2(), but with @a tree_lock instead of
198 * @a levels_to_lock. @a levels_to_lock is set to -1 if @a tree_lock
199 * is @c TRUE, else 0.
201 * @deprecated Provided for backward compatibility with the 1.0 API.
204 svn_wc_adm_open(svn_wc_adm_access_t
**adm_access
,
205 svn_wc_adm_access_t
*associated
,
207 svn_boolean_t write_lock
,
208 svn_boolean_t tree_lock
,
212 * Checks the working copy to determine the node type of @a path. If
213 * @a path is a versioned directory then the behaviour is like that of
214 * svn_wc_adm_open3(), otherwise, if @a path is a file or does not
215 * exist, then the behaviour is like that of svn_wc_adm_open3() with
216 * @a path replaced by the parent directory of @a path. If @a path is
217 * an unversioned directory, the behaviour is also like that of
218 * svn_wc_adm_open3() on the parent, except that if the open fails,
219 * then the returned SVN_ERR_WC_NOT_DIRECTORY error refers to @a path,
220 * not to @a path's parent.
225 svn_wc_adm_probe_open3(svn_wc_adm_access_t
**adm_access
,
226 svn_wc_adm_access_t
*associated
,
228 svn_boolean_t write_lock
,
230 svn_cancel_func_t cancel_func
,
235 * Similar to svn_wc_adm_probe_open3() without the cancel
238 * @deprecated Provided for backward compatibility with the 1.1 API.
241 svn_wc_adm_probe_open2(svn_wc_adm_access_t
**adm_access
,
242 svn_wc_adm_access_t
*associated
,
244 svn_boolean_t write_lock
,
249 * Similar to svn_wc_adm_probe_open2(), but with @a tree_lock instead of
250 * @a levels_to_lock. @a levels_to_lock is set to -1 if @a tree_lock
251 * is @c TRUE, else 0.
253 * @deprecated Provided for backward compatibility with the 1.0 API.
256 svn_wc_adm_probe_open(svn_wc_adm_access_t
**adm_access
,
257 svn_wc_adm_access_t
*associated
,
259 svn_boolean_t write_lock
,
260 svn_boolean_t tree_lock
,
264 * Open access batons for @a path and return in @a *anchor_access and
265 * @a *target the anchor and target required to drive an editor. Return
266 * in @a *target_access the access baton for the target, which may be the
267 * same as @a *anchor_access. All the access batons will be in the
268 * @a *anchor_access set.
270 * @a levels_to_lock determines the levels_to_lock used when opening
271 * @a path if @a path is a versioned directory, @a levels_to_lock is
272 * ignored otherwise. If @a write_lock is @c TRUE the access batons
273 * will hold write locks.
275 * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
276 * if the client has cancelled the operation.
278 * This function is essentially a combination of svn_wc_adm_open3() and
279 * svn_wc_get_actual_target(), with the emphasis on reducing physical IO.
284 svn_wc_adm_open_anchor(svn_wc_adm_access_t
**anchor_access
,
285 svn_wc_adm_access_t
**target_access
,
288 svn_boolean_t write_lock
,
290 svn_cancel_func_t cancel_func
,
294 /** Return, in @a *adm_access, a pointer to an existing access baton associated
295 * with @a path. @a path must be a directory that is locked as part of the
296 * set containing the @a associated access baton.
298 * If the requested access baton is marked as missing in, or is simply
299 * absent from, @a associated, return SVN_ERR_WC_NOT_LOCKED.
301 * @a pool is used only for local processing, it is not used for the batons.
304 svn_wc_adm_retrieve(svn_wc_adm_access_t
**adm_access
,
305 svn_wc_adm_access_t
*associated
,
309 /** Check the working copy to determine the node type of @a path. If
310 * @a path is a versioned directory then the behaviour is like that of
311 * svn_wc_adm_retrieve(), otherwise, if @a path is a file, an unversioned
312 * directory, or does not exist, then the behaviour is like that of
313 * svn_wc_adm_retrieve() with @a path replaced by the parent directory of
317 svn_wc_adm_probe_retrieve(svn_wc_adm_access_t
**adm_access
,
318 svn_wc_adm_access_t
*associated
,
323 * Try various ways to obtain an access baton for @a path.
325 * First, try to obtain @a *adm_access via svn_wc_adm_probe_retrieve(),
326 * but if this fails because @a associated can't give a baton for
327 * @a path or @a path's parent, then try svn_wc_adm_probe_open3(),
328 * this time passing @a write_lock and @a levels_to_lock. If there is
329 * still no access because @a path is not a versioned directory, then
330 * just set @a *adm_access to NULL and return success. But if it is
331 * because @a path is locked, then return the error @c SVN_ERR_WC_LOCKED,
332 * and the effect on @a *adm_access is undefined. (Or if the attempt
333 * fails for any other reason, return the corresponding error, and the
334 * effect on @a *adm_access is also undefined.)
336 * If svn_wc_adm_probe_open3() succeeds, then add @a *adm_access to
339 * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
340 * if the client has cancelled the operation.
342 * Use @a pool only for local processing, not to allocate @a *adm_access.
347 svn_wc_adm_probe_try3(svn_wc_adm_access_t
**adm_access
,
348 svn_wc_adm_access_t
*associated
,
350 svn_boolean_t write_lock
,
352 svn_cancel_func_t cancel_func
,
357 * Similar to svn_wc_adm_probe_try3() without the cancel
360 * @deprecated Provided for backward compatibility with the 1.1 API.
363 svn_wc_adm_probe_try2(svn_wc_adm_access_t
**adm_access
,
364 svn_wc_adm_access_t
*associated
,
366 svn_boolean_t write_lock
,
371 * Similar to svn_wc_adm_probe_try2(), but with @a tree_lock instead of
372 * @a levels_to_lock. @a levels_to_lock is set to -1 if @a tree_lock
373 * is @c TRUE, else 0.
375 * @deprecated Provided for backward compatibility with the 1.0 API.
378 svn_wc_adm_probe_try(svn_wc_adm_access_t
**adm_access
,
379 svn_wc_adm_access_t
*associated
,
381 svn_boolean_t write_lock
,
382 svn_boolean_t tree_lock
,
386 /** Give up the access baton @a adm_access, and its lock if any. This will
387 * recursively close any batons in the same set that are direct
388 * subdirectories of @a adm_access. Any physical locks will be removed from
389 * the working copy. Lock removal is unconditional, there is no check to
390 * determine if cleanup is required.
392 svn_error_t
*svn_wc_adm_close(svn_wc_adm_access_t
*adm_access
);
394 /** Return the path used to open the access baton @a adm_access */
395 const char *svn_wc_adm_access_path(svn_wc_adm_access_t
*adm_access
);
397 /** Return the pool used by access baton @a adm_access */
398 apr_pool_t
*svn_wc_adm_access_pool(svn_wc_adm_access_t
*adm_access
);
400 /** Return @c TRUE is the access baton @a adm_access has a write lock,
401 * @c FALSE otherwise. Compared to svn_wc_locked() this is a cheap, fast
402 * function that doesn't access the filesystem.
404 svn_boolean_t
svn_wc_adm_locked(svn_wc_adm_access_t
*adm_access
);
406 /** Set @a *locked to non-zero if @a path is locked, else set it to zero. */
408 svn_wc_locked(svn_boolean_t
*locked
,
414 * Return @c TRUE if @a name is the name of the WC administrative
415 * directory. Use @a pool for any temporary allocations. Only works
416 * with base directory names, not paths or URIs.
418 * For compatibility, the default name (.svn) will always be treated
419 * as an admin dir name, even if the working copy is actually using an
424 svn_boolean_t
svn_wc_is_adm_dir(const char *name
, apr_pool_t
*pool
);
428 * Return the name of the administrative directory.
429 * Use @a pool for any temporary allocations.
431 * The returned pointer will refer to either a statically allocated
432 * string, or to a string allocated in @a pool.
436 const char *svn_wc_get_adm_dir(apr_pool_t
*pool
);
440 * Use @a name for the administrative directory in the working copy.
441 * Use @a pool for any temporary allocations.
443 * The list of valid names is limited. Currently only ".svn" (the
444 * default) and "_svn" are allowed.
446 * @note This function changes global (per-process) state and must be
447 * called in a single-threaded context during the initialization of a
452 svn_error_t
*svn_wc_set_adm_dir(const char *name
, apr_pool_t
*pool
);
456 /** Traversal information is information gathered by a working copy
457 * crawl or update. For example, the before and after values of the
458 * svn:externals property are important after an update, and since
459 * we're traversing the working tree anyway (a complete traversal
460 * during the initial crawl, and a traversal of changed paths during
461 * the checkout/update/switch), it makes sense to gather the
462 * property's values then instead of making a second pass.
464 typedef struct svn_wc_traversal_info_t svn_wc_traversal_info_t
;
467 /** Return a new, empty traversal info object, allocated in @a pool. */
468 svn_wc_traversal_info_t
*svn_wc_init_traversal_info(apr_pool_t
*pool
);
471 /** Set @a *externals_old and @a *externals_new to hash tables representing
472 * changes to values of the svn:externals property on directories
473 * traversed by @a traversal_info.
475 * @a traversal_info is obtained from svn_wc_init_traversal_info(), but is
476 * only useful after it has been passed through another function, such
477 * as svn_wc_crawl_revisions(), svn_wc_get_update_editor(),
478 * svn_wc_get_switch_editor(), etc.
480 * Each hash maps <tt>const char *</tt> directory names onto
481 * <tt>const char *</tt> values of the externals property for that directory.
482 * The dir names are full paths -- that is, anchor plus target, not target
483 * alone. The values are not parsed, they are simply copied raw, and are
484 * never NULL: directories that acquired or lost the property are
485 * simply omitted from the appropriate table. Directories whose value
486 * of the property did not change show the same value in each hash.
488 * The hashes, keys, and values have the same lifetime as @a traversal_info.
491 svn_wc_edited_externals(apr_hash_t
**externals_old
,
492 apr_hash_t
**externals_new
,
493 svn_wc_traversal_info_t
*traversal_info
);
496 /** Set @a *depths to a hash table mapping <tt>const char *</tt>
497 * directory names (directories traversed by @a traversal_info) to
498 * <tt>const char *</tt> values (the depths of those directories, as
499 * converted by svn_depth_to_word()).
501 * @a traversal_info is obtained from svn_wc_init_traversal_info(), but is
502 * only useful after it has been passed through another function, such
503 * as svn_wc_crawl_revisions(), svn_wc_get_update_editor(),
504 * svn_wc_get_switch_editor(), etc.
506 * The dir names are full paths -- that is, anchor plus target, not target
507 * alone. The values are not allocated, they are static constant strings.
508 * Although the values are never NULL, not all directories traversed
509 * are necessarily listed. For example, directories which did not
510 * have an svn:externals property set or modified are not included.
512 * The hashes and keys have the same lifetime as @a traversal_info.
517 svn_wc_traversed_depths(apr_hash_t
**depths
,
518 svn_wc_traversal_info_t
*traversal_info
);
521 /** One external item. This usually represents one line from an
522 * svn:externals description but with the path and URL
525 * In order to avoid backwards compatibility problems clients should use
526 * svn_wc_external_item_create() to allocate and intialize this structure
527 * instead of doing so themselves.
531 typedef struct svn_wc_external_item2_t
533 /** The name of the subdirectory into which this external should be
534 checked out. This is relative to the parent directory that
535 holds this external item. (Note that these structs are often
536 stored in hash tables with the target dirs as keys, so this
537 field will often be redundant.) */
538 const char *target_dir
;
540 /** Where to check out from. */
543 /** What revision to check out. The only valid kinds for this are
544 svn_opt_revision_number, svn_opt_revision_date, and
545 svn_opt_revision_head. */
546 svn_opt_revision_t revision
;
548 /** The peg revision to use when checking out. The only valid kinds are
549 svn_opt_revision_number, svn_opt_revision_date, and
550 svn_opt_revision_head. */
551 svn_opt_revision_t peg_revision
;
553 } svn_wc_external_item2_t
;
556 * Initialize an external item.
557 * Set @a *item to an external item object, allocated in @a pool.
559 * In order to avoid backwards compatibility problems, this function
560 * is used to intialize and allocate the @c svn_wc_external_item2_t
561 * structure rather than doing so explicitly, as the size of this
562 * structure may change in the future.
564 * The current implementation never returns error, but callers should
565 * still check for error, for compatibility with future versions.
570 svn_wc_external_item_create(const svn_wc_external_item2_t
**item
,
574 * Return a duplicate of @a item, allocated in @a pool. No part of the new
575 * item will be shared with @a item.
579 svn_wc_external_item2_t
*
580 svn_wc_external_item2_dup(const svn_wc_external_item2_t
*item
,
584 * One external item. Similar to svn_wc_external_item2_t, except
585 * @a revision is interpreted as both the operational revision and the
588 * @deprecated Provided for backward compatibility with the 1.4 API.
590 typedef struct svn_wc_external_item_t
592 /** Same as @c svn_wc_external_item2_t.target_dir */
593 const char *target_dir
;
595 /** Same as @c svn_wc_external_item2_t.url */
598 /** Same as @c svn_wc_external_item2_t.revision */
599 svn_opt_revision_t revision
;
601 } svn_wc_external_item_t
;
604 * Return a duplicate of @a item, allocated in @a pool. No part of the new
605 * item will be shared with @a item.
609 * @deprecated Provided for backward compatibility with the 1.4 API.
611 svn_wc_external_item_t
*
612 svn_wc_external_item_dup(const svn_wc_external_item_t
*item
,
616 * If @a externals_p is non-NULL, set @a *externals_p to an array of
617 * @c svn_wc_external_item2_t * objects based on @a desc. The @a url
618 * member of the objects will be canonicalized if @a canonicalize_url
621 * If the format of @a desc is invalid, don't touch @a *externals_p and
622 * return @c SVN_ERR_CLIENT_INVALID_EXTERNALS_DESCRIPTION. Thus, if
623 * you just want to check the validity of an externals description,
624 * and don't care about the parsed result, pass NULL for @a externals_p.
626 * The format of @a desc is the same as for values of the directory
627 * property @c SVN_PROP_EXTERNALS, which see.
629 * Allocate the table, keys, and values in @a pool.
631 * Use @a parent_directory only in constructing error strings.
636 svn_wc_parse_externals_description3(apr_array_header_t
**externals_p
,
637 const char *parent_directory
,
639 svn_boolean_t canonicalize_url
,
643 * Similar to svn_wc_parse_externals_description3() with @a
644 * canonicalize_url set to @c TRUE, but returns an array of @c
645 * svn_wc_external_item_t * objects instead of @c
646 * svn_wc_external_item2_t * objects
650 * @deprecated Provided for backward compatibility with the 1.4 API.
653 svn_wc_parse_externals_description2(apr_array_header_t
**externals_p
,
654 const char *parent_directory
,
659 * Similar to svn_wc_parse_externals_description2(), but returns the
660 * parsed externals in a hash instead of an array. This function
661 * should not be used, as storing the externals in a hash causes their
662 * order of evaluation to be not easily identifiable.
664 * @deprecated Provided for backward compatibility with the 1.0 API.
667 svn_wc_parse_externals_description(apr_hash_t
**externals_p
,
668 const char *parent_directory
,
674 /* Notification/callback handling. */
677 * @defgroup svn_wc_notifications Notification callback handling
680 * In many cases, the WC library will scan a working copy and make
681 * changes. The caller usually wants to know when each of these changes
682 * has been made, so that it can display some kind of notification to
685 * These notifications have a standard callback function type, which
686 * takes the path of the file that was affected, and a caller-
689 * Note that the callback is a 'void' return -- this is a simple
690 * reporting mechanism, rather than an opportunity for the caller to
691 * alter the operation of the WC library.
693 * Note also that some of the actions are used across several
694 * different Subversion commands. For example, the update actions are
695 * also used for checkouts, switches, and merges.
698 /** The type of action occurring. */
699 typedef enum svn_wc_notify_action_t
701 /** Adding a path to revision control. */
702 svn_wc_notify_add
= 0,
704 /** Copying a versioned path. */
707 /** Deleting a versioned path. */
708 svn_wc_notify_delete
,
710 /** Restoring a missing path from the pristine text-base. */
711 svn_wc_notify_restore
,
713 /** Reverting a modified path. */
714 svn_wc_notify_revert
,
716 /** A revert operation has failed. */
717 svn_wc_notify_failed_revert
,
719 /** Resolving a conflict. */
720 svn_wc_notify_resolved
,
722 /** Skipping a path. */
725 /** Got a delete in an update. */
726 svn_wc_notify_update_delete
,
728 /** Got an add in an update. */
729 svn_wc_notify_update_add
,
731 /** Got any other action in an update. */
732 svn_wc_notify_update_update
,
734 /** The last notification in an update (including updates of externals). */
735 svn_wc_notify_update_completed
,
737 /** Updating an external module. */
738 svn_wc_notify_update_external
,
740 /** The last notification in a status (including status on externals). */
741 svn_wc_notify_status_completed
,
743 /** Running status on an external module. */
744 svn_wc_notify_status_external
,
746 /** Committing a modification. */
747 svn_wc_notify_commit_modified
,
749 /** Committing an addition. */
750 svn_wc_notify_commit_added
,
752 /** Committing a deletion. */
753 svn_wc_notify_commit_deleted
,
755 /** Committing a replacement. */
756 svn_wc_notify_commit_replaced
,
758 /** Transmitting post-fix text-delta data for a file. */
759 svn_wc_notify_commit_postfix_txdelta
,
761 /** Processed a single revision's blame. */
762 svn_wc_notify_blame_revision
,
764 /** Locking a path. @since New in 1.2. */
765 svn_wc_notify_locked
,
767 /** Unlocking a path. @since New in 1.2. */
768 svn_wc_notify_unlocked
,
770 /** Failed to lock a path. @since New in 1.2. */
771 svn_wc_notify_failed_lock
,
773 /** Failed to unlock a path. @since New in 1.2. */
774 svn_wc_notify_failed_unlock
,
776 /** Tried adding a path that already exists. @since New in 1.5. */
777 svn_wc_notify_exists
,
779 /** Changelist name set. @since New in 1.5. */
780 svn_wc_notify_changelist_set
,
782 /** Changelist name cleared. @since New in 1.5. */
783 svn_wc_notify_changelist_clear
,
785 /** Warn user that a path has moved from one changelist to another.
786 @since New in 1.5. */
787 svn_wc_notify_changelist_moved
,
789 /** A merge operation (to path) has begun. See @c merge_range in
790 @c svn_wc_notify_t. @since New in 1.5. */
791 svn_wc_notify_merge_begin
,
793 /** A merge operation (to path) from a foreign repository has begun.
794 See @c merge_range in @c svn_wc_notify_t. @since New in 1.5. */
795 svn_wc_notify_foreign_merge_begin
,
797 /** Replace notification. @since New in 1.5. */
798 svn_wc_notify_update_replace
,
800 /** Property updated. @since New in 1.6. */
801 svn_wc_notify_property_updated
803 } svn_wc_notify_action_t
;
806 /** The type of notification that is occurring. */
807 typedef enum svn_wc_notify_state_t
809 svn_wc_notify_state_inapplicable
= 0,
811 /** Notifier doesn't know or isn't saying. */
812 svn_wc_notify_state_unknown
,
814 /** The state did not change. */
815 svn_wc_notify_state_unchanged
,
817 /** The item wasn't present. */
818 svn_wc_notify_state_missing
,
820 /** An unversioned item obstructed work. */
821 svn_wc_notify_state_obstructed
,
823 /** Pristine state was modified. */
824 svn_wc_notify_state_changed
,
826 /** Modified state had mods merged in. */
827 svn_wc_notify_state_merged
,
829 /** Modified state got conflicting mods. */
830 svn_wc_notify_state_conflicted
832 } svn_wc_notify_state_t
;
835 * What happened to a lock during an operation.
839 typedef enum svn_wc_notify_lock_state_t
{
840 svn_wc_notify_lock_state_inapplicable
= 0,
841 svn_wc_notify_lock_state_unknown
,
842 /** The lock wasn't changed. */
843 svn_wc_notify_lock_state_unchanged
,
844 /** The item was locked. */
845 svn_wc_notify_lock_state_locked
,
846 /** The item was unlocked. */
847 svn_wc_notify_lock_state_unlocked
848 } svn_wc_notify_lock_state_t
;
851 * Structure used in the @c svn_wc_notify_func2_t function.
853 * @c kind, @c content_state, @c prop_state and @c lock_state are from
854 * after @c action, not before.
856 * @note If @c action is @c svn_wc_notify_update, then @c path has
857 * already been installed, so it is legitimate for an implementation of
858 * @c svn_wc_notify_func2_t to examine @c path in the working copy.
860 * @note The purpose of the @c kind, @c mime_type, @c content_state, and
861 * @c prop_state fields is to provide "for free" information that an
862 * implementation is likely to want, and which it would otherwise be
863 * forced to deduce via expensive operations such as reading entries
864 * and properties. However, if the caller does not have this
865 * information, it will simply pass the corresponding `*_unknown'
866 * values, and it is up to the implementation how to handle that
867 * (i.e., whether to attempt deduction, or just to punt and
868 * give a less informative notification).
870 * @note Callers of notification functions should use svn_wc_create_notify()
871 * to create structures of this type to allow for extensibility.
875 typedef struct svn_wc_notify_t
{
876 /** Path, either absolute or relative to the current working directory
877 * (i.e., not relative to an anchor). */
879 /** Action that describes what happened to @c path. */
880 svn_wc_notify_action_t action
;
881 /** Node kind of @c path. */
882 svn_node_kind_t kind
;
883 /** If non-NULL, indicates the mime-type of @c path.
884 * It is always @c NULL for directories. */
885 const char *mime_type
;
886 /** Points to the lock structure received from the repository when
887 * @c action is @c svn_wc_notify_locked. For other actions, it is
889 const svn_lock_t
*lock
;
890 /** Points to an error describing the reason for the failure when @c
891 * action is @c svn_wc_notify_failed_lock or @c svn_wc_notify_failed_unlock.
892 * Is @c NULL otherwise. */
894 /** The type of notification that is occurring about node content. */
895 svn_wc_notify_state_t content_state
;
896 /** The type of notification that is occurring about node properties. */
897 svn_wc_notify_state_t prop_state
;
898 /** Reflects the addition or removal of a lock token in the working copy. */
899 svn_wc_notify_lock_state_t lock_state
;
900 /** When @c action is @c svn_wc_notify_update_completed, target revision
901 * of the update, or @c SVN_INVALID_REVNUM if not available; when @c
902 * action is @c svn_wc_notify_blame_revision, processed revision.
903 * In all other cases, it is @c SVN_INVALID_REVNUM. */
904 svn_revnum_t revision
;
905 /** When @c action is @c svn_wc_notify_changelist_add or name. In all other
906 * cases, it is @c NULL. */
907 const char *changelist_name
;
908 /** When @c action is @c svn_wc_notify_merge_begin, and both the
909 left and right sides of the merge are from the same URL. In all
910 other cases, it is @c NULL. */
911 svn_merge_range_t
*merge_range
;
912 /* NOTE: Add new fields at the end to preserve binary compatibility.
913 Also, if you add fields here, you have to update svn_wc_create_notify
914 and svn_wc_dup_notify. */
918 * Allocate an @c svn_wc_notify_t structure in @a pool, initialize and return
921 * Set the @c path field of the created struct to @a path, and @c action to
922 * @a action. Set all other fields to their @c _unknown, @c NULL or
923 * invalid value, respectively.
928 svn_wc_create_notify(const char *path
,
929 svn_wc_notify_action_t action
,
933 * Return a deep copy of @a notify, allocated in @a pool.
938 svn_wc_dup_notify(const svn_wc_notify_t
*notify
,
942 * Notify the world that @a notify->action has happened to @a notify->path.
944 * Recommendation: callers of @c svn_wc_notify_func2_t should avoid
945 * invoking it multiple times on the same path within a given
946 * operation, and implementations should not bother checking for such
947 * duplicate calls. For example, in an update, the caller should not
948 * invoke the notify func on receiving a prop change and then again
949 * on receiving a text change. Instead, wait until all changes have
950 * been received, and then invoke the notify func once (from within
951 * an @c svn_delta_editor_t's close_file(), for example), passing
952 * the appropriate @a notify->content_state and @a notify->prop_state flags.
956 typedef void (*svn_wc_notify_func2_t
)(void *baton
,
957 const svn_wc_notify_t
*notify
,
961 * Similar to @c svn_wc_notify_func2_t, but takes the information as arguments
962 * instead of struct fields.
964 * @deprecated Provided for backward compatibility with the 1.1 API.
966 typedef void (*svn_wc_notify_func_t
)(void *baton
,
968 svn_wc_notify_action_t action
,
969 svn_node_kind_t kind
,
970 const char *mime_type
,
971 svn_wc_notify_state_t content_state
,
972 svn_wc_notify_state_t prop_state
,
973 svn_revnum_t revision
);
979 * A simple callback type to wrap svn_ra_get_file(); see that
980 * docstring for more information.
982 * This technique allows libsvn_client to 'wrap' svn_ra_get_file() and
983 * pass it down into libsvn_wc functions, thus allowing the WC layer
984 * to legally call the RA function via (blind) callback.
988 typedef svn_error_t
*(*svn_wc_get_file_t
)(void *baton
,
990 svn_revnum_t revision
,
991 svn_stream_t
*stream
,
992 svn_revnum_t
*fetched_rev
,
998 * Interactive conflict handling
1000 * @defgroup svn_wc_conflict Conflict callback functionality
1004 * This API gives a Subversion client application the opportunity to
1005 * define a callback that allows the user to resolve conflicts
1006 * interactively during updates and merges.
1008 * If a conflict is discovered, libsvn_wc invokes the callback with an
1009 * @c svn_wc_conflict_description_t. This structure describes the
1010 * path in conflict, whether it's a text or property conflict, and may
1011 * also present up to three files that can be used to resolve the
1012 * conflict (perhaps by launching an editor or 3rd-party merging
1013 * tool). The structure also provides a possible fourth file (@c
1014 * merged_file) which, if not NULL, represents libsvn_wc's attempt to
1015 * contextually merge the first three files. (Note that libsvn_wc
1016 * will not attempt to merge a file that it believes is binary, and it
1017 * will only attempt to merge property values it believes to be a
1018 * series of multi-line text.)
1020 * When the callback is finished interacting with the user, it
1021 * responds by returning a @c svn_wc_conflict_result_t. This
1022 * structure indicates whether the user wants to postpone the conflict
1023 * for later (allowing libsvn_wc to mark the path "conflicted" as
1024 * usual), or whether the user wants libsvn_wc to use one of the four
1025 * files as the "final" state for resolving the conflict immediately.
1027 * Note that the callback is at liberty (and encouraged) to merge the
1028 * three files itself. If it does so, it signals this to libsvn_wc by
1029 * returning a choice of @c svn_wc_conflict_choose_merged. To return
1030 * the 'final' merged file to libsvn_wc, the callback has the option of
1033 * - editing the original @c merged_file in-place
1035 * or, if libsvn_wc never supplied a merged_file in the
1036 * description structure (i.e. passed NULL for that field),
1038 * - return the merged file in the @c svn_wc_conflict_result_t.
1042 /** The type of action being attempted on an object.
1044 * @since New in 1.5.
1046 typedef enum svn_wc_conflict_action_t
1048 svn_wc_conflict_action_edit
, /* attempting to change text or props */
1049 svn_wc_conflict_action_add
, /* attempting to add object */
1050 svn_wc_conflict_action_delete
/* attempting to delete object */
1052 } svn_wc_conflict_action_t
;
1055 /** The pre-existing condition which is causing a state of conflict.
1057 * @since New in 1.5.
1059 typedef enum svn_wc_conflict_reason_t
1061 svn_wc_conflict_reason_edited
, /* local edits are already present */
1062 svn_wc_conflict_reason_obstructed
, /* another object is in the way */
1063 svn_wc_conflict_reason_deleted
, /* object is already schedule-delete */
1064 svn_wc_conflict_reason_missing
, /* object is unknown or missing */
1065 svn_wc_conflict_reason_unversioned
/* object is unversioned */
1067 } svn_wc_conflict_reason_t
;
1070 /** The type of conflict being described by an @c
1071 * svn_wc_conflict_description_t (see below).
1073 * @since New in 1.5.
1075 typedef enum svn_wc_conflict_kind_t
1077 svn_wc_conflict_kind_text
, /* textual conflict (on a file) */
1078 svn_wc_conflict_kind_property
/* property conflict (on a file or dir) */
1080 /* ### Add future kinds here that represent "tree" conflicts. */
1082 } svn_wc_conflict_kind_t
;
1085 /** A struct that describes a conflict that has occurred in the
1086 * working copy. Passed to @c svn_wc_conflict_resolver_func_t.
1088 * @note Fields may be added to the end of this structure in future
1089 * versions. Therefore, to preserve binary compatibility, users
1090 * should not directly allocate structures of this type.
1092 * @since New in 1.5.
1094 typedef struct svn_wc_conflict_description_t
1096 /** The path that is being operated on */
1099 /** The node type of the path being operated on */
1100 svn_node_kind_t node_kind
;
1102 /** What sort of conflict are we describing? */
1103 svn_wc_conflict_kind_t kind
;
1105 /** Only set if this is a property conflict. */
1106 const char *property_name
;
1108 /** The following only apply to file objects:
1109 * - Whether svn thinks the object is a binary file.
1110 * - If available (non-NULL), the svn:mime-type property of the path */
1111 svn_boolean_t is_binary
;
1113 /** mime-type of the object */
1114 const char *mime_type
;
1116 /** If not NULL, an open working copy access baton to either the
1117 * path itself (if @c path is a directory), or to the parent
1118 * directory (if @c path is a file.) */
1119 svn_wc_adm_access_t
*access
;
1121 /** The action being attempted on @c path. */
1122 svn_wc_conflict_action_t action
;
1124 /** The reason for the conflict. */
1125 svn_wc_conflict_reason_t reason
;
1127 /** If this is text-conflict and involves the merging of two files
1128 * descended from a common ancestor, here are the paths of up to
1129 * four fulltext files that can be used to interactively resolve the
1130 * conflict. All four files will be in repository-normal form -- LF
1131 * line endings and contracted keywords. (If any of these files are
1132 * not available, they default to NULL.)
1134 * On the other hand, if this is a property-conflict, then these
1135 * paths represent temporary files that contain the three different
1136 * property-values in conflict. The fourth path (@c merged_file)
1137 * may or may not be NULL; if set, it represents libsvn_wc's
1138 * attempt to merge the property values together. (Remember that
1139 * property values are technically binary values, and thus can't
1140 * always be merged.)
1142 const char *base_file
; /* common ancestor of the two files being merged */
1144 /** their version of the file */
1145 const char *their_file
;
1147 /** my locally-edited version of the file */
1148 const char *my_file
;
1150 /** merged version; may contain conflict markers */
1151 const char *merged_file
;
1153 } svn_wc_conflict_description_t
;
1156 /** The way in which the conflict callback chooses a course of action.
1158 * @since New in 1.5.
1160 typedef enum svn_wc_conflict_choice_t
1162 /* Don't resolve the conflict now. Let libsvn_wc mark the path
1163 'conflicted', so user can run 'svn resolved' later. */
1164 svn_wc_conflict_choose_postpone
,
1166 /* If their were files to choose from, select one as a way of
1167 resolving the conflict here and now. libsvn_wc will then do the
1168 work of "installing" the chosen file.
1170 svn_wc_conflict_choose_base
, /* original version */
1171 svn_wc_conflict_choose_theirs_full
, /* incoming version */
1172 svn_wc_conflict_choose_mine_full
, /* own version */
1173 svn_wc_conflict_choose_theirs_conflict
, /* incoming (for conflicted hunks) */
1174 svn_wc_conflict_choose_mine_conflict
, /* own (for conflicted hunks) */
1175 svn_wc_conflict_choose_merged
/* merged version */
1177 } svn_wc_conflict_choice_t
;
1180 /** The final result returned by @a svn_wc_conflict_resolver_func_t.
1182 * @note Fields may be added to the end of this structure in future
1183 * versions. Therefore, to preserve binary compatibility, users
1184 * should not directly allocate structures of this type. Instead,
1185 * construct this structure using @c svn_wc_create_conflict_result()
1188 * @since New in 1.5.
1190 typedef struct svn_wc_conflict_result_t
1192 /** A choice to either delay the conflict resolution or select a
1193 particular file to resolve the conflict. */
1194 svn_wc_conflict_choice_t choice
;
1196 /** If not NULL, this is a path to a file which contains the client's
1197 (or more likely, the user's) merging of the three values in
1198 conflict. libsvn_wc accepts this file if (and only if) @c choice
1199 is set to @c svn_wc_conflict_choose_merged.*/
1200 const char *merged_file
;
1202 } svn_wc_conflict_result_t
;
1206 * Allocate an @c svn_wc_conflict_result_t structure in @a pool,
1207 * initialize and return it.
1209 * Set the @c choice field of the structure to @a choice, and @c
1210 * merged_file to @a merged_file. Set all other fields to their @c
1211 * _unknown, @c NULL or invalid value, respectively.
1213 * @since New in 1.5.
1215 svn_wc_conflict_result_t
*
1216 svn_wc_create_conflict_result(svn_wc_conflict_choice_t choice
,
1217 const char *merged_file
,
1221 /** A callback used in svn_client_merge3(), svn_client_update3(), and
1222 * svn_client_switch2() for resolving conflicts during the application
1223 * of a tree delta to a working copy.
1225 * @a description describes the exact nature of the conflict, and
1226 * provides information to help resolve it. @a baton is a closure
1227 * object; it should be provided by the implementation, and passed by
1228 * the caller. All allocations should be performed in @a pool. When
1229 * finished, the callback signals its resolution by returning a
1230 * structure in @a *result. (See @c svn_wc_conflict_result_t.)
1232 * Implementations of this callback are free to present the conflict
1233 * using any user interface. This may include simple contextual
1234 * conflicts in a file's text or properties, or more complex
1235 * 'tree'-based conflcts related to obstructed additions, deletions,
1236 * and edits. The callback implementation is free to decide which
1237 * sorts of conflicts to handle; it's also free to decide which types
1238 * of conflicts are automatically resolvable and which require user
1241 * @since New in 1.5.
1243 typedef svn_error_t
*(*svn_wc_conflict_resolver_func_t
)
1244 (svn_wc_conflict_result_t
**result
,
1245 const svn_wc_conflict_description_t
*description
,
1254 * A callback vtable invoked by our diff-editors, as they receive
1255 * diffs from the server. 'svn diff' and 'svn merge' both implement
1256 * their own versions of this table.
1258 * Common parameters:
1260 * @a adm_access will be an access baton for the directory containing
1261 * @a path, or @c NULL if the diff editor is not using access batons.
1263 * If @a state is non-NULL, set @a *state to the state of the item
1264 * after the operation has been performed. (In practice, this is only
1265 * useful with merge, not diff; diff callbacks will probably set
1266 * @a *state to @c svn_wc_notify_state_unknown, since they do not change
1267 * the state and therefore do not bother to know the state after the
1268 * operation.) By default, @a state refers to the item's content
1269 * state. Functions concerned with property state have separate
1270 * @a contentstate and @a propstate arguments.
1272 * @since New in 1.6.
1274 typedef struct svn_wc_diff_callbacks3_t
1277 * A file @a path has changed. If @a tmpfile2 is non-NULL, the
1278 * contents have changed and those changes can be seen by comparing
1279 * @a tmpfile1 and @a tmpfile2, which represent @a rev1 and @a rev2 of
1280 * the file, respectively.
1282 * If known, the @c svn:mime-type value of each file is passed into
1283 * @a mimetype1 and @a mimetype2; either or both of the values can
1284 * be NULL. The implementor can use this information to decide if
1285 * (or how) to generate differences.
1287 * @a propchanges is an array of (@c svn_prop_t) structures. If it contains
1288 * any elements, the original list of properties is provided in
1289 * @a originalprops, which is a hash of @c svn_string_t values, keyed on the
1293 svn_error_t
*(*file_changed
)(svn_wc_adm_access_t
*adm_access
,
1294 svn_wc_notify_state_t
*contentstate
,
1295 svn_wc_notify_state_t
*propstate
,
1297 const char *tmpfile1
,
1298 const char *tmpfile2
,
1301 const char *mimetype1
,
1302 const char *mimetype2
,
1303 const apr_array_header_t
*propchanges
,
1304 apr_hash_t
*originalprops
,
1308 * A file @a path was added. The contents can be seen by comparing
1309 * @a tmpfile1 and @a tmpfile2, which represent @a rev1 and @a rev2
1310 * of the file, respectively. (If either file is empty, the rev
1313 * If known, the @c svn:mime-type value of each file is passed into
1314 * @a mimetype1 and @a mimetype2; either or both of the values can
1315 * be NULL. The implementor can use this information to decide if
1316 * (or how) to generate differences.
1318 * @a propchanges is an array of (@c svn_prop_t) structures. If it contains
1319 * any elements, the original list of properties is provided in
1320 * @a originalprops, which is a hash of @c svn_string_t values, keyed on the
1323 svn_error_t
*(*file_added
)(svn_wc_adm_access_t
*adm_access
,
1324 svn_wc_notify_state_t
*contentstate
,
1325 svn_wc_notify_state_t
*propstate
,
1327 const char *tmpfile1
,
1328 const char *tmpfile2
,
1331 const char *mimetype1
,
1332 const char *mimetype2
,
1333 const apr_array_header_t
*propchanges
,
1334 apr_hash_t
*originalprops
,
1338 * A file @a path was deleted. The [loss of] contents can be seen by
1339 * comparing @a tmpfile1 and @a tmpfile2. @a originalprops provides
1340 * the properties of the file.
1342 * If known, the @c svn:mime-type value of each file is passed into
1343 * @a mimetype1 and @a mimetype2; either or both of the values can
1344 * be NULL. The implementor can use this information to decide if
1345 * (or how) to generate differences.
1347 svn_error_t
*(*file_deleted
)(svn_wc_adm_access_t
*adm_access
,
1348 svn_wc_notify_state_t
*state
,
1350 const char *tmpfile1
,
1351 const char *tmpfile2
,
1352 const char *mimetype1
,
1353 const char *mimetype2
,
1354 apr_hash_t
*originalprops
,
1358 * A directory @a path was added. @a rev is the revision that the
1359 * directory came from.
1361 svn_error_t
*(*dir_added
)(svn_wc_adm_access_t
*adm_access
,
1362 svn_wc_notify_state_t
*state
,
1368 * A directory @a path was deleted.
1370 svn_error_t
*(*dir_deleted
)(svn_wc_adm_access_t
*adm_access
,
1371 svn_wc_notify_state_t
*state
,
1376 * A list of property changes (@a propchanges) was applied to the
1377 * directory @a path.
1379 * The array is a list of (@c svn_prop_t) structures.
1381 * The original list of properties is provided in @a original_props,
1382 * which is a hash of @c svn_string_t values, keyed on the property
1385 svn_error_t
*(*dir_props_changed
)(svn_wc_adm_access_t
*adm_access
,
1386 svn_wc_notify_state_t
*propstate
,
1388 const apr_array_header_t
*propchanges
,
1389 apr_hash_t
*original_props
,
1393 * A directory @a path has been opened. @a rev is the revision that the
1394 * directory came from.
1397 svn_error_t
*(*dir_opened
)(svn_wc_adm_access_t
*adm_access
,
1403 * A directory @a path has been closed.
1405 * If @a state is non-NULL, set @a *state to the tree-conflict state
1408 * The client may now report the final state of the directory's
1409 * children (e.g., report a path as 'replaced').
1411 svn_error_t
*(*dir_closed
)(svn_wc_adm_access_t
*adm_access
,
1412 svn_wc_notify_state_t
*state
,
1416 } svn_wc_diff_callbacks3_t
;
1419 * Similar to @c svn_wc_diff_callbacks3_t, but without dir_opened or
1420 * dir_closed functions.
1422 * @deprecated Provided for backward compatibility with the 1.2 API.
1424 typedef struct svn_wc_diff_callbacks2_t
1426 /** The same as @c file_changed in @c svn_wc_diff_callbacks3_t. */
1427 svn_error_t
*(*file_changed
)(svn_wc_adm_access_t
*adm_access
,
1428 svn_wc_notify_state_t
*contentstate
,
1429 svn_wc_notify_state_t
*propstate
,
1431 const char *tmpfile1
,
1432 const char *tmpfile2
,
1435 const char *mimetype1
,
1436 const char *mimetype2
,
1437 const apr_array_header_t
*propchanges
,
1438 apr_hash_t
*originalprops
,
1441 /** The same as @c file_added in @c svn_wc_diff_callbacks3_t. */
1442 svn_error_t
*(*file_added
)(svn_wc_adm_access_t
*adm_access
,
1443 svn_wc_notify_state_t
*contentstate
,
1444 svn_wc_notify_state_t
*propstate
,
1446 const char *tmpfile1
,
1447 const char *tmpfile2
,
1450 const char *mimetype1
,
1451 const char *mimetype2
,
1452 const apr_array_header_t
*propchanges
,
1453 apr_hash_t
*originalprops
,
1456 /** The same as @c file_deleted in @c svn_wc_diff_callbacks3_t. */
1457 svn_error_t
*(*file_deleted
)(svn_wc_adm_access_t
*adm_access
,
1458 svn_wc_notify_state_t
*state
,
1460 const char *tmpfile1
,
1461 const char *tmpfile2
,
1462 const char *mimetype1
,
1463 const char *mimetype2
,
1464 apr_hash_t
*originalprops
,
1467 /** The same as @c dir_added in @c svn_wc_diff_callbacks3_t. */
1468 svn_error_t
*(*dir_added
)(svn_wc_adm_access_t
*adm_access
,
1469 svn_wc_notify_state_t
*state
,
1474 /** The same as @c dir_deleted in @c svn_wc_diff_callbacks3_t. */
1475 svn_error_t
*(*dir_deleted
)(svn_wc_adm_access_t
*adm_access
,
1476 svn_wc_notify_state_t
*state
,
1480 /** The same as @c dir_props_changed in @c svn_wc_diff_callbacks3_t. */
1481 svn_error_t
*(*dir_props_changed
)(svn_wc_adm_access_t
*adm_access
,
1482 svn_wc_notify_state_t
*state
,
1484 const apr_array_header_t
*propchanges
,
1485 apr_hash_t
*original_props
,
1488 } svn_wc_diff_callbacks2_t
;
1491 * Similar to @c svn_wc_diff_callbacks2_t, but with file additions/content
1492 * changes and property changes split into different functions.
1494 * @deprecated Provided for backward compatibility with the 1.1 API.
1496 typedef struct svn_wc_diff_callbacks_t
1498 /** Similar to @c file_changed in @c svn_wc_diff_callbacks2_t, but without
1499 * property change information. @a tmpfile2 is never NULL. @a state applies
1500 * to the file contents. */
1501 svn_error_t
*(*file_changed
)(svn_wc_adm_access_t
*adm_access
,
1502 svn_wc_notify_state_t
*state
,
1504 const char *tmpfile1
,
1505 const char *tmpfile2
,
1508 const char *mimetype1
,
1509 const char *mimetype2
,
1512 /** Similar to @c file_added in @c svn_wc_diff_callbacks2_t, but without
1513 * property change information. @a *state applies to the file contents. */
1514 svn_error_t
*(*file_added
)(svn_wc_adm_access_t
*adm_access
,
1515 svn_wc_notify_state_t
*state
,
1517 const char *tmpfile1
,
1518 const char *tmpfile2
,
1521 const char *mimetype1
,
1522 const char *mimetype2
,
1525 /** Similar to @c file_deleted in @c svn_wc_diff_callbacks2_t, but without
1526 * the properties. */
1527 svn_error_t
*(*file_deleted
)(svn_wc_adm_access_t
*adm_access
,
1528 svn_wc_notify_state_t
*state
,
1530 const char *tmpfile1
,
1531 const char *tmpfile2
,
1532 const char *mimetype1
,
1533 const char *mimetype2
,
1536 /** The same as @c dir_added in @c svn_wc_diff_callbacks2_t. */
1537 svn_error_t
*(*dir_added
)(svn_wc_adm_access_t
*adm_access
,
1538 svn_wc_notify_state_t
*state
,
1543 /** The same as @c dir_deleted in @c svn_wc_diff_callbacks2_t. */
1544 svn_error_t
*(*dir_deleted
)(svn_wc_adm_access_t
*adm_access
,
1545 svn_wc_notify_state_t
*state
,
1549 /** Similar to @c dir_props_changed in @c svn_wc_diff_callbacks2_t, but this
1550 * function is called for files as well as directories. */
1551 svn_error_t
*(*props_changed
)(svn_wc_adm_access_t
*adm_access
,
1552 svn_wc_notify_state_t
*state
,
1554 const apr_array_header_t
*propchanges
,
1555 apr_hash_t
*original_props
,
1558 } svn_wc_diff_callbacks_t
;
1561 /* Asking questions about a working copy. */
1563 /** Set @a *wc_format to @a path's working copy format version number if
1564 * @a path is a valid working copy directory, else set it to 0.
1565 * Return error @c APR_ENOENT if @a path does not exist at all.
1568 svn_wc_check_wc(const char *path
,
1573 /** Set @a *has_binary_prop to @c TRUE iff @a path has been marked
1574 * with a property indicating that it is non-text (in other words, binary).
1575 * @a adm_access is an access baton set that contains @a path.
1578 svn_wc_has_binary_prop(svn_boolean_t
*has_binary_prop
,
1580 svn_wc_adm_access_t
*adm_access
,
1584 /* Detecting modification. */
1586 /** Set @a *modified_p to non-zero if @a filename's text is modified
1587 * with regard to the base revision, else set @a *modified_p to zero.
1588 * @a filename is a path to the file, not just a basename. @a adm_access
1589 * must be an access baton for @a filename.
1591 * If @a force_comparison is @c TRUE, this function will not allow
1592 * early return mechanisms that avoid actual content comparison.
1593 * Instead, if there is a text base, a full byte-by-byte comparison
1594 * will be done, and the entry checksum verified as well. (This means
1595 * that if the text base is much longer than the working file, every
1596 * byte of the text base will still be examined.)
1598 * If @a filename does not exist, consider it unmodified. If it exists
1599 * but is not under revision control (not even scheduled for
1600 * addition), return the error @c SVN_ERR_ENTRY_NOT_FOUND.
1602 * If @a filename is unmodified but has a timestamp variation then this
1603 * function may "repair" @a filename's text-time by setting it to
1604 * @a filename's last modification time.
1607 svn_wc_text_modified_p(svn_boolean_t
*modified_p
,
1608 const char *filename
,
1609 svn_boolean_t force_comparison
,
1610 svn_wc_adm_access_t
*adm_access
,
1614 /** Set @a *modified_p to non-zero if @a path's properties are modified
1615 * with regard to the base revision, else set @a modified_p to zero.
1616 * @a adm_access must be an access baton for @a path.
1619 svn_wc_props_modified_p(svn_boolean_t
*modified_p
,
1621 svn_wc_adm_access_t
*adm_access
,
1627 /** Administrative subdir.
1629 * Ideally, this would be completely private to wc internals (in fact,
1630 * it used to be that adm_subdir() in adm_files.c was the only function
1631 * who knew the adm subdir's name). However, import wants to protect
1632 * against importing administrative subdirs, so now the name is a
1633 * matter of public record.
1635 * @deprecated Provided for backward compatibility with the 1.2 API.
1637 #define SVN_WC_ADM_DIR_NAME ".svn"
1641 /* Entries and status. */
1643 /** The schedule states an entry can be in. */
1644 typedef enum svn_wc_schedule_t
1646 /** Nothing special here */
1647 svn_wc_schedule_normal
,
1649 /** Slated for addition */
1650 svn_wc_schedule_add
,
1652 /** Slated for deletion */
1653 svn_wc_schedule_delete
,
1655 /** Slated for replacement (delete + add) */
1656 svn_wc_schedule_replace
1658 } svn_wc_schedule_t
;
1662 * Values for the working_size field in svn_wc_entry_t
1663 * when it isn't set to the actual size value of the unchanged
1666 * @defgroup svn_wc_entry_working_size_constants Working size constants
1671 /** The value of the working size is unknown (hasn't been
1672 * calculated and stored in the past for whatever reason).
1676 #define SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN -1
1680 /** A working copy entry -- that is, revision control information about
1681 * one versioned entity.
1683 typedef struct svn_wc_entry_t
1685 /* IMPORTANT: If you extend this structure, add new fields to the end. */
1687 /* General Attributes */
1692 /** base revision */
1693 svn_revnum_t revision
;
1695 /** url in repository */
1698 /** canonical repository URL or NULL if not known */
1701 /** repository uuid */
1704 /** node kind (file, dir, ...) */
1705 svn_node_kind_t kind
;
1707 /* State information */
1709 /** scheduling (add, delete, replace ...) */
1710 svn_wc_schedule_t schedule
;
1712 /** in a copied state (possibly because the entry is a child of a
1713 path that is @c svn_wc_schedule_add or @c svn_wc_schedule_replace,
1714 when the entry itself is @c svn_wc_schedule_normal) */
1715 svn_boolean_t copied
;
1717 /** deleted, but parent rev lags behind */
1718 svn_boolean_t deleted
;
1720 /** absent -- we know an entry of this name exists, but that's all
1721 (usually this happens because of authz restrictions) */
1722 svn_boolean_t absent
;
1724 /** for THIS_DIR entry, implies whole entries file is incomplete */
1725 svn_boolean_t incomplete
;
1727 /** copyfrom location */
1728 const char *copyfrom_url
;
1730 /** copyfrom revision */
1731 svn_revnum_t copyfrom_rev
;
1733 /** old version of conflicted file */
1734 const char *conflict_old
;
1736 /** new version of conflicted file */
1737 const char *conflict_new
;
1739 /** working version of conflicted file */
1740 const char *conflict_wrk
;
1742 /** property reject file */
1743 const char *prejfile
;
1745 /** last up-to-date time for text contents (0 means no information available)
1747 apr_time_t text_time
;
1749 /** last up-to-date time for properties (0 means no information available) */
1750 apr_time_t prop_time
;
1752 /** Hex MD5 checksum for the untranslated text base file,
1753 * can be @c NULL for backwards compatibility.
1755 const char *checksum
;
1759 /** last revision this was changed */
1760 svn_revnum_t cmt_rev
;
1762 /** last date this was changed */
1763 apr_time_t cmt_date
;
1765 /** last commit author of this item */
1766 const char *cmt_author
;
1768 /** lock token or NULL if path not locked in this WC
1769 * @since New in 1.2.
1771 const char *lock_token
;
1772 /** lock owner, or NULL if not locked in this WC
1773 * @since New in 1.2.
1775 const char *lock_owner
;
1776 /** lock comment or NULL if not locked in this WC or no comment
1777 * @since New in 1.2.
1779 const char *lock_comment
;
1780 /** Lock creation date or 0 if not locked in this WC
1781 * @since New in 1.2.
1783 apr_time_t lock_creation_date
;
1785 /** Whether this entry has any working properties.
1786 * False if this information is not stored in the entry.
1788 * @since New in 1.4. */
1789 svn_boolean_t has_props
;
1791 /** Whether this entry has property modifications.
1793 * @note For working copies in older formats, this flag is not valid.
1795 * @see svn_wc_props_modified_p().
1797 * @since New in 1.4. */
1798 svn_boolean_t has_prop_mods
;
1800 /** A space-separated list of all properties whose presence/absence is cached
1803 * @see @c present_props.
1805 * @since New in 1.4. */
1806 const char *cachable_props
;
1808 /** Cached property existence for this entry.
1809 * This is a space-separated list of property names. If a name exists in
1810 * @c cachable_props but not in this list, this entry does not have that
1811 * property. If a name exists in both lists, the property is present on this
1814 * @since New in 1.4. */
1815 const char *present_props
;
1817 /** which changelist this item is part of, or NULL if not part of any.
1818 * @since New in 1.5.
1820 const char *changelist
;
1822 /** Size of the file after being translated into local
1823 * representation, or @c SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN if
1826 * @since New in 1.5.
1828 apr_off_t working_size
;
1830 /** Whether a local copy of this entry should be kept in the working copy
1831 * after a deletion has been committed, Only valid for the this-dir entry
1832 * when it is scheduled for deletion.
1834 * @since New in 1.5. */
1835 svn_boolean_t keep_local
;
1837 /** The depth of this entry.
1839 * ### It's a bit annoying that we only use this on this_dir
1840 * ### entries, yet it will exist (with value svn_depth_infinity) on
1841 * ### all entries. Maybe some future extensibility would make this
1842 * ### field meaningful on entries besides this_dir.
1844 * @since New in 1.5. */
1847 /* IMPORTANT: If you extend this structure, check the following functions in
1848 * subversion/libsvn_wc/entries.c, to see if you need to extend them as well.
1850 * svn_wc__atts_to_entry()
1851 * svn_wc_entry_dup()
1861 /** How an entries file's owner dir is named in the entries file. */
1862 #define SVN_WC_ENTRY_THIS_DIR ""
1865 /** Set @a *entry to an entry for @a path, allocated in the access baton
1866 * pool. If @a show_hidden is TRUE, return the entry even if it's in
1867 * 'deleted' or 'absent' state. If @a path is not under revision
1868 * control, or if entry is hidden, not scheduled for re-addition,
1869 * and @a show_hidden is @c FALSE, then set @a *entry to @c NULL.
1871 * @a *entry should not be modified, since doing so modifies the entries
1872 * cache in @a adm_access without changing the entries file on disk.
1874 * If @a path is not a directory then @a adm_access must be an access baton
1875 * for the parent directory of @a path. To avoid needing to know whether
1876 * @a path is a directory or not, if @a path is a directory @a adm_access
1877 * can still be an access baton for the parent of @a path so long as the
1878 * access baton for @a path itself is in the same access baton set.
1880 * @a path can be relative or absolute but must share the same base used
1881 * to open @a adm_access.
1883 * Note that it is possible for @a path to be absent from disk but still
1884 * under revision control; and conversely, it is possible for @a path to
1885 * be present, but not under revision control.
1887 * Use @a pool only for local processing.
1890 svn_wc_entry(const svn_wc_entry_t
**entry
,
1892 svn_wc_adm_access_t
*adm_access
,
1893 svn_boolean_t show_hidden
,
1897 /** Parse the `entries' file for @a adm_access and return a hash @a entries,
1898 * whose keys are (<tt>const char *</tt>) entry names and values are
1899 * (<tt>svn_wc_entry_t *</tt>). The hash @a entries, and its keys and
1900 * values, are allocated from the pool used to open the @a adm_access
1901 * baton (that's how the entries caching works). @a pool is used for
1902 * transient allocations.
1904 * Entries that are in a 'deleted' or 'absent' state (and not
1905 * scheduled for re-addition) are not returned in the hash, unless
1906 * @a show_hidden is TRUE.
1909 * The @a entries hash is the entries cache in @a adm_access
1910 * and so usually the hash itself, the keys and the values should be treated
1911 * as read-only. If any of these are modified then it is the caller's
1912 * responsibility to ensure that the entries file on disk is updated. Treat
1913 * the hash values as type (<tt>const svn_wc_entry_t *</tt>) if you wish to
1914 * avoid accidental modification. Modifying the schedule member is a
1915 * particularly bad idea, as the entries writing process relies on having
1916 * access to the original schedule. Use a duplicate entry to modify the
1920 * Only the entry structures representing files and
1921 * @c SVN_WC_ENTRY_THIS_DIR contain complete information. The entry
1922 * structures representing subdirs have only the `kind' and `state'
1923 * fields filled in. If you want info on a subdir, you must use this
1924 * routine to open its @a path and read the @c SVN_WC_ENTRY_THIS_DIR
1925 * structure, or call svn_wc_entry() on its @a path.
1928 svn_wc_entries_read(apr_hash_t
**entries
,
1929 svn_wc_adm_access_t
*adm_access
,
1930 svn_boolean_t show_hidden
,
1934 /** Return a duplicate of @a entry, allocated in @a pool. No part of the new
1935 * entry will be shared with @a entry.
1938 svn_wc_entry_dup(const svn_wc_entry_t
*entry
,
1942 /** Given a @a dir_path under version control, decide if one of its
1943 * entries (@a entry) is in state of conflict; return the answers in
1944 * @a text_conflicted_p and @a prop_conflicted_p.
1946 * (If the entry mentions that a .rej or .prej exist, but they are
1947 * both removed, assume the conflict has been resolved by the user.)
1950 svn_wc_conflicted_p(svn_boolean_t
*text_conflicted_p
,
1951 svn_boolean_t
*prop_conflicted_p
,
1952 const char *dir_path
,
1953 const svn_wc_entry_t
*entry
,
1956 /** Set @a *url and @a *rev to the ancestor URL and revision for @a path,
1957 * allocating in @a pool. @a adm_access must be an access baton for @a path.
1959 * If @a url or @a rev is NULL, then ignore it (just don't return the
1960 * corresponding information).
1963 svn_wc_get_ancestry(char **url
,
1966 svn_wc_adm_access_t
*adm_access
,
1970 /** A callback vtable invoked by the generic entry-walker function.
1971 * @since New in 1.5.
1973 typedef struct svn_wc_entry_callbacks2_t
1975 /** An @a entry was found at @a path. */
1976 svn_error_t
*(*found_entry
)(const char *path
,
1977 const svn_wc_entry_t
*entry
,
1981 /** Handle the error @a err encountered while processing @a path.
1982 * Wrap or squelch @a err as desired, and return an @c svn_error_t
1983 * *, or @c SVN_NO_ERROR.
1985 svn_error_t
*(*handle_error
)(const char *path
,
1990 } svn_wc_entry_callbacks2_t
;
1992 /** @deprecated Provided for backward compatibility with the 1.4 API. */
1993 typedef struct svn_wc_entry_callbacks_t
1995 /** An @a entry was found at @a path. */
1996 svn_error_t
*(*found_entry
)(const char *path
,
1997 const svn_wc_entry_t
*entry
,
2001 } svn_wc_entry_callbacks_t
;
2004 * A generic entry-walker.
2006 * Do a potentially recursive depth-first entry-walk beginning on
2007 * @a path, which can be a file or dir. Call callbacks in
2008 * @a walk_callbacks, passing @a walk_baton to each. Use @a pool for
2009 * looping, recursion, and to allocate all entries returned.
2010 * @a adm_access must be an access baton for @a path.
2012 * If @a depth is @c svn_depth_empty, invoke the callbacks on @a path
2013 * and return without recursing further. If @c svn_depth_files, do
2014 * the same and invoke the callbacks on file children (if any) of
2015 * @a path, then return. If @c svn_depth_immediates, do the preceding
2016 * but also invoke callbacks on immediate subdirectories, then return.
2017 * If @c svn_depth_infinity, recurse fully starting from @a path.
2019 * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
2020 * if the client has cancelled the operation.
2022 * Like our other entries interfaces, entries that are in a 'deleted'
2023 * or 'absent' state (and not scheduled for re-addition) are not
2024 * discovered, unless @a show_hidden is TRUE.
2026 * When a new directory is entered, @c SVN_WC_ENTRY_THIS_DIR will always
2027 * be returned first.
2029 * @note Callers should be aware that each directory will be
2030 * returned *twice*: first as an entry within its parent, and
2031 * subsequently as the '.' entry within itself. The two calls can be
2032 * distinguished by looking for @c SVN_WC_ENTRY_THIS_DIR in the 'name'
2033 * field of the entry.
2035 * @since New in 1.5.
2038 svn_wc_walk_entries3(const char *path
,
2039 svn_wc_adm_access_t
*adm_access
,
2040 const svn_wc_entry_callbacks2_t
2044 svn_boolean_t show_hidden
,
2045 svn_cancel_func_t cancel_func
,
2050 * Similar to svn_wc_walk_entries3(), but without cancellation support
2051 * or error handling from @a walk_callbacks, and with @a depth always
2052 * set to @c svn_depth_infinity.
2054 * @deprecated Provided for backward compatibility with the 1.4 API.
2057 svn_wc_walk_entries2(const char *path
,
2058 svn_wc_adm_access_t
*adm_access
,
2059 const svn_wc_entry_callbacks_t
2062 svn_boolean_t show_hidden
,
2063 svn_cancel_func_t cancel_func
,
2068 * Similar to svn_wc_walk_entries2(), but without cancellation support.
2070 * @deprecated Provided for backward compatibility with the 1.0 API.
2073 svn_wc_walk_entries(const char *path
,
2074 svn_wc_adm_access_t
*adm_access
,
2075 const svn_wc_entry_callbacks_t
2078 svn_boolean_t show_hidden
,
2082 /** Mark missing @a path as 'deleted' in its @a parent's list of entries.
2084 * Return @c SVN_ERR_WC_PATH_FOUND if @a path isn't actually missing.
2087 svn_wc_mark_missing_deleted(const char *path
,
2088 svn_wc_adm_access_t
*parent
,
2092 /** Ensure that an administrative area exists for @a path, so that @a
2093 * path is a working copy subdir based on @a url at @a revision, with
2094 * depth @a depth, and with repository UUID @a uuid and repository
2095 * root URL @a repos.
2097 * @a depth must be a definite depth, it cannot be @c svn_depth_unknown.
2098 * @a uuid and @a repos may be @c NULL. If non-@c NULL, @a repos must
2099 * be a prefix of @a url.
2101 * If the administrative area does not exist, then create it and
2102 * initialize it to an unlocked state.
2104 * If the administrative area already exists then the given @a url
2105 * must match the URL in the administrative area and the given
2106 * @a revision must match the BASE of the working copy dir unless
2107 * the admin directory is scheduled for deletion or the
2108 * SVN_ERR_WC_OBSTRUCTED_UPDATE error will be returned.
2110 * Do not ensure existence of @a path itself; if @a path does not
2111 * exist, return error.
2113 * @since New in 1.5.
2116 svn_wc_ensure_adm3(const char *path
,
2120 svn_revnum_t revision
,
2126 * Similar to svn_wc_ensure_adm3(), but with @a depth set to
2127 * @c svn_depth_infinity.
2129 * @deprecated Provided for backwards compatibility with the 1.4 API.
2131 * @since New in 1.3.
2134 svn_wc_ensure_adm2(const char *path
,
2138 svn_revnum_t revision
,
2143 * Similar to svn_wc_ensure_adm2(), but with @a repos set to @c NULL.
2145 * @deprecated Provided for backwards compatibility with the 1.2 API.
2148 svn_wc_ensure_adm(const char *path
,
2151 svn_revnum_t revision
,
2155 /** Set the repository root URL of @a path to @a repos, if possible.
2157 * @a adm_access must contain @a path and be write-locked, if @a path
2158 * is versioned. Return no error if path is missing or unversioned.
2159 * Use @a pool for temporary allocations.
2161 * @note In some circumstances, the repository root can't be set
2162 * without making the working copy corrupt. In such cases, this
2163 * function just returns no error, without modifying the @a path entry.
2165 * @note This function exists to make it possible to try to set the repository
2166 * root in old working copies; new working copies normally get this set at
2169 * @since New in 1.3.
2172 svn_wc_maybe_set_repos_root(svn_wc_adm_access_t
*adm_access
,
2179 * @defgroup svn_wc_status Working copy status.
2182 * We have two functions for getting working copy status: one function
2183 * for getting the status of exactly one thing, and another for
2184 * getting the statuses of (potentially) multiple things.
2186 * The concept of depth, as explained in the documentation for
2187 * svn_depth_t, may be useful in understanding this. Suppose we're
2188 * getting the status of directory D:
2190 * To offer all three levels, we could have one unified function,
2191 * taking a `depth' parameter. Unfortunately, because this function
2192 * would have to handle multiple return values as well as the single
2193 * return value case, getting the status of just one entity would
2194 * become cumbersome: you'd have to roll through a hash to find one
2197 * So we have svn_wc_status() for depth-empty (just D itself), and
2198 * svn_wc_get_status_editor() for depth-immediates and depth-infinity,
2199 * since the latter two involve multiple return values.
2201 * @note The status structures may contain a @c NULL ->entry field.
2202 * This indicates an item that is not versioned in the working copy.
2205 /** The type of status for the working copy. */
2206 enum svn_wc_status_kind
2208 /** does not exist */
2209 svn_wc_status_none
= 1,
2211 /** is not a versioned thing in this wc */
2212 svn_wc_status_unversioned
,
2214 /** exists, but uninteresting */
2215 svn_wc_status_normal
,
2217 /** is scheduled for addition */
2218 svn_wc_status_added
,
2220 /** under v.c., but is missing */
2221 svn_wc_status_missing
,
2223 /** scheduled for deletion */
2224 svn_wc_status_deleted
,
2226 /** was deleted and then re-added */
2227 svn_wc_status_replaced
,
2229 /** text or props have been modified */
2230 svn_wc_status_modified
,
2232 /** local mods received repos mods */
2233 svn_wc_status_merged
,
2235 /** local mods received conflicting repos mods */
2236 svn_wc_status_conflicted
,
2238 /** is unversioned but configured to be ignored */
2239 svn_wc_status_ignored
,
2241 /** an unversioned resource is in the way of the versioned resource */
2242 svn_wc_status_obstructed
,
2244 /** an unversioned path populated by an svn:externals property */
2245 svn_wc_status_external
,
2247 /** a directory doesn't contain a complete entries list */
2248 svn_wc_status_incomplete
2252 * Structure for holding the "status" of a working copy item.
2254 * The item's entry data is in @a entry, augmented and possibly shadowed
2255 * by the other fields. @a entry is @c NULL if this item is not under
2258 * @note Fields may be added to the end of this structure in future
2259 * versions. Therefore, to preserve binary compatibility, users
2260 * should not directly allocate structures of this type.
2262 * @since New in 1.2.
2264 typedef struct svn_wc_status2_t
2266 /** Can be @c NULL if not under version control. */
2267 svn_wc_entry_t
*entry
;
2269 /** The status of the entries text. */
2270 enum svn_wc_status_kind text_status
;
2272 /** The status of the entries properties. */
2273 enum svn_wc_status_kind prop_status
;
2275 /** a directory can be 'locked' if a working copy update was interrupted. */
2276 svn_boolean_t locked
;
2278 /** a file or directory can be 'copied' if it's scheduled for
2279 * addition-with-history (or part of a subtree that is scheduled as such.).
2281 svn_boolean_t copied
;
2283 /** a file or directory can be 'switched' if the switch command has been
2286 svn_boolean_t switched
;
2288 /** The entry's text status in the repository. */
2289 enum svn_wc_status_kind repos_text_status
;
2291 /** The entry's property status in the repository. */
2292 enum svn_wc_status_kind repos_prop_status
;
2294 /** The entry's lock in the repository, if any. */
2295 svn_lock_t
*repos_lock
;
2297 /** Set to the URI (actual or expected) of the item.
2303 * @defgroup svn_wc_status_ood WC out-of-date info from the repository
2306 * When the working copy item is out-of-date compared to the
2307 * repository, the following fields represent the state of the
2308 * youngest revision of the item in the repository. If the working
2309 * copy is not out of date, the fields are initialized as described
2313 /** Set to the youngest committed revision, or @c SVN_INVALID_REVNUM
2314 * if not out of date.
2317 svn_revnum_t ood_last_cmt_rev
;
2319 /** Set to the most recent commit date, or @c 0 if not out of date.
2322 apr_time_t ood_last_cmt_date
;
2324 /** Set to the node kind of the youngest commit, or @c svn_node_none
2325 * if not out of date.
2328 svn_node_kind_t ood_kind
;
2330 /** Set to the user name of the youngest commit, or @c NULL if not
2331 * out of date or non-existent. Because a non-existent @c
2332 * svn:author property has the same behavior as an out-of-date
2333 * working copy, examine @c ood_last_cmt_rev to determine whether
2334 * the working copy is out of date.
2337 const char *ood_last_cmt_author
;
2341 /* NOTE! Please update svn_wc_dup_status2() when adding new fields here. */
2347 * Same as @c svn_wc_status2_t, but without the svn_lock_t 'repos_lock' field.
2349 * @deprecated Provided for backward compatibility with the 1.1 API.
2351 typedef struct svn_wc_status_t
2353 /** Can be @c NULL if not under version control. */
2354 svn_wc_entry_t
*entry
;
2356 /** The status of the entries text. */
2357 enum svn_wc_status_kind text_status
;
2359 /** The status of the entries properties. */
2360 enum svn_wc_status_kind prop_status
;
2362 /** a directory can be 'locked' if a working copy update was interrupted. */
2363 svn_boolean_t locked
;
2365 /** a file or directory can be 'copied' if it's scheduled for
2366 * addition-with-history (or part of a subtree that is scheduled as such.).
2368 svn_boolean_t copied
;
2370 /** a file or directory can be 'switched' if the switch command has been
2373 svn_boolean_t switched
;
2375 /** The entry's text status in the repository. */
2376 enum svn_wc_status_kind repos_text_status
;
2378 /** The entry's property status in the repository. */
2379 enum svn_wc_status_kind repos_prop_status
;
2386 * Return a deep copy of the @a orig_stat status structure, allocated
2389 * @since New in 1.2.
2392 svn_wc_dup_status2(svn_wc_status2_t
*orig_stat
,
2397 * Same as svn_wc_dup_status2(), but for older svn_wc_status_t structures.
2399 * @deprecated Provided for backward compatibility with the 1.1 API.
2402 svn_wc_dup_status(svn_wc_status_t
*orig_stat
,
2407 * Fill @a *status for @a path, allocating in @a pool.
2408 * @a adm_access must be an access baton for @a path.
2410 * Here are some things to note about the returned structure. A quick
2411 * examination of the @c status->text_status after a successful return of
2412 * this function can reveal the following things:
2414 * - @c svn_wc_status_none : @a path is not versioned, and is either not
2415 * present on disk, or is ignored by svn's
2416 * default ignore regular expressions or the
2417 * svn:ignore property setting for @a path's
2420 * - @c svn_wc_status_missing : @a path is versioned, but is missing from
2423 * - @c svn_wc_status_unversioned : @a path is not versioned, but is
2424 * present on disk and not being
2425 * ignored (see above).
2427 * The other available results for the @c text_status field are more
2428 * straightforward in their meanings. See the comments on the
2429 * @c svn_wc_status_kind structure for some hints.
2431 * @since New in 1.2.
2434 svn_wc_status2(svn_wc_status2_t
**status
,
2436 svn_wc_adm_access_t
*adm_access
,
2441 * Same as svn_wc_status2(), but for older svn_wc_status_t structures.
2443 * @deprecated Provided for backward compatibility with the 1.1 API.
2446 svn_wc_status(svn_wc_status_t
**status
,
2448 svn_wc_adm_access_t
*adm_access
,
2455 * A callback for reporting a @a status about @a path.
2457 * @a baton is a closure object; it should be provided by the
2458 * implementation, and passed by the caller.
2460 * @since New in 1.2.
2462 typedef void (*svn_wc_status_func2_t
)(void *baton
,
2464 svn_wc_status2_t
*status
);
2467 * Same as svn_wc_status_func2_t(), but for older svn_wc_status_t structures.
2469 * @deprecated Provided for backward compatibility with the 1.1 API.
2471 typedef void (*svn_wc_status_func_t
)(void *baton
,
2473 svn_wc_status_t
*status
);
2477 * Set @a *editor and @a *edit_baton to an editor that generates @c
2478 * svn_wc_status2_t structures and sends them through @a status_func /
2479 * @a status_baton. @a anchor is an access baton, with a tree lock,
2480 * for the local path to the working copy which will be used as the
2481 * root of our editor. If @a target is not empty, it represents an
2482 * entry in the @a anchor path which is the subject of the editor
2483 * drive (otherwise, the @a anchor is the subject).
2485 * If @a set_locks_baton is non-@c NULL, it will be set to a baton that can
2486 * be used in a call to the svn_wc_status_set_repos_locks() function.
2488 * Callers drive this editor to describe working copy out-of-dateness
2489 * with respect to the repository. If this information is not
2490 * available or not desired, callers should simply call the
2491 * close_edit() function of the @a editor vtable.
2493 * If the editor driver calls @a editor's set_target_revision() vtable
2494 * function, then when the edit drive is completed, @a *edit_revision
2495 * will contain the revision delivered via that interface.
2497 * Assuming the target is a directory, then:
2499 * - If @a get_all is FALSE, then only locally-modified entries will be
2500 * returned. If TRUE, then all entries will be returned.
2502 * - If @a depth is @c svn_depth_empty, a status structure will
2503 * be returned for the target only; if @c svn_depth_files, for the
2504 * target and its immediate file children; if
2505 * @c svn_depth_immediates, for the target and its immediate
2506 * children; if @c svn_depth_infinity, for the target and
2507 * everything underneath it, fully recursively.
2509 * If @a depth is @c svn_depth_unknown, take depths from the
2510 * working copy and behave as above in each directory's case.
2512 * If the given @a depth is incompatible with the depth found in a
2513 * working copy directory, the found depth always governs.
2515 * If @a no_ignore is set, statuses that would typically be ignored
2516 * will instead be reported.
2518 * @a ignore_patterns is an array of file patterns matching
2519 * unversioned files to ignore for the purposes of status reporting,
2520 * or @c NULL if the default set of ignorable file patterns should be used.
2522 * If @a cancel_func is non-NULL, call it with @a cancel_baton while building
2523 * the @a statushash to determine if the client has cancelled the operation.
2525 * If @a traversal_info is non-NULL, then record pre-update traversal
2526 * state in it. (Caller should obtain @a traversal_info from
2527 * svn_wc_init_traversal_info().)
2529 * Allocate the editor itself in @a pool, but the editor does temporary
2530 * allocations in a subpool of @a pool.
2532 * @since New in 1.5.
2535 svn_wc_get_status_editor3(const svn_delta_editor_t
**editor
,
2537 void **set_locks_baton
,
2538 svn_revnum_t
*edit_revision
,
2539 svn_wc_adm_access_t
*anchor
,
2542 svn_boolean_t get_all
,
2543 svn_boolean_t no_ignore
,
2544 apr_array_header_t
*ignore_patterns
,
2545 svn_wc_status_func2_t status_func
,
2547 svn_cancel_func_t cancel_func
,
2549 svn_wc_traversal_info_t
*traversal_info
,
2553 * Like svn_wc_get_status_editor3(), but with @a ignore_patterns
2554 * provided from the corresponding value in @a config, and @a recurse
2555 * instead of @a depth. If @a recurse is TRUE, behave as if for @c
2556 * svn_depth_infinity; else if @a recurse is FALSE, behave as if for
2557 * @c svn_depth_immediates.
2559 * @since New in 1.2.
2560 * @deprecated Provided for backward compatibility with the 1.4 API.
2563 svn_wc_get_status_editor2(const svn_delta_editor_t
**editor
,
2565 void **set_locks_baton
,
2566 svn_revnum_t
*edit_revision
,
2567 svn_wc_adm_access_t
*anchor
,
2570 svn_boolean_t recurse
,
2571 svn_boolean_t get_all
,
2572 svn_boolean_t no_ignore
,
2573 svn_wc_status_func2_t status_func
,
2575 svn_cancel_func_t cancel_func
,
2577 svn_wc_traversal_info_t
*traversal_info
,
2581 * Same as svn_wc_get_status_editor2(), but with @a set_locks_baton set
2582 * to @c NULL, and taking a deprecated svn_wc_status_func_t argument.
2584 * @deprecated Provided for backward compatibility with the 1.1 API.
2587 svn_wc_get_status_editor(const svn_delta_editor_t
**editor
,
2589 svn_revnum_t
*edit_revision
,
2590 svn_wc_adm_access_t
*anchor
,
2593 svn_boolean_t recurse
,
2594 svn_boolean_t get_all
,
2595 svn_boolean_t no_ignore
,
2596 svn_wc_status_func_t status_func
,
2598 svn_cancel_func_t cancel_func
,
2600 svn_wc_traversal_info_t
*traversal_info
,
2605 * Associate @a locks, a hash table mapping <tt>const char*</tt>
2606 * absolute repository paths to <tt>svn_lock_t</tt> objects, with a
2607 * @a set_locks_baton returned by an earlier call to
2608 * svn_wc_get_status_editor3(). @a repos_root is the repository root URL.
2609 * Perform all allocations in @a pool.
2611 * @note @a locks will not be copied, so it must be valid throughout the
2612 * edit. @a pool must also not be destroyed or cleared before the edit is
2615 * @since New in 1.2.
2618 svn_wc_status_set_repos_locks(void *set_locks_baton
,
2620 const char *repos_root
,
2627 * Copy @a src to @a dst_basename in @a dst_parent, and schedule
2628 * @a dst_basename for addition to the repository, remembering the copy
2631 * @a src must be a file or directory under version control; @a dst_parent
2632 * must be a directory under version control in the same working copy;
2633 * @a dst_basename will be the name of the copied item, and it must not
2636 * If @a cancel_func is non-NULL, call it with @a cancel_baton at
2637 * various points during the operation. If it returns an error
2638 * (typically @c SVN_ERR_CANCELLED), return that error immediately.
2640 * For each file or directory copied, @a notify_func will be called
2641 * with its path and the @a notify_baton. @a notify_func may be @c NULL
2642 * if you are not interested in this information.
2645 * This is a variant of svn_wc_add(). No changes will happen
2646 * to the repository until a commit occurs. This scheduling can be
2647 * removed with svn_client_revert2().
2649 * @since New in 1.2.
2652 svn_wc_copy2(const char *src
,
2653 svn_wc_adm_access_t
*dst_parent
,
2654 const char *dst_basename
,
2655 svn_cancel_func_t cancel_func
,
2657 svn_wc_notify_func2_t notify_func
,
2662 * Similar to svn_wc_copy2(), but takes an @c svn_wc_notify_func_t instead.
2664 * @deprecated Provided for backward compatibility with the 1.1 API.
2667 svn_wc_copy(const char *src
,
2668 svn_wc_adm_access_t
*dst_parent
,
2669 const char *dst_basename
,
2670 svn_cancel_func_t cancel_func
,
2672 svn_wc_notify_func_t notify_func
,
2677 * Schedule @a path for deletion, it will be deleted from the repository on
2678 * the next commit. If @a path refers to a directory, then a recursive
2679 * deletion will occur. @a adm_access must hold a write lock for the parent
2682 * If @a keep_local is FALSE, this function immediately deletes all files,
2683 * modified and unmodified, versioned and unversioned from the working copy.
2684 * It also immediately deletes unversioned directories and directories that
2685 * are scheduled to be added. Only versioned directories will remain in the
2686 * working copy, these get deleted by the update following the commit.
2688 * If @a keep_local is TRUE, all files and directories will be kept in the
2689 * working copy (and will become unversioned on the next commit).
2691 * If @a cancel_func is non-NULL, call it with @a cancel_baton at
2692 * various points during the operation. If it returns an error
2693 * (typically @c SVN_ERR_CANCELLED), return that error immediately.
2695 * For each path marked for deletion, @a notify_func will be called with
2696 * the @a notify_baton and that path. The @a notify_func callback may be
2697 * @c NULL if notification is not needed.
2699 * @since New in 1.5.
2702 svn_wc_delete3(const char *path
,
2703 svn_wc_adm_access_t
*adm_access
,
2704 svn_cancel_func_t cancel_func
,
2706 svn_wc_notify_func2_t notify_func
,
2708 svn_boolean_t keep_local
,
2712 * Similar to svn_wc_delete3(), but with @a keep_local always set to FALSE.
2714 * @deprecated Provided for backward compatibility with the 1.4 API.
2717 svn_wc_delete2(const char *path
,
2718 svn_wc_adm_access_t
*adm_access
,
2719 svn_cancel_func_t cancel_func
,
2721 svn_wc_notify_func2_t notify_func
,
2726 * Similar to svn_wc_delete2(), but takes an @c svn_wc_notify_func_t instead.
2728 * @deprecated Provided for backward compatibility with the 1.1 API.
2731 svn_wc_delete(const char *path
,
2732 svn_wc_adm_access_t
*adm_access
,
2733 svn_cancel_func_t cancel_func
,
2735 svn_wc_notify_func_t notify_func
,
2741 * Put @a path under version control by adding an entry in its parent,
2742 * and, if @a path is a directory, adding an administrative area. The
2743 * new entry and anything under it is scheduled for addition to the
2744 * repository. @a parent_access should hold a write lock for the parent
2745 * directory of @a path. If @a path is a directory then an access baton
2746 * for @a path will be added to the set containing @a parent_access.
2748 * If @a path does not exist, return @c SVN_ERR_WC_PATH_NOT_FOUND.
2750 * If @a copyfrom_url is non-NULL, it and @a copyfrom_rev are used as
2751 * `copyfrom' args. This is for copy operations, where one wants
2752 * to schedule @a path for addition with a particular history.
2754 * If @a cancel_func is non-NULL, call it with @a cancel_baton at
2755 * various points during the operation. If it returns an error
2756 * (typically @c SVN_ERR_CANCELLED), return that error immediately.
2758 * When the @a path has been added, then @a notify_func will be called
2759 * (if it is not @c NULL) with the @a notify_baton and the path.
2761 * Return @c SVN_ERR_WC_NODE_KIND_CHANGE if @a path is both an unversioned
2762 * directory and a file that is scheduled for deletion or in state deleted.
2764 *<pre> ### This function currently does double duty -- it is also
2765 * ### responsible for "switching" a working copy directory over to a
2766 * ### new copyfrom ancestry and scheduling it for addition. Here is
2767 * ### the old doc string from Ben, lightly edited to bring it
2768 * ### up-to-date, explaining the TRUE, secret life of this function:</pre>
2770 * Given a @a path within a working copy of type KIND, follow this algorithm:
2772 * - if @a path is not under version control:
2773 * - Place it under version control and schedule for addition;
2774 * if @a copyfrom_url is non-NULL, use it and @a copyfrom_rev as
2775 * 'copyfrom' history
2777 * - if @a path is already under version control:
2778 * (This can only happen when a directory is copied, in which
2779 * case ancestry must have been supplied as well.)
2781 * - Schedule the directory itself for addition with copyfrom history.
2782 * - Mark all its children with a 'copied' flag
2783 * - Rewrite all the URLs to what they will be after a commit.
2784 * - ### @todo Remove old wcprops too, see the '###' below.
2786 *<pre> ### I think possibly the "switchover" functionality should be
2787 * ### broken out into a separate function, but its all intertwined in
2788 * ### the code right now. Ben, thoughts? Hard? Easy? Mauve?</pre>
2790 * ### Update: see "###" comment in svn_wc_add_repos_file()'s doc
2791 * string about this.
2793 * @since New in 1.2.
2796 svn_wc_add2(const char *path
,
2797 svn_wc_adm_access_t
*parent_access
,
2798 const char *copyfrom_url
,
2799 svn_revnum_t copyfrom_rev
,
2800 svn_cancel_func_t cancel_func
,
2802 svn_wc_notify_func2_t notify_func
,
2807 * Similar to svn_wc_add2(), but takes an @c svn_wc_notify_func_t instead.
2809 * @deprecated Provided for backward compatibility with the 1.1 API.
2812 svn_wc_add(const char *path
,
2813 svn_wc_adm_access_t
*parent_access
,
2814 const char *copyfrom_url
,
2815 svn_revnum_t copyfrom_rev
,
2816 svn_cancel_func_t cancel_func
,
2818 svn_wc_notify_func_t notify_func
,
2822 /** Add a file to a working copy at @a dst_path, obtaining the text-base's
2823 * contents from @a new_text_base_path, the wc file's content from
2824 * @a new_text_path, its base properties from @a new_base_props and
2825 * wc properties from @a new_props.
2826 * The base text and props normally come from the repository file
2827 * represented by the copyfrom args, see below. The new file will
2828 * be scheduled for addition with history.
2830 * Automatically remove @a new_text_base_path and @a new_text_path
2831 * upon successful completion.
2833 * @a new_text_path and @a new_props may be NULL, in which case
2834 * the working copy text and props are taken from the base files with
2835 * appropriate translation of the file's content.
2837 * @a adm_access, or an access baton in its associated set, must
2838 * contain a write lock for the parent of @a dst_path.
2840 * If @a copyfrom_url is non-NULL, then @a copyfrom_rev must be a
2841 * valid revision number, and together they are the copyfrom history
2844 * Use @a pool for temporary allocations.
2846 * ### This function is very redundant with svn_wc_add(). Ideally,
2847 * we'd merge them, so that svn_wc_add() would just take optional
2848 * new_props and optional copyfrom information. That way it could be
2849 * used for both 'svn add somefilesittingonmydisk' and for adding
2850 * files from repositories, with or without copyfrom history.
2852 * The problem with this Ideal Plan is that svn_wc_add() also takes
2853 * care of recursive URL-rewriting. There's a whole comment in its
2854 * doc string about how that's really weird, outside its core mission,
2855 * etc, etc. So another part of the Ideal Plan is that that
2856 * functionality of svn_wc_add() would move into a separate function.
2861 svn_wc_add_repos_file2(const char *dst_path
,
2862 svn_wc_adm_access_t
*adm_access
,
2863 const char *new_text_base_path
,
2864 const char *new_text_path
,
2865 apr_hash_t
*new_base_props
,
2866 apr_hash_t
*new_props
,
2867 const char *copyfrom_url
,
2868 svn_revnum_t copyfrom_rev
,
2871 /** Same as svn_wc_add_repos_file2(), except that it doesn't have the
2872 * new_text_base_path and new_base_props arguments.
2874 * @deprecated Provided for compatibility with the 1.3 API
2879 svn_wc_add_repos_file(const char *dst_path
,
2880 svn_wc_adm_access_t
*adm_access
,
2881 const char *new_text_path
,
2882 apr_hash_t
*new_props
,
2883 const char *copyfrom_url
,
2884 svn_revnum_t copyfrom_rev
,
2888 /** Remove entry @a name in @a adm_access from revision control. @a name
2889 * must be either a file or @c SVN_WC_ENTRY_THIS_DIR. @a adm_access must
2890 * hold a write lock.
2892 * If @a name is a file, all its info will be removed from @a adm_access's
2893 * administrative directory. If @a name is @c SVN_WC_ENTRY_THIS_DIR, then
2894 * @a adm_access's entire administrative area will be deleted, along with
2895 * *all* the administrative areas anywhere in the tree below @a adm_access.
2897 * Normally, only administrative data is removed. However, if
2898 * @a destroy_wf is TRUE, then all working file(s) and dirs are deleted
2899 * from disk as well. When called with @a destroy_wf, any locally
2900 * modified files will *not* be deleted, and the special error
2901 * @c SVN_ERR_WC_LEFT_LOCAL_MOD might be returned. (Callers only need to
2902 * check for this special return value if @a destroy_wf is TRUE.)
2904 * If @a instant_error is TRUE, then return @c
2905 * SVN_ERR_WC_LEFT_LOCAL_MOD the instant a locally modified file is
2906 * encountered. Otherwise, leave locally modified files in place and
2907 * return the error only after all the recursion is complete.
2909 * If @a cancel_func is non-NULL, call it with @a cancel_baton at
2910 * various points during the removal. If it returns an error
2911 * (typically @c SVN_ERR_CANCELLED), return that error immediately.
2913 * WARNING: This routine is exported for careful, measured use by
2914 * libsvn_client. Do *not* call this routine unless you really
2915 * understand what the heck you're doing.
2918 svn_wc_remove_from_revision_control(svn_wc_adm_access_t
*adm_access
,
2920 svn_boolean_t destroy_wf
,
2921 svn_boolean_t instant_error
,
2922 svn_cancel_func_t cancel_func
,
2928 * Assuming @a path is under version control and in a state of conflict,
2929 * then take @a path *out* of this state. If @a resolve_text is TRUE then
2930 * any text conflict is resolved, if @a resolve_props is TRUE then any
2931 * property conflicts are resolved.
2933 * If @a depth is @c svn_depth_empty, act only on @a path; if
2934 * @c svn_depth_files, resolve @a path and its conflicted file
2935 * children (if any); if @c svn_depth_immediates, resolve @a path and
2936 * all its immediate conflicted children (both files and directories,
2937 * if any); if @c svn_depth_infinity, resolve @a path and every
2938 * conflicted file or directory anywhere beneath it.
2940 * If @a conflict_choice is @c svn_wc_conflict_choose_base, resolve the
2941 * conflict with the old file contents; if
2942 * @c svn_wc_conflict_choose_mine_full, use the original working contents;
2943 * if @c svn_wc_conflict_choose_theirs_full, the new contents; and if
2944 * @c svn_wc_conflict_choose_merged, don't change the contents at all,
2945 * just remove the conflict status, which is the pre-1.5 behavior.
2947 * (@c svn_wc_conflict_choose_theirs_conflict and
2948 * @c svn_wc_conflict_choose_mine_conflict are not yet implemented;
2949 * the effect of passing one of those values as @a conflict_choice is
2950 * currently undefined, which may or may not be an underhanded way of
2951 * allowing real behaviors to be added for them later without revving
2954 * @a adm_access is an access baton, with a write lock, for @a path.
2956 * Needless to say, this function doesn't touch conflict markers or
2957 * anything of that sort -- only a human can semantically resolve a
2958 * conflict. Instead, this function simply marks a file as "having
2959 * been resolved", clearing the way for a commit.
2961 * The implementation details are opaque, as our "conflicted" criteria
2962 * might change over time. (At the moment, this routine removes the
2963 * three fulltext 'backup' files and any .prej file created in a conflict,
2964 * and modifies @a path's entry.)
2966 * If @a path is not under version control, return @c SVN_ERR_ENTRY_NOT_FOUND.
2967 * If @a path isn't in a state of conflict to begin with, do nothing, and
2968 * return @c SVN_NO_ERROR.
2970 * If @c path was successfully taken out of a state of conflict, report this
2971 * information to @c notify_func (if non-@c NULL.) If only text or only
2972 * property conflict resolution was requested, and it was successful, then
2973 * success gets reported.
2975 * @since New in 1.5.
2978 svn_wc_resolved_conflict3(const char *path
,
2979 svn_wc_adm_access_t
*adm_access
,
2980 svn_boolean_t resolve_text
,
2981 svn_boolean_t resolve_props
,
2983 svn_wc_conflict_choice_t conflict_choice
,
2984 svn_wc_notify_func2_t notify_func
,
2986 svn_cancel_func_t cancel_func
,
2992 * Similar to svn_wc_resolved_conflict3(), but without automatic conflict
2993 * resolution support, and with @a depth set according to @a recurse:
2994 * if @a recurse is TRUE, @a depth is @c svn_depth_infinity, else it is
2995 * @c svn_depth_files.
2997 * @deprecated Provided for backward compatibility with the 1.4 API.
3000 svn_wc_resolved_conflict2(const char *path
,
3001 svn_wc_adm_access_t
*adm_access
,
3002 svn_boolean_t resolve_text
,
3003 svn_boolean_t resolve_props
,
3004 svn_boolean_t recurse
,
3005 svn_wc_notify_func2_t notify_func
,
3007 svn_cancel_func_t cancel_func
,
3012 * Similar to svn_wc_resolved_conflict2(), but takes an
3013 * svn_wc_notify_func_t and doesn't have cancellation support.
3015 * @deprecated Provided for backward compatibility with the 1.0 API.
3018 svn_wc_resolved_conflict(const char *path
,
3019 svn_wc_adm_access_t
*adm_access
,
3020 svn_boolean_t resolve_text
,
3021 svn_boolean_t resolve_props
,
3022 svn_boolean_t recurse
,
3023 svn_wc_notify_func_t notify_func
,
3032 * Storage type for queued post-commit data.
3034 * @since New in 1.5.
3036 typedef struct svn_wc_committed_queue_t svn_wc_committed_queue_t
;
3040 * Create a queue for use with svn_wc_queue_committed() and
3041 * svn_wc_process_committed_queue().
3043 * The returned queue and all further
3044 * allocations required for queueing new items will also be done
3047 * @since New in 1.5.
3049 svn_wc_committed_queue_t
*
3050 svn_wc_committed_queue_create(apr_pool_t
*pool
);
3055 * Queue committed items to be processed later by
3056 * svn_wc_process_committed_queue().
3058 * The first time this function is called, @a *queue should
3059 * be @c NULL to signal that initialization is required.
3061 * All pointer data passed to this function
3062 * (@a path, @a adm_access, @a wcprop_changes
3063 * and @a digest) should remain valid until the queue has been
3064 * processed by svn_wc_process_committed_queue().
3066 * The parameters have the same meaning as those
3067 * for svn_wc_process_committed4().
3069 * @since New in 1.5.
3072 svn_wc_queue_committed(svn_wc_committed_queue_t
**queue
,
3074 svn_wc_adm_access_t
*adm_access
,
3075 svn_boolean_t recurse
,
3076 apr_array_header_t
*wcprop_changes
,
3077 svn_boolean_t remove_lock
,
3078 svn_boolean_t remove_changelist
,
3079 const unsigned char *digest
,
3084 * Like svn_wc_process_committed4(), but batch processes
3085 * items queued with svn_wc_queue_committed().
3087 * @since New in 1.5.
3090 svn_wc_process_committed_queue(svn_wc_committed_queue_t
*queue
,
3091 svn_wc_adm_access_t
*adm_access
,
3092 svn_revnum_t new_revnum
,
3093 const char *rev_date
,
3094 const char *rev_author
,
3099 * Bump a successfully committed absolute @a path to @a new_revnum after a
3100 * commit succeeds. @a rev_date and @a rev_author are the (server-side)
3101 * date and author of the new revision; one or both may be @c NULL.
3102 * @a adm_access must hold a write lock appropriate for @a path.
3104 * If non-NULL, @a wcprop_changes is an array of <tt>svn_prop_t *</tt>
3105 * changes to wc properties; if an @c svn_prop_t->value is NULL, then
3106 * that property is deleted.
3108 * If @a remove_lock is @c TRUE, any entryprops related to a repository
3109 * lock will be removed.
3111 * If @a remove_changelist is @c TRUE, any association with a
3112 * changelist will be removed.
3114 * If @a path is a member of a changelist, remove that association.
3116 * If @a path is a file and @a digest is non-NULL, use @a digest as
3117 * the checksum for the new text base. Else, calculate the checksum
3120 * If @a recurse is TRUE and @a path is a directory, then bump every
3121 * versioned object at or under @a path. This is usually done for
3124 * @since New in 1.5.
3127 svn_wc_process_committed4(const char *path
,
3128 svn_wc_adm_access_t
*adm_access
,
3129 svn_boolean_t recurse
,
3130 svn_revnum_t new_revnum
,
3131 const char *rev_date
,
3132 const char *rev_author
,
3133 apr_array_header_t
*wcprop_changes
,
3134 svn_boolean_t remove_lock
,
3135 svn_boolean_t remove_changelist
,
3136 const unsigned char *digest
,
3139 /** Similar to svn_wc_process_committed4(), but with @a
3140 * remove_changelist set to FALSE.
3142 * @since New in 1.4.
3144 * @deprecated Provided for backwards compatibility with the 1.4 API.
3147 svn_wc_process_committed3(const char *path
,
3148 svn_wc_adm_access_t
*adm_access
,
3149 svn_boolean_t recurse
,
3150 svn_revnum_t new_revnum
,
3151 const char *rev_date
,
3152 const char *rev_author
,
3153 apr_array_header_t
*wcprop_changes
,
3154 svn_boolean_t remove_lock
,
3155 const unsigned char *digest
,
3158 /** Similar to svn_wc_process_committed3(), but with @a digest set to
3161 * @since New in 1.2.
3163 * @deprecated Provided for backwards compatibility with the 1.3 API.
3166 svn_wc_process_committed2(const char *path
,
3167 svn_wc_adm_access_t
*adm_access
,
3168 svn_boolean_t recurse
,
3169 svn_revnum_t new_revnum
,
3170 const char *rev_date
,
3171 const char *rev_author
,
3172 apr_array_header_t
*wcprop_changes
,
3173 svn_boolean_t remove_lock
,
3177 * Similar to svn_wc_process_committed2(), but with @a remove_lock set to
3180 * @deprecated Provided for backward compatibility with the 1.1 API.
3183 svn_wc_process_committed(const char *path
,
3184 svn_wc_adm_access_t
*adm_access
,
3185 svn_boolean_t recurse
,
3186 svn_revnum_t new_revnum
,
3187 const char *rev_date
,
3188 const char *rev_author
,
3189 apr_array_header_t
*wcprop_changes
,
3197 * Do a depth-first crawl in a working copy, beginning at @a path.
3199 * Communicate the `state' of the working copy's revisions and depths
3200 * to @a reporter/@a report_baton. Obviously, if @a path is a file
3201 * instead of a directory, this depth-first crawl will be a short one.
3203 * No locks are or logs are created, nor are any animals harmed in the
3204 * process. No cleanup is necessary. @a adm_access must be an access
3205 * baton for the @a path hierarchy, it does not require a write lock.
3207 * After all revisions are reported, @a reporter->finish_report() is
3208 * called, which immediately causes the RA layer to update the working
3209 * copy. Thus the return value may very well reflect the result of
3212 * If @a depth is @c svn_depth_empty, then report state only for
3213 * @a path itself. If @c svn_depth_files, do the same and include
3214 * immediate file children of @a path. If @c svn_depth_immediates,
3215 * then behave as if for @c svn_depth_files but also report the
3216 * property states of immediate subdirectories. If @a depth is
3217 * @c svn_depth_infinity, then report state fully recursively. All
3218 * descents are only as deep as @a path's own depth permits, of
3219 * course. If @a depth is @c svn_depth_unknown, then just use
3220 * @c svn_depth_infinity, which in practice means depth of @a path.
3222 * Iff @a depth_compatibility_trick is TRUE, then set the @c start_empty
3223 * flag on @a reporter->set_path() and @a reporter->link_path() calls
3224 * as necessary to trick a pre-1.5 (i.e., depth-unaware) server into
3225 * sending back all the items the client might need to upgrade a
3226 * working copy from a shallower depth to a deeper one.
3228 * If @a restore_files is TRUE, then unexpectedly missing working files
3229 * will be restored from the administrative directory's cache. For each
3230 * file restored, the @a notify_func function will be called with the
3231 * @a notify_baton and the path of the restored file. @a notify_func may
3232 * be @c NULL if this notification is not required. If @a
3233 * use_commit_times is TRUE, then set restored files' timestamps to
3234 * their last-commit-times.
3236 * If @a traversal_info is non-NULL, then record pre-update traversal
3237 * state in it. (Caller should obtain @a traversal_info from
3238 * svn_wc_init_traversal_info().)
3240 * @since New in 1.5.
3243 svn_wc_crawl_revisions3(const char *path
,
3244 svn_wc_adm_access_t
*adm_access
,
3245 const svn_ra_reporter3_t
*reporter
,
3247 svn_boolean_t restore_files
,
3249 svn_boolean_t depth_compatibility_trick
,
3250 svn_boolean_t use_commit_times
,
3251 svn_wc_notify_func2_t notify_func
,
3253 svn_wc_traversal_info_t
*traversal_info
,
3257 * Similar to svn_wc_crawl_revisions3, but taking svn_ra_reporter2_t
3258 * instead of svn_ra_reporter3_t, and therefore only able to report @c
3259 * svn_depth_infinity for depths; and taking @a recurse instead of @a
3260 * depth; and with @a depth_compatibility_trick always false.
3262 * @deprecated Provided for compatibility with the 1.4 API.
3265 svn_wc_crawl_revisions2(const char *path
,
3266 svn_wc_adm_access_t
*adm_access
,
3267 const svn_ra_reporter2_t
*reporter
,
3269 svn_boolean_t restore_files
,
3270 svn_boolean_t recurse
,
3271 svn_boolean_t use_commit_times
,
3272 svn_wc_notify_func2_t notify_func
,
3274 svn_wc_traversal_info_t
*traversal_info
,
3278 * Similar to svn_wc_crawl_revisions2(), but takes an svn_wc_notify_func_t
3279 * and a @c svn_reporter_t instead.
3281 * @deprecated Provided for backward compatibility with the 1.1 API.
3284 svn_wc_crawl_revisions(const char *path
,
3285 svn_wc_adm_access_t
*adm_access
,
3286 const svn_ra_reporter_t
*reporter
,
3288 svn_boolean_t restore_files
,
3289 svn_boolean_t recurse
,
3290 svn_boolean_t use_commit_times
,
3291 svn_wc_notify_func_t notify_func
,
3293 svn_wc_traversal_info_t
*traversal_info
,
3299 /** Set @a *wc_root to @c TRUE if @a path represents a "working copy root",
3300 * @c FALSE otherwise. Use @a pool for any intermediate allocations.
3302 * If @a path is not found, return the error @c SVN_ERR_ENTRY_NOT_FOUND.
3304 * @note Due to the way in which "WC-root-ness" is calculated, passing
3305 * a @a path of `.' to this function will always return @c TRUE.
3308 svn_wc_is_wc_root(svn_boolean_t
*wc_root
,
3310 svn_wc_adm_access_t
*adm_access
,
3314 /** Conditionally split @a path into an @a anchor and @a target for the
3315 * purpose of updating and committing.
3317 * @a anchor is the directory at which the update or commit editor
3320 * @a target is the actual subject (relative to the @a anchor) of the
3321 * update/commit, or "" if the @a anchor itself is the subject.
3323 * Allocate @a anchor and @a target in @a pool.
3326 svn_wc_get_actual_target(const char *path
,
3327 const char **anchor
,
3328 const char **target
,
3333 /* Update and update-like functionality. */
3336 * Set @a *editor and @a *edit_baton to an editor and baton for updating a
3339 * If @a ti is non-NULL, record traversal info in @a ti, for use by
3340 * post-traversal accessors such as svn_wc_edited_externals().
3342 * @a anchor is an access baton, with a write lock, for the local path to the
3343 * working copy which will be used as the root of our editor. Further
3344 * locks will be acquired if the update creates new directories. All
3345 * locks, both those in @a anchor and newly acquired ones, will be released
3346 * when the editor driver calls @c close_edit.
3348 * @a target is the entry in @a anchor that will actually be updated, or
3349 * empty if all of @a anchor should be updated.
3351 * The editor invokes @a notify_func with @a notify_baton as the update
3352 * progresses, if @a notify_func is non-NULL.
3354 * If @a cancel_func is non-NULL, the editor will invoke @a cancel_func with
3355 * @a cancel_baton as the update progresses to see if it should continue.
3357 * If @a conflict_func is non-NULL, then invoke it with @a
3358 * conflict_baton whenever a conflict is encountered, giving the
3359 * callback a chance to resolve the conflict before the editor takes
3360 * more drastic measures (such as marking a file conflicted, or
3361 * bailing out of the update).
3363 * If @a fetch_func is non-NULL, then use it (with @a fetch_baton) as
3364 * a fallback for retrieving repository files whenever 'copyfrom' args
3365 * are sent into editor->add_file().
3367 * If @a diff3_cmd is non-NULL, then use it as the diff3 command for
3368 * any merging; otherwise, use the built-in merge code.
3370 * @a preserved_exts is an array of filename patterns which, when
3371 * matched against the extensions of versioned files, determine for
3372 * which such files any related generated conflict files will preserve
3373 * the original file's extension as their own. If a file's extension
3374 * does not match any of the patterns in @a preserved_exts (which is
3375 * certainly the case if @a preserved_exts is @c NULL or empty),
3376 * generated conflict files will carry Subversion's custom extensions.
3378 * @a target_revision is a pointer to a revision location which, after
3379 * successful completion of the drive of this editor, will be
3380 * populated with the revision to which the working copy was updated.
3382 * If @a use_commit_times is TRUE, then all edited/added files will
3383 * have their working timestamp set to the last-committed-time. If
3384 * FALSE, the working files will be touched with the 'now' time.
3386 * If @a allow_unver_obstructions is TRUE, then allow unversioned
3387 * obstructions when adding a path.
3389 * If @a depth is @c svn_depth_infinity, update fully recursively.
3390 * Else if it is @c svn_depth_immediates, update the uppermost
3391 * directory, its file entries, and the presence or absence of
3392 * subdirectories (but do not descend into the subdirectories).
3393 * Else if it is @c svn_depth_files, update the uppermost directory
3394 * and its immediate file entries, but not subdirectories.
3395 * Else if it is @c svn_depth_empty, update exactly the uppermost
3396 * target, and don't touch its entries.
3398 * If @a depth_is_sticky is set and @a depth is not @c
3399 * svn_depth_unknown, then in addition to updating PATHS, also set
3400 * their sticky ambient depth value to @a depth.
3402 * @since New in 1.5.
3405 svn_wc_get_update_editor3(svn_revnum_t
*target_revision
,
3406 svn_wc_adm_access_t
*anchor
,
3408 svn_boolean_t use_commit_times
,
3410 svn_boolean_t depth_is_sticky
,
3411 svn_boolean_t allow_unver_obstructions
,
3412 svn_wc_notify_func2_t notify_func
,
3414 svn_cancel_func_t cancel_func
,
3416 svn_wc_conflict_resolver_func_t conflict_func
,
3417 void *conflict_baton
,
3418 svn_wc_get_file_t fetch_func
,
3420 const char *diff3_cmd
,
3421 apr_array_header_t
*preserved_exts
,
3422 const svn_delta_editor_t
**editor
,
3424 svn_wc_traversal_info_t
*ti
,
3429 * Similar to svn_wc_get_update_editor3() but with the @a
3430 * allow_unver_obstructions parameter always set to FALSE, @a
3431 * conflict_func and baton set to NULL, @a fetch_func and baton set to
3432 * NULL, @a preserved_exts set to NULL, @a depth_is_sticky set to
3433 * FALSE, and @a depth set according to @a recurse: if @a recurse is
3434 * TRUE, pass @c svn_depth_infinity, if FALSE, pass @c
3437 * @deprecated Provided for backward compatibility with the 1.4 API.
3440 svn_wc_get_update_editor2(svn_revnum_t
*target_revision
,
3441 svn_wc_adm_access_t
*anchor
,
3443 svn_boolean_t use_commit_times
,
3444 svn_boolean_t recurse
,
3445 svn_wc_notify_func2_t notify_func
,
3447 svn_cancel_func_t cancel_func
,
3449 const char *diff3_cmd
,
3450 const svn_delta_editor_t
**editor
,
3452 svn_wc_traversal_info_t
*ti
,
3456 * Similar to svn_wc_get_update_editor2(), but takes an svn_wc_notify_func_t
3459 * @deprecated Provided for backward compatibility with the 1.1 API.
3462 svn_wc_get_update_editor(svn_revnum_t
*target_revision
,
3463 svn_wc_adm_access_t
*anchor
,
3465 svn_boolean_t use_commit_times
,
3466 svn_boolean_t recurse
,
3467 svn_wc_notify_func_t notify_func
,
3469 svn_cancel_func_t cancel_func
,
3471 const char *diff3_cmd
,
3472 const svn_delta_editor_t
**editor
,
3474 svn_wc_traversal_info_t
*ti
,
3478 * A variant of svn_wc_get_update_editor().
3480 * Set @a *editor and @a *edit_baton to an editor and baton for "switching"
3481 * a working copy to a new @a switch_url. (Right now, this URL must be
3482 * within the same repository that the working copy already comes
3483 * from.) @a switch_url must not be @c NULL.
3485 * If @a ti is non-NULL, record traversal info in @a ti, for use by
3486 * post-traversal accessors such as svn_wc_edited_externals().
3488 * @a anchor is an access baton, with a write lock, for the local path to the
3489 * working copy which will be used as the root of our editor. Further
3490 * locks will be acquired if the switch creates new directories. All
3491 * locks, both those in @a anchor and newly acquired ones, will be released
3492 * when the editor driver calls @c close_edit.
3494 * @a target is the entry in @a anchor that will actually be updated, or
3495 * empty if all of @a anchor should be updated.
3497 * The editor invokes @a notify_func with @a notify_baton as the switch
3498 * progresses, if @a notify_func is non-NULL.
3500 * If @a cancel_func is non-NULL, it will be called with @a cancel_baton as
3501 * the switch progresses to determine if it should continue.
3503 * If @a conflict_func is non-NULL, then invoke it with @a
3504 * conflict_baton whenever a conflict is encountered, giving the
3505 * callback a chance to resolve the conflict before the editor takes
3506 * more drastic measures (such as marking a file conflicted, or
3507 * bailing out of the switch).
3509 * If @a diff3_cmd is non-NULL, then use it as the diff3 command for
3510 * any merging; otherwise, use the built-in merge code.
3512 * @a preserved_exts is an array of filename patterns which, when
3513 * matched against the extensions of versioned files, determine for
3514 * which such files any related generated conflict files will preserve
3515 * the original file's extension as their own. If a file's extension
3516 * does not match any of the patterns in @a preserved_exts (which is
3517 * certainly the case if @a preserved_exts is @c NULL or empty),
3518 * generated conflict files will carry Subversion's custom extensions.
3520 * @a target_revision is a pointer to a revision location which, after
3521 * successful completion of the drive of this editor, will be
3522 * populated with the revision to which the working copy was updated.
3524 * If @a use_commit_times is TRUE, then all edited/added files will
3525 * have their working timestamp set to the last-committed-time. If
3526 * FALSE, the working files will be touched with the 'now' time.
3528 * @a depth and @a depth_is_sticky behave as for svn_wc_get_update_editor3().
3530 * If @a allow_unver_obstructions is TRUE, then allow unversioned
3531 * obstructions when adding a path.
3533 * @since New in 1.5.
3536 svn_wc_get_switch_editor3(svn_revnum_t
*target_revision
,
3537 svn_wc_adm_access_t
*anchor
,
3539 const char *switch_url
,
3540 svn_boolean_t use_commit_times
,
3542 svn_boolean_t depth_is_sticky
,
3543 svn_boolean_t allow_unver_obstructions
,
3544 svn_wc_notify_func2_t notify_func
,
3546 svn_cancel_func_t cancel_func
,
3548 svn_wc_conflict_resolver_func_t conflict_func
,
3549 void *conflict_baton
,
3550 const char *diff3_cmd
,
3551 apr_array_header_t
*preserved_exts
,
3552 const svn_delta_editor_t
**editor
,
3554 svn_wc_traversal_info_t
*ti
,
3558 * Similar to svn_wc_get_switch_editor3() but with the
3559 * @a allow_unver_obstructions parameter always set to FALSE,
3560 * @a preserved_exts set to NULL, @a conflict_func and baton set to NULL,
3561 * @a depth_is_sticky set to FALSE, and @a depth set according to @a
3562 * recurse: if @a recurse is TRUE, pass @c svn_depth_infinity, if
3563 * FALSE, pass @c svn_depth_files.
3565 * @deprecated Provided for backward compatibility with the 1.4 API.
3568 svn_wc_get_switch_editor2(svn_revnum_t
*target_revision
,
3569 svn_wc_adm_access_t
*anchor
,
3571 const char *switch_url
,
3572 svn_boolean_t use_commit_times
,
3573 svn_boolean_t recurse
,
3574 svn_wc_notify_func2_t notify_func
,
3576 svn_cancel_func_t cancel_func
,
3578 const char *diff3_cmd
,
3579 const svn_delta_editor_t
**editor
,
3581 svn_wc_traversal_info_t
*ti
,
3585 * Similar to svn_wc_get_switch_editor2(), but takes an
3586 * @c svn_wc_notify_func_t instead.
3588 * @deprecated Provided for backward compatibility with the 1.1 API.
3591 svn_wc_get_switch_editor(svn_revnum_t
*target_revision
,
3592 svn_wc_adm_access_t
*anchor
,
3594 const char *switch_url
,
3595 svn_boolean_t use_commit_times
,
3596 svn_boolean_t recurse
,
3597 svn_wc_notify_func_t notify_func
,
3599 svn_cancel_func_t cancel_func
,
3601 const char *diff3_cmd
,
3602 const svn_delta_editor_t
**editor
,
3604 svn_wc_traversal_info_t
*ti
,
3609 /* A word about the implementation of working copy property storage:
3611 * Since properties are key/val pairs, you'd think we store them in
3612 * some sort of Berkeley DB-ish format, and even store pending changes
3613 * to them that way too.
3615 * However, we already have libsvn_subr/hashdump.c working, and it
3616 * uses a human-readable format. That will be very handy when we're
3617 * debugging, and presumably we will not be dealing with any huge
3618 * properties or property lists initially. Therefore, we will
3619 * continue to use hashdump as the internal mechanism for storing and
3620 * reading from property lists, but note that the interface here is
3621 * _not_ dependent on that. We can swap in a DB-based implementation
3622 * at any time and users of this library will never know the
3626 /** Set @a *props to a hash table mapping <tt>char *</tt> names onto
3627 * <tt>svn_string_t *</tt> values for all the regular properties of
3628 * @a path. Allocate the table, names, and values in @a pool. If
3629 * the node has no properties, or does not exist in the working copy,
3630 * then an empty hash is returned. @a adm_access is an access baton
3631 * set that contains @a path.
3634 svn_wc_prop_list(apr_hash_t
**props
,
3636 svn_wc_adm_access_t
*adm_access
,
3640 /** Set @a *value to the value of property @a name for @a path, allocating
3641 * @a *value in @a pool. If no such prop, set @a *value to @c NULL.
3642 * @a name may be a regular or wc property; if it is an entry property,
3643 * return the error @c SVN_ERR_BAD_PROP_KIND. @a adm_access is an access
3644 * baton set that contains @a path.
3647 svn_wc_prop_get(const svn_string_t
**value
,
3650 svn_wc_adm_access_t
*adm_access
,
3654 * Set property @a name to @a value for @a path, or if @a value is
3655 * NULL, remove property @a name from @a path. @a adm_access is an
3656 * access baton with a write lock for @a path.
3658 * If @a skip_checks is TRUE, do no validity checking. But if @a
3659 * skip_checks is FALSE, and @a name is not a valid property for @a
3660 * path, return an error, either @c SVN_ERR_ILLEGAL_TARGET (if the
3661 * property is not appropriate for @a path), or @c
3662 * SVN_ERR_BAD_MIME_TYPE (if @a name is "svn:mime-type", but @a value
3663 * is not a valid mime-type).
3665 * @a name may be a wc property or a regular property; but if it is an
3666 * entry property, return the error @c SVN_ERR_BAD_PROP_KIND, even if
3667 * @a skip_checks is TRUE.
3669 * Use @a pool for temporary allocation.
3671 * @since New in 1.2.
3674 svn_wc_prop_set2(const char *name
,
3675 const svn_string_t
*value
,
3677 svn_wc_adm_access_t
*adm_access
,
3678 svn_boolean_t skip_checks
,
3683 * Like svn_wc_prop_set2(), but with @a skip_checks always FALSE.
3685 * @deprecated Provided for backward compatibility with the 1.1 API.
3688 svn_wc_prop_set(const char *name
,
3689 const svn_string_t
*value
,
3691 svn_wc_adm_access_t
*adm_access
,
3695 /** Return TRUE iff @a name is a 'normal' property name. 'Normal' is
3696 * defined as a user-visible and user-tweakable property that shows up
3697 * when you fetch a proplist.
3699 * The function currently parses the namespace like so:
3701 * - 'svn:wc:' ==> a wcprop, stored/accessed separately via different API.
3703 * - 'svn:entry:' ==> an "entry" prop, shunted into the 'entries' file.
3705 * If these patterns aren't found, then the property is assumed to be
3708 svn_boolean_t
svn_wc_is_normal_prop(const char *name
);
3712 /** Return TRUE iff @a name is a 'wc' property name. */
3713 svn_boolean_t
svn_wc_is_wc_prop(const char *name
);
3715 /** Return TRUE iff @a name is a 'entry' property name. */
3716 svn_boolean_t
svn_wc_is_entry_prop(const char *name
);
3718 /** Callback type used by @c svn_wc_canonicalize_svn_prop.
3720 * If @a mime_type is non-null, it sets @a *mime_type to the value of
3721 * @a SVN_PROP_MIME_TYPE for the path passed to @c
3722 * svn_wc_canonicalize_svn_prop (allocated from @a pool). If @a
3723 * stream is non-null, it writes the contents of the file to @a
3726 * (Currently, this is used if you are attempting to set the @a
3727 * SVN_PROP_EOL_STYLE property, to make sure that the value matches
3728 * the mime type and contents.)
3730 typedef svn_error_t
*(*svn_wc_canonicalize_svn_prop_get_file_t
)
3731 (const svn_string_t
**mime_type
,
3732 svn_stream_t
*stream
,
3737 /** Canonicalize the value of an svn:* property @a propname with
3740 * If the property is not appropriate for a node of kind @a kind, or
3741 * is otherwise invalid, throw an error. Otherwise, set @a *propval_p
3742 * to a canonicalized version of the property value. If @a
3743 * skip_some_checks is TRUE, only some validity checks are taken.
3745 * Some validity checks require access to the contents and MIME type
3746 * of the target if it is a file; they will call @a prop_getter with @a
3747 * getter_baton, which then needs to set the MIME type and print the
3748 * contents of the file to the given stream.
3750 * @a path should be the path of the file in question; it is only used
3751 * for error messages.
3753 * ### This is not actually related to the WC, but it does need to call
3754 * ### svn_wc_parse_externals_description2.
3757 svn_wc_canonicalize_svn_prop(const svn_string_t
**propval_p
,
3758 const char *propname
,
3759 const svn_string_t
*propval
,
3761 svn_node_kind_t kind
,
3762 svn_boolean_t skip_some_checks
,
3763 svn_wc_canonicalize_svn_prop_get_file_t prop_getter
,
3773 * Return an @a editor/@a edit_baton for diffing a working copy against the
3776 * @a anchor/@a target represent the base of the hierarchy to be compared.
3778 * @a callbacks/@a callback_baton is the callback table to use when two
3779 * files are to be compared.
3781 * If @a depth is @c svn_depth_empty, just diff exactly @a target or
3782 * @a anchor if @a target is empty. If @c svn_depth_files then do the same
3783 * and for top-level file entries as well (if any). If
3784 * @c svn_depth_immediates, do the same as @c svn_depth_files but also diff
3785 * top-level subdirectories at @c svn_depth_empty. If @c svn_depth_infinity,
3786 * then diff fully recursively. In the latter case, @a anchor should be part
3787 * of an access baton set for the @a target hierarchy.
3789 * @a ignore_ancestry determines whether paths that have discontinuous node
3790 * ancestry are treated as delete/add or as simple modifications. If
3791 * @a ignore_ancestry is @c FALSE, then any discontinuous node ancestry will
3792 * result in the diff given as a full delete followed by an add.
3794 * If @a use_text_base is TRUE, then compare the repository against
3795 * the working copy's text-base files, rather than the working files.
3797 * Normally, the difference from repository->working_copy is shown.
3798 * If @a reverse_order is TRUE, then show working_copy->repository diffs.
3800 * If @a cancel_func is non-NULL, it will be used along with @a cancel_baton
3801 * to periodically check if the client has canceled the operation.
3803 * @a changelists is an array of <tt>const char *</tt> changelist
3804 * names, used as a restrictive filter on items whose differences are
3805 * reported; that is, don't generate diffs about any item unless
3806 * it's a member of one of those changelists. If @a changelists is
3807 * empty (or altogether @c NULL), no changelist filtering occurs.
3809 * @since New in 1.6.
3812 svn_wc_get_diff_editor5(svn_wc_adm_access_t
*anchor
,
3814 const svn_wc_diff_callbacks3_t
*callbacks
,
3815 void *callback_baton
,
3817 svn_boolean_t ignore_ancestry
,
3818 svn_boolean_t use_text_base
,
3819 svn_boolean_t reverse_order
,
3820 svn_cancel_func_t cancel_func
,
3822 const apr_array_header_t
*changelists
,
3823 const svn_delta_editor_t
**editor
,
3828 * Similar to svn_wc_get_diff_editor5(), but with an
3829 * @c svn_wc_diff_callbacks2_t instead of @c svn_wc_diff_callbacks3_t.
3831 * @deprecated Provided for backward compatibility with the 1.5 API.
3834 svn_wc_get_diff_editor4(svn_wc_adm_access_t
*anchor
,
3836 const svn_wc_diff_callbacks2_t
*callbacks
,
3837 void *callback_baton
,
3839 svn_boolean_t ignore_ancestry
,
3840 svn_boolean_t use_text_base
,
3841 svn_boolean_t reverse_order
,
3842 svn_cancel_func_t cancel_func
,
3844 const apr_array_header_t
*changelists
,
3845 const svn_delta_editor_t
**editor
,
3850 * Similar to svn_wc_get_diff_editor4(), but with @a changelists
3851 * passed as @c NULL, and @a depth set to @c svn_depth_infinity if @a
3852 * recurse is TRUE, or @a svn_depth_files if @a recurse is FALSE.
3854 * @deprecated Provided for backward compatibility with the 1.4 API.
3856 * @since New in 1.2.
3859 svn_wc_get_diff_editor3(svn_wc_adm_access_t
*anchor
,
3861 const svn_wc_diff_callbacks2_t
*callbacks
,
3862 void *callback_baton
,
3863 svn_boolean_t recurse
,
3864 svn_boolean_t ignore_ancestry
,
3865 svn_boolean_t use_text_base
,
3866 svn_boolean_t reverse_order
,
3867 svn_cancel_func_t cancel_func
,
3869 const svn_delta_editor_t
**editor
,
3875 * Similar to svn_wc_get_diff_editor3(), but with an
3876 * @c svn_wc_diff_callbacks_t instead of @c svn_wc_diff_callbacks2_t.
3878 * @deprecated Provided for backward compatibility with the 1.1 API.
3881 svn_wc_get_diff_editor2(svn_wc_adm_access_t
*anchor
,
3883 const svn_wc_diff_callbacks_t
*callbacks
,
3884 void *callback_baton
,
3885 svn_boolean_t recurse
,
3886 svn_boolean_t ignore_ancestry
,
3887 svn_boolean_t use_text_base
,
3888 svn_boolean_t reverse_order
,
3889 svn_cancel_func_t cancel_func
,
3891 const svn_delta_editor_t
**editor
,
3897 * Similar to svn_wc_get_diff_editor2(), but with @a ignore_ancestry
3898 * always set to @c FALSE.
3900 * @deprecated Provided for backward compatibility with the 1.0 API.
3903 svn_wc_get_diff_editor(svn_wc_adm_access_t
*anchor
,
3905 const svn_wc_diff_callbacks_t
*callbacks
,
3906 void *callback_baton
,
3907 svn_boolean_t recurse
,
3908 svn_boolean_t use_text_base
,
3909 svn_boolean_t reverse_order
,
3910 svn_cancel_func_t cancel_func
,
3912 const svn_delta_editor_t
**editor
,
3918 * Compare working copy against the text-base.
3920 * @a anchor/@a target represent the base of the hierarchy to be compared.
3922 * @a callbacks/@a callback_baton is the callback table to use when two
3923 * files are to be compared.
3925 * If @a depth is @c svn_depth_empty, just diff exactly @a target or
3926 * @a anchor if @a target is empty. If @c svn_depth_files then do the same
3927 * and for top-level file entries as well (if any). If
3928 * @c svn_depth_immediates, do the same as @c svn_depth_files but also diff
3929 * top-level subdirectories at @c svn_depth_empty. If @c svn_depth_infinity,
3930 * then diff fully recursively. In the latter case, @a anchor should be part
3931 * of an access baton set for the @a target hierarchy.
3933 * @a ignore_ancestry determines whether paths that have discontinuous node
3934 * ancestry are treated as delete/add or as simple modifications. If
3935 * @a ignore_ancestry is @c FALSE, then any discontinuous node ancestry will
3936 * result in the diff given as a full delete followed by an add.
3938 * @a changelists is an array of <tt>const char *</tt> changelist
3939 * names, used as a restrictive filter on items whose differences are
3940 * reported; that is, don't generate diffs about any item unless
3941 * it's a member of one of those changelists. If @a changelists is
3942 * empty (or altogether @c NULL), no changelist filtering occurs.
3944 * @since New in 1.6.
3947 svn_wc_diff5(svn_wc_adm_access_t
*anchor
,
3949 const svn_wc_diff_callbacks3_t
*callbacks
,
3950 void *callback_baton
,
3952 svn_boolean_t ignore_ancestry
,
3953 const apr_array_header_t
*changelists
,
3957 * Similar to svn_wc_diff5(), but with a @c svn_wc_diff_callbacks2_t argument
3958 * instead of @c svn_wc_diff_callbacks3_t.
3960 * @deprecated Provided for backward compatibility with the 1.5 API.
3963 svn_wc_diff4(svn_wc_adm_access_t
*anchor
,
3965 const svn_wc_diff_callbacks2_t
*callbacks
,
3966 void *callback_baton
,
3968 svn_boolean_t ignore_ancestry
,
3969 const apr_array_header_t
*changelists
,
3974 * Similar to svn_wc_diff4(), but with @a changelists passed @c NULL,
3975 * and @a depth set to @c svn_depth_infinity if @a recurse is TRUE, or
3976 * @a svn_depth_files if @a recurse is FALSE.
3978 * @deprecated Provided for backward compatibility with the 1.2 API.
3981 svn_wc_diff3(svn_wc_adm_access_t
*anchor
,
3983 const svn_wc_diff_callbacks2_t
*callbacks
,
3984 void *callback_baton
,
3985 svn_boolean_t recurse
,
3986 svn_boolean_t ignore_ancestry
,
3990 * Similar to svn_wc_diff3(), but with a @c svn_wc_diff_callbacks_t argument
3991 * instead of @c svn_wc_diff_callbacks2_t.
3993 * @deprecated Provided for backward compatibility with the 1.1 API.
3996 svn_wc_diff2(svn_wc_adm_access_t
*anchor
,
3998 const svn_wc_diff_callbacks_t
*callbacks
,
3999 void *callback_baton
,
4000 svn_boolean_t recurse
,
4001 svn_boolean_t ignore_ancestry
,
4005 * Similar to svn_wc_diff2(), but with @a ignore_ancestry always set
4008 * @deprecated Provided for backward compatibility with the 1.0 API.
4011 svn_wc_diff(svn_wc_adm_access_t
*anchor
,
4013 const svn_wc_diff_callbacks_t
*callbacks
,
4014 void *callback_baton
,
4015 svn_boolean_t recurse
,
4019 /** Given a @a path to a file or directory under version control, discover
4020 * any local changes made to properties and/or the set of 'pristine'
4021 * properties. @a adm_access is an access baton set for @a path.
4023 * If @a propchanges is non-@c NULL, return these changes as an array of
4024 * @c svn_prop_t structures stored in @a *propchanges. The structures and
4025 * array will be allocated in @a pool. If there are no local property
4026 * modifications on @a path, then set @a *propchanges to @c NULL.
4028 * If @a original_props is non-@c NULL, then set @a *original_props to
4029 * hashtable (<tt>const char *name</tt> -> <tt>const svn_string_t *value</tt>)
4030 * that represents the 'pristine' property list of @a path. This hashtable is
4031 * allocated in @a pool, and can be used to compare old and new values of
4035 svn_wc_get_prop_diffs(apr_array_header_t
**propchanges
,
4036 apr_hash_t
**original_props
,
4038 svn_wc_adm_access_t
*adm_access
,
4042 /** The outcome of a merge carried out (or tried as a dry-run) by
4045 typedef enum svn_wc_merge_outcome_t
4047 /** The working copy is (or would be) unchanged. The changes to be
4048 * merged were already present in the working copy
4050 svn_wc_merge_unchanged
,
4052 /** The working copy has been (or would be) changed. */
4053 svn_wc_merge_merged
,
4055 /** The working copy has been (or would be) changed, but there was (or
4056 * would be) a conflict
4058 svn_wc_merge_conflict
,
4060 /** No merge was performed, probably because the target file was
4061 * either absent or not under version control.
4063 svn_wc_merge_no_merge
4065 } svn_wc_merge_outcome_t
;
4067 /** Given paths to three fulltexts, merge the differences between @a left
4068 * and @a right into @a merge_target. (It may help to know that @a left,
4069 * @a right, and @a merge_target correspond to "OLDER", "YOURS", and "MINE",
4070 * respectively, in the diff3 documentation.) Use @a pool for any
4071 * temporary allocation.
4073 * @a adm_access is an access baton with a write lock for the directory
4074 * containing @a merge_target.
4076 * This function assumes that @a left and @a right are in repository-normal
4077 * form (linefeeds, with keywords contracted); if necessary,
4078 * @a merge_target is temporarily converted to this form to receive the
4079 * changes, then translated back again.
4081 * If @a merge_target is absent, or present but not under version
4082 * control, then set @a *merge_outcome to @c svn_wc_merge_no_merge and
4083 * return success without merging anything. (The reasoning is that if
4084 * the file is not versioned, then it is probably unrelated to the
4085 * changes being considered, so they should not be merged into it.)
4087 * @a dry_run determines whether the working copy is modified. When it
4088 * is @c FALSE the merge will cause @a merge_target to be modified, when it
4089 * is @c TRUE the merge will be carried out to determine the result but
4090 * @a merge_target will not be modified.
4092 * If @a diff3_cmd is non-NULL, then use it as the diff3 command for
4093 * any merging; otherwise, use the built-in merge code. If @a
4094 * merge_options is non-NULL, either pass its elements to @a diff3_cmd or
4095 * parse it and use as options to the internal merge code (@see
4096 * svn_diff_file_options_parse()). @a merge_options must contain
4097 * <tt>const char *</tt> elements.
4099 * The outcome of the merge is returned in @a *merge_outcome. If there
4100 * is a conflict and @a dry_run is @c FALSE, then attempt to call @a
4101 * conflict_func with @a conflict_baton (if non-NULL). If the
4102 * conflict callback cannot resolve the conflict, then:
4104 * * Put conflict markers around the conflicting regions in
4105 * @a merge_target, labeled with @a left_label, @a right_label, and
4106 * @a target_label. (If any of these labels are @c NULL, default
4107 * values will be used.)
4109 * * Copy @a left, @a right, and the original @a merge_target to unique
4110 * names in the same directory as @a merge_target, ending with the
4111 * suffixes ".LEFT_LABEL", ".RIGHT_LABEL", and ".TARGET_LABEL"
4114 * * Mark the entry for @a merge_target as "conflicted", and track the
4115 * above mentioned backup files in the entry as well.
4119 * If @a merge_target is a binary file, then no merging is attempted,
4120 * the merge is deemed to be a conflict. If @a dry_run is @c FALSE the
4121 * working @a merge_target is untouched, and copies of @a left and
4122 * @a right are created next to it using @a left_label and @a right_label.
4123 * @a merge_target's entry is marked as "conflicted", and begins
4124 * tracking the two backup files. If @a dry_run is @c TRUE no files are
4125 * changed. The outcome of the merge is returned in @a *merge_outcome.
4127 * @since New in 1.5.
4130 svn_wc_merge3(enum svn_wc_merge_outcome_t
*merge_outcome
,
4133 const char *merge_target
,
4134 svn_wc_adm_access_t
*adm_access
,
4135 const char *left_label
,
4136 const char *right_label
,
4137 const char *target_label
,
4138 svn_boolean_t dry_run
,
4139 const char *diff3_cmd
,
4140 const apr_array_header_t
*merge_options
,
4141 const apr_array_header_t
*prop_diff
,
4142 svn_wc_conflict_resolver_func_t conflict_func
,
4143 void *conflict_baton
,
4146 /** Similar to svn_wc_merge3(), but with @a prop_diff, @a
4147 * conflict_func, @a conflict_baton set to NULL.
4149 * @deprecated Provided for backwards compatibility with the 1.4 API.
4152 svn_wc_merge2(enum svn_wc_merge_outcome_t
*merge_outcome
,
4155 const char *merge_target
,
4156 svn_wc_adm_access_t
*adm_access
,
4157 const char *left_label
,
4158 const char *right_label
,
4159 const char *target_label
,
4160 svn_boolean_t dry_run
,
4161 const char *diff3_cmd
,
4162 const apr_array_header_t
*merge_options
,
4166 /** Similar to svn_wc_merge2(), but with @a merge_options set to NULL.
4168 * @deprecated Provided for backwards compatibility with the 1.3 API.
4171 svn_wc_merge(const char *left
,
4173 const char *merge_target
,
4174 svn_wc_adm_access_t
*adm_access
,
4175 const char *left_label
,
4176 const char *right_label
,
4177 const char *target_label
,
4178 svn_boolean_t dry_run
,
4179 enum svn_wc_merge_outcome_t
*merge_outcome
,
4180 const char *diff3_cmd
,
4184 /** Given a @a path under version control, merge an array of @a
4185 * propchanges into the path's existing properties. @a propchanges is
4186 * an array of @c svn_prop_t objects, and @a baseprops is a hash
4187 * representing the original set of properties that @a propchanges is
4188 * working against. @a adm_access is an access baton for the directory
4189 * containing @a path.
4191 * If @a base_merge is @c FALSE only the working properties will be changed,
4192 * if it is @c TRUE both the base and working properties will be changed.
4194 * If @a state is non-NULL, set @a *state to the state of the properties
4197 * If conflicts are found when merging working properties, they are
4198 * described in a temporary .prej file (or appended to an already-existing
4199 * .prej file), and the entry is marked "conflicted". Base properties
4200 * are changed unconditionally, if @a base_merge is @c TRUE, they never result
4203 * If @a path is not under version control, return the error
4204 * SVN_ERR_UNVERSIONED_RESOURCE and don't touch anyone's properties.
4206 * @since New in 1.5.
4209 svn_wc_merge_props2(svn_wc_notify_state_t
*state
,
4211 svn_wc_adm_access_t
*adm_access
,
4212 apr_hash_t
*baseprops
,
4213 const apr_array_header_t
*propchanges
,
4214 svn_boolean_t base_merge
,
4215 svn_boolean_t dry_run
,
4216 svn_wc_conflict_resolver_func_t conflict_func
,
4217 void *conflict_baton
,
4222 * Same as svn_wc_merge_props2(), but with a @a conflict_func (and
4225 * @deprecated Provided for backward compatibility with the 1.3 API.
4229 svn_wc_merge_props(svn_wc_notify_state_t
*state
,
4231 svn_wc_adm_access_t
*adm_access
,
4232 apr_hash_t
*baseprops
,
4233 const apr_array_header_t
*propchanges
,
4234 svn_boolean_t base_merge
,
4235 svn_boolean_t dry_run
,
4240 * Similar to svn_wc_merge_props(), but no baseprops are given.
4241 * Instead, it's assumed that the incoming propchanges are based
4242 * against the working copy's own baseprops. While this assumption is
4243 * correct for 'svn update', it's incorrect for 'svn merge', and can
4244 * cause flawed behavior. (See issue #2035.)
4246 * @deprecated Provided for backward compatibility with the 1.2 API.
4249 svn_wc_merge_prop_diffs(svn_wc_notify_state_t
*state
,
4251 svn_wc_adm_access_t
*adm_access
,
4252 const apr_array_header_t
*propchanges
,
4253 svn_boolean_t base_merge
,
4254 svn_boolean_t dry_run
,
4259 /** Given a @a path to a wc file, return a @a pristine_path which points to a
4260 * pristine version of the file. This is needed so clients can do
4261 * diffs. If the WC has no text-base, return a @c NULL instead of a
4265 svn_wc_get_pristine_copy_path(const char *path
,
4266 const char **pristine_path
,
4271 * Recurse from @a path, cleaning up unfinished log business. Perform
4272 * necessary allocations in @a pool. Any working copy locks under @a path
4273 * will be taken over and then cleared by this function. If @a diff3_cmd
4274 * is non-NULL, then use it as the diff3 command for any merging; otherwise,
4275 * use the built-in merge code.
4277 * WARNING: there is no mechanism that will protect locks that are still
4280 * If @a cancel_func is non-NULL, invoke it with @a cancel_baton at
4281 * various points during the operation. If it returns an error
4282 * (typically @c SVN_ERR_CANCELLED), return that error immediately.
4284 * @since New in 1.2.
4287 svn_wc_cleanup2(const char *path
,
4288 const char *diff3_cmd
,
4289 svn_cancel_func_t cancel_func
,
4294 * Similar to svn_wc_cleanup2(). @a optional_adm_access is an historic
4295 * relic and not used, it may be NULL.
4297 * @deprecated Provided for backward compatibility with the 1.1 API.
4300 svn_wc_cleanup(const char *path
,
4301 svn_wc_adm_access_t
*optional_adm_access
,
4302 const char *diff3_cmd
,
4303 svn_cancel_func_t cancel_func
,
4308 /** Relocation validation callback typedef.
4310 * Called for each relocated file/directory. @a uuid, if non-NULL, contains
4311 * the expected repository UUID, @a url contains the tentative URL.
4313 * @a baton is a closure object; it should be provided by the
4314 * implementation, and passed by the caller.
4316 * If @a root is TRUE, then the implementation should make sure that @a url
4317 * is the repository root. Else, it can be an URL inside the repository.
4318 * @a pool may be used for temporary allocations.
4320 * @since New in 1.5.
4322 typedef svn_error_t
*(*svn_wc_relocation_validator3_t
)(void *baton
,
4325 const char *root_url
,
4328 /** Similar to @c svn_wc_relocation_validator3_t, but without
4329 * the @a root_url arguments.
4331 * @deprecated Provided for backwards compatibility with the 1.4 API.
4333 typedef svn_error_t
*(*svn_wc_relocation_validator2_t
)(void *baton
,
4339 /** Similar to @c svn_wc_relocation_validator2_t, but without
4340 * the @a root and @a pool arguments. @a uuid will not be NULL in this version
4343 * @deprecated Provided for backwards compatibility with the 1.3 API.
4345 typedef svn_error_t
*(*svn_wc_relocation_validator_t
)(void *baton
,
4349 /** Change repository references at @a path that begin with @a from
4350 * to begin with @a to instead. Perform necessary allocations in @a pool.
4351 * If @a recurse is TRUE, do so. @a validator (and its baton,
4352 * @a validator_baton), will be called for each newly generated URL.
4354 * @a adm_access is an access baton for the directory containing
4357 * @since New in 1.5.
4360 svn_wc_relocate3(const char *path
,
4361 svn_wc_adm_access_t
*adm_access
,
4364 svn_boolean_t recurse
,
4365 svn_wc_relocation_validator3_t validator
,
4366 void *validator_baton
,
4369 /** Similar to svn_wc_relocate3(), but uses @c svn_wc_relocation_validator2_t.
4371 * @deprecated Provided for backwards compatibility with the 1.4 API. */
4373 svn_wc_relocate2(const char *path
,
4374 svn_wc_adm_access_t
*adm_access
,
4377 svn_boolean_t recurse
,
4378 svn_wc_relocation_validator2_t validator
,
4379 void *validator_baton
,
4382 /** Similar to svn_wc_relocate2(), but uses @c svn_wc_relocation_validator_t.
4384 * @deprecated Provided for backwards compatibility with the 1.3 API. */
4386 svn_wc_relocate(const char *path
,
4387 svn_wc_adm_access_t
*adm_access
,
4390 svn_boolean_t recurse
,
4391 svn_wc_relocation_validator_t validator
,
4392 void *validator_baton
,
4397 * Revert changes to @a path. Perform necessary allocations in @a pool.
4399 * @a parent_access is an access baton for the directory containing @a
4400 * path, unless @a path is a working copy root (as determined by @c
4401 * svn_wc_is_wc_root), in which case @a parent_access refers to @a
4404 * If @a depth is @c svn_depth_empty, revert just @a path (if a
4405 * directory, then revert just the properties on that directory).
4406 * Else if @c svn_depth_files, revert @a path and any files
4407 * directly under @a path if it is directory. Else if
4408 * @c svn_depth_immediates, revert all of the preceding plus
4409 * properties on immediate subdirectories; else if @c svn_depth_infinity,
4410 * revert path and everything under it fully recursively.
4412 * @a changelists is an array of <tt>const char *</tt> changelist
4413 * names, used as a restrictive filter on items reverted; that is,
4414 * don't revert any item unless it's a member of one of those
4415 * changelists. If @a changelists is empty (or altogether @c NULL),
4416 * no changelist filtering occurs.
4418 * If @a cancel_func is non-NULL, call it with @a cancel_baton at
4419 * various points during the reversion process. If it returns an
4420 * error (typically @c SVN_ERR_CANCELLED), return that error
4423 * If @a use_commit_times is TRUE, then all reverted working-files
4424 * will have their timestamp set to the last-committed-time. If
4425 * FALSE, the reverted working-files will be touched with the 'now' time.
4427 * For each item reverted, @a notify_func will be called with @a notify_baton
4428 * and the path of the reverted item. @a notify_func may be @c NULL if this
4429 * notification is not needed.
4431 * If @a path is not under version control, return the error
4432 * SVN_ERR_UNVERSIONED_RESOURCE.
4434 * @since New in 1.5.
4437 svn_wc_revert3(const char *path
,
4438 svn_wc_adm_access_t
*parent_access
,
4440 svn_boolean_t use_commit_times
,
4441 const apr_array_header_t
*changelists
,
4442 svn_cancel_func_t cancel_func
,
4444 svn_wc_notify_func2_t notify_func
,
4449 * Similar to svn_wc_revert3(), but with @a changelists passed as @c
4450 * NULL, and @a depth set according to @a recursive: if @a recursive
4451 * is TRUE, @a depth is @c svn_depth_infinity; if FALSE, @a depth is
4452 * @c svn_depth_empty.
4454 * @note Most APIs map @a recurse==FALSE to @a depth==svn_depth_files;
4455 * revert is deliberately different.
4457 * @deprecated Provided for backward compatibility with the 1.2 API.
4460 svn_wc_revert2(const char *path
,
4461 svn_wc_adm_access_t
*parent_access
,
4462 svn_boolean_t recursive
,
4463 svn_boolean_t use_commit_times
,
4464 svn_cancel_func_t cancel_func
,
4466 svn_wc_notify_func2_t notify_func
,
4471 * Similar to svn_wc_revert2(), but takes an @c svn_wc_notify_func_t instead.
4473 * @deprecated Provided for backward compatibility with the 1.1 API.
4476 svn_wc_revert(const char *path
,
4477 svn_wc_adm_access_t
*parent_access
,
4478 svn_boolean_t recursive
,
4479 svn_boolean_t use_commit_times
,
4480 svn_cancel_func_t cancel_func
,
4482 svn_wc_notify_func_t notify_func
,
4489 /** Create a unique temporary file in administrative tmp/ area of
4490 * directory @a path. Return a handle in @a *fp and the path
4491 * in @a *new_name. Either @a fp or @a new_name can be NULL.
4493 * The flags will be <tt>APR_WRITE | APR_CREATE | APR_EXCL</tt> and
4494 * optionally @c APR_DELONCLOSE (if the @a delete_when argument is
4495 * set to @c svn_io_file_del_on_close).
4497 * This means that as soon as @a fp is closed, the tmp file will vanish.
4502 svn_wc_create_tmp_file2(apr_file_t
**fp
,
4503 const char **new_name
,
4505 svn_io_file_del_t delete_when
,
4509 /** Same as svn_wc_create_tmp_file2(), but with @a new_name set to @c NULL,
4510 * and without the ability to delete the file on pool cleanup.
4512 * @deprecated For compatibility with 1.3 API
4515 svn_wc_create_tmp_file(apr_file_t
**fp
,
4517 svn_boolean_t delete_on_close
,
4522 /* EOL conversion and keyword expansion. */
4524 /** Set @a xlated_path to a translated copy of @a src
4525 * or to @a src itself if no translation is necessary.
4526 * That is, if @a versioned_file's properties indicate newline conversion or
4527 * keyword expansion, point @a *xlated_path to a copy of @a src
4528 * whose newlines and keywords are converted using the translation
4529 * as requested by @a flags.
4531 * When translating to the normal form, inconsistent eol styles will be
4532 * repaired when appropriate for the given setting. When translating
4533 * from normal form, no EOL repair is performed (consistency is assumed).
4534 * This behaviour can be overridden by specifying
4535 * @c SVN_WC_TRANSLATE_FORCE_EOL_REPAIR.
4537 * The caller can explicitly request a new file to be returned by setting the
4538 * @c SVN_WC_TRANSLATE_FORCE_COPY flag in @a flags.
4540 * This function is generally used to get a file that can be compared
4541 * meaningfully against @a versioned_file's text base, if
4542 * @c SVN_WC_TRANSLATE_TO_NF is specified, against @a versioned_file itself
4543 * if @c SVN_WC_TRANSLATE_FROM_NF is specified.
4545 * Output files are created in the temp file area belonging to
4546 * @a versioned_file. By default they will be deleted at pool cleanup.
4548 * If @c SVN_WC_TRANSLATE_NO_OUTPUT_CLEANUP is specified, the default
4549 * pool cleanup handler to remove @a *xlated_path is not registered.
4551 * If an error is returned, the effect on @a *xlated_path is undefined.
4556 svn_wc_translated_file2(const char **xlated_path
,
4558 const char *versioned_file
,
4559 svn_wc_adm_access_t
*adm_access
,
4564 /** Same as svn_wc_translated_file2, but will never clean up
4567 * @deprecated Provided for compatibility with the 1.3 API
4570 svn_wc_translated_file(const char **xlated_p
,
4572 svn_wc_adm_access_t
*adm_access
,
4573 svn_boolean_t force_repair
,
4577 /** Returns a @a stream allocated in @a pool with access to the given
4578 * @a path taking the file properties from @a versioned_file using
4581 * When translation from normal form is requested
4582 * (@c SVN_WC_TRANSLATE_FROM_NF is specified in @a flags), @a path
4583 * is used as target path and stream read operations are not supported.
4584 * Conversely, if translation to normal form is requested
4585 * (@c SVN_WC_TRANSLATE_TO_NF is specified in @a flags), @a path is
4586 * used as source path and stream write operations are not supported.
4588 * The @a flags are the same constants as those used for
4589 * svn_wc_translated_file().
4591 * @since New in 1.5.
4594 svn_wc_translated_stream(svn_stream_t
**stream
,
4596 const char *versioned_file
,
4597 svn_wc_adm_access_t
*adm_access
,
4602 /* Text/Prop Deltas Using an Editor */
4605 /** Send the local modifications for versioned file @a path (with
4606 * matching @a file_baton) through @a editor, then close @a file_baton
4607 * afterwards. Use @a pool for any temporary allocation and
4608 * @a adm_access as an access baton for @a path.
4610 * This process creates a copy of @a path with keywords and eol
4611 * untranslated. If @a tempfile is non-NULL, set @a *tempfile to the
4612 * path to this copy. Do not clean up the copy; caller can do that.
4613 * If @a digest is non-NULL, put the MD5 checksum of the
4614 * temporary file into @a digest, which must point to @c APR_MD5_DIGESTSIZE
4615 * bytes of storage. (The purpose of handing back the tmp copy is that
4616 * it is usually about to become the new text base anyway, but the
4617 * installation of the new text base is outside the scope of this
4620 * If @a fulltext, send the untranslated copy of @a path through @a editor
4621 * as full-text; else send it as svndiff against the current text base.
4623 * If sending a diff, and the recorded checksum for @a path's text-base
4624 * does not match the current actual checksum, then remove the tmp
4625 * copy (and set @a *tempfile to NULL if appropriate), and return the
4626 * error @c SVN_ERR_WC_CORRUPT_TEXT_BASE.
4628 * @note This is intended for use with both infix and postfix
4629 * text-delta styled editor drivers.
4631 * @since New in 1.4.
4634 svn_wc_transmit_text_deltas2(const char **tempfile
,
4635 unsigned char digest
[],
4637 svn_wc_adm_access_t
*adm_access
,
4638 svn_boolean_t fulltext
,
4639 const svn_delta_editor_t
*editor
,
4643 /** Similar to svn_wc_transmit_text_deltas2(), but with @a digest set to NULL.
4645 * @deprecated Provided for backwards compatibility with the 1.3 API.
4648 svn_wc_transmit_text_deltas(const char *path
,
4649 svn_wc_adm_access_t
*adm_access
,
4650 svn_boolean_t fulltext
,
4651 const svn_delta_editor_t
*editor
,
4653 const char **tempfile
,
4657 /** Given a @a path with its accompanying @a entry, transmit all local
4658 * property modifications using the appropriate @a editor method (in
4659 * conjunction with @a baton). @a adm_access is an access baton set
4660 * that contains @a path. Use @a pool for all allocations.
4662 * If a temporary file remains after this function is finished, the
4663 * path to that file is returned in @a *tempfile (so the caller can
4664 * clean this up if it wishes to do so).
4666 * @note Starting version 1.5, no tempfile will ever be returned
4667 * anymore. If @a *tempfile is passed, its value is set to @c NULL.
4670 svn_wc_transmit_prop_deltas(const char *path
,
4671 svn_wc_adm_access_t
*adm_access
,
4672 const svn_wc_entry_t
*entry
,
4673 const svn_delta_editor_t
*editor
,
4675 const char **tempfile
,
4679 /** Get the run-time configured list of ignore patterns from the
4680 * @c svn_config_t's in the @a config hash, and store them in @a *patterns.
4681 * Allocate @a *patterns and its contents in @a pool.
4684 svn_wc_get_default_ignores(apr_array_header_t
**patterns
,
4688 /** Get the list of ignore patterns from the @c svn_config_t's in the
4689 * @a config hash and the local ignore patterns from the directory
4690 * in @a adm_access, and store them in @a *patterns.
4691 * Allocate @a *patterns and its contents in @a pool.
4693 * @since New in 1.3.
4696 svn_wc_get_ignores(apr_array_header_t
**patterns
,
4698 svn_wc_adm_access_t
*adm_access
,
4701 /** Return TRUE iff @a str matches any of the elements of @a list, a
4702 * list of zero or more ignore patterns.
4704 * @since New in 1.5.
4707 svn_wc_match_ignore_list(const char *str
,
4708 apr_array_header_t
*list
,
4712 /** Add @a lock to the working copy for @a path. @a adm_access must contain
4713 * a write lock for @a path. If @a path is read-only, due to locking
4714 * properties, make it writable. Perform temporary allocations in @a
4717 svn_wc_add_lock(const char *path
,
4718 const svn_lock_t
*lock
,
4719 svn_wc_adm_access_t
*adm_access
,
4722 /** Remove any lock from @a path. @a adm_access must contain a
4723 * write-lock for @a path. If @a path has a lock and the locking
4724 * so specifies, make the file read-only. Don't return an error if @a
4725 * path didn't have a lock. Perform temporary allocations in @a pool. */
4727 svn_wc_remove_lock(const char *path
,
4728 svn_wc_adm_access_t
*adm_access
,
4732 /** A structure to report a summary of a working copy, including the
4733 * mix of revisions found within it, whether any parts are switched or
4734 * locally modified, and whether it is a sparse checkout.
4736 * @note Fields may be added to the end of this structure in future
4737 * versions. Therefore, to preserve binary compatibility, users
4738 * should not directly allocate structures of this type.
4742 typedef struct svn_wc_revision_status_t
4744 svn_revnum_t min_rev
; /**< Lowest revision found */
4745 svn_revnum_t max_rev
; /**< Highest revision found */
4747 svn_boolean_t switched
; /**< Is anything switched? */
4748 svn_boolean_t modified
; /**< Is anything modified? */
4750 /** Whether any WC paths are at a depth other than @c svn_depth_infinity.
4751 * @since New in 1.5.
4753 svn_boolean_t sparse_checkout
;
4755 svn_wc_revision_status_t
;
4757 /** Set @a *result_p to point to a new @c svn_wc_revision_status_t structure
4758 * containing a summary of the revision range and status of the working copy
4759 * at @a wc_path (not including "externals").
4761 * Set @a (*result_p)->min_rev and @a (*result_p)->max_rev respectively to the
4762 * lowest and highest revision numbers in the working copy. If @a committed
4763 * is TRUE, summarize the last-changed revisions, else the base revisions.
4765 * Set @a (*result_p)->switched to indicate whether any item in the WC is
4766 * switched relative to its parent. If @a trail_url is non-NULL, use it to
4767 * determine if @a wc_path itself is switched. It should be any trailing
4768 * portion of @a wc_path's expected URL, long enough to include any parts
4769 * that the caller considers might be changed by a switch. If it does not
4770 * match the end of @a wc_path's actual URL, then report a "switched"
4773 * Set @a (*result_p)->modified to indicate whether any item is locally
4776 * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
4777 * if the client has cancelled the operation.
4779 * Allocate *result_p in @a pool.
4784 svn_wc_revision_status(svn_wc_revision_status_t
**result_p
,
4785 const char *wc_path
,
4786 const char *trail_url
,
4787 svn_boolean_t committed
,
4788 svn_cancel_func_t cancel_func
,
4794 * Set @a path's entry's 'changelist' attribute to @a changelist iff
4795 * @a changelist is not @c NULL; otherwise, remove any current
4796 * changelist assignment from @a path. @a adm_access is an access
4797 * baton set that contains @a path.
4799 * If @a cancel_func is not @c NULL, call it with @a cancel_baton to
4800 * determine if the client has cancelled the operation.
4802 * If @a notify_func is not @c NULL, call it with @a notify_baton to
4803 * report the change (using notification types @c
4804 * svn_wc_notify_changelist_set and @c svn_wc_notify_changelist_clear).
4806 * @note For now, directories are NOT allowed to be associated with
4807 * changelists; there is confusion about whether they should behave
4808 * as depth-0 or depth-infinity objects. If @a path is a directory,
4809 * return @c SVN_ERR_UNSUPPORTED_FEATURE.
4811 * @note This metadata is purely a client-side "bookkeeping"
4812 * convenience, and is entirely managed by the working copy.
4814 * @since New in 1.5.
4817 svn_wc_set_changelist(const char *path
,
4818 const char *changelist
,
4819 svn_wc_adm_access_t
*adm_access
,
4820 svn_cancel_func_t cancel_func
,
4822 svn_wc_notify_func2_t notify_func
,
4831 #endif /* __cplusplus */
4833 #endif /* SVN_WC_H */