Change the format of the revprops block sent in svnserve for
[svn.git] / subversion / libsvn_wc / log.h
blob80a94426bf3f4e9fb44b62d99ad966ce0a53b2f5
1 /*
2 * log.h : interfaces for running .svn/log files.
4 * ====================================================================
5 * Copyright (c) 2000-2007 CollabNet. All rights reserved.
7 * This software is licensed as described in the file COPYING, which
8 * you should have received as part of this distribution. The terms
9 * are also available at http://subversion.tigris.org/license-1.html.
10 * If newer versions of this license are posted there, you may use a
11 * newer version instead, at your option.
13 * This software consists of voluntary contributions made by many
14 * individuals. For exact contribution history, see the revision
15 * history and logs, available at http://subversion.tigris.org/.
16 * ====================================================================
20 #ifndef SVN_LIBSVN_WC_LOG_H
21 #define SVN_LIBSVN_WC_LOG_H
23 #include <apr_pools.h>
25 #include "svn_types.h"
26 #include "svn_error.h"
27 #include "svn_wc.h"
29 #ifdef __cplusplus
30 extern "C" {
31 #endif /* __cplusplus */
35 /* Return the path to use for logfile number LOG_NUMBER. The returned
36 string will be allocated from POOL.
38 For log number 0, this will just be SVN_WC__ADM_LOG to maintain
39 compatibility with 1.0.x. Higher numbers have the digits of the
40 number appended to SVN_WC__ADM_LOG so that they look like "log.1",
41 "log.2", etc. */
42 const char *svn_wc__logfile_path(int log_number,
43 apr_pool_t *pool);
47 /* The svn_wc__loggy_* functions in this section take path arguments
48 with the same base as with which the adm_access was opened.
52 /* Extend **LOG_ACCUM with log instructions to append the contents
53 of SRC to DST.
55 This command fails to be idempotent or atomic: there's no way to
56 tell if you should re-run this! This function is deprecated; new
57 uses should not be added, and the single current use (constructing
58 human-readable non-parsed property conflict files) should be
59 rewritten. See Issue #3015.
61 svn_error_t *
62 svn_wc__loggy_append(svn_stringbuf_t **log_accum,
63 svn_wc_adm_access_t *adm_access,
64 const char *src, const char *dst,
65 apr_pool_t *pool);
68 /* Extend **LOG_ACCUM with log instructions to mark PATH as committed
69 with revision REVNUM.
71 svn_error_t *
72 svn_wc__loggy_committed(svn_stringbuf_t **log_accum,
73 svn_wc_adm_access_t *adm_access,
74 const char *path, svn_revnum_t revnum,
75 apr_pool_t *pool);
78 /* Extend **LOG_ACCUM with log instructions to copy the file SRC_PATH to
79 DST_PATH, if it exists. If it doesn't and REMOVE_DST_IF_NO_SRC is TRUE
80 the file at DST_PATH will be deleted if any.
82 Sets *DST_MODIFIED, if either the copy or the remove have been carried out.
85 typedef enum svn_wc__copy_t
87 /* Normal copy, no translation */
88 svn_wc__copy_normal = 0,
90 /* Copy, translate using file properties */
91 svn_wc__copy_translate,
93 /* Copy, translate using only the svn:special property, if any */
94 svn_wc__copy_translate_special_only,
96 /* Copy, detranslate using file properties */
97 svn_wc__copy_detranslate
98 } svn_wc__copy_t;
100 svn_error_t *
101 svn_wc__loggy_copy(svn_stringbuf_t **log_accum,
102 svn_boolean_t *dst_modified,
103 svn_wc_adm_access_t *adm_access,
104 svn_wc__copy_t copy_type,
105 const char *src_path, const char *dst_path,
106 svn_boolean_t remove_dst_if_no_src,
107 apr_pool_t *pool);
110 /* Extend **LOG_ACCUM with log instructions to generate a translated
111 file from SRC to DST with translation settings from VERSIONED
112 and flags specified in FLAGS.
114 svn_error_t *
115 svn_wc__loggy_translated_file(svn_stringbuf_t **log_accum,
116 svn_wc_adm_access_t *adm_access,
117 const char *dst,
118 const char *src,
119 const char *versioned,
120 apr_pool_t *pool);
122 /* Extend **LOG_ACCUM with log instructions to delete the entry
123 associated with PATH from the entries file.
125 svn_error_t *
126 svn_wc__loggy_delete_entry(svn_stringbuf_t **log_accum,
127 svn_wc_adm_access_t *adm_access,
128 const char *path,
129 apr_pool_t *pool);
132 /* Extend **LOG_ACCUM with log instructions to delete lock related
133 fields from the entry belonging to PATH.
135 svn_error_t *
136 svn_wc__loggy_delete_lock(svn_stringbuf_t **log_accum,
137 svn_wc_adm_access_t *adm_access,
138 const char *path,
139 apr_pool_t *pool);
141 /* Extend **LOG_ACCUM with log instructions to delete changelist
142 from the entry belonging to PATH.
144 svn_error_t *
145 svn_wc__loggy_delete_changelist(svn_stringbuf_t **log_accum,
146 svn_wc_adm_access_t *adm_access,
147 const char *path,
148 apr_pool_t *pool);
150 /* Extend **LOG_ACCUM with commands to modify the entry associated with NAME
151 according to the flags specified in MODIFY_FLAGS, based on the values
152 supplied in *ENTRY.
154 The flags in MODIFY_FLAGS are to be taken from the svn_wc__entry_modify
155 parameter by the same name.
157 svn_error_t *
158 svn_wc__loggy_entry_modify(svn_stringbuf_t **log_accum,
159 svn_wc_adm_access_t *adm_access,
160 const char *name,
161 svn_wc_entry_t *entry,
162 apr_uint64_t modify_flags,
163 apr_pool_t *pool);
165 /* Extend **LOG_ACCUM with log instructions to modify wcprop PROPNAME
166 for PATH, setting it to PROPVAL.
168 svn_error_t *
169 svn_wc__loggy_modify_wcprop(svn_stringbuf_t **log_accum,
170 svn_wc_adm_access_t *adm_access,
171 const char *path,
172 const char *propname,
173 const char *propval,
174 apr_pool_t *pool);
177 /* Extend **LOG_ACCUM with log instructions to move the file SRC_PATH to
178 DST_PATH, if it exists. If it doesn't and REMOVE_DST_IF_NO_SRC is TRUE
179 the file at DST_PATH will be deleted if any.
181 Sets *DST_MODIFIED, if either the copy or the remove have been carried out.
183 svn_error_t *
184 svn_wc__loggy_move(svn_stringbuf_t **log_accum,
185 svn_boolean_t *dst_modified,
186 svn_wc_adm_access_t *adm_access,
187 const char *src_path, const char *dst_path,
188 svn_boolean_t remove_dst_if_no_src,
189 apr_pool_t *pool);
193 /* Extend **LOG_ACCUM with log instructions to set permissions of PATH
194 to 'executable' if it has the 'executable' property set.
196 svn_error_t *
197 svn_wc__loggy_maybe_set_executable(svn_stringbuf_t **log_accum,
198 svn_wc_adm_access_t *adm_access,
199 const char *path,
200 apr_pool_t *pool);
202 /* Extend **LOG_ACCUM with log instructions to set permissions of PATH
203 to 'readonly' if it has the 'needs-lock' property set and there is
204 no lock for the file in the working copy.
206 svn_error_t *
207 svn_wc__loggy_maybe_set_readonly(svn_stringbuf_t **log_accum,
208 svn_wc_adm_access_t *adm_access,
209 const char *path,
210 apr_pool_t *pool);
213 /* Extend **LOG_ACCUM with log instructions to set the timestamp of PATH
214 in the entry field with name TIME_PROP.
216 Use SVN_WC__ENTRY_ATTR_* values for TIME_PROP.
218 svn_error_t *
219 svn_wc__loggy_set_entry_timestamp_from_wc(svn_stringbuf_t **log_accum,
220 svn_wc_adm_access_t *adm_access,
221 const char *path,
222 const char *time_prop,
223 apr_pool_t *pool);
226 /* Extend **LOG_ACCUM with log instructions to set the file size of PATH
227 in the entries' WORKING_SIZE field.
229 svn_error_t *
230 svn_wc__loggy_set_entry_working_size_from_wc(svn_stringbuf_t **log_accum,
231 svn_wc_adm_access_t *adm_access,
232 const char *path,
233 apr_pool_t *pool);
236 /* Extend **LOG_ACCUM with log instructions to set permissions of PATH
237 to 'readonly'.
239 svn_error_t *
240 svn_wc__loggy_set_readonly(svn_stringbuf_t **log_accum,
241 svn_wc_adm_access_t *adm_access,
242 const char *path,
243 apr_pool_t *pool);
245 /* Extend **LOG_ACCUM with log instructions to set the timestamp of PATH.
248 svn_error_t *
249 svn_wc__loggy_set_timestamp(svn_stringbuf_t **log_accum,
250 svn_wc_adm_access_t *adm_access,
251 const char *path,
252 const char *timestr,
253 apr_pool_t *pool);
255 /* Extend **LOG_ACCUM with log instructions to remove the file
256 BASE_NAME, if it exists.
258 svn_error_t *
259 svn_wc__loggy_remove(svn_stringbuf_t **log_accum,
260 svn_wc_adm_access_t *adm_access,
261 const char *path,
262 apr_pool_t *pool);
264 /* Extend **LOG_ACCUM with instructions to cause the working copy of ADM_ACCESS
265 to be upgraded to FORMAT. */
266 svn_error_t *
267 svn_wc__loggy_upgrade_format(svn_stringbuf_t **log_accum,
268 svn_wc_adm_access_t *adm_access,
269 int format,
270 apr_pool_t *pool);
273 /* Create a log file with LOG_NUMBER. Write LOG_CONTENT to it and close-
274 and-sync afterwards. ADM_ACCESS must point to a locked working copy.
277 Helper to eliminate code duplication. */
278 svn_error_t *
279 svn_wc__write_log(svn_wc_adm_access_t *adm_access,
280 int log_number, svn_stringbuf_t *log_content,
281 apr_pool_t *pool);
284 /* Process the instructions in the log file for ADM_ACCESS.
285 DIFF3_CMD is the external differ used by the 'SVN_WC__LOG_MERGE'
286 log entry. It is always safe to pass null for this.
288 If the log fails on its first command, return the error
289 SVN_ERR_WC_BAD_ADM_LOG_START. If it fails on some subsequent
290 command, return SVN_ERR_WC_BAD_ADM_LOG. */
291 svn_error_t *svn_wc__run_log(svn_wc_adm_access_t *adm_access,
292 const char *diff3_cmd,
293 apr_pool_t *pool);
295 /* Similar to svn_wc__run_log except that it is assumed that the log
296 file has been run before and so some of the log commands may
297 already have been processed. */
298 svn_error_t *svn_wc__rerun_log(svn_wc_adm_access_t *adm_access,
299 const char *diff3_cmd,
300 apr_pool_t *pool);
303 #ifdef __cplusplus
305 #endif /* __cplusplus */
307 #endif /* SVN_LIBSVN_WC_LOG_H */