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 /** Failed to update a path's changelist association. @since New in 1.5. */
786 svn_wc_notify_changelist_failed
,
788 /** Warn user that a path has moved from one changelist to another.
789 @since New in 1.5. */
790 svn_wc_notify_changelist_moved
,
792 /** A merge operation (to path) has begun. See @c merge_range in
793 @c svn_wc_notify_t. @since New in 1.5. */
794 svn_wc_notify_merge_begin
,
796 /** Replace notification. @since New in 1.5. */
797 svn_wc_notify_update_replace
,
799 /** Property updated. @since New in 1.6. */
800 svn_wc_notify_property_updated
802 } svn_wc_notify_action_t
;
805 /** The type of notification that is occurring. */
806 typedef enum svn_wc_notify_state_t
808 svn_wc_notify_state_inapplicable
= 0,
810 /** Notifier doesn't know or isn't saying. */
811 svn_wc_notify_state_unknown
,
813 /** The state did not change. */
814 svn_wc_notify_state_unchanged
,
816 /** The item wasn't present. */
817 svn_wc_notify_state_missing
,
819 /** An unversioned item obstructed work. */
820 svn_wc_notify_state_obstructed
,
822 /** Pristine state was modified. */
823 svn_wc_notify_state_changed
,
825 /** Modified state had mods merged in. */
826 svn_wc_notify_state_merged
,
828 /** Modified state got conflicting mods. */
829 svn_wc_notify_state_conflicted
831 } svn_wc_notify_state_t
;
834 * What happened to a lock during an operation.
838 typedef enum svn_wc_notify_lock_state_t
{
839 svn_wc_notify_lock_state_inapplicable
= 0,
840 svn_wc_notify_lock_state_unknown
,
841 /** The lock wasn't changed. */
842 svn_wc_notify_lock_state_unchanged
,
843 /** The item was locked. */
844 svn_wc_notify_lock_state_locked
,
845 /** The item was unlocked. */
846 svn_wc_notify_lock_state_unlocked
847 } svn_wc_notify_lock_state_t
;
850 * Structure used in the @c svn_wc_notify_func2_t function.
852 * @c kind, @c content_state, @c prop_state and @c lock_state are from
853 * after @c action, not before.
855 * @note If @c action is @c svn_wc_notify_update, then @c path has
856 * already been installed, so it is legitimate for an implementation of
857 * @c svn_wc_notify_func2_t to examine @c path in the working copy.
859 * @note The purpose of the @c kind, @c mime_type, @c content_state, and
860 * @c prop_state fields is to provide "for free" information that an
861 * implementation is likely to want, and which it would otherwise be
862 * forced to deduce via expensive operations such as reading entries
863 * and properties. However, if the caller does not have this
864 * information, it will simply pass the corresponding `*_unknown'
865 * values, and it is up to the implementation how to handle that
866 * (i.e., whether to attempt deduction, or just to punt and
867 * give a less informative notification).
869 * @note Callers of notification functions should use svn_wc_create_notify()
870 * to create structures of this type to allow for extensibility.
874 typedef struct svn_wc_notify_t
{
875 /** Path, either absolute or relative to the current working directory
876 * (i.e., not relative to an anchor). */
878 /** Action that describes what happened to @c path. */
879 svn_wc_notify_action_t action
;
880 /** Node kind of @c path. */
881 svn_node_kind_t kind
;
882 /** If non-NULL, indicates the mime-type of @c path.
883 * It is always @c NULL for directories. */
884 const char *mime_type
;
885 /** Points to the lock structure received from the repository when
886 * @c action is @c svn_wc_notify_locked. For other actions, it is
888 const svn_lock_t
*lock
;
889 /** Points to an error describing the reason for the failure when @c
890 * action is @c svn_wc_notify_failed_lock or @c svn_wc_notify_failed_unlock.
891 * Is @c NULL otherwise. */
893 /** The type of notification that is occurring about node content. */
894 svn_wc_notify_state_t content_state
;
895 /** The type of notification that is occurring about node properties. */
896 svn_wc_notify_state_t prop_state
;
897 /** Reflects the addition or removal of a lock token in the working copy. */
898 svn_wc_notify_lock_state_t lock_state
;
899 /** When @c action is @c svn_wc_notify_update_completed, target revision
900 * of the update, or @c SVN_INVALID_REVNUM if not available; when @c
901 * action is @c svn_wc_notify_blame_revision, processed revision.
902 * In all other cases, it is @c SVN_INVALID_REVNUM. */
903 svn_revnum_t revision
;
904 /** When @c action is @c svn_wc_notify_changelist_add or name. In all other
905 * cases, it is @c NULL. */
906 const char *changelist_name
;
907 /** When @c action is @c svn_wc_notify_merge_begin, and both the
908 left and right sides of the merge are from the same URL. In all
909 other cases, it is @c NULL. */
910 svn_merge_range_t
*merge_range
;
911 /* NOTE: Add new fields at the end to preserve binary compatibility.
912 Also, if you add fields here, you have to update svn_wc_create_notify
913 and svn_wc_dup_notify. */
917 * Allocate an @c svn_wc_notify_t structure in @a pool, initialize and return
920 * Set the @c path field of the created struct to @a path, and @c action to
921 * @a action. Set all other fields to their @c _unknown, @c NULL or
922 * invalid value, respectively.
927 svn_wc_create_notify(const char *path
,
928 svn_wc_notify_action_t action
,
932 * Return a deep copy of @a notify, allocated in @a pool.
937 svn_wc_dup_notify(const svn_wc_notify_t
*notify
,
941 * Notify the world that @a notify->action has happened to @a notify->path.
943 * Recommendation: callers of @c svn_wc_notify_func2_t should avoid
944 * invoking it multiple times on the same path within a given
945 * operation, and implementations should not bother checking for such
946 * duplicate calls. For example, in an update, the caller should not
947 * invoke the notify func on receiving a prop change and then again
948 * on receiving a text change. Instead, wait until all changes have
949 * been received, and then invoke the notify func once (from within
950 * an @c svn_delta_editor_t's close_file(), for example), passing
951 * the appropriate @a notify->content_state and @a notify->prop_state flags.
955 typedef void (*svn_wc_notify_func2_t
)(void *baton
,
956 const svn_wc_notify_t
*notify
,
960 * Similar to @c svn_wc_notify_func2_t, but takes the information as arguments
961 * instead of struct fields.
963 * @deprecated Provided for backward compatibility with the 1.1 API.
965 typedef void (*svn_wc_notify_func_t
)(void *baton
,
967 svn_wc_notify_action_t action
,
968 svn_node_kind_t kind
,
969 const char *mime_type
,
970 svn_wc_notify_state_t content_state
,
971 svn_wc_notify_state_t prop_state
,
972 svn_revnum_t revision
);
978 * A simple callback type to wrap svn_ra_get_file(); see that
979 * docstring for more information.
981 * This technique allows libsvn_client to 'wrap' svn_ra_get_file() and
982 * pass it down into libsvn_wc functions, thus allowing the WC layer
983 * to legally call the RA function via (blind) callback.
987 typedef svn_error_t
*(*svn_wc_get_file_t
)(void *baton
,
989 svn_revnum_t revision
,
990 svn_stream_t
*stream
,
991 svn_revnum_t
*fetched_rev
,
997 * Interactive conflict handling
999 * @defgroup svn_wc_conflict Conflict callback functionality
1003 * This API gives a Subversion client application the opportunity to
1004 * define a callback that allows the user to resolve conflicts
1005 * interactively during updates and merges.
1007 * If a conflict is discovered, libsvn_wc invokes the callback with an
1008 * @c svn_wc_conflict_description_t. This structure describes the
1009 * path in conflict, whether it's a text or property conflict, and may
1010 * also present up to three files that can be used to resolve the
1011 * conflict (perhaps by launching an editor or 3rd-party merging
1012 * tool). The structure also provides a possible fourth file (@c
1013 * merged_file) which, if not NULL, represents libsvn_wc's attempt to
1014 * contextually merge the first three files. (Note that libsvn_wc
1015 * will not attempt to merge a file that it believes is binary, and it
1016 * will only attempt to merge property values it believes to be a
1017 * series of multi-line text.)
1019 * When the callback is finished interacting with the user, it
1020 * responds by returning a @c svn_wc_conflict_result_t. This
1021 * structure indicates whether the user wants to postpone the conflict
1022 * for later (allowing libsvn_wc to mark the path "conflicted" as
1023 * usual), or whether the user wants libsvn_wc to use one of the four
1024 * files as the "final" state for resolving the conflict immediately.
1026 * Note that the callback is at liberty (and encouraged) to merge the
1027 * three files itself. If it does so, it signals this to libsvn_wc by
1028 * returning a choice of @c svn_wc_conflict_choose_merged. To return
1029 * the 'final' merged file to libsvn_wc, the callback has the option of
1032 * - editing the original @c merged_file in-place
1034 * or, if libsvn_wc never supplied a merged_file in the
1035 * description structure (i.e. passed NULL for that field),
1037 * - return the merged file in the @c svn_wc_conflict_result_t.
1041 /** The type of action being attempted on an object.
1043 * @since New in 1.5.
1045 typedef enum svn_wc_conflict_action_t
1047 svn_wc_conflict_action_edit
, /* attempting to change text or props */
1048 svn_wc_conflict_action_add
, /* attempting to add object */
1049 svn_wc_conflict_action_delete
/* attempting to delete object */
1051 } svn_wc_conflict_action_t
;
1054 /** The pre-existing condition which is causing a state of conflict.
1056 * @since New in 1.5.
1058 typedef enum svn_wc_conflict_reason_t
1060 svn_wc_conflict_reason_edited
, /* local edits are already present */
1061 svn_wc_conflict_reason_obstructed
, /* another object is in the way */
1062 svn_wc_conflict_reason_deleted
, /* object is already schedule-delete */
1063 svn_wc_conflict_reason_missing
, /* object is unknown or missing */
1064 svn_wc_conflict_reason_unversioned
/* object is unversioned */
1066 } svn_wc_conflict_reason_t
;
1069 /** The type of conflict being described by an @c
1070 * svn_wc_conflict_description_t (see below).
1072 * @since New in 1.5.
1074 typedef enum svn_wc_conflict_kind_t
1076 svn_wc_conflict_kind_text
, /* textual conflict (on a file) */
1077 svn_wc_conflict_kind_property
/* property conflict (on a file or dir) */
1079 /* ### Add future kinds here that represent "tree" conflicts. */
1081 } svn_wc_conflict_kind_t
;
1084 /** A struct that describes a conflict that has occurred in the
1085 * working copy. Passed to @c svn_wc_conflict_resolver_func_t.
1087 * @note Fields may be added to the end of this structure in future
1088 * versions. Therefore, to preserve binary compatibility, users
1089 * should not directly allocate structures of this type.
1091 * @since New in 1.5.
1093 typedef struct svn_wc_conflict_description_t
1095 /** The path that is being operated on */
1098 /** The node type of the path being operated on */
1099 svn_node_kind_t node_kind
;
1101 /** What sort of conflict are we describing? */
1102 svn_wc_conflict_kind_t kind
;
1104 /** Only set if this is a property conflict. */
1105 const char *property_name
;
1107 /** The following only apply to file objects:
1108 * - Whether svn thinks the object is a binary file.
1109 * - If available (non-NULL), the svn:mime-type property of the path */
1110 svn_boolean_t is_binary
;
1112 /** mime-type of the object */
1113 const char *mime_type
;
1115 /** If not NULL, an open working copy access baton to either the
1116 * path itself (if @c path is a directory), or to the parent
1117 * directory (if @c path is a file.) */
1118 svn_wc_adm_access_t
*access
;
1120 /** The action being attempted on @c path. */
1121 svn_wc_conflict_action_t action
;
1123 /** The reason for the conflict. */
1124 svn_wc_conflict_reason_t reason
;
1126 /** If this is text-conflict and involves the merging of two files
1127 * descended from a common ancestor, here are the paths of up to
1128 * four fulltext files that can be used to interactively resolve the
1129 * conflict. All four files will be in repository-normal form -- LF
1130 * line endings and contracted keywords. (If any of these files are
1131 * not available, they default to NULL.)
1133 * On the other hand, if this is a property-conflict, then these
1134 * paths represent temporary files that contain the three different
1135 * property-values in conflict. The fourth path (@c merged_file)
1136 * may or may not be NULL; if set, it represents libsvn_wc's
1137 * attempt to merge the property values together. (Remember that
1138 * property values are technically binary values, and thus can't
1139 * always be merged.)
1141 const char *base_file
; /* common ancestor of the two files being merged */
1143 /** their version of the file */
1144 const char *their_file
;
1146 /** my locally-edited version of the file */
1147 const char *my_file
;
1149 /** merged version; may contain conflict markers */
1150 const char *merged_file
;
1152 } svn_wc_conflict_description_t
;
1155 /** The way in which the conflict callback chooses a course of action.
1157 * @since New in 1.5.
1159 typedef enum svn_wc_conflict_choice_t
1161 /* Don't resolve the conflict now. Let libsvn_wc mark the path
1162 'conflicted', so user can run 'svn resolved' later. */
1163 svn_wc_conflict_choose_postpone
,
1165 /* If their were files to choose from, select one as a way of
1166 resolving the conflict here and now. libsvn_wc will then do the
1167 work of "installing" the chosen file.
1169 svn_wc_conflict_choose_base
, /* original version */
1170 svn_wc_conflict_choose_theirs_full
, /* incoming version */
1171 svn_wc_conflict_choose_mine_full
, /* own version */
1172 svn_wc_conflict_choose_theirs_conflict
, /* incoming (for conflicted hunks) */
1173 svn_wc_conflict_choose_mine_conflict
, /* own (for conflicted hunks) */
1174 svn_wc_conflict_choose_merged
/* merged version */
1176 } svn_wc_conflict_choice_t
;
1179 /** The final result returned by @a svn_wc_conflict_resolver_func_t.
1181 * @note Fields may be added to the end of this structure in future
1182 * versions. Therefore, to preserve binary compatibility, users
1183 * should not directly allocate structures of this type. Instead,
1184 * construct this structure using @c svn_wc_create_conflict_result()
1187 * @since New in 1.5.
1189 typedef struct svn_wc_conflict_result_t
1191 /** A choice to either delay the conflict resolution or select a
1192 particular file to resolve the conflict. */
1193 svn_wc_conflict_choice_t choice
;
1195 /** If not NULL, this is a path to a file which contains the client's
1196 (or more likely, the user's) merging of the three values in
1197 conflict. libsvn_wc accepts this file if (and only if) @c choice
1198 is set to @c svn_wc_conflict_choose_merged.*/
1199 const char *merged_file
;
1201 } svn_wc_conflict_result_t
;
1205 * Allocate an @c svn_wc_conflict_result_t structure in @a pool,
1206 * initialize and return it.
1208 * Set the @c choice field of the structure to @a choice, and @c
1209 * merged_file to @a merged_file. Set all other fields to their @c
1210 * _unknown, @c NULL or invalid value, respectively.
1212 * @since New in 1.5.
1214 svn_wc_conflict_result_t
*
1215 svn_wc_create_conflict_result(svn_wc_conflict_choice_t choice
,
1216 const char *merged_file
,
1220 /** A callback used in svn_client_merge3(), svn_client_update3(), and
1221 * svn_client_switch2() for resolving conflicts during the application
1222 * of a tree delta to a working copy.
1224 * @a description describes the exact nature of the conflict, and
1225 * provides information to help resolve it. @a baton is a closure
1226 * object; it should be provided by the implementation, and passed by
1227 * the caller. All allocations should be performed in @a pool. When
1228 * finished, the callback signals its resolution by returning a
1229 * structure in @a *result. (See @c svn_wc_conflict_result_t.)
1231 * Implementations of this callback are free to present the conflict
1232 * using any user interface. This may include simple contextual
1233 * conflicts in a file's text or properties, or more complex
1234 * 'tree'-based conflcts related to obstructed additions, deletions,
1235 * and edits. The callback implementation is free to decide which
1236 * sorts of conflicts to handle; it's also free to decide which types
1237 * of conflicts are automatically resolvable and which require user
1240 * @since New in 1.5.
1242 typedef svn_error_t
*(*svn_wc_conflict_resolver_func_t
)
1243 (svn_wc_conflict_result_t
**result
,
1244 const svn_wc_conflict_description_t
*description
,
1253 * A callback vtable invoked by our diff-editors, as they receive
1254 * diffs from the server. 'svn diff' and 'svn merge' both implement
1255 * their own versions of this table.
1257 * @since New in 1.2.
1259 typedef struct svn_wc_diff_callbacks2_t
1261 /** A file @a path has changed. If @a tmpfile2 is non-NULL, the
1262 * contents have changed and those changes can be seen by comparing
1263 * @a tmpfile1 and @a tmpfile2, which represent @a rev1 and @a rev2 of
1264 * the file, respectively.
1266 * If known, the @c svn:mime-type value of each file is passed into
1267 * @a mimetype1 and @a mimetype2; either or both of the values can
1268 * be NULL. The implementor can use this information to decide if
1269 * (or how) to generate differences.
1271 * @a propchanges is an array of (@c svn_prop_t) structures. If it has
1272 * any elements, the original list of properties is provided in
1273 * @a originalprops, which is a hash of @c svn_string_t values, keyed on the
1276 * @a adm_access will be an access baton for the directory containing
1277 * @a path, or @c NULL if the diff editor is not using access batons.
1279 * If @a contentstate is non-NULL, set @a *contentstate to the state of
1280 * the file contents after the operation has been performed. The same
1281 * applies for @a propstate regarding the property changes. (In
1282 * practice, this is only useful with merge, not diff; diff callbacks
1283 * will probably set @a *contentstate and @a *propstate to
1284 * @c svn_wc_notify_state_unknown, since they do not change the state and
1285 * therefore do not bother to know the state after the operation.)
1287 svn_error_t
*(*file_changed
)(svn_wc_adm_access_t
*adm_access
,
1288 svn_wc_notify_state_t
*contentstate
,
1289 svn_wc_notify_state_t
*propstate
,
1291 const char *tmpfile1
,
1292 const char *tmpfile2
,
1295 const char *mimetype1
,
1296 const char *mimetype2
,
1297 const apr_array_header_t
*propchanges
,
1298 apr_hash_t
*originalprops
,
1301 /** A file @a path was added. The contents can be seen by comparing
1302 * @a tmpfile1 and @a tmpfile2, which represent @a rev1 and @a rev2
1303 * of the file, respectively. (If either file is empty, the rev
1306 * If known, the @c svn:mime-type value of each file is passed into
1307 * @a mimetype1 and @a mimetype2; either or both of the values can
1308 * be NULL. The implementor can use this information to decide if
1309 * (or how) to generate differences.
1311 * @a propchanges is an array of (@c svn_prop_t) structures. If it contains
1312 * any elements, the original list of properties is provided in
1313 * @a originalprops, which is a hash of @c svn_string_t values, keyed on the
1316 * @a adm_access will be an access baton for the directory containing
1317 * @a path, or @c NULL if the diff editor is not using access batons.
1319 * If @a contentstate is non-NULL, set @a *contentstate to the state of the
1320 * file contents after the operation has been performed. The same
1321 * applies for @a propstate regarding the property changes. (In practice,
1322 * this is only useful with merge, not diff; diff callbacks will
1323 * probably set @a *contentstate and *propstate to
1324 * @c svn_wc_notify_state_unknown, since they do not change the state
1325 * and therefore do not bother to know the state after the operation.)
1328 svn_error_t
*(*file_added
)(svn_wc_adm_access_t
*adm_access
,
1329 svn_wc_notify_state_t
*contentstate
,
1330 svn_wc_notify_state_t
*propstate
,
1332 const char *tmpfile1
,
1333 const char *tmpfile2
,
1336 const char *mimetype1
,
1337 const char *mimetype2
,
1338 const apr_array_header_t
*propchanges
,
1339 apr_hash_t
*originalprops
,
1342 /** A file @a path was deleted. The [loss of] contents can be seen by
1343 * comparing @a tmpfile1 and @a tmpfile2. @a originalprops provides
1344 * the properties of the file.
1346 * If known, the @c svn:mime-type value of each file is passed into
1347 * @a mimetype1 and @a mimetype2; either or both of the values can
1348 * be NULL. The implementor can use this information to decide if
1349 * (or how) to generate differences.
1351 * @a adm_access will be an access baton for the directory containing
1352 * @a path, or @c NULL if the diff editor is not using access batons.
1354 * If @a state is non-NULL, set @a *state to the state of the item
1355 * after the delete operation has been performed. (In practice,
1356 * this is only useful with merge, not diff; diff callbacks will
1357 * probably set @a *state to @c svn_wc_notify_state_unknown, since
1358 * they do not change the state and therefore do not bother to know
1359 * the state after the operation.)
1361 svn_error_t
*(*file_deleted
)(svn_wc_adm_access_t
*adm_access
,
1362 svn_wc_notify_state_t
*state
,
1364 const char *tmpfile1
,
1365 const char *tmpfile2
,
1366 const char *mimetype1
,
1367 const char *mimetype2
,
1368 apr_hash_t
*originalprops
,
1371 /** A directory @a path was added. @a rev is the revision that the
1372 * directory came from.
1374 * @a adm_access will be an access baton for the directory containing
1375 * @a path, or @c NULL if the diff editor is not using access batons.
1377 svn_error_t
*(*dir_added
)(svn_wc_adm_access_t
*adm_access
,
1378 svn_wc_notify_state_t
*state
,
1383 /** A directory @a path was deleted.
1385 * @a adm_access will be an access baton for the directory containing
1386 * @a path, or @c NULL if the diff editor is not using access batons.
1388 * If @a state is non-NULL, set @a *state to the state of the item
1389 * after the delete operation has been performed. (In practice,
1390 * this is only useful with merge, not diff; diff callbacks will
1391 * probably set @a *state to @c svn_wc_notify_state_unknown, since
1392 * they do not change the state and therefore do not bother to know
1393 * the state after the operation.)
1395 svn_error_t
*(*dir_deleted
)(svn_wc_adm_access_t
*adm_access
,
1396 svn_wc_notify_state_t
*state
,
1400 /** A list of property changes (@a propchanges) was applied to the
1401 * directory @a path.
1403 * The array is a list of (@c svn_prop_t) structures.
1405 * The original list of properties is provided in @a original_props,
1406 * which is a hash of @c svn_string_t values, keyed on the property
1409 * @a adm_access will be an access baton for the directory containing
1410 * @a path, or @c NULL if the diff editor is not using access batons.
1412 * If @a state is non-NULL, set @a *state to the state of the properties
1413 * after the operation has been performed. (In practice, this is only
1414 * useful with merge, not diff; diff callbacks will probably set @a *state
1415 * to @c svn_wc_notify_state_unknown, since they do not change the state
1416 * and therefore do not bother to know the state after the operation.)
1418 svn_error_t
*(*dir_props_changed
)(svn_wc_adm_access_t
*adm_access
,
1419 svn_wc_notify_state_t
*state
,
1421 const apr_array_header_t
*propchanges
,
1422 apr_hash_t
*original_props
,
1425 } svn_wc_diff_callbacks2_t
;
1428 * Similar to @c svn_wc_diff_callbacks2_t, but with file additions/content
1429 * changes and property changes split into different functions.
1431 * @deprecated Provided for backward compatibility with the 1.1 API.
1433 typedef struct svn_wc_diff_callbacks_t
1435 /** Similar to @c file_changed in @c svn_wc_diff_callbacks2_t, but without
1436 * property change information. @a tmpfile2 is never NULL. @a state applies
1437 * to the file contents. */
1438 svn_error_t
*(*file_changed
)(svn_wc_adm_access_t
*adm_access
,
1439 svn_wc_notify_state_t
*state
,
1441 const char *tmpfile1
,
1442 const char *tmpfile2
,
1445 const char *mimetype1
,
1446 const char *mimetype2
,
1449 /** Similar to @c file_added in @c svn_wc_diff_callbacks2_t, but without
1450 * property change information. @a *state applies to the file contents. */
1451 svn_error_t
*(*file_added
)(svn_wc_adm_access_t
*adm_access
,
1452 svn_wc_notify_state_t
*state
,
1454 const char *tmpfile1
,
1455 const char *tmpfile2
,
1458 const char *mimetype1
,
1459 const char *mimetype2
,
1462 /** Similar to @c file_deleted in @c svn_wc_diff_callbacks2_t, but without
1463 * the properties. */
1464 svn_error_t
*(*file_deleted
)(svn_wc_adm_access_t
*adm_access
,
1465 svn_wc_notify_state_t
*state
,
1467 const char *tmpfile1
,
1468 const char *tmpfile2
,
1469 const char *mimetype1
,
1470 const char *mimetype2
,
1473 /** The same as @c dir_added in @c svn_wc_diff_callbacks2_t. */
1474 svn_error_t
*(*dir_added
)(svn_wc_adm_access_t
*adm_access
,
1475 svn_wc_notify_state_t
*state
,
1480 /** The same as @c dir_deleted in @c svn_wc_diff_callbacks2_t. */
1481 svn_error_t
*(*dir_deleted
)(svn_wc_adm_access_t
*adm_access
,
1482 svn_wc_notify_state_t
*state
,
1486 /** Similar to @c dir_props_changed in @c svn_wc_diff_callbacks2_t, but this
1487 * function is called for files as well as directories. */
1488 svn_error_t
*(*props_changed
)(svn_wc_adm_access_t
*adm_access
,
1489 svn_wc_notify_state_t
*state
,
1491 const apr_array_header_t
*propchanges
,
1492 apr_hash_t
*original_props
,
1495 } svn_wc_diff_callbacks_t
;
1498 /* Asking questions about a working copy. */
1500 /** Set @a *wc_format to @a path's working copy format version number if
1501 * @a path is a valid working copy directory, else set it to 0.
1502 * Return error @c APR_ENOENT if @a path does not exist at all.
1505 svn_wc_check_wc(const char *path
,
1510 /** Set @a *has_binary_prop to @c TRUE iff @a path has been marked
1511 * with a property indicating that it is non-text (in other words, binary).
1512 * @a adm_access is an access baton set that contains @a path.
1515 svn_wc_has_binary_prop(svn_boolean_t
*has_binary_prop
,
1517 svn_wc_adm_access_t
*adm_access
,
1521 /* Detecting modification. */
1523 /** Set @a *modified_p to non-zero if @a filename's text is modified
1524 * with regard to the base revision, else set @a *modified_p to zero.
1525 * @a filename is a path to the file, not just a basename. @a adm_access
1526 * must be an access baton for @a filename.
1528 * If @a force_comparison is @c TRUE, this function will not allow
1529 * early return mechanisms that avoid actual content comparison.
1530 * Instead, if there is a text base, a full byte-by-byte comparison
1531 * will be done, and the entry checksum verified as well. (This means
1532 * that if the text base is much longer than the working file, every
1533 * byte of the text base will still be examined.)
1535 * If @a filename does not exist, consider it unmodified. If it exists
1536 * but is not under revision control (not even scheduled for
1537 * addition), return the error @c SVN_ERR_ENTRY_NOT_FOUND.
1539 * If @a filename is unmodified but has a timestamp variation then this
1540 * function may "repair" @a filename's text-time by setting it to
1541 * @a filename's last modification time.
1544 svn_wc_text_modified_p(svn_boolean_t
*modified_p
,
1545 const char *filename
,
1546 svn_boolean_t force_comparison
,
1547 svn_wc_adm_access_t
*adm_access
,
1551 /** Set @a *modified_p to non-zero if @a path's properties are modified
1552 * with regard to the base revision, else set @a modified_p to zero.
1553 * @a adm_access must be an access baton for @a path.
1556 svn_wc_props_modified_p(svn_boolean_t
*modified_p
,
1558 svn_wc_adm_access_t
*adm_access
,
1564 /** Administrative subdir.
1566 * Ideally, this would be completely private to wc internals (in fact,
1567 * it used to be that adm_subdir() in adm_files.c was the only function
1568 * who knew the adm subdir's name). However, import wants to protect
1569 * against importing administrative subdirs, so now the name is a
1570 * matter of public record.
1572 * @deprecated Provided for backward compatibility with the 1.2 API.
1574 #define SVN_WC_ADM_DIR_NAME ".svn"
1578 /* Entries and status. */
1580 /** The schedule states an entry can be in. */
1581 typedef enum svn_wc_schedule_t
1583 /** Nothing special here */
1584 svn_wc_schedule_normal
,
1586 /** Slated for addition */
1587 svn_wc_schedule_add
,
1589 /** Slated for deletion */
1590 svn_wc_schedule_delete
,
1592 /** Slated for replacement (delete + add) */
1593 svn_wc_schedule_replace
1595 } svn_wc_schedule_t
;
1599 * Values for the working_size field in svn_wc_entry_t
1600 * when it isn't set to the actual size value of the unchanged
1603 * @defgroup svn_wc_entry_working_size_constants Working size constants
1608 /** The value of the working size is unknown (hasn't been
1609 * calculated and stored in the past for whatever reason).
1613 #define SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN -1
1617 /** A working copy entry -- that is, revision control information about
1618 * one versioned entity.
1620 typedef struct svn_wc_entry_t
1622 /* IMPORTANT: If you extend this structure, add new fields to the end. */
1624 /* General Attributes */
1629 /** base revision */
1630 svn_revnum_t revision
;
1632 /** url in repository */
1635 /** canonical repository URL or NULL if not known */
1638 /** repository uuid */
1641 /** node kind (file, dir, ...) */
1642 svn_node_kind_t kind
;
1644 /* State information */
1646 /** scheduling (add, delete, replace ...) */
1647 svn_wc_schedule_t schedule
;
1649 /** in a copied state (possibly because the entry is a child of a
1650 path that is @c svn_wc_schedule_add or @c svn_wc_schedule_replace,
1651 when the entry itself is @c svn_wc_schedule_normal) */
1652 svn_boolean_t copied
;
1654 /** deleted, but parent rev lags behind */
1655 svn_boolean_t deleted
;
1657 /** absent -- we know an entry of this name exists, but that's all
1658 (usually this happens because of authz restrictions) */
1659 svn_boolean_t absent
;
1661 /** for THIS_DIR entry, implies whole entries file is incomplete */
1662 svn_boolean_t incomplete
;
1664 /** copyfrom location */
1665 const char *copyfrom_url
;
1667 /** copyfrom revision */
1668 svn_revnum_t copyfrom_rev
;
1670 /** old version of conflicted file */
1671 const char *conflict_old
;
1673 /** new version of conflicted file */
1674 const char *conflict_new
;
1676 /** working version of conflicted file */
1677 const char *conflict_wrk
;
1679 /** property reject file */
1680 const char *prejfile
;
1682 /** last up-to-date time for text contents (0 means no information available)
1684 apr_time_t text_time
;
1686 /** last up-to-date time for properties (0 means no information available) */
1687 apr_time_t prop_time
;
1689 /** Hex MD5 checksum for the untranslated text base file,
1690 * can be @c NULL for backwards compatibility.
1692 const char *checksum
;
1696 /** last revision this was changed */
1697 svn_revnum_t cmt_rev
;
1699 /** last date this was changed */
1700 apr_time_t cmt_date
;
1702 /** last commit author of this item */
1703 const char *cmt_author
;
1705 /** lock token or NULL if path not locked in this WC
1706 * @since New in 1.2.
1708 const char *lock_token
;
1709 /** lock owner, or NULL if not locked in this WC
1710 * @since New in 1.2.
1712 const char *lock_owner
;
1713 /** lock comment or NULL if not locked in this WC or no comment
1714 * @since New in 1.2.
1716 const char *lock_comment
;
1717 /** Lock creation date or 0 if not locked in this WC
1718 * @since New in 1.2.
1720 apr_time_t lock_creation_date
;
1722 /** Whether this entry has any working properties.
1723 * False if this information is not stored in the entry.
1725 * @since New in 1.4. */
1726 svn_boolean_t has_props
;
1728 /** Whether this entry has property modifications.
1730 * @note For working copies in older formats, this flag is not valid.
1732 * @see svn_wc_props_modified_p().
1734 * @since New in 1.4. */
1735 svn_boolean_t has_prop_mods
;
1737 /** A space-separated list of all properties whose presence/absence is cached
1740 * @see @c present_props.
1742 * @since New in 1.4. */
1743 const char *cachable_props
;
1745 /** Cached property existence for this entry.
1746 * This is a space-separated list of property names. If a name exists in
1747 * @c cachable_props but not in this list, this entry does not have that
1748 * property. If a name exists in both lists, the property is present on this
1751 * @since New in 1.4. */
1752 const char *present_props
;
1754 /** which changelist this item is part of, or NULL if not part of any.
1755 * @since New in 1.5.
1757 const char *changelist
;
1759 /** Size of the file after being translated into local
1760 * representation, or @c SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN if
1763 * @since New in 1.5.
1765 apr_off_t working_size
;
1767 /** Whether a local copy of this entry should be kept in the working copy
1768 * after a deletion has been committed, Only valid for the this-dir entry
1769 * when it is scheduled for deletion.
1771 * @since New in 1.5. */
1772 svn_boolean_t keep_local
;
1774 /** The depth of this entry.
1776 * ### It's a bit annoying that we only use this on this_dir
1777 * ### entries, yet it will exist (with value svn_depth_infinity) on
1778 * ### all entries. Maybe some future extensibility would make this
1779 * ### field meaningful on entries besides this_dir.
1781 * @since New in 1.5. */
1784 /* IMPORTANT: If you extend this structure, check the following functions in
1785 * subversion/libsvn_wc/entries.c, to see if you need to extend them as well.
1787 * svn_wc__atts_to_entry()
1788 * svn_wc_entry_dup()
1798 /** How an entries file's owner dir is named in the entries file. */
1799 #define SVN_WC_ENTRY_THIS_DIR ""
1802 /** Set @a *entry to an entry for @a path, allocated in the access baton
1803 * pool. If @a show_hidden is TRUE, return the entry even if it's in
1804 * 'deleted' or 'absent' state. If @a path is not under revision
1805 * control, or if entry is hidden, not scheduled for re-addition,
1806 * and @a show_hidden is @c FALSE, then set @a *entry to @c NULL.
1808 * @a *entry should not be modified, since doing so modifies the entries
1809 * cache in @a adm_access without changing the entries file on disk.
1811 * If @a path is not a directory then @a adm_access must be an access baton
1812 * for the parent directory of @a path. To avoid needing to know whether
1813 * @a path is a directory or not, if @a path is a directory @a adm_access
1814 * can still be an access baton for the parent of @a path so long as the
1815 * access baton for @a path itself is in the same access baton set.
1817 * @a path can be relative or absolute but must share the same base used
1818 * to open @a adm_access.
1820 * Note that it is possible for @a path to be absent from disk but still
1821 * under revision control; and conversely, it is possible for @a path to
1822 * be present, but not under revision control.
1824 * Use @a pool only for local processing.
1827 svn_wc_entry(const svn_wc_entry_t
**entry
,
1829 svn_wc_adm_access_t
*adm_access
,
1830 svn_boolean_t show_hidden
,
1834 /** Parse the `entries' file for @a adm_access and return a hash @a entries,
1835 * whose keys are (<tt>const char *</tt>) entry names and values are
1836 * (<tt>svn_wc_entry_t *</tt>). The hash @a entries, and its keys and
1837 * values, are allocated from the pool used to open the @a adm_access
1838 * baton (that's how the entries caching works). @a pool is used for
1839 * transient allocations.
1841 * Entries that are in a 'deleted' or 'absent' state (and not
1842 * scheduled for re-addition) are not returned in the hash, unless
1843 * @a show_hidden is TRUE.
1846 * The @a entries hash is the entries cache in @a adm_access
1847 * and so usually the hash itself, the keys and the values should be treated
1848 * as read-only. If any of these are modified then it is the caller's
1849 * responsibility to ensure that the entries file on disk is updated. Treat
1850 * the hash values as type (<tt>const svn_wc_entry_t *</tt>) if you wish to
1851 * avoid accidental modification. Modifying the schedule member is a
1852 * particularly bad idea, as the entries writing process relies on having
1853 * access to the original schedule. Use a duplicate entry to modify the
1857 * Only the entry structures representing files and
1858 * @c SVN_WC_ENTRY_THIS_DIR contain complete information. The entry
1859 * structures representing subdirs have only the `kind' and `state'
1860 * fields filled in. If you want info on a subdir, you must use this
1861 * routine to open its @a path and read the @c SVN_WC_ENTRY_THIS_DIR
1862 * structure, or call svn_wc_entry() on its @a path.
1865 svn_wc_entries_read(apr_hash_t
**entries
,
1866 svn_wc_adm_access_t
*adm_access
,
1867 svn_boolean_t show_hidden
,
1871 /** Return a duplicate of @a entry, allocated in @a pool. No part of the new
1872 * entry will be shared with @a entry.
1875 svn_wc_entry_dup(const svn_wc_entry_t
*entry
,
1879 /** Given a @a dir_path under version control, decide if one of its
1880 * entries (@a entry) is in state of conflict; return the answers in
1881 * @a text_conflicted_p and @a prop_conflicted_p.
1883 * (If the entry mentions that a .rej or .prej exist, but they are
1884 * both removed, assume the conflict has been resolved by the user.)
1887 svn_wc_conflicted_p(svn_boolean_t
*text_conflicted_p
,
1888 svn_boolean_t
*prop_conflicted_p
,
1889 const char *dir_path
,
1890 const svn_wc_entry_t
*entry
,
1893 /** Set @a *url and @a *rev to the ancestor URL and revision for @a path,
1894 * allocating in @a pool. @a adm_access must be an access baton for @a path.
1896 * If @a url or @a rev is NULL, then ignore it (just don't return the
1897 * corresponding information).
1900 svn_wc_get_ancestry(char **url
,
1903 svn_wc_adm_access_t
*adm_access
,
1907 /** A callback vtable invoked by the generic entry-walker function.
1908 * @since New in 1.5.
1910 typedef struct svn_wc_entry_callbacks2_t
1912 /** An @a entry was found at @a path. */
1913 svn_error_t
*(*found_entry
)(const char *path
,
1914 const svn_wc_entry_t
*entry
,
1918 /** Handle the error @a err encountered while processing @a path.
1919 * Wrap or squelch @a err as desired, and return an @c svn_error_t
1920 * *, or @c SVN_NO_ERROR.
1922 svn_error_t
*(*handle_error
)(const char *path
,
1927 } svn_wc_entry_callbacks2_t
;
1929 /** @deprecated Provided for backward compatibility with the 1.4 API. */
1930 typedef struct svn_wc_entry_callbacks_t
1932 /** An @a entry was found at @a path. */
1933 svn_error_t
*(*found_entry
)(const char *path
,
1934 const svn_wc_entry_t
*entry
,
1938 } svn_wc_entry_callbacks_t
;
1941 * A generic entry-walker.
1943 * Do a potentially recursive depth-first entry-walk beginning on
1944 * @a path, which can be a file or dir. Call callbacks in
1945 * @a walk_callbacks, passing @a walk_baton to each. Use @a pool for
1946 * looping, recursion, and to allocate all entries returned.
1947 * @a adm_access must be an access baton for @a path.
1949 * If @a depth is @c svn_depth_empty, invoke the callbacks on @a path
1950 * and return without recursing further. If @c svn_depth_files, do
1951 * the same and invoke the callbacks on file children (if any) of
1952 * @a path, then return. If @c svn_depth_immediates, do the preceding
1953 * but also invoke callbacks on immediate subdirectories, then return.
1954 * If @c svn_depth_infinity, recurse fully starting from @a path.
1956 * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
1957 * if the client has cancelled the operation.
1959 * Like our other entries interfaces, entries that are in a 'deleted'
1960 * or 'absent' state (and not scheduled for re-addition) are not
1961 * discovered, unless @a show_hidden is TRUE.
1963 * When a new directory is entered, @c SVN_WC_ENTRY_THIS_DIR will always
1964 * be returned first.
1966 * @note Callers should be aware that each directory will be
1967 * returned *twice*: first as an entry within its parent, and
1968 * subsequently as the '.' entry within itself. The two calls can be
1969 * distinguished by looking for @c SVN_WC_ENTRY_THIS_DIR in the 'name'
1970 * field of the entry.
1972 * @since New in 1.5.
1975 svn_wc_walk_entries3(const char *path
,
1976 svn_wc_adm_access_t
*adm_access
,
1977 const svn_wc_entry_callbacks2_t
1981 svn_boolean_t show_hidden
,
1982 svn_cancel_func_t cancel_func
,
1987 * Similar to svn_wc_walk_entries3(), but without cancellation support
1988 * or error handling from @a walk_callbacks, and with @a depth always
1989 * set to @c svn_depth_infinity.
1991 * @deprecated Provided for backward compatibility with the 1.4 API.
1994 svn_wc_walk_entries2(const char *path
,
1995 svn_wc_adm_access_t
*adm_access
,
1996 const svn_wc_entry_callbacks_t
1999 svn_boolean_t show_hidden
,
2000 svn_cancel_func_t cancel_func
,
2005 * Similar to svn_wc_walk_entries2(), but without cancellation support.
2007 * @deprecated Provided for backward compatibility with the 1.0 API.
2010 svn_wc_walk_entries(const char *path
,
2011 svn_wc_adm_access_t
*adm_access
,
2012 const svn_wc_entry_callbacks_t
2015 svn_boolean_t show_hidden
,
2019 /** Mark missing @a path as 'deleted' in its @a parent's list of entries.
2021 * Return @c SVN_ERR_WC_PATH_FOUND if @a path isn't actually missing.
2024 svn_wc_mark_missing_deleted(const char *path
,
2025 svn_wc_adm_access_t
*parent
,
2029 /** Ensure that an administrative area exists for @a path, so that @a
2030 * path is a working copy subdir based on @a url at @a revision, with
2031 * depth @a depth, and with repository UUID @a uuid and repository
2032 * root URL @a repos.
2034 * @a depth must be a definite depth, it cannot be @c svn_depth_unknown.
2035 * @a uuid and @a repos may be @c NULL. If non-@c NULL, @a repos must
2036 * be a prefix of @a url.
2038 * If the administrative area does not exist, then create it and
2039 * initialize it to an unlocked state.
2041 * If the administrative area already exists then the given @a url
2042 * must match the URL in the administrative area and the given
2043 * @a revision must match the BASE of the working copy dir unless
2044 * the admin directory is scheduled for deletion or the
2045 * SVN_ERR_WC_OBSTRUCTED_UPDATE error will be returned.
2047 * Do not ensure existence of @a path itself; if @a path does not
2048 * exist, return error.
2050 * @since New in 1.5.
2053 svn_wc_ensure_adm3(const char *path
,
2057 svn_revnum_t revision
,
2063 * Similar to svn_wc_ensure_adm3(), but with @a depth set to
2064 * @c svn_depth_infinity.
2066 * @deprecated Provided for backwards compatibility with the 1.4 API.
2068 * @since New in 1.3.
2071 svn_wc_ensure_adm2(const char *path
,
2075 svn_revnum_t revision
,
2080 * Similar to svn_wc_ensure_adm2(), but with @a repos set to @c NULL.
2082 * @deprecated Provided for backwards compatibility with the 1.2 API.
2085 svn_wc_ensure_adm(const char *path
,
2088 svn_revnum_t revision
,
2092 /** Set the repository root URL of @a path to @a repos, if possible.
2094 * @a adm_access must contain @a path and be write-locked, if @a path
2095 * is versioned. Return no error if path is missing or unversioned.
2096 * Use @a pool for temporary allocations.
2098 * @note In some circumstances, the repository root can't be set
2099 * without making the working copy corrupt. In such cases, this
2100 * function just returns no error, without modifying the @a path entry.
2102 * @note This function exists to make it possible to try to set the repository
2103 * root in old working copies; new working copies normally get this set at
2106 * @since New in 1.3.
2109 svn_wc_maybe_set_repos_root(svn_wc_adm_access_t
*adm_access
,
2116 * @defgroup svn_wc_status Working copy status.
2119 * We have two functions for getting working copy status: one function
2120 * for getting the status of exactly one thing, and another for
2121 * getting the statuses of (potentially) multiple things.
2123 * The concept of depth, as explained in the documentation for
2124 * svn_depth_t, may be useful in understanding this. Suppose we're
2125 * getting the status of directory D:
2127 * To offer all three levels, we could have one unified function,
2128 * taking a `depth' parameter. Unfortunately, because this function
2129 * would have to handle multiple return values as well as the single
2130 * return value case, getting the status of just one entity would
2131 * become cumbersome: you'd have to roll through a hash to find one
2134 * So we have svn_wc_status() for depth-empty (just D itself), and
2135 * svn_wc_get_status_editor() for depth-immediates and depth-infinity,
2136 * since the latter two involve multiple return values.
2138 * @note The status structures may contain a @c NULL ->entry field.
2139 * This indicates an item that is not versioned in the working copy.
2142 /** The type of status for the working copy. */
2143 enum svn_wc_status_kind
2145 /** does not exist */
2146 svn_wc_status_none
= 1,
2148 /** is not a versioned thing in this wc */
2149 svn_wc_status_unversioned
,
2151 /** exists, but uninteresting */
2152 svn_wc_status_normal
,
2154 /** is scheduled for addition */
2155 svn_wc_status_added
,
2157 /** under v.c., but is missing */
2158 svn_wc_status_missing
,
2160 /** scheduled for deletion */
2161 svn_wc_status_deleted
,
2163 /** was deleted and then re-added */
2164 svn_wc_status_replaced
,
2166 /** text or props have been modified */
2167 svn_wc_status_modified
,
2169 /** local mods received repos mods */
2170 svn_wc_status_merged
,
2172 /** local mods received conflicting repos mods */
2173 svn_wc_status_conflicted
,
2175 /** is unversioned but configured to be ignored */
2176 svn_wc_status_ignored
,
2178 /** an unversioned resource is in the way of the versioned resource */
2179 svn_wc_status_obstructed
,
2181 /** an unversioned path populated by an svn:externals property */
2182 svn_wc_status_external
,
2184 /** a directory doesn't contain a complete entries list */
2185 svn_wc_status_incomplete
2189 * Structure for holding the "status" of a working copy item.
2191 * The item's entry data is in @a entry, augmented and possibly shadowed
2192 * by the other fields. @a entry is @c NULL if this item is not under
2195 * @note Fields may be added to the end of this structure in future
2196 * versions. Therefore, to preserve binary compatibility, users
2197 * should not directly allocate structures of this type.
2199 * @since New in 1.2.
2201 typedef struct svn_wc_status2_t
2203 /** Can be @c NULL if not under version control. */
2204 svn_wc_entry_t
*entry
;
2206 /** The status of the entries text. */
2207 enum svn_wc_status_kind text_status
;
2209 /** The status of the entries properties. */
2210 enum svn_wc_status_kind prop_status
;
2212 /** a directory can be 'locked' if a working copy update was interrupted. */
2213 svn_boolean_t locked
;
2215 /** a file or directory can be 'copied' if it's scheduled for
2216 * addition-with-history (or part of a subtree that is scheduled as such.).
2218 svn_boolean_t copied
;
2220 /** a file or directory can be 'switched' if the switch command has been
2223 svn_boolean_t switched
;
2225 /** The entry's text status in the repository. */
2226 enum svn_wc_status_kind repos_text_status
;
2228 /** The entry's property status in the repository. */
2229 enum svn_wc_status_kind repos_prop_status
;
2231 /** The entry's lock in the repository, if any. */
2232 svn_lock_t
*repos_lock
;
2234 /** Set to the URI (actual or expected) of the item.
2240 * @defgroup svn_wc_status_ood WC out-of-date info from the repository
2243 * When the working copy item is out-of-date compared to the
2244 * repository, the following fields represent the state of the
2245 * youngest revision of the item in the repository. If the working
2246 * copy is not out of date, the fields are initialized as described
2250 /** Set to the youngest committed revision, or @c SVN_INVALID_REVNUM
2251 * if not out of date.
2254 svn_revnum_t ood_last_cmt_rev
;
2256 /** Set to the most recent commit date, or @c 0 if not out of date.
2259 apr_time_t ood_last_cmt_date
;
2261 /** Set to the node kind of the youngest commit, or @c svn_node_none
2262 * if not out of date.
2265 svn_node_kind_t ood_kind
;
2267 /** Set to the user name of the youngest commit, or @c NULL if not
2268 * out of date or non-existent. Because a non-existent @c
2269 * svn:author property has the same behavior as an out-of-date
2270 * working copy, examine @c ood_last_cmt_rev to determine whether
2271 * the working copy is out of date.
2274 const char *ood_last_cmt_author
;
2278 /* NOTE! Please update svn_wc_dup_status2() when adding new fields here. */
2284 * Same as @c svn_wc_status2_t, but without the svn_lock_t 'repos_lock' field.
2286 * @deprecated Provided for backward compatibility with the 1.1 API.
2288 typedef struct svn_wc_status_t
2290 /** Can be @c NULL if not under version control. */
2291 svn_wc_entry_t
*entry
;
2293 /** The status of the entries text. */
2294 enum svn_wc_status_kind text_status
;
2296 /** The status of the entries properties. */
2297 enum svn_wc_status_kind prop_status
;
2299 /** a directory can be 'locked' if a working copy update was interrupted. */
2300 svn_boolean_t locked
;
2302 /** a file or directory can be 'copied' if it's scheduled for
2303 * addition-with-history (or part of a subtree that is scheduled as such.).
2305 svn_boolean_t copied
;
2307 /** a file or directory can be 'switched' if the switch command has been
2310 svn_boolean_t switched
;
2312 /** The entry's text status in the repository. */
2313 enum svn_wc_status_kind repos_text_status
;
2315 /** The entry's property status in the repository. */
2316 enum svn_wc_status_kind repos_prop_status
;
2323 * Return a deep copy of the @a orig_stat status structure, allocated
2326 * @since New in 1.2.
2329 svn_wc_dup_status2(svn_wc_status2_t
*orig_stat
,
2334 * Same as svn_wc_dup_status2(), but for older svn_wc_status_t structures.
2336 * @deprecated Provided for backward compatibility with the 1.1 API.
2339 svn_wc_dup_status(svn_wc_status_t
*orig_stat
,
2344 * Fill @a *status for @a path, allocating in @a pool.
2345 * @a adm_access must be an access baton for @a path.
2347 * Here are some things to note about the returned structure. A quick
2348 * examination of the @c status->text_status after a successful return of
2349 * this function can reveal the following things:
2351 * - @c svn_wc_status_none : @a path is not versioned, and is either not
2352 * present on disk, or is ignored by svn's
2353 * default ignore regular expressions or the
2354 * svn:ignore property setting for @a path's
2357 * - @c svn_wc_status_missing : @a path is versioned, but is missing from
2360 * - @c svn_wc_status_unversioned : @a path is not versioned, but is
2361 * present on disk and not being
2362 * ignored (see above).
2364 * The other available results for the @c text_status field are more
2365 * straightforward in their meanings. See the comments on the
2366 * @c svn_wc_status_kind structure for some hints.
2368 * @since New in 1.2.
2371 svn_wc_status2(svn_wc_status2_t
**status
,
2373 svn_wc_adm_access_t
*adm_access
,
2378 * Same as svn_wc_status2(), but for older svn_wc_status_t structures.
2380 * @deprecated Provided for backward compatibility with the 1.1 API.
2383 svn_wc_status(svn_wc_status_t
**status
,
2385 svn_wc_adm_access_t
*adm_access
,
2392 * A callback for reporting a @a status about @a path.
2394 * @a baton is a closure object; it should be provided by the
2395 * implementation, and passed by the caller.
2397 * @since New in 1.2.
2399 typedef void (*svn_wc_status_func2_t
)(void *baton
,
2401 svn_wc_status2_t
*status
);
2404 * Same as svn_wc_status_func2_t(), but for older svn_wc_status_t structures.
2406 * @deprecated Provided for backward compatibility with the 1.1 API.
2408 typedef void (*svn_wc_status_func_t
)(void *baton
,
2410 svn_wc_status_t
*status
);
2414 * Set @a *editor and @a *edit_baton to an editor that generates @c
2415 * svn_wc_status2_t structures and sends them through @a status_func /
2416 * @a status_baton. @a anchor is an access baton, with a tree lock,
2417 * for the local path to the working copy which will be used as the
2418 * root of our editor. If @a target is not empty, it represents an
2419 * entry in the @a anchor path which is the subject of the editor
2420 * drive (otherwise, the @a anchor is the subject).
2422 * If @a set_locks_baton is non-@c NULL, it will be set to a baton that can
2423 * be used in a call to the svn_wc_status_set_repos_locks() function.
2425 * Callers drive this editor to describe working copy out-of-dateness
2426 * with respect to the repository. If this information is not
2427 * available or not desired, callers should simply call the
2428 * close_edit() function of the @a editor vtable.
2430 * If the editor driver calls @a editor's set_target_revision() vtable
2431 * function, then when the edit drive is completed, @a *edit_revision
2432 * will contain the revision delivered via that interface.
2434 * Assuming the target is a directory, then:
2436 * - If @a get_all is FALSE, then only locally-modified entries will be
2437 * returned. If TRUE, then all entries will be returned.
2439 * - If @a depth is @c svn_depth_empty, a status structure will
2440 * be returned for the target only; if @c svn_depth_files, for the
2441 * target and its immediate file children; if
2442 * @c svn_depth_immediates, for the target and its immediate
2443 * children; if @c svn_depth_infinity, for the target and
2444 * everything underneath it, fully recursively.
2446 * If @a depth is @c svn_depth_unknown, take depths from the
2447 * working copy and behave as above in each directory's case.
2449 * If the given @a depth is incompatible with the depth found in a
2450 * working copy directory, the found depth always governs.
2452 * If @a no_ignore is set, statuses that would typically be ignored
2453 * will instead be reported.
2455 * @a ignore_patterns is an array of file patterns matching
2456 * unversioned files to ignore for the purposes of status reporting,
2457 * or @c NULL if the default set of ignorable file patterns should be used.
2459 * If @a cancel_func is non-NULL, call it with @a cancel_baton while building
2460 * the @a statushash to determine if the client has cancelled the operation.
2462 * If @a traversal_info is non-NULL, then record pre-update traversal
2463 * state in it. (Caller should obtain @a traversal_info from
2464 * svn_wc_init_traversal_info().)
2466 * Allocate the editor itself in @a pool, but the editor does temporary
2467 * allocations in a subpool of @a pool.
2469 * @since New in 1.5.
2472 svn_wc_get_status_editor3(const svn_delta_editor_t
**editor
,
2474 void **set_locks_baton
,
2475 svn_revnum_t
*edit_revision
,
2476 svn_wc_adm_access_t
*anchor
,
2479 svn_boolean_t get_all
,
2480 svn_boolean_t no_ignore
,
2481 apr_array_header_t
*ignore_patterns
,
2482 svn_wc_status_func2_t status_func
,
2484 svn_cancel_func_t cancel_func
,
2486 svn_wc_traversal_info_t
*traversal_info
,
2490 * Like svn_wc_get_status_editor3(), but with @a ignore_patterns
2491 * provided from the corresponding value in @a config, and @a recurse
2492 * instead of @a depth. If @a recurse is TRUE, behave as if for @c
2493 * svn_depth_infinity; else if @a recurse is FALSE, behave as if for
2494 * @c svn_depth_immediates.
2496 * @since New in 1.2.
2497 * @deprecated Provided for backward compatibility with the 1.4 API.
2500 svn_wc_get_status_editor2(const svn_delta_editor_t
**editor
,
2502 void **set_locks_baton
,
2503 svn_revnum_t
*edit_revision
,
2504 svn_wc_adm_access_t
*anchor
,
2507 svn_boolean_t recurse
,
2508 svn_boolean_t get_all
,
2509 svn_boolean_t no_ignore
,
2510 svn_wc_status_func2_t status_func
,
2512 svn_cancel_func_t cancel_func
,
2514 svn_wc_traversal_info_t
*traversal_info
,
2518 * Same as svn_wc_get_status_editor2(), but with @a set_locks_baton set
2519 * to @c NULL, and taking a deprecated svn_wc_status_func_t argument.
2521 * @deprecated Provided for backward compatibility with the 1.1 API.
2524 svn_wc_get_status_editor(const svn_delta_editor_t
**editor
,
2526 svn_revnum_t
*edit_revision
,
2527 svn_wc_adm_access_t
*anchor
,
2530 svn_boolean_t recurse
,
2531 svn_boolean_t get_all
,
2532 svn_boolean_t no_ignore
,
2533 svn_wc_status_func_t status_func
,
2535 svn_cancel_func_t cancel_func
,
2537 svn_wc_traversal_info_t
*traversal_info
,
2542 * Associate @a locks, a hash table mapping <tt>const char*</tt>
2543 * absolute repository paths to <tt>svn_lock_t</tt> objects, with a
2544 * @a set_locks_baton returned by an earlier call to
2545 * svn_wc_get_status_editor3(). @a repos_root is the repository root URL.
2546 * Perform all allocations in @a pool.
2548 * @note @a locks will not be copied, so it must be valid throughout the
2549 * edit. @a pool must also not be destroyed or cleared before the edit is
2552 * @since New in 1.2.
2555 svn_wc_status_set_repos_locks(void *set_locks_baton
,
2557 const char *repos_root
,
2564 * Copy @a src to @a dst_basename in @a dst_parent, and schedule
2565 * @a dst_basename for addition to the repository, remembering the copy
2568 * @a src must be a file or directory under version control; @a dst_parent
2569 * must be a directory under version control in the same working copy;
2570 * @a dst_basename will be the name of the copied item, and it must not
2573 * If @a cancel_func is non-NULL, call it with @a cancel_baton at
2574 * various points during the operation. If it returns an error
2575 * (typically @c SVN_ERR_CANCELLED), return that error immediately.
2577 * For each file or directory copied, @a notify_func will be called
2578 * with its path and the @a notify_baton. @a notify_func may be @c NULL
2579 * if you are not interested in this information.
2582 * This is a variant of svn_wc_add(). No changes will happen
2583 * to the repository until a commit occurs. This scheduling can be
2584 * removed with svn_client_revert2().
2586 * @since New in 1.2.
2589 svn_wc_copy2(const char *src
,
2590 svn_wc_adm_access_t
*dst_parent
,
2591 const char *dst_basename
,
2592 svn_cancel_func_t cancel_func
,
2594 svn_wc_notify_func2_t notify_func
,
2599 * Similar to svn_wc_copy2(), but takes an @c svn_wc_notify_func_t instead.
2601 * @deprecated Provided for backward compatibility with the 1.1 API.
2604 svn_wc_copy(const char *src
,
2605 svn_wc_adm_access_t
*dst_parent
,
2606 const char *dst_basename
,
2607 svn_cancel_func_t cancel_func
,
2609 svn_wc_notify_func_t notify_func
,
2614 * Schedule @a path for deletion, it will be deleted from the repository on
2615 * the next commit. If @a path refers to a directory, then a recursive
2616 * deletion will occur. @a adm_access must hold a write lock for the parent
2619 * If @a keep_local is FALSE, this function immediately deletes all files,
2620 * modified and unmodified, versioned and unversioned from the working copy.
2621 * It also immediately deletes unversioned directories and directories that
2622 * are scheduled to be added. Only versioned directories will remain in the
2623 * working copy, these get deleted by the update following the commit.
2625 * If @a keep_local is TRUE, all files and directories will be kept in the
2626 * working copy (and will become unversioned on the next commit).
2628 * If @a cancel_func is non-NULL, call it with @a cancel_baton at
2629 * various points during the operation. If it returns an error
2630 * (typically @c SVN_ERR_CANCELLED), return that error immediately.
2632 * For each path marked for deletion, @a notify_func will be called with
2633 * the @a notify_baton and that path. The @a notify_func callback may be
2634 * @c NULL if notification is not needed.
2636 * @since New in 1.5.
2639 svn_wc_delete3(const char *path
,
2640 svn_wc_adm_access_t
*adm_access
,
2641 svn_cancel_func_t cancel_func
,
2643 svn_wc_notify_func2_t notify_func
,
2645 svn_boolean_t keep_local
,
2649 * Similar to svn_wc_delete3(), but with @a keep_local always set to FALSE.
2651 * @deprecated Provided for backward compatibility with the 1.4 API.
2654 svn_wc_delete2(const char *path
,
2655 svn_wc_adm_access_t
*adm_access
,
2656 svn_cancel_func_t cancel_func
,
2658 svn_wc_notify_func2_t notify_func
,
2663 * Similar to svn_wc_delete2(), but takes an @c svn_wc_notify_func_t instead.
2665 * @deprecated Provided for backward compatibility with the 1.1 API.
2668 svn_wc_delete(const char *path
,
2669 svn_wc_adm_access_t
*adm_access
,
2670 svn_cancel_func_t cancel_func
,
2672 svn_wc_notify_func_t notify_func
,
2678 * Put @a path under version control by adding an entry in its parent,
2679 * and, if @a path is a directory, adding an administrative area. The
2680 * new entry and anything under it is scheduled for addition to the
2681 * repository. @a parent_access should hold a write lock for the parent
2682 * directory of @a path. If @a path is a directory then an access baton
2683 * for @a path will be added to the set containing @a parent_access.
2685 * If @a path does not exist, return @c SVN_ERR_WC_PATH_NOT_FOUND.
2687 * If @a copyfrom_url is non-NULL, it and @a copyfrom_rev are used as
2688 * `copyfrom' args. This is for copy operations, where one wants
2689 * to schedule @a path for addition with a particular history.
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 * When the @a path has been added, then @a notify_func will be called
2696 * (if it is not @c NULL) with the @a notify_baton and the path.
2698 * Return @c SVN_ERR_WC_NODE_KIND_CHANGE if @a path is both an unversioned
2699 * directory and a file that is scheduled for deletion or in state deleted.
2701 *<pre> ### This function currently does double duty -- it is also
2702 * ### responsible for "switching" a working copy directory over to a
2703 * ### new copyfrom ancestry and scheduling it for addition. Here is
2704 * ### the old doc string from Ben, lightly edited to bring it
2705 * ### up-to-date, explaining the TRUE, secret life of this function:</pre>
2707 * Given a @a path within a working copy of type KIND, follow this algorithm:
2709 * - if @a path is not under version control:
2710 * - Place it under version control and schedule for addition;
2711 * if @a copyfrom_url is non-NULL, use it and @a copyfrom_rev as
2712 * 'copyfrom' history
2714 * - if @a path is already under version control:
2715 * (This can only happen when a directory is copied, in which
2716 * case ancestry must have been supplied as well.)
2718 * - Schedule the directory itself for addition with copyfrom history.
2719 * - Mark all its children with a 'copied' flag
2720 * - Rewrite all the URLs to what they will be after a commit.
2721 * - ### @todo Remove old wcprops too, see the '###' below.
2723 *<pre> ### I think possibly the "switchover" functionality should be
2724 * ### broken out into a separate function, but its all intertwined in
2725 * ### the code right now. Ben, thoughts? Hard? Easy? Mauve?</pre>
2727 * ### Update: see "###" comment in svn_wc_add_repos_file()'s doc
2728 * string about this.
2730 * @since New in 1.2.
2733 svn_wc_add2(const char *path
,
2734 svn_wc_adm_access_t
*parent_access
,
2735 const char *copyfrom_url
,
2736 svn_revnum_t copyfrom_rev
,
2737 svn_cancel_func_t cancel_func
,
2739 svn_wc_notify_func2_t notify_func
,
2744 * Similar to svn_wc_add2(), but takes an @c svn_wc_notify_func_t instead.
2746 * @deprecated Provided for backward compatibility with the 1.1 API.
2749 svn_wc_add(const char *path
,
2750 svn_wc_adm_access_t
*parent_access
,
2751 const char *copyfrom_url
,
2752 svn_revnum_t copyfrom_rev
,
2753 svn_cancel_func_t cancel_func
,
2755 svn_wc_notify_func_t notify_func
,
2759 /** Add a file to a working copy at @a dst_path, obtaining the text-base's
2760 * contents from @a new_text_base_path, the wc file's content from
2761 * @a new_text_path, its base properties from @a new_base_props and
2762 * wc properties from @a new_props.
2763 * The base text and props normally come from the repository file
2764 * represented by the copyfrom args, see below. The new file will
2765 * be scheduled for addition with history.
2767 * Automatically remove @a new_text_base_path and @a new_text_path
2768 * upon successful completion.
2770 * @a new_text_path and @a new_props may be NULL, in which case
2771 * the working copy text and props are taken from the base files with
2772 * appropriate translation of the file's content.
2774 * @a adm_access, or an access baton in its associated set, must
2775 * contain a write lock for the parent of @a dst_path.
2777 * If @a copyfrom_url is non-NULL, then @a copyfrom_rev must be a
2778 * valid revision number, and together they are the copyfrom history
2781 * Use @a pool for temporary allocations.
2783 * ### This function is very redundant with svn_wc_add(). Ideally,
2784 * we'd merge them, so that svn_wc_add() would just take optional
2785 * new_props and optional copyfrom information. That way it could be
2786 * used for both 'svn add somefilesittingonmydisk' and for adding
2787 * files from repositories, with or without copyfrom history.
2789 * The problem with this Ideal Plan is that svn_wc_add() also takes
2790 * care of recursive URL-rewriting. There's a whole comment in its
2791 * doc string about how that's really weird, outside its core mission,
2792 * etc, etc. So another part of the Ideal Plan is that that
2793 * functionality of svn_wc_add() would move into a separate function.
2798 svn_wc_add_repos_file2(const char *dst_path
,
2799 svn_wc_adm_access_t
*adm_access
,
2800 const char *new_text_base_path
,
2801 const char *new_text_path
,
2802 apr_hash_t
*new_base_props
,
2803 apr_hash_t
*new_props
,
2804 const char *copyfrom_url
,
2805 svn_revnum_t copyfrom_rev
,
2808 /** Same as svn_wc_add_repos_file2(), except that it doesn't have the
2809 * new_text_base_path and new_base_props arguments.
2811 * @deprecated Provided for compatibility with the 1.3 API
2816 svn_wc_add_repos_file(const char *dst_path
,
2817 svn_wc_adm_access_t
*adm_access
,
2818 const char *new_text_path
,
2819 apr_hash_t
*new_props
,
2820 const char *copyfrom_url
,
2821 svn_revnum_t copyfrom_rev
,
2825 /** Remove entry @a name in @a adm_access from revision control. @a name
2826 * must be either a file or @c SVN_WC_ENTRY_THIS_DIR. @a adm_access must
2827 * hold a write lock.
2829 * If @a name is a file, all its info will be removed from @a adm_access's
2830 * administrative directory. If @a name is @c SVN_WC_ENTRY_THIS_DIR, then
2831 * @a adm_access's entire administrative area will be deleted, along with
2832 * *all* the administrative areas anywhere in the tree below @a adm_access.
2834 * Normally, only administrative data is removed. However, if
2835 * @a destroy_wf is TRUE, then all working file(s) and dirs are deleted
2836 * from disk as well. When called with @a destroy_wf, any locally
2837 * modified files will *not* be deleted, and the special error
2838 * @c SVN_ERR_WC_LEFT_LOCAL_MOD might be returned. (Callers only need to
2839 * check for this special return value if @a destroy_wf is TRUE.)
2841 * If @a instant_error is TRUE, then return @c
2842 * SVN_ERR_WC_LEFT_LOCAL_MOD the instant a locally modified file is
2843 * encountered. Otherwise, leave locally modified files in place and
2844 * return the error only after all the recursion is complete.
2846 * If @a cancel_func is non-NULL, call it with @a cancel_baton at
2847 * various points during the removal. If it returns an error
2848 * (typically @c SVN_ERR_CANCELLED), return that error immediately.
2850 * WARNING: This routine is exported for careful, measured use by
2851 * libsvn_client. Do *not* call this routine unless you really
2852 * understand what the heck you're doing.
2855 svn_wc_remove_from_revision_control(svn_wc_adm_access_t
*adm_access
,
2857 svn_boolean_t destroy_wf
,
2858 svn_boolean_t instant_error
,
2859 svn_cancel_func_t cancel_func
,
2865 * Assuming @a path is under version control and in a state of conflict,
2866 * then take @a path *out* of this state. If @a resolve_text is TRUE then
2867 * any text conflict is resolved, if @a resolve_props is TRUE then any
2868 * property conflicts are resolved.
2870 * If @a depth is @c svn_depth_empty, act only on @a path; if
2871 * @c svn_depth_files, resolve @a path and its conflicted file
2872 * children (if any); if @c svn_depth_immediates, resolve @a path and
2873 * all its immediate conflicted children (both files and directories,
2874 * if any); if @c svn_depth_infinity, resolve @a path and every
2875 * conflicted file or directory anywhere beneath it.
2877 * If @a conflict_choice is @c svn_wc_conflict_choose_base, resolve the
2878 * conflict with the old file contents; if
2879 * @c svn_wc_conflict_choose_mine_full, use the original working contents;
2880 * if @c svn_wc_conflict_choose_theirs_full, the new contents; and if
2881 * @c svn_wc_conflict_choose_merged, don't change the contents at all,
2882 * just remove the conflict status, which is the pre-1.5 behavior.
2884 * (@c svn_wc_conflict_choose_theirs_conflict and
2885 * @c svn_wc_conflict_choose_mine_conflict are not yet implemented;
2886 * the effect of passing one of those values as @a conflict_choice is
2887 * currently undefined, which may or may not be an underhanded way of
2888 * allowing real behaviors to be added for them later without revving
2891 * @a adm_access is an access baton, with a write lock, for @a path.
2893 * Needless to say, this function doesn't touch conflict markers or
2894 * anything of that sort -- only a human can semantically resolve a
2895 * conflict. Instead, this function simply marks a file as "having
2896 * been resolved", clearing the way for a commit.
2898 * The implementation details are opaque, as our "conflicted" criteria
2899 * might change over time. (At the moment, this routine removes the
2900 * three fulltext 'backup' files and any .prej file created in a conflict,
2901 * and modifies @a path's entry.)
2903 * If @a path is not under version control, return @c SVN_ERR_ENTRY_NOT_FOUND.
2904 * If @a path isn't in a state of conflict to begin with, do nothing, and
2905 * return @c SVN_NO_ERROR.
2907 * If @c path was successfully taken out of a state of conflict, report this
2908 * information to @c notify_func (if non-@c NULL.) If only text or only
2909 * property conflict resolution was requested, and it was successful, then
2910 * success gets reported.
2912 * @since New in 1.5.
2915 svn_wc_resolved_conflict3(const char *path
,
2916 svn_wc_adm_access_t
*adm_access
,
2917 svn_boolean_t resolve_text
,
2918 svn_boolean_t resolve_props
,
2920 svn_wc_conflict_choice_t conflict_choice
,
2921 svn_wc_notify_func2_t notify_func
,
2923 svn_cancel_func_t cancel_func
,
2929 * Similar to svn_wc_resolved_conflict3(), but without automatic conflict
2930 * resolution support, and with @a depth set according to @a recurse:
2931 * if @a recurse is TRUE, @a depth is @c svn_depth_infinity, else it is
2932 * @c svn_depth_files.
2934 * @deprecated Provided for backward compatibility with the 1.4 API.
2937 svn_wc_resolved_conflict2(const char *path
,
2938 svn_wc_adm_access_t
*adm_access
,
2939 svn_boolean_t resolve_text
,
2940 svn_boolean_t resolve_props
,
2941 svn_boolean_t recurse
,
2942 svn_wc_notify_func2_t notify_func
,
2944 svn_cancel_func_t cancel_func
,
2949 * Similar to svn_wc_resolved_conflict2(), but takes an
2950 * svn_wc_notify_func_t and doesn't have cancellation support.
2952 * @deprecated Provided for backward compatibility with the 1.0 API.
2955 svn_wc_resolved_conflict(const char *path
,
2956 svn_wc_adm_access_t
*adm_access
,
2957 svn_boolean_t resolve_text
,
2958 svn_boolean_t resolve_props
,
2959 svn_boolean_t recurse
,
2960 svn_wc_notify_func_t notify_func
,
2969 * Storage type for queued post-commit data.
2971 * @since New in 1.5.
2973 typedef struct svn_wc_committed_queue_t svn_wc_committed_queue_t
;
2977 * Create a queue for use with svn_wc_queue_committed() and
2978 * svn_wc_process_committed_queue().
2980 * The returned queue and all further
2981 * allocations required for queueing new items will also be done
2984 * @since New in 1.5.
2986 svn_wc_committed_queue_t
*
2987 svn_wc_committed_queue_create(apr_pool_t
*pool
);
2992 * Queue committed items to be processed later by
2993 * svn_wc_process_committed_queue().
2995 * The first time this function is called, @a *queue should
2996 * be @c NULL to signal that initialization is required.
2998 * All pointer data passed to this function
2999 * (@a path, @a adm_access, @a wcprop_changes
3000 * and @a digest) should remain valid until the queue has been
3001 * processed by svn_wc_process_committed_queue().
3003 * The parameters have the same meaning as those
3004 * for svn_wc_process_committed4().
3006 * @since New in 1.5.
3009 svn_wc_queue_committed(svn_wc_committed_queue_t
**queue
,
3011 svn_wc_adm_access_t
*adm_access
,
3012 svn_boolean_t recurse
,
3013 apr_array_header_t
*wcprop_changes
,
3014 svn_boolean_t remove_lock
,
3015 svn_boolean_t remove_changelist
,
3016 const unsigned char *digest
,
3021 * Like svn_wc_process_committed4(), but batch processes
3022 * items queued with svn_wc_queue_committed().
3024 * @since New in 1.5.
3027 svn_wc_process_committed_queue(svn_wc_committed_queue_t
*queue
,
3028 svn_wc_adm_access_t
*adm_access
,
3029 svn_revnum_t new_revnum
,
3030 const char *rev_date
,
3031 const char *rev_author
,
3036 * Bump a successfully committed absolute @a path to @a new_revnum after a
3037 * commit succeeds. @a rev_date and @a rev_author are the (server-side)
3038 * date and author of the new revision; one or both may be @c NULL.
3039 * @a adm_access must hold a write lock appropriate for @a path.
3041 * If non-NULL, @a wcprop_changes is an array of <tt>svn_prop_t *</tt>
3042 * changes to wc properties; if an @c svn_prop_t->value is NULL, then
3043 * that property is deleted.
3045 * If @a remove_lock is @c TRUE, any entryprops related to a repository
3046 * lock will be removed.
3048 * If @a remove_changelist is @c TRUE, any association with a
3049 * changelist will be removed.
3051 * If @a path is a member of a changelist, remove that association.
3053 * If @a path is a file and @a digest is non-NULL, use @a digest as
3054 * the checksum for the new text base. Else, calculate the checksum
3057 * If @a recurse is TRUE and @a path is a directory, then bump every
3058 * versioned object at or under @a path. This is usually done for
3061 * @since New in 1.5.
3064 svn_wc_process_committed4(const char *path
,
3065 svn_wc_adm_access_t
*adm_access
,
3066 svn_boolean_t recurse
,
3067 svn_revnum_t new_revnum
,
3068 const char *rev_date
,
3069 const char *rev_author
,
3070 apr_array_header_t
*wcprop_changes
,
3071 svn_boolean_t remove_lock
,
3072 svn_boolean_t remove_changelist
,
3073 const unsigned char *digest
,
3076 /** Similar to svn_wc_process_committed4(), but with @a
3077 * remove_changelist set to FALSE.
3079 * @since New in 1.4.
3081 * @deprecated Provided for backwards compatibility with the 1.4 API.
3084 svn_wc_process_committed3(const char *path
,
3085 svn_wc_adm_access_t
*adm_access
,
3086 svn_boolean_t recurse
,
3087 svn_revnum_t new_revnum
,
3088 const char *rev_date
,
3089 const char *rev_author
,
3090 apr_array_header_t
*wcprop_changes
,
3091 svn_boolean_t remove_lock
,
3092 const unsigned char *digest
,
3095 /** Similar to svn_wc_process_committed3(), but with @a digest set to
3098 * @since New in 1.2.
3100 * @deprecated Provided for backwards compatibility with the 1.3 API.
3103 svn_wc_process_committed2(const char *path
,
3104 svn_wc_adm_access_t
*adm_access
,
3105 svn_boolean_t recurse
,
3106 svn_revnum_t new_revnum
,
3107 const char *rev_date
,
3108 const char *rev_author
,
3109 apr_array_header_t
*wcprop_changes
,
3110 svn_boolean_t remove_lock
,
3114 * Similar to svn_wc_process_committed2(), but with @a remove_lock set to
3117 * @deprecated Provided for backward compatibility with the 1.1 API.
3120 svn_wc_process_committed(const char *path
,
3121 svn_wc_adm_access_t
*adm_access
,
3122 svn_boolean_t recurse
,
3123 svn_revnum_t new_revnum
,
3124 const char *rev_date
,
3125 const char *rev_author
,
3126 apr_array_header_t
*wcprop_changes
,
3134 * Do a depth-first crawl in a working copy, beginning at @a path.
3136 * Communicate the `state' of the working copy's revisions and depths
3137 * to @a reporter/@a report_baton. Obviously, if @a path is a file
3138 * instead of a directory, this depth-first crawl will be a short one.
3140 * No locks are or logs are created, nor are any animals harmed in the
3141 * process. No cleanup is necessary. @a adm_access must be an access
3142 * baton for the @a path hierarchy, it does not require a write lock.
3144 * After all revisions are reported, @a reporter->finish_report() is
3145 * called, which immediately causes the RA layer to update the working
3146 * copy. Thus the return value may very well reflect the result of
3149 * If @a depth is @c svn_depth_empty, then report state only for
3150 * @a path itself. If @c svn_depth_files, do the same and include
3151 * immediate file children of @a path. If @c svn_depth_immediates,
3152 * then behave as if for @c svn_depth_files but also report the
3153 * property states of immediate subdirectories. If @a depth is
3154 * @c svn_depth_infinity, then report state fully recursively. All
3155 * descents are only as deep as @a path's own depth permits, of
3156 * course. If @a depth is @c svn_depth_unknown, then just use
3157 * @c svn_depth_infinity, which in practice means depth of @a path.
3159 * Iff @a depth_compatibility_trick is TRUE, then set the @c start_empty
3160 * flag on @a reporter->set_path() and @a reporter->link_path() calls
3161 * as necessary to trick a pre-1.5 (i.e., depth-unaware) server into
3162 * sending back all the items the client might need to upgrade a
3163 * working copy from a shallower depth to a deeper one.
3165 * If @a restore_files is TRUE, then unexpectedly missing working files
3166 * will be restored from the administrative directory's cache. For each
3167 * file restored, the @a notify_func function will be called with the
3168 * @a notify_baton and the path of the restored file. @a notify_func may
3169 * be @c NULL if this notification is not required. If @a
3170 * use_commit_times is TRUE, then set restored files' timestamps to
3171 * their last-commit-times.
3173 * If @a traversal_info is non-NULL, then record pre-update traversal
3174 * state in it. (Caller should obtain @a traversal_info from
3175 * svn_wc_init_traversal_info().)
3177 * @since New in 1.5.
3180 svn_wc_crawl_revisions3(const char *path
,
3181 svn_wc_adm_access_t
*adm_access
,
3182 const svn_ra_reporter3_t
*reporter
,
3184 svn_boolean_t restore_files
,
3186 svn_boolean_t depth_compatibility_trick
,
3187 svn_boolean_t use_commit_times
,
3188 svn_wc_notify_func2_t notify_func
,
3190 svn_wc_traversal_info_t
*traversal_info
,
3194 * Similar to svn_wc_crawl_revisions3, but taking svn_ra_reporter2_t
3195 * instead of svn_ra_reporter3_t, and therefore only able to report @c
3196 * svn_depth_infinity for depths; and taking @a recurse instead of @a
3197 * depth; and with @a depth_compatibility_trick always false.
3199 * @deprecated Provided for compatibility with the 1.4 API.
3202 svn_wc_crawl_revisions2(const char *path
,
3203 svn_wc_adm_access_t
*adm_access
,
3204 const svn_ra_reporter2_t
*reporter
,
3206 svn_boolean_t restore_files
,
3207 svn_boolean_t recurse
,
3208 svn_boolean_t use_commit_times
,
3209 svn_wc_notify_func2_t notify_func
,
3211 svn_wc_traversal_info_t
*traversal_info
,
3215 * Similar to svn_wc_crawl_revisions2(), but takes an svn_wc_notify_func_t
3216 * and a @c svn_reporter_t instead.
3218 * @deprecated Provided for backward compatibility with the 1.1 API.
3221 svn_wc_crawl_revisions(const char *path
,
3222 svn_wc_adm_access_t
*adm_access
,
3223 const svn_ra_reporter_t
*reporter
,
3225 svn_boolean_t restore_files
,
3226 svn_boolean_t recurse
,
3227 svn_boolean_t use_commit_times
,
3228 svn_wc_notify_func_t notify_func
,
3230 svn_wc_traversal_info_t
*traversal_info
,
3236 /** Set @a *wc_root to @c TRUE if @a path represents a "working copy root",
3237 * @c FALSE otherwise. Use @a pool for any intermediate allocations.
3239 * If @a path is not found, return the error @c SVN_ERR_ENTRY_NOT_FOUND.
3241 * @note Due to the way in which "WC-root-ness" is calculated, passing
3242 * a @a path of `.' to this function will always return @c TRUE.
3245 svn_wc_is_wc_root(svn_boolean_t
*wc_root
,
3247 svn_wc_adm_access_t
*adm_access
,
3251 /** Conditionally split @a path into an @a anchor and @a target for the
3252 * purpose of updating and committing.
3254 * @a anchor is the directory at which the update or commit editor
3257 * @a target is the actual subject (relative to the @a anchor) of the
3258 * update/commit, or "" if the @a anchor itself is the subject.
3260 * Allocate @a anchor and @a target in @a pool.
3263 svn_wc_get_actual_target(const char *path
,
3264 const char **anchor
,
3265 const char **target
,
3270 /* Update and update-like functionality. */
3273 * Set @a *editor and @a *edit_baton to an editor and baton for updating a
3276 * If @a ti is non-NULL, record traversal info in @a ti, for use by
3277 * post-traversal accessors such as svn_wc_edited_externals().
3279 * @a anchor is an access baton, with a write lock, for the local path to the
3280 * working copy which will be used as the root of our editor. Further
3281 * locks will be acquired if the update creates new directories. All
3282 * locks, both those in @a anchor and newly acquired ones, will be released
3283 * when the editor driver calls @c close_edit.
3285 * @a target is the entry in @a anchor that will actually be updated, or
3286 * empty if all of @a anchor should be updated.
3288 * The editor invokes @a notify_func with @a notify_baton as the update
3289 * progresses, if @a notify_func is non-NULL.
3291 * If @a cancel_func is non-NULL, the editor will invoke @a cancel_func with
3292 * @a cancel_baton as the update progresses to see if it should continue.
3294 * If @a conflict_func is non-NULL, then invoke it with @a
3295 * conflict_baton whenever a conflict is encountered, giving the
3296 * callback a chance to resolve the conflict before the editor takes
3297 * more drastic measures (such as marking a file conflicted, or
3298 * bailing out of the update).
3300 * If @a fetch_func is non-NULL, then use it (with @a fetch_baton) as
3301 * a fallback for retrieving repository files whenever 'copyfrom' args
3302 * are sent into editor->add_file().
3304 * If @a diff3_cmd is non-NULL, then use it as the diff3 command for
3305 * any merging; otherwise, use the built-in merge code.
3307 * @a preserved_exts is an array of filename patterns which, when
3308 * matched against the extensions of versioned files, determine for
3309 * which such files any related generated conflict files will preserve
3310 * the original file's extension as their own. If a file's extension
3311 * does not match any of the patterns in @a preserved_exts (which is
3312 * certainly the case if @a preserved_exts is @c NULL or empty),
3313 * generated conflict files will carry Subversion's custom extensions.
3315 * @a target_revision is a pointer to a revision location which, after
3316 * successful completion of the drive of this editor, will be
3317 * populated with the revision to which the working copy was updated.
3319 * If @a use_commit_times is TRUE, then all edited/added files will
3320 * have their working timestamp set to the last-committed-time. If
3321 * FALSE, the working files will be touched with the 'now' time.
3323 * If @a allow_unver_obstructions is TRUE, then allow unversioned
3324 * obstructions when adding a path.
3326 * If @a depth is @c svn_depth_infinity, update fully recursively.
3327 * Else if it is @c svn_depth_immediates, update the uppermost
3328 * directory, its file entries, and the presence or absence of
3329 * subdirectories (but do not descend into the subdirectories).
3330 * Else if it is @c svn_depth_files, update the uppermost directory
3331 * and its immediate file entries, but not subdirectories.
3332 * Else if it is @c svn_depth_empty, update exactly the uppermost
3333 * target, and don't touch its entries.
3335 * If @a depth_is_sticky is set and @a depth is not @c
3336 * svn_depth_unknown, then in addition to updating PATHS, also set
3337 * their sticky ambient depth value to @a depth.
3339 * @since New in 1.5.
3342 svn_wc_get_update_editor3(svn_revnum_t
*target_revision
,
3343 svn_wc_adm_access_t
*anchor
,
3345 svn_boolean_t use_commit_times
,
3347 svn_boolean_t depth_is_sticky
,
3348 svn_boolean_t allow_unver_obstructions
,
3349 svn_wc_notify_func2_t notify_func
,
3351 svn_cancel_func_t cancel_func
,
3353 svn_wc_conflict_resolver_func_t conflict_func
,
3354 void *conflict_baton
,
3355 svn_wc_get_file_t fetch_func
,
3357 const char *diff3_cmd
,
3358 apr_array_header_t
*preserved_exts
,
3359 const svn_delta_editor_t
**editor
,
3361 svn_wc_traversal_info_t
*ti
,
3366 * Similar to svn_wc_get_update_editor3() but with the @a
3367 * allow_unver_obstructions parameter always set to FALSE, @a
3368 * conflict_func and baton set to NULL, @a fetch_func and baton set to
3369 * NULL, @a preserved_exts set to NULL, @a depth_is_sticky set to
3370 * FALSE, and @a depth set according to @a recurse: if @a recurse is
3371 * TRUE, pass @c svn_depth_infinity, if FALSE, pass @c
3374 * @deprecated Provided for backward compatibility with the 1.4 API.
3377 svn_wc_get_update_editor2(svn_revnum_t
*target_revision
,
3378 svn_wc_adm_access_t
*anchor
,
3380 svn_boolean_t use_commit_times
,
3381 svn_boolean_t recurse
,
3382 svn_wc_notify_func2_t notify_func
,
3384 svn_cancel_func_t cancel_func
,
3386 const char *diff3_cmd
,
3387 const svn_delta_editor_t
**editor
,
3389 svn_wc_traversal_info_t
*ti
,
3393 * Similar to svn_wc_get_update_editor2(), but takes an svn_wc_notify_func_t
3396 * @deprecated Provided for backward compatibility with the 1.1 API.
3399 svn_wc_get_update_editor(svn_revnum_t
*target_revision
,
3400 svn_wc_adm_access_t
*anchor
,
3402 svn_boolean_t use_commit_times
,
3403 svn_boolean_t recurse
,
3404 svn_wc_notify_func_t notify_func
,
3406 svn_cancel_func_t cancel_func
,
3408 const char *diff3_cmd
,
3409 const svn_delta_editor_t
**editor
,
3411 svn_wc_traversal_info_t
*ti
,
3415 * A variant of svn_wc_get_update_editor().
3417 * Set @a *editor and @a *edit_baton to an editor and baton for "switching"
3418 * a working copy to a new @a switch_url. (Right now, this URL must be
3419 * within the same repository that the working copy already comes
3420 * from.) @a switch_url must not be @c NULL.
3422 * If @a ti is non-NULL, record traversal info in @a ti, for use by
3423 * post-traversal accessors such as svn_wc_edited_externals().
3425 * @a anchor is an access baton, with a write lock, for the local path to the
3426 * working copy which will be used as the root of our editor. Further
3427 * locks will be acquired if the switch creates new directories. All
3428 * locks, both those in @a anchor and newly acquired ones, will be released
3429 * when the editor driver calls @c close_edit.
3431 * @a target is the entry in @a anchor that will actually be updated, or
3432 * empty if all of @a anchor should be updated.
3434 * The editor invokes @a notify_func with @a notify_baton as the switch
3435 * progresses, if @a notify_func is non-NULL.
3437 * If @a cancel_func is non-NULL, it will be called with @a cancel_baton as
3438 * the switch progresses to determine if it should continue.
3440 * If @a conflict_func is non-NULL, then invoke it with @a
3441 * conflict_baton whenever a conflict is encountered, giving the
3442 * callback a chance to resolve the conflict before the editor takes
3443 * more drastic measures (such as marking a file conflicted, or
3444 * bailing out of the switch).
3446 * If @a diff3_cmd is non-NULL, then use it as the diff3 command for
3447 * any merging; otherwise, use the built-in merge code.
3449 * @a preserved_exts is an array of filename patterns which, when
3450 * matched against the extensions of versioned files, determine for
3451 * which such files any related generated conflict files will preserve
3452 * the original file's extension as their own. If a file's extension
3453 * does not match any of the patterns in @a preserved_exts (which is
3454 * certainly the case if @a preserved_exts is @c NULL or empty),
3455 * generated conflict files will carry Subversion's custom extensions.
3457 * @a target_revision is a pointer to a revision location which, after
3458 * successful completion of the drive of this editor, will be
3459 * populated with the revision to which the working copy was updated.
3461 * If @a use_commit_times is TRUE, then all edited/added files will
3462 * have their working timestamp set to the last-committed-time. If
3463 * FALSE, the working files will be touched with the 'now' time.
3465 * @a depth and @a depth_is_sticky behave as for svn_wc_get_update_editor3().
3467 * If @a allow_unver_obstructions is TRUE, then allow unversioned
3468 * obstructions when adding a path.
3470 * @since New in 1.5.
3473 svn_wc_get_switch_editor3(svn_revnum_t
*target_revision
,
3474 svn_wc_adm_access_t
*anchor
,
3476 const char *switch_url
,
3477 svn_boolean_t use_commit_times
,
3479 svn_boolean_t depth_is_sticky
,
3480 svn_boolean_t allow_unver_obstructions
,
3481 svn_wc_notify_func2_t notify_func
,
3483 svn_cancel_func_t cancel_func
,
3485 svn_wc_conflict_resolver_func_t conflict_func
,
3486 void *conflict_baton
,
3487 const char *diff3_cmd
,
3488 apr_array_header_t
*preserved_exts
,
3489 const svn_delta_editor_t
**editor
,
3491 svn_wc_traversal_info_t
*ti
,
3495 * Similar to svn_wc_get_switch_editor3() but with the
3496 * @a allow_unver_obstructions parameter always set to FALSE,
3497 * @a preserved_exts set to NULL, @a conflict_func and baton set to NULL,
3498 * @a depth_is_sticky set to FALSE, and @a depth set according to @a
3499 * recurse: if @a recurse is TRUE, pass @c svn_depth_infinity, if
3500 * FALSE, pass @c svn_depth_files.
3502 * @deprecated Provided for backward compatibility with the 1.4 API.
3505 svn_wc_get_switch_editor2(svn_revnum_t
*target_revision
,
3506 svn_wc_adm_access_t
*anchor
,
3508 const char *switch_url
,
3509 svn_boolean_t use_commit_times
,
3510 svn_boolean_t recurse
,
3511 svn_wc_notify_func2_t notify_func
,
3513 svn_cancel_func_t cancel_func
,
3515 const char *diff3_cmd
,
3516 const svn_delta_editor_t
**editor
,
3518 svn_wc_traversal_info_t
*ti
,
3522 * Similar to svn_wc_get_switch_editor2(), but takes an
3523 * @c svn_wc_notify_func_t instead.
3525 * @deprecated Provided for backward compatibility with the 1.1 API.
3528 svn_wc_get_switch_editor(svn_revnum_t
*target_revision
,
3529 svn_wc_adm_access_t
*anchor
,
3531 const char *switch_url
,
3532 svn_boolean_t use_commit_times
,
3533 svn_boolean_t recurse
,
3534 svn_wc_notify_func_t notify_func
,
3536 svn_cancel_func_t cancel_func
,
3538 const char *diff3_cmd
,
3539 const svn_delta_editor_t
**editor
,
3541 svn_wc_traversal_info_t
*ti
,
3546 /* A word about the implementation of working copy property storage:
3548 * Since properties are key/val pairs, you'd think we store them in
3549 * some sort of Berkeley DB-ish format, and even store pending changes
3550 * to them that way too.
3552 * However, we already have libsvn_subr/hashdump.c working, and it
3553 * uses a human-readable format. That will be very handy when we're
3554 * debugging, and presumably we will not be dealing with any huge
3555 * properties or property lists initially. Therefore, we will
3556 * continue to use hashdump as the internal mechanism for storing and
3557 * reading from property lists, but note that the interface here is
3558 * _not_ dependent on that. We can swap in a DB-based implementation
3559 * at any time and users of this library will never know the
3563 /** Set @a *props to a hash table mapping <tt>char *</tt> names onto
3564 * <tt>svn_string_t *</tt> values for all the regular properties of
3565 * @a path. Allocate the table, names, and values in @a pool. If
3566 * the node has no properties, or does not exist in the working copy,
3567 * then an empty hash is returned. @a adm_access is an access baton
3568 * set that contains @a path.
3571 svn_wc_prop_list(apr_hash_t
**props
,
3573 svn_wc_adm_access_t
*adm_access
,
3577 /** Set @a *value to the value of property @a name for @a path, allocating
3578 * @a *value in @a pool. If no such prop, set @a *value to @c NULL.
3579 * @a name may be a regular or wc property; if it is an entry property,
3580 * return the error @c SVN_ERR_BAD_PROP_KIND. @a adm_access is an access
3581 * baton set that contains @a path.
3584 svn_wc_prop_get(const svn_string_t
**value
,
3587 svn_wc_adm_access_t
*adm_access
,
3591 * Set property @a name to @a value for @a path, or if @a value is
3592 * NULL, remove property @a name from @a path. @a adm_access is an
3593 * access baton with a write lock for @a path.
3595 * If @a skip_checks is TRUE, do no validity checking. But if @a
3596 * skip_checks is FALSE, and @a name is not a valid property for @a
3597 * path, return an error, either @c SVN_ERR_ILLEGAL_TARGET (if the
3598 * property is not appropriate for @a path), or @c
3599 * SVN_ERR_BAD_MIME_TYPE (if @a name is "svn:mime-type", but @a value
3600 * is not a valid mime-type).
3602 * @a name may be a wc property or a regular property; but if it is an
3603 * entry property, return the error @c SVN_ERR_BAD_PROP_KIND, even if
3604 * @a skip_checks is TRUE.
3606 * Use @a pool for temporary allocation.
3608 * @since New in 1.2.
3611 svn_wc_prop_set2(const char *name
,
3612 const svn_string_t
*value
,
3614 svn_wc_adm_access_t
*adm_access
,
3615 svn_boolean_t skip_checks
,
3620 * Like svn_wc_prop_set2(), but with @a skip_checks always FALSE.
3622 * @deprecated Provided for backward compatibility with the 1.1 API.
3625 svn_wc_prop_set(const char *name
,
3626 const svn_string_t
*value
,
3628 svn_wc_adm_access_t
*adm_access
,
3632 /** Return TRUE iff @a name is a 'normal' property name. 'Normal' is
3633 * defined as a user-visible and user-tweakable property that shows up
3634 * when you fetch a proplist.
3636 * The function currently parses the namespace like so:
3638 * - 'svn:wc:' ==> a wcprop, stored/accessed separately via different API.
3640 * - 'svn:entry:' ==> an "entry" prop, shunted into the 'entries' file.
3642 * If these patterns aren't found, then the property is assumed to be
3645 svn_boolean_t
svn_wc_is_normal_prop(const char *name
);
3649 /** Return TRUE iff @a name is a 'wc' property name. */
3650 svn_boolean_t
svn_wc_is_wc_prop(const char *name
);
3652 /** Return TRUE iff @a name is a 'entry' property name. */
3653 svn_boolean_t
svn_wc_is_entry_prop(const char *name
);
3655 /** Callback type used by @c svn_wc_canonicalize_svn_prop.
3657 * If @a mime_type is non-null, it sets @a *mime_type to the value of
3658 * @a SVN_PROP_MIME_TYPE for the path passed to @c
3659 * svn_wc_canonicalize_svn_prop (allocated from @a pool). If @a
3660 * stream is non-null, it writes the contents of the file to @a
3663 * (Currently, this is used if you are attempting to set the @a
3664 * SVN_PROP_EOL_STYLE property, to make sure that the value matches
3665 * the mime type and contents.)
3667 typedef svn_error_t
*(*svn_wc_canonicalize_svn_prop_get_file_t
)
3668 (const svn_string_t
**mime_type
,
3669 svn_stream_t
*stream
,
3674 /** Canonicalize the value of an svn:* property @a propname with
3677 * If the property is not appropriate for a node of kind @a kind, or
3678 * is otherwise invalid, throw an error. Otherwise, set @a *propval_p
3679 * to a canonicalized version of the property value. If @a
3680 * skip_some_checks is TRUE, only some validity checks are taken.
3682 * Some validity checks require access to the contents and MIME type
3683 * of the target if it is a file; they will call @a prop_getter with @a
3684 * getter_baton, which then needs to set the MIME type and print the
3685 * contents of the file to the given stream.
3687 * @a path should be the path of the file in question; it is only used
3688 * for error messages.
3690 * ### This is not actually related to the WC, but it does need to call
3691 * ### svn_wc_parse_externals_description2.
3694 svn_wc_canonicalize_svn_prop(const svn_string_t
**propval_p
,
3695 const char *propname
,
3696 const svn_string_t
*propval
,
3698 svn_node_kind_t kind
,
3699 svn_boolean_t skip_some_checks
,
3700 svn_wc_canonicalize_svn_prop_get_file_t prop_getter
,
3710 * Return an @a editor/@a edit_baton for diffing a working copy against the
3713 * @a anchor/@a target represent the base of the hierarchy to be compared.
3715 * @a callbacks/@a callback_baton is the callback table to use when two
3716 * files are to be compared.
3718 * If @a depth is @c svn_depth_empty, just diff exactly @a target or
3719 * @a anchor if @a target is empty. If @c svn_depth_files then do the same
3720 * and for top-level file entries as well (if any). If
3721 * @c svn_depth_immediates, do the same as @c svn_depth_files but also diff
3722 * top-level subdirectories at @c svn_depth_empty. If @c svn_depth_infinity,
3723 * then diff fully recursively. In the latter case, @a anchor should be part
3724 * of an access baton set for the @a target hierarchy.
3726 * @a ignore_ancestry determines whether paths that have discontinuous node
3727 * ancestry are treated as delete/add or as simple modifications. If
3728 * @a ignore_ancestry is @c FALSE, then any discontinuous node ancestry will
3729 * result in the diff given as a full delete followed by an add.
3731 * If @a use_text_base is TRUE, then compare the repository against
3732 * the working copy's text-base files, rather than the working files.
3734 * Normally, the difference from repository->working_copy is shown.
3735 * If @a reverse_order is TRUE, then show working_copy->repository diffs.
3737 * If @a cancel_func is non-NULL, it will be used along with @a cancel_baton
3738 * to periodically check if the client has canceled the operation.
3740 * @a changelists is an array of <tt>const char *</tt> changelist
3741 * names, used as a restrictive filter on items whose differences are
3742 * reported; that is, don't generate diffs about any item unless
3743 * it's a member of one of those changelists. If @a changelists is
3744 * empty (or altogether @c NULL), no changelist filtering occurs.
3746 * @since New in 1.5.
3749 svn_wc_get_diff_editor4(svn_wc_adm_access_t
*anchor
,
3751 const svn_wc_diff_callbacks2_t
*callbacks
,
3752 void *callback_baton
,
3754 svn_boolean_t ignore_ancestry
,
3755 svn_boolean_t use_text_base
,
3756 svn_boolean_t reverse_order
,
3757 svn_cancel_func_t cancel_func
,
3759 const apr_array_header_t
*changelists
,
3760 const svn_delta_editor_t
**editor
,
3765 * Similar to svn_wc_get_diff_editor4(), but with @a changelists
3766 * passed as @c NULL, and @a depth set to @c svn_depth_infinity if @a
3767 * recurse is TRUE, or @a svn_depth_files if @a recurse is FALSE.
3769 * @deprecated Provided for backward compatibility with the 1.4 API.
3771 * @since New in 1.2.
3774 svn_wc_get_diff_editor3(svn_wc_adm_access_t
*anchor
,
3776 const svn_wc_diff_callbacks2_t
*callbacks
,
3777 void *callback_baton
,
3778 svn_boolean_t recurse
,
3779 svn_boolean_t ignore_ancestry
,
3780 svn_boolean_t use_text_base
,
3781 svn_boolean_t reverse_order
,
3782 svn_cancel_func_t cancel_func
,
3784 const svn_delta_editor_t
**editor
,
3790 * Similar to svn_wc_get_diff_editor3(), but with an
3791 * @c svn_wc_diff_callbacks_t instead of @c svn_wc_diff_callbacks2_t.
3793 * @deprecated Provided for backward compatibility with the 1.1 API.
3796 svn_wc_get_diff_editor2(svn_wc_adm_access_t
*anchor
,
3798 const svn_wc_diff_callbacks_t
*callbacks
,
3799 void *callback_baton
,
3800 svn_boolean_t recurse
,
3801 svn_boolean_t ignore_ancestry
,
3802 svn_boolean_t use_text_base
,
3803 svn_boolean_t reverse_order
,
3804 svn_cancel_func_t cancel_func
,
3806 const svn_delta_editor_t
**editor
,
3812 * Similar to svn_wc_get_diff_editor2(), but with @a ignore_ancestry
3813 * always set to @c FALSE.
3815 * @deprecated Provided for backward compatibility with the 1.0 API.
3818 svn_wc_get_diff_editor(svn_wc_adm_access_t
*anchor
,
3820 const svn_wc_diff_callbacks_t
*callbacks
,
3821 void *callback_baton
,
3822 svn_boolean_t recurse
,
3823 svn_boolean_t use_text_base
,
3824 svn_boolean_t reverse_order
,
3825 svn_cancel_func_t cancel_func
,
3827 const svn_delta_editor_t
**editor
,
3833 * Compare working copy against the text-base.
3835 * @a anchor/@a target represent the base of the hierarchy to be compared.
3837 * @a callbacks/@a callback_baton is the callback table to use when two
3838 * files are to be compared.
3840 * If @a depth is @c svn_depth_empty, just diff exactly @a target or
3841 * @a anchor if @a target is empty. If @c svn_depth_files then do the same
3842 * and for top-level file entries as well (if any). If
3843 * @c svn_depth_immediates, do the same as @c svn_depth_files but also diff
3844 * top-level subdirectories at @c svn_depth_empty. If @c svn_depth_infinity,
3845 * then diff fully recursively. In the latter case, @a anchor should be part
3846 * of an access baton set for the @a target hierarchy.
3848 * @a ignore_ancestry determines whether paths that have discontinuous node
3849 * ancestry are treated as delete/add or as simple modifications. If
3850 * @a ignore_ancestry is @c FALSE, then any discontinuous node ancestry will
3851 * result in the diff given as a full delete followed by an add.
3853 * @a changelists is an array of <tt>const char *</tt> changelist
3854 * names, used as a restrictive filter on items whose differences are
3855 * reported; that is, don't generate diffs about any item unless
3856 * it's a member of one of those changelists. If @a changelists is
3857 * empty (or altogether @c NULL), no changelist filtering occurs.
3859 * @since New in 1.5.
3862 svn_wc_diff4(svn_wc_adm_access_t
*anchor
,
3864 const svn_wc_diff_callbacks2_t
*callbacks
,
3865 void *callback_baton
,
3867 svn_boolean_t ignore_ancestry
,
3868 const apr_array_header_t
*changelists
,
3873 * Similar to svn_wc_diff4(), but with @a changelists passed @c NULL,
3874 * and @a depth set to @c svn_depth_infinity if @a recurse is TRUE, or
3875 * @a svn_depth_files if @a recurse is FALSE.
3877 * @deprecated Provided for backward compatibility with the 1.2 API.
3880 svn_wc_diff3(svn_wc_adm_access_t
*anchor
,
3882 const svn_wc_diff_callbacks2_t
*callbacks
,
3883 void *callback_baton
,
3884 svn_boolean_t recurse
,
3885 svn_boolean_t ignore_ancestry
,
3889 * Similar to svn_wc_diff3(), but with a @c svn_wc_diff_callbacks_t argument
3890 * instead of @c svn_wc_diff_callbacks2_t.
3892 * @deprecated Provided for backward compatibility with the 1.1 API.
3895 svn_wc_diff2(svn_wc_adm_access_t
*anchor
,
3897 const svn_wc_diff_callbacks_t
*callbacks
,
3898 void *callback_baton
,
3899 svn_boolean_t recurse
,
3900 svn_boolean_t ignore_ancestry
,
3904 * Similar to svn_wc_diff2(), but with @a ignore_ancestry always set
3907 * @deprecated Provided for backward compatibility with the 1.0 API.
3910 svn_wc_diff(svn_wc_adm_access_t
*anchor
,
3912 const svn_wc_diff_callbacks_t
*callbacks
,
3913 void *callback_baton
,
3914 svn_boolean_t recurse
,
3918 /** Given a @a path to a file or directory under version control, discover
3919 * any local changes made to properties and/or the set of 'pristine'
3920 * properties. @a adm_access is an access baton set for @a path.
3922 * If @a propchanges is non-@c NULL, return these changes as an array of
3923 * @c svn_prop_t structures stored in @a *propchanges. The structures and
3924 * array will be allocated in @a pool. If there are no local property
3925 * modifications on @a path, then set @a *propchanges to @c NULL.
3927 * If @a original_props is non-@c NULL, then set @a *original_props to
3928 * hashtable (<tt>const char *name</tt> -> <tt>const svn_string_t *value</tt>)
3929 * that represents the 'pristine' property list of @a path. This hashtable is
3930 * allocated in @a pool, and can be used to compare old and new values of
3934 svn_wc_get_prop_diffs(apr_array_header_t
**propchanges
,
3935 apr_hash_t
**original_props
,
3937 svn_wc_adm_access_t
*adm_access
,
3941 /** The outcome of a merge carried out (or tried as a dry-run) by
3944 typedef enum svn_wc_merge_outcome_t
3946 /** The working copy is (or would be) unchanged. The changes to be
3947 * merged were already present in the working copy
3949 svn_wc_merge_unchanged
,
3951 /** The working copy has been (or would be) changed. */
3952 svn_wc_merge_merged
,
3954 /** The working copy has been (or would be) changed, but there was (or
3955 * would be) a conflict
3957 svn_wc_merge_conflict
,
3959 /** No merge was performed, probably because the target file was
3960 * either absent or not under version control.
3962 svn_wc_merge_no_merge
3964 } svn_wc_merge_outcome_t
;
3966 /** Given paths to three fulltexts, merge the differences between @a left
3967 * and @a right into @a merge_target. (It may help to know that @a left,
3968 * @a right, and @a merge_target correspond to "OLDER", "YOURS", and "MINE",
3969 * respectively, in the diff3 documentation.) Use @a pool for any
3970 * temporary allocation.
3972 * @a adm_access is an access baton with a write lock for the directory
3973 * containing @a merge_target.
3975 * This function assumes that @a left and @a right are in repository-normal
3976 * form (linefeeds, with keywords contracted); if necessary,
3977 * @a merge_target is temporarily converted to this form to receive the
3978 * changes, then translated back again.
3980 * If @a merge_target is absent, or present but not under version
3981 * control, then set @a *merge_outcome to @c svn_wc_merge_no_merge and
3982 * return success without merging anything. (The reasoning is that if
3983 * the file is not versioned, then it is probably unrelated to the
3984 * changes being considered, so they should not be merged into it.)
3986 * @a dry_run determines whether the working copy is modified. When it
3987 * is @c FALSE the merge will cause @a merge_target to be modified, when it
3988 * is @c TRUE the merge will be carried out to determine the result but
3989 * @a merge_target will not be modified.
3991 * If @a diff3_cmd is non-NULL, then use it as the diff3 command for
3992 * any merging; otherwise, use the built-in merge code. If @a
3993 * merge_options is non-NULL, either pass its elements to @a diff3_cmd or
3994 * parse it and use as options to the internal merge code (@see
3995 * svn_diff_file_options_parse()). @a merge_options must contain
3996 * <tt>const char *</tt> elements.
3998 * The outcome of the merge is returned in @a *merge_outcome. If there
3999 * is a conflict and @a dry_run is @c FALSE, then attempt to call @a
4000 * conflict_func with @a conflict_baton (if non-NULL). If the
4001 * conflict callback cannot resolve the conflict, then:
4003 * * Put conflict markers around the conflicting regions in
4004 * @a merge_target, labeled with @a left_label, @a right_label, and
4005 * @a target_label. (If any of these labels are @c NULL, default
4006 * values will be used.)
4008 * * Copy @a left, @a right, and the original @a merge_target to unique
4009 * names in the same directory as @a merge_target, ending with the
4010 * suffixes ".LEFT_LABEL", ".RIGHT_LABEL", and ".TARGET_LABEL"
4013 * * Mark the entry for @a merge_target as "conflicted", and track the
4014 * above mentioned backup files in the entry as well.
4018 * If @a merge_target is a binary file, then no merging is attempted,
4019 * the merge is deemed to be a conflict. If @a dry_run is @c FALSE the
4020 * working @a merge_target is untouched, and copies of @a left and
4021 * @a right are created next to it using @a left_label and @a right_label.
4022 * @a merge_target's entry is marked as "conflicted", and begins
4023 * tracking the two backup files. If @a dry_run is @c TRUE no files are
4024 * changed. The outcome of the merge is returned in @a *merge_outcome.
4026 * @since New in 1.5.
4029 svn_wc_merge3(enum svn_wc_merge_outcome_t
*merge_outcome
,
4032 const char *merge_target
,
4033 svn_wc_adm_access_t
*adm_access
,
4034 const char *left_label
,
4035 const char *right_label
,
4036 const char *target_label
,
4037 svn_boolean_t dry_run
,
4038 const char *diff3_cmd
,
4039 const apr_array_header_t
*merge_options
,
4040 const apr_array_header_t
*prop_diff
,
4041 svn_wc_conflict_resolver_func_t conflict_func
,
4042 void *conflict_baton
,
4045 /** Similar to svn_wc_merge3(), but with @a prop_diff, @a
4046 * conflict_func, @a conflict_baton set to NULL.
4048 * @deprecated Provided for backwards compatibility with the 1.4 API.
4051 svn_wc_merge2(enum svn_wc_merge_outcome_t
*merge_outcome
,
4054 const char *merge_target
,
4055 svn_wc_adm_access_t
*adm_access
,
4056 const char *left_label
,
4057 const char *right_label
,
4058 const char *target_label
,
4059 svn_boolean_t dry_run
,
4060 const char *diff3_cmd
,
4061 const apr_array_header_t
*merge_options
,
4065 /** Similar to svn_wc_merge2(), but with @a merge_options set to NULL.
4067 * @deprecated Provided for backwards compatibility with the 1.3 API.
4070 svn_wc_merge(const char *left
,
4072 const char *merge_target
,
4073 svn_wc_adm_access_t
*adm_access
,
4074 const char *left_label
,
4075 const char *right_label
,
4076 const char *target_label
,
4077 svn_boolean_t dry_run
,
4078 enum svn_wc_merge_outcome_t
*merge_outcome
,
4079 const char *diff3_cmd
,
4083 /** Given a @a path under version control, merge an array of @a
4084 * propchanges into the path's existing properties. @a propchanges is
4085 * an array of @c svn_prop_t objects, and @a baseprops is a hash
4086 * representing the original set of properties that @a propchanges is
4087 * working against. @a adm_access is an access baton for the directory
4088 * containing @a path.
4090 * If @a base_merge is @c FALSE only the working properties will be changed,
4091 * if it is @c TRUE both the base and working properties will be changed.
4093 * If @a state is non-NULL, set @a *state to the state of the properties
4096 * If conflicts are found when merging working properties, they are
4097 * described in a temporary .prej file (or appended to an already-existing
4098 * .prej file), and the entry is marked "conflicted". Base properties
4099 * are changed unconditionally, if @a base_merge is @c TRUE, they never result
4102 * If @a path is not under version control, return the error
4103 * SVN_ERR_UNVERSIONED_RESOURCE and don't touch anyone's properties.
4105 * @since New in 1.5.
4108 svn_wc_merge_props2(svn_wc_notify_state_t
*state
,
4110 svn_wc_adm_access_t
*adm_access
,
4111 apr_hash_t
*baseprops
,
4112 const apr_array_header_t
*propchanges
,
4113 svn_boolean_t base_merge
,
4114 svn_boolean_t dry_run
,
4115 svn_wc_conflict_resolver_func_t conflict_func
,
4116 void *conflict_baton
,
4121 * Same as svn_wc_merge_props2(), but with a @a conflict_func (and
4124 * @deprecated Provided for backward compatibility with the 1.3 API.
4128 svn_wc_merge_props(svn_wc_notify_state_t
*state
,
4130 svn_wc_adm_access_t
*adm_access
,
4131 apr_hash_t
*baseprops
,
4132 const apr_array_header_t
*propchanges
,
4133 svn_boolean_t base_merge
,
4134 svn_boolean_t dry_run
,
4139 * Similar to svn_wc_merge_props(), but no baseprops are given.
4140 * Instead, it's assumed that the incoming propchanges are based
4141 * against the working copy's own baseprops. While this assumption is
4142 * correct for 'svn update', it's incorrect for 'svn merge', and can
4143 * cause flawed behavior. (See issue #2035.)
4145 * @deprecated Provided for backward compatibility with the 1.2 API.
4148 svn_wc_merge_prop_diffs(svn_wc_notify_state_t
*state
,
4150 svn_wc_adm_access_t
*adm_access
,
4151 const apr_array_header_t
*propchanges
,
4152 svn_boolean_t base_merge
,
4153 svn_boolean_t dry_run
,
4158 /** Given a @a path to a wc file, return a @a pristine_path which points to a
4159 * pristine version of the file. This is needed so clients can do
4160 * diffs. If the WC has no text-base, return a @c NULL instead of a
4164 svn_wc_get_pristine_copy_path(const char *path
,
4165 const char **pristine_path
,
4170 * Recurse from @a path, cleaning up unfinished log business. Perform
4171 * necessary allocations in @a pool. Any working copy locks under @a path
4172 * will be taken over and then cleared by this function. If @a diff3_cmd
4173 * is non-NULL, then use it as the diff3 command for any merging; otherwise,
4174 * use the built-in merge code.
4176 * WARNING: there is no mechanism that will protect locks that are still
4179 * If @a cancel_func is non-NULL, invoke it with @a cancel_baton at
4180 * various points during the operation. If it returns an error
4181 * (typically @c SVN_ERR_CANCELLED), return that error immediately.
4183 * @since New in 1.2.
4186 svn_wc_cleanup2(const char *path
,
4187 const char *diff3_cmd
,
4188 svn_cancel_func_t cancel_func
,
4193 * Similar to svn_wc_cleanup2(). @a optional_adm_access is an historic
4194 * relic and not used, it may be NULL.
4196 * @deprecated Provided for backward compatibility with the 1.1 API.
4199 svn_wc_cleanup(const char *path
,
4200 svn_wc_adm_access_t
*optional_adm_access
,
4201 const char *diff3_cmd
,
4202 svn_cancel_func_t cancel_func
,
4207 /** Relocation validation callback typedef.
4209 * Called for each relocated file/directory. @a uuid, if non-NULL, contains
4210 * the expected repository UUID, @a url contains the tentative URL.
4212 * @a baton is a closure object; it should be provided by the
4213 * implementation, and passed by the caller.
4215 * If @a root is TRUE, then the implementation should make sure that @a url
4216 * is the repository root. Else, it can be an URL inside the repository.
4217 * @a pool may be used for temporary allocations.
4219 * @since New in 1.5.
4221 typedef svn_error_t
*(*svn_wc_relocation_validator3_t
)(void *baton
,
4224 const char *root_url
,
4227 /** Similar to @c svn_wc_relocation_validator3_t, but without
4228 * the @a root_url arguments.
4230 * @deprecated Provided for backwards compatibility with the 1.4 API.
4232 typedef svn_error_t
*(*svn_wc_relocation_validator2_t
)(void *baton
,
4238 /** Similar to @c svn_wc_relocation_validator2_t, but without
4239 * the @a root and @a pool arguments. @a uuid will not be NULL in this version
4242 * @deprecated Provided for backwards compatibility with the 1.3 API.
4244 typedef svn_error_t
*(*svn_wc_relocation_validator_t
)(void *baton
,
4248 /** Change repository references at @a path that begin with @a from
4249 * to begin with @a to instead. Perform necessary allocations in @a pool.
4250 * If @a recurse is TRUE, do so. @a validator (and its baton,
4251 * @a validator_baton), will be called for each newly generated URL.
4253 * @a adm_access is an access baton for the directory containing
4256 * @since New in 1.5.
4259 svn_wc_relocate3(const char *path
,
4260 svn_wc_adm_access_t
*adm_access
,
4263 svn_boolean_t recurse
,
4264 svn_wc_relocation_validator3_t validator
,
4265 void *validator_baton
,
4268 /** Similar to svn_wc_relocate3(), but uses @c svn_wc_relocation_validator2_t.
4270 * @deprecated Provided for backwards compatibility with the 1.4 API. */
4272 svn_wc_relocate2(const char *path
,
4273 svn_wc_adm_access_t
*adm_access
,
4276 svn_boolean_t recurse
,
4277 svn_wc_relocation_validator2_t validator
,
4278 void *validator_baton
,
4281 /** Similar to svn_wc_relocate2(), but uses @c svn_wc_relocation_validator_t.
4283 * @deprecated Provided for backwards compatibility with the 1.3 API. */
4285 svn_wc_relocate(const char *path
,
4286 svn_wc_adm_access_t
*adm_access
,
4289 svn_boolean_t recurse
,
4290 svn_wc_relocation_validator_t validator
,
4291 void *validator_baton
,
4296 * Revert changes to @a path. Perform necessary allocations in @a pool.
4298 * @a parent_access is an access baton for the directory containing @a
4299 * path, unless @a path is a working copy root (as determined by @c
4300 * svn_wc_is_wc_root), in which case @a parent_access refers to @a
4303 * If @a depth is @c svn_depth_empty, revert just @a path (if a
4304 * directory, then revert just the properties on that directory).
4305 * Else if @c svn_depth_files, revert @a path and any files
4306 * directly under @a path if it is directory. Else if
4307 * @c svn_depth_immediates, revert all of the preceding plus
4308 * properties on immediate subdirectories; else if @c svn_depth_infinity,
4309 * revert path and everything under it fully recursively.
4311 * @a changelists is an array of <tt>const char *</tt> changelist
4312 * names, used as a restrictive filter on items reverted; that is,
4313 * don't revert any item unless it's a member of one of those
4314 * changelists. If @a changelists is empty (or altogether @c NULL),
4315 * no changelist filtering occurs.
4317 * If @a cancel_func is non-NULL, call it with @a cancel_baton at
4318 * various points during the reversion process. If it returns an
4319 * error (typically @c SVN_ERR_CANCELLED), return that error
4322 * If @a use_commit_times is TRUE, then all reverted working-files
4323 * will have their timestamp set to the last-committed-time. If
4324 * FALSE, the reverted working-files will be touched with the 'now' time.
4326 * For each item reverted, @a notify_func will be called with @a notify_baton
4327 * and the path of the reverted item. @a notify_func may be @c NULL if this
4328 * notification is not needed.
4330 * If @a path is not under version control, return the error
4331 * SVN_ERR_UNVERSIONED_RESOURCE.
4333 * @since New in 1.5.
4336 svn_wc_revert3(const char *path
,
4337 svn_wc_adm_access_t
*parent_access
,
4339 svn_boolean_t use_commit_times
,
4340 const apr_array_header_t
*changelists
,
4341 svn_cancel_func_t cancel_func
,
4343 svn_wc_notify_func2_t notify_func
,
4348 * Similar to svn_wc_revert3(), but with @a changelists passed as @c
4349 * NULL, and @a depth set according to @a recursive: if @a recursive
4350 * is TRUE, @a depth is @c svn_depth_infinity; if FALSE, @a depth is
4351 * @c svn_depth_empty.
4353 * @note Most APIs map @a recurse==FALSE to @a depth==svn_depth_files;
4354 * revert is deliberately different.
4356 * @deprecated Provided for backward compatibility with the 1.2 API.
4359 svn_wc_revert2(const char *path
,
4360 svn_wc_adm_access_t
*parent_access
,
4361 svn_boolean_t recursive
,
4362 svn_boolean_t use_commit_times
,
4363 svn_cancel_func_t cancel_func
,
4365 svn_wc_notify_func2_t notify_func
,
4370 * Similar to svn_wc_revert2(), but takes an @c svn_wc_notify_func_t instead.
4372 * @deprecated Provided for backward compatibility with the 1.1 API.
4375 svn_wc_revert(const char *path
,
4376 svn_wc_adm_access_t
*parent_access
,
4377 svn_boolean_t recursive
,
4378 svn_boolean_t use_commit_times
,
4379 svn_cancel_func_t cancel_func
,
4381 svn_wc_notify_func_t notify_func
,
4388 /** Create a unique temporary file in administrative tmp/ area of
4389 * directory @a path. Return a handle in @a *fp and the path
4390 * in @a *new_name. Either @a fp or @a new_name can be NULL.
4392 * The flags will be <tt>APR_WRITE | APR_CREATE | APR_EXCL</tt> and
4393 * optionally @c APR_DELONCLOSE (if the @a delete_when argument is
4394 * set to @c svn_io_file_del_on_close).
4396 * This means that as soon as @a fp is closed, the tmp file will vanish.
4401 svn_wc_create_tmp_file2(apr_file_t
**fp
,
4402 const char **new_name
,
4404 svn_io_file_del_t delete_when
,
4408 /** Same as svn_wc_create_tmp_file2(), but with @a new_name set to @c NULL,
4409 * and without the ability to delete the file on pool cleanup.
4411 * @deprecated For compatibility with 1.3 API
4414 svn_wc_create_tmp_file(apr_file_t
**fp
,
4416 svn_boolean_t delete_on_close
,
4421 /* EOL conversion and keyword expansion. */
4423 /** Set @a xlated_path to a translated copy of @a src
4424 * or to @a src itself if no translation is necessary.
4425 * That is, if @a versioned_file's properties indicate newline conversion or
4426 * keyword expansion, point @a *xlated_path to a copy of @a src
4427 * whose newlines and keywords are converted using the translation
4428 * as requested by @a flags.
4430 * When translating to the normal form, inconsistent eol styles will be
4431 * repaired when appropriate for the given setting. When translating
4432 * from normal form, no EOL repair is performed (consistency is assumed).
4433 * This behaviour can be overridden by specifying
4434 * @c SVN_WC_TRANSLATE_FORCE_EOL_REPAIR.
4436 * The caller can explicitly request a new file to be returned by setting the
4437 * @c SVN_WC_TRANSLATE_FORCE_COPY flag in @a flags.
4439 * This function is generally used to get a file that can be compared
4440 * meaningfully against @a versioned_file's text base, if
4441 * @c SVN_WC_TRANSLATE_TO_NF is specified, against @a versioned_file itself
4442 * if @c SVN_WC_TRANSLATE_FROM_NF is specified.
4444 * Output files are created in the temp file area belonging to
4445 * @a versioned_file. By default they will be deleted at pool cleanup.
4447 * If @c SVN_WC_TRANSLATE_NO_OUTPUT_CLEANUP is specified, the default
4448 * pool cleanup handler to remove @a *xlated_path is not registered.
4450 * If an error is returned, the effect on @a *xlated_path is undefined.
4455 svn_wc_translated_file2(const char **xlated_path
,
4457 const char *versioned_file
,
4458 svn_wc_adm_access_t
*adm_access
,
4463 /** Same as svn_wc_translated_file2, but will never clean up
4466 * @deprecated Provided for compatibility with the 1.3 API
4469 svn_wc_translated_file(const char **xlated_p
,
4471 svn_wc_adm_access_t
*adm_access
,
4472 svn_boolean_t force_repair
,
4476 /** Returns a @a stream allocated in @a pool with access to the given
4477 * @a path taking the file properties from @a versioned_file using
4480 * When translation from normal form is requested
4481 * (@c SVN_WC_TRANSLATE_FROM_NF is specified in @a flags), @a path
4482 * is used as target path and stream read operations are not supported.
4483 * Conversely, if translation to normal form is requested
4484 * (@c SVN_WC_TRANSLATE_TO_NF is specified in @a flags), @a path is
4485 * used as source path and stream write operations are not supported.
4487 * The @a flags are the same constants as those used for
4488 * svn_wc_translated_file().
4490 * @since New in 1.5.
4493 svn_wc_translated_stream(svn_stream_t
**stream
,
4495 const char *versioned_file
,
4496 svn_wc_adm_access_t
*adm_access
,
4501 /* Text/Prop Deltas Using an Editor */
4504 /** Send the local modifications for versioned file @a path (with
4505 * matching @a file_baton) through @a editor, then close @a file_baton
4506 * afterwards. Use @a pool for any temporary allocation and
4507 * @a adm_access as an access baton for @a path.
4509 * This process creates a copy of @a path with keywords and eol
4510 * untranslated. If @a tempfile is non-NULL, set @a *tempfile to the
4511 * path to this copy. Do not clean up the copy; caller can do that.
4512 * If @a digest is non-NULL, put the MD5 checksum of the
4513 * temporary file into @a digest, which must point to @c APR_MD5_DIGESTSIZE
4514 * bytes of storage. (The purpose of handing back the tmp copy is that
4515 * it is usually about to become the new text base anyway, but the
4516 * installation of the new text base is outside the scope of this
4519 * If @a fulltext, send the untranslated copy of @a path through @a editor
4520 * as full-text; else send it as svndiff against the current text base.
4522 * If sending a diff, and the recorded checksum for @a path's text-base
4523 * does not match the current actual checksum, then remove the tmp
4524 * copy (and set @a *tempfile to NULL if appropriate), and return the
4525 * error @c SVN_ERR_WC_CORRUPT_TEXT_BASE.
4527 * @note This is intended for use with both infix and postfix
4528 * text-delta styled editor drivers.
4530 * @since New in 1.4.
4533 svn_wc_transmit_text_deltas2(const char **tempfile
,
4534 unsigned char digest
[],
4536 svn_wc_adm_access_t
*adm_access
,
4537 svn_boolean_t fulltext
,
4538 const svn_delta_editor_t
*editor
,
4542 /** Similar to svn_wc_transmit_text_deltas2(), but with @a digest set to NULL.
4544 * @deprecated Provided for backwards compatibility with the 1.3 API.
4547 svn_wc_transmit_text_deltas(const char *path
,
4548 svn_wc_adm_access_t
*adm_access
,
4549 svn_boolean_t fulltext
,
4550 const svn_delta_editor_t
*editor
,
4552 const char **tempfile
,
4556 /** Given a @a path with its accompanying @a entry, transmit all local
4557 * property modifications using the appropriate @a editor method (in
4558 * conjunction with @a baton). @a adm_access is an access baton set
4559 * that contains @a path. Use @a pool for all allocations.
4561 * If a temporary file remains after this function is finished, the
4562 * path to that file is returned in @a *tempfile (so the caller can
4563 * clean this up if it wishes to do so).
4565 * @note Starting version 1.5, no tempfile will ever be returned
4566 * anymore. If @a *tempfile is passed, its value is set to @c NULL.
4569 svn_wc_transmit_prop_deltas(const char *path
,
4570 svn_wc_adm_access_t
*adm_access
,
4571 const svn_wc_entry_t
*entry
,
4572 const svn_delta_editor_t
*editor
,
4574 const char **tempfile
,
4578 /** Get the run-time configured list of ignore patterns from the
4579 * @c svn_config_t's in the @a config hash, and store them in @a *patterns.
4580 * Allocate @a *patterns and its contents in @a pool.
4583 svn_wc_get_default_ignores(apr_array_header_t
**patterns
,
4587 /** Get the list of ignore patterns from the @c svn_config_t's in the
4588 * @a config hash and the local ignore patterns from the directory
4589 * in @a adm_access, and store them in @a *patterns.
4590 * Allocate @a *patterns and its contents in @a pool.
4592 * @since New in 1.3.
4595 svn_wc_get_ignores(apr_array_header_t
**patterns
,
4597 svn_wc_adm_access_t
*adm_access
,
4600 /** Return TRUE iff @a str matches any of the elements of @a list, a
4601 * list of zero or more ignore patterns.
4603 * @since New in 1.5.
4606 svn_wc_match_ignore_list(const char *str
,
4607 apr_array_header_t
*list
,
4611 /** Add @a lock to the working copy for @a path. @a adm_access must contain
4612 * a write lock for @a path. If @a path is read-only, due to locking
4613 * properties, make it writable. Perform temporary allocations in @a
4616 svn_wc_add_lock(const char *path
,
4617 const svn_lock_t
*lock
,
4618 svn_wc_adm_access_t
*adm_access
,
4621 /** Remove any lock from @a path. @a adm_access must contain a
4622 * write-lock for @a path. If @a path has a lock and the locking
4623 * so specifies, make the file read-only. Don't return an error if @a
4624 * path didn't have a lock. Perform temporary allocations in @a pool. */
4626 svn_wc_remove_lock(const char *path
,
4627 svn_wc_adm_access_t
*adm_access
,
4631 /** A structure to report a summary of a working copy, including the
4632 * mix of revisions found within it, whether any parts are switched or
4633 * locally modified, and whether it is a sparse checkout.
4635 * @note Fields may be added to the end of this structure in future
4636 * versions. Therefore, to preserve binary compatibility, users
4637 * should not directly allocate structures of this type.
4641 typedef struct svn_wc_revision_status_t
4643 svn_revnum_t min_rev
; /**< Lowest revision found */
4644 svn_revnum_t max_rev
; /**< Highest revision found */
4646 svn_boolean_t switched
; /**< Is anything switched? */
4647 svn_boolean_t modified
; /**< Is anything modified? */
4649 /** Whether any WC paths are at a depth other than @c svn_depth_infinity.
4650 * @since New in 1.5.
4652 svn_boolean_t sparse_checkout
;
4654 svn_wc_revision_status_t
;
4656 /** Set @a *result_p to point to a new @c svn_wc_revision_status_t structure
4657 * containing a summary of the revision range and status of the working copy
4658 * at @a wc_path (not including "externals").
4660 * Set @a (*result_p)->min_rev and @a (*result_p)->max_rev respectively to the
4661 * lowest and highest revision numbers in the working copy. If @a committed
4662 * is TRUE, summarize the last-changed revisions, else the base revisions.
4664 * Set @a (*result_p)->switched to indicate whether any item in the WC is
4665 * switched relative to its parent. If @a trail_url is non-NULL, use it to
4666 * determine if @a wc_path itself is switched. It should be any trailing
4667 * portion of @a wc_path's expected URL, long enough to include any parts
4668 * that the caller considers might be changed by a switch. If it does not
4669 * match the end of @a wc_path's actual URL, then report a "switched"
4672 * Set @a (*result_p)->modified to indicate whether any item is locally
4675 * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
4676 * if the client has cancelled the operation.
4678 * Allocate *result_p in @a pool.
4683 svn_wc_revision_status(svn_wc_revision_status_t
**result_p
,
4684 const char *wc_path
,
4685 const char *trail_url
,
4686 svn_boolean_t committed
,
4687 svn_cancel_func_t cancel_func
,
4693 * Set @a path's entry's 'changelist' attribute to @a changelist iff
4694 * @a changelist is not @c NULL; otherwise, remove any current
4695 * changelist assignment from @a path. @a adm_access is an access
4696 * baton set that contains @a path.
4698 * If @a cancel_func is not @c NULL, call it with @a cancel_baton to
4699 * determine if the client has cancelled the operation.
4701 * If @a notify_func is not @c NULL, call it with @a notify_baton to
4702 * report the change (using notification types @c
4703 * svn_wc_notify_changelist_set and @c svn_wc_notify_changelist_clear).
4705 * @note For now, directories are NOT allowed to be associated with
4706 * changelists; there is confusion about whether they should behave
4707 * as depth-0 or depth-infinity objects. If @a path is a directory,
4708 * return @c SVN_ERR_UNSUPPORTED_FEATURE.
4710 * @note This metadata is purely a client-side "bookkeeping"
4711 * convenience, and is entirely managed by the working copy.
4713 * @since New in 1.5.
4716 svn_wc_set_changelist(const char *path
,
4717 const char *changelist
,
4718 svn_wc_adm_access_t
*adm_access
,
4719 svn_cancel_func_t cancel_func
,
4721 svn_wc_notify_func2_t notify_func
,
4730 #endif /* __cplusplus */
4732 #endif /* SVN_WC_H */