132
130
/* Add a text conflict to CONFLICT_SKEL.
133
131
Allocate data stored in the skel in RESULT_POOL.
135
All checksums passed should be suitable for retreiving conflicted
136
versions of the file from the pristine store.
138
ORIGINAL_CHECKSUM is the checksum of the BASE version of the conflicted
139
file (without local modifications).
140
MINE_CHECKSUM is the checksum of the WORKING version of the conflicted
141
file as of the time the conflicting operation was run (i.e. including
142
local modifications).
143
INCOMING_CHECKSUM is the checksum of the incoming file causing the
144
conflict. ### is this needed for update? what about merge?
146
It is an error (### which one?) if no conflicting operation has been
147
set on CONFLICT_SKEL before calling this function.
148
It is an error (### which one?) if CONFLICT_SKEL already contains
151
Do temporary allocations in SCRATCH_POOL.
154
svn_wc__conflict_skel_add_text_conflict(
155
svn_skel_t *conflict_skel,
156
const svn_checksum_t *original_checksum,
157
const svn_checksum_t *mine_checksum,
158
const svn_checksum_t *incoming_checksum,
159
apr_pool_t *result_pool,
160
apr_pool_t *scratch_pool);
163
/* Add a property conflict to SKEL.
165
PROP_NAME is the name of the conflicted property.
167
ORIGINAL_VALUE is the property's value at the BASE revision. MINE_VALUE
168
is the property's value in WORKING (BASE + local modifications).
169
INCOMING_VALUE is the incoming property value brought in by the
170
operation. When merging, INCOMING_BASE_VALUE is the base value against
171
which INCOMING_VALUE ws being applied. For updates, INCOMING_BASE_VALUE
172
should be the same as ORIGINAL_VALUE.
174
*_VALUE may be NULL, indicating no value was present.
176
It is an error (### which one?) if no conflicting operation has been
177
set on CONFLICT_SKEL before calling this function.
178
It is an error (### which one?) if CONFLICT_SKEL already cotains
179
a propery conflict for PROP_NAME.
181
The conflict recorded in SKEL will be allocated from RESULT_POOL. Do
182
temporary allocations in SCRATCH_POOL.
185
svn_wc__conflict_skel_add_prop_conflict(
187
const char *prop_name,
188
const svn_string_t *original_value,
189
const svn_string_t *mine_value,
190
const svn_string_t *incoming_value,
191
const svn_string_t *incoming_base_value,
192
apr_pool_t *result_pool,
193
apr_pool_t *scratch_pool);
133
The DB, WRI_ABSPATH pair specifies in which working copy the conflict
134
will be recorded. (Needed for making the paths relative).
136
MINE_ABSPATH, THEIR_OLD_ABSPATH and THEIR_ABSPATH specify the marker
137
files for this text conflict. Each of these values can be NULL to specify
138
that the node doesn't exist in this case.
140
### It is expected that in a future version we will also want to store
141
### the sha1 checksum of these files to allow reinstalling the conflict
142
### markers from the pristine store.
144
It is an error to add another text conflict to a conflict skel that
145
already contains a text conflict.
147
Do temporary allocations in SCRATCH_POOL.
150
svn_wc__conflict_skel_add_text_conflict(svn_skel_t *conflict_skel,
152
const char *wri_abspath,
153
const char *mine_abspath,
154
const char *their_old_abspath,
155
const char *their_abspath,
156
apr_pool_t *result_pool,
157
apr_pool_t *scratch_pool);
160
/* Add property conflict details to CONFLICT_SKEL.
161
Allocate data stored in the skel in RESULT_POOL.
163
The DB, WRI_ABSPATH pair specifies in which working copy the conflict
164
will be recorded. (Needed for making the paths relative).
166
The MARKER_ABSPATH is NULL when raising a conflict in v1.8+. See below.
168
The MINE_PROPS, THEIR_OLD_PROPS and THEIR_PROPS are hashes mapping a
169
const char * property name to a const svn_string_t* value.
171
The CONFLICTED_PROP_NAMES is a const char * property name value mapping
172
to "", recording which properties aren't resolved yet in the current
174
### Needed for creating the marker file from this conflict data.
175
### Would also allow per property marking as resolved.
176
### Maybe useful for calling (legacy) conflict resolvers that expect one
177
### property conflict per invocation.
179
When raising a property conflict in the course of upgrading an old WC,
180
MARKER_ABSPATH is the path to the file containing a human-readable
181
description of the conflict, MINE_PROPS and THEIR_OLD_PROPS and
182
THEIR_PROPS are all NULL, and CONFLICTED_PROP_NAMES is an empty hash.
184
It is an error to add another prop conflict to a conflict skel that
185
already contains a prop conflict. (A single call to this function can
186
record that multiple properties are in conflict.)
188
Do temporary allocations in SCRATCH_POOL.
191
svn_wc__conflict_skel_add_prop_conflict(svn_skel_t *conflict_skel,
193
const char *wri_abspath,
194
const char *marker_abspath,
195
const apr_hash_t *mine_props,
196
const apr_hash_t *their_old_props,
197
const apr_hash_t *their_props,
198
const apr_hash_t *conflicted_prop_names,
199
apr_pool_t *result_pool,
200
apr_pool_t *scratch_pool);
196
203
/* Add a tree conflict to CONFLICT_SKEL.
197
204
Allocate data stored in the skel in RESULT_POOL.
199
206
LOCAL_CHANGE is the local tree change made to the node.
200
ORIGINAL_LOCAL_KIND is the kind of the local node in BASE.
201
If ORIGINAL_LOCAL_KIND is svn_node_file, ORIGINAL_CHECKSUM is the checksum
202
for the BASE of the file, for retrieval from the pristine store.
204
MINE_LOCAL_KIND is the kind of the local node in WORKING at the
205
time the conflict was flagged.
206
If MINE_LOCAL_KIND is svn_node_file, ORIGINAL_CHECKSUM is the checksum
207
of the WORKING version of the file at the time the conflict was flagged,
208
for retrieval from the pristine store.
210
INCOMING_KIND is the kind of the incoming node.
211
If INCOMING_KIND is svn_node_file, INCOMING_CHECKSUM is the checksum
212
of the INCOMING version of the file, for retrieval from the pristine store.
214
It is an error (### which one?) if no conflicting operation has been
215
set on CONFLICT_SKEL before calling this function.
216
It is an error (### which one?) if CONFLICT_SKEL already contains
219
Do temporary allocations in SCRATCH_POOL.
222
svn_wc__conflict_skel_add_tree_conflict(
224
svn_wc_conflict_reason_t local_change,
225
svn_wc__db_kind_t original_local_kind,
226
const svn_checksum_t *original_checksum,
227
svn_wc__db_kind_t mine_local_kind,
228
const svn_checksum_t *mine_checksum,
229
svn_wc_conflict_action_t incoming_change,
230
svn_wc__db_kind_t incoming_kind,
231
const svn_checksum_t *incoming_checksum,
232
apr_pool_t *result_pool,
233
apr_pool_t *scratch_pool);
236
/* Add a reject conflict to CONFLICT_SKEL.
237
Allocate data stored in the skel in RESULT_POOL.
239
HUNK_ORIGINAL_OFFSET, HUNK_ORIGINAL_LENGTH, HUNK_MODIFIED_OFFSET,
240
and HUNK_MODIFIED_LENGTH is hunk-header data identifying the hunk
243
REJECT_DIFF_CHECKSUM is the checksum of the text of the rejected
244
diff, for retrieval from the pristine store.
246
It is an error (### which one?) if no conflicting operation has been
247
set on CONFLICT_SKEL before calling this function.
248
It is an error (### which one?) if CONFLICT_SKEL already contains
249
a reject conflict for the hunk.
251
Do temporary allocations in SCRATCH_POOL.
254
svn_wc__conflict_skel_add_reject_conflict(
255
svn_skel_t *conflict_skel,
256
svn_linenum_t hunk_original_offset,
257
svn_linenum_t hunk_original_length,
258
svn_linenum_t hunk_modified_offset,
259
svn_linenum_t hunk_modified_length,
260
const svn_checksum_t *reject_diff_checksum,
261
apr_pool_t *result_pool,
262
apr_pool_t *scratch_pool);
265
/* Add an obstruction conflict to CONFLICT_SKEL.
266
Allocate data stored in the skel in RESULT_POOL.
268
It is an error (### which one?) if no conflicting operation has been
269
set on CONFLICT_SKEL before calling this function.
270
It is an error (### which one?) if CONFLICT_SKEL already contains
273
Do temporary allocations in SCRATCH_POOL.
276
svn_wc__conflict_skel_add_obstruction(svn_skel_t *conflict_skel,
277
apr_pool_t *result_pool,
278
apr_pool_t *scratch_pool);
281
/* Resolve text conflicts on the given node. */
283
svn_wc__resolve_text_conflict(svn_wc__db_t *db,
284
const char *local_abspath,
285
apr_pool_t *scratch_pool);
207
INCOMING_CHANGE is the incoming change made to the node.
209
MOVE_SRC_OP_ROOT_ABSPATH must be set when LOCAL_CHANGE is
210
svn_wc_conflict_reason_moved_away and NULL otherwise and the operation
211
is svn_wc_operation_update or svn_wc_operation_switch. It should be
212
set to the op-root of the move-away unless the move is inside a
213
delete in which case it should be set to the op-root of the delete
214
(the delete can be a replace). So given:
216
A deleted and replaced
219
MOVE_SRC_OP_ROOT_ABSPATH should be A for a conflict associated
220
with (1), MOVE_SRC_OP_ROOT_ABSPATH should be A/B for a conflict
223
It is an error to add another tree conflict to a conflict skel that
224
already contains a tree conflict. (It is not an error, at this level,
225
to add a tree conflict to an existing text or property conflict skel.)
227
Do temporary allocations in SCRATCH_POOL.
230
svn_wc__conflict_skel_add_tree_conflict(svn_skel_t *conflict_skel,
232
const char *wri_abspath,
233
svn_wc_conflict_reason_t local_change,
234
svn_wc_conflict_action_t incoming_change,
235
const char *move_src_op_root_abspath,
236
apr_pool_t *result_pool,
237
apr_pool_t *scratch_pool);
239
/* Allows resolving specific conflicts stored in CONFLICT_SKEL.
241
When RESOLVE_TEXT is TRUE and CONFLICT_SKEL contains a text conflict,
242
resolve/remove the text conflict in CONFLICT_SKEL.
244
When RESOLVE_PROP is "" and CONFLICT_SKEL contains a property conflict,
245
resolve/remove all property conflicts in CONFLICT_SKEL.
247
When RESOLVE_PROP is not NULL and not "", remove the property conflict on
248
the property RESOLVE_PROP in CONFLICT_SKEL. When RESOLVE_PROP was the last
249
property in CONFLICT_SKEL remove the property conflict info from
252
When RESOLVE_TREE is TRUE and CONFLICT_SKEL contains a tree conflict,
253
resolve/remove the tree conflict in CONFLICT_SKEL.
255
If COMPLETELY_RESOLVED is not NULL, then set *COMPLETELY_RESOLVED to TRUE,
256
when no conflict registration is left in CONFLICT_SKEL after editting,
259
Allocate data stored in the skel in RESULT_POOL.
261
This functions edits CONFLICT_SKEL. New skels might be created in
262
RESULT_POOL. Temporary allocations will use SCRATCH_POOL.
264
/* ### db, wri_abspath is currently unused. Remove? */
266
svn_wc__conflict_skel_resolve(svn_boolean_t *completely_resolved,
267
svn_skel_t *conflict_skel,
269
const char *wri_abspath,
270
svn_boolean_t resolve_text,
271
const char *resolve_prop,
272
svn_boolean_t resolve_tree,
273
apr_pool_t *result_pool,
274
apr_pool_t *scratch_pool);
277
* -----------------------------------------------------------
278
* Reading conflict skels. Maybe this can be made private later
279
* -----------------------------------------------------------
282
/* Read common information from CONFLICT_SKEL to determine the operation
285
* Output arguments can be NULL if the value is not necessary.
287
* Set *LOCATIONS to an array of (svn_wc_conflict_version_t *). For
288
* conflicts written by current code, there are 2 elements: index [0] is
289
* the 'old' or 'left' side and [1] is the 'new' or 'right' side.
291
* For conflicts written by 1.6 or 1.7 there are 2 locations for a tree
292
* conflict, but none for a text or property conflict.
294
* TEXT_, PROP_ and TREE_CONFLICTED (when not NULL) will be set to TRUE
295
* when the conflict contains the specified kind of conflict, otherwise
298
* Allocate the result in RESULT_POOL. Perform temporary allocations in
302
svn_wc__conflict_read_info(svn_wc_operation_t *operation,
303
const apr_array_header_t **locations,
304
svn_boolean_t *text_conflicted,
305
svn_boolean_t *prop_conflicted,
306
svn_boolean_t *tree_conflicted,
308
const char *wri_abspath,
309
const svn_skel_t *conflict_skel,
310
apr_pool_t *result_pool,
311
apr_pool_t *scratch_pool);
313
/* Reads back the original data stored by svn_wc__conflict_skel_add_text_conflict()
314
* in CONFLICT_SKEL for a node in DB, WRI_ABSPATH.
316
* Values as documented for svn_wc__conflict_skel_add_text_conflict().
318
* Output arguments can be NULL if the value is not necessary.
320
* Allocate the result in RESULT_POOL. Perform temporary allocations in
324
svn_wc__conflict_read_text_conflict(const char **mine_abspath,
325
const char **their_old_abspath,
326
const char **their_abspath,
328
const char *wri_abspath,
329
const svn_skel_t *conflict_skel,
330
apr_pool_t *result_pool,
331
apr_pool_t *scratch_pool);
333
/* Reads back the original data stored by svn_wc__conflict_skel_add_prop_conflict()
334
* in CONFLICT_SKEL for a node in DB, WRI_ABSPATH.
336
* Values as documented for svn_wc__conflict_skel_add_prop_conflict().
338
* Output arguments can be NULL if the value is not necessary
339
* Allocate the result in RESULT_POOL. Perform temporary allocations in
343
svn_wc__conflict_read_prop_conflict(const char **marker_abspath,
344
apr_hash_t **mine_props,
345
apr_hash_t **their_old_props,
346
apr_hash_t **their_props,
347
apr_hash_t **conflicted_prop_names,
349
const char *wri_abspath,
350
const svn_skel_t *conflict_skel,
351
apr_pool_t *result_pool,
352
apr_pool_t *scratch_pool);
354
/* Reads back the original data stored by svn_wc__conflict_skel_add_tree_conflict()
355
* in CONFLICT_SKEL for a node in DB, WRI_ABSPATH.
357
* Values as documented for svn_wc__conflict_skel_add_tree_conflict().
359
* Output arguments can be NULL if the value is not necessary
360
* Allocate the result in RESULT_POOL. Perform temporary allocations in
364
svn_wc__conflict_read_tree_conflict(svn_wc_conflict_reason_t *local_change,
365
svn_wc_conflict_action_t *incoming_change,
366
const char **move_src_op_root_abspath,
368
const char *wri_abspath,
369
const svn_skel_t *conflict_skel,
370
apr_pool_t *result_pool,
371
apr_pool_t *scratch_pool);
373
/* Reads in *MARKERS a list of const char * absolute paths of the marker files
374
referenced from CONFLICT_SKEL.
375
* Allocate the result in RESULT_POOL. Perform temporary allocations in
379
svn_wc__conflict_read_markers(const apr_array_header_t **markers,
381
const char *wri_abspath,
382
const svn_skel_t *conflict_skel,
383
apr_pool_t *result_pool,
384
apr_pool_t *scratch_pool);
386
/* Create the necessary marker files for the conflicts stored in
387
* CONFLICT_SKEL and return the work items to fill the markers from
390
* Currently only used for property conflicts as text conflict markers
391
* are just in-wc files.
393
* Allocate the result in RESULT_POOL. Perform temporary allocations in
397
svn_wc__conflict_create_markers(svn_skel_t **work_item,
399
const char *local_abspath,
400
svn_skel_t *conflict_skel,
401
apr_pool_t *result_pool,
402
apr_pool_t *scratch_pool);
404
/* Call the interactive conflict resolver RESOLVER_FUNC with RESOLVER_BATON to
405
allow resolving the conflicts on LOCAL_ABSPATH.
407
Call RESOLVER_FUNC once for each property conflict, and again for any
408
text conflict, and again for any tree conflict on the node.
410
CONFLICT_SKEL contains the details of the conflicts on LOCAL_ABSPATH.
412
Resolver actions are directly applied to the in-db state of LOCAL_ABSPATH,
413
so the conflict and the state in CONFLICT_SKEL must already be installed in
416
svn_wc__conflict_invoke_resolver(svn_wc__db_t *db,
417
const char *local_abspath,
418
const svn_skel_t *conflict_skel,
419
const apr_array_header_t *merge_options,
420
svn_wc_conflict_resolver_func2_t resolver_func,
421
void *resolver_baton,
422
svn_cancel_func_t cancel_func,
424
apr_pool_t *scratch_pool);
427
/* Mark as resolved any text conflict on the node at DB/LOCAL_ABSPATH. */
429
svn_wc__mark_resolved_text_conflict(svn_wc__db_t *db,
430
const char *local_abspath,
431
apr_pool_t *scratch_pool);
433
/* Mark as resolved any prop conflicts on the node at DB/LOCAL_ABSPATH. */
435
svn_wc__mark_resolved_prop_conflicts(svn_wc__db_t *db,
436
const char *local_abspath,
437
apr_pool_t *scratch_pool);
288
439
#ifdef __cplusplus