81
81
/* Serialize a DAG node, except don't try to preserve the 'fs' member.
82
82
Implements svn_cache__serialize_func_t */
84
svn_fs_fs__dag_serialize(char **data,
84
svn_fs_fs__dag_serialize(void **data,
85
85
apr_size_t *data_len,
123
123
/* Set *ID_P to the node revision ID of NODE's immediate predecessor,
124
or NULL if NODE has no predecessor, allocating from POOL.
126
Use POOL for all allocations, including to cache the node_revision in
124
or NULL if NODE has no predecessor.
129
126
svn_error_t *svn_fs_fs__dag_get_predecessor_id(const svn_fs_id_t **id_p,
134
130
/* Set *COUNT to the number of predecessors NODE has (recursively), or
135
-1 if not known, allocating from POOL.
137
Use POOL for all allocations, including to cache the node_revision in
133
/* ### This function is currently only used by 'verify'. */
140
134
svn_error_t *svn_fs_fs__dag_get_predecessor_count(int *count,
144
137
/* Set *COUNT to the number of node under NODE (inclusive) with
145
svn:mergeinfo properties, allocating from POOL.
147
Use POOL for all allocations, including to cache the node_revision in
138
svn:mergeinfo properties.
150
140
svn_error_t *svn_fs_fs__dag_get_mergeinfo_count(apr_int64_t *count,
154
143
/* Set *DO_THEY to a flag indicating whether or not NODE is a
155
144
directory with at least one descendant (not including itself) with
158
Use POOL for all allocations, including to cache the node_revision in
162
148
svn_fs_fs__dag_has_descendants_with_mergeinfo(svn_boolean_t *do_they,
166
151
/* Set *HAS_MERGEINFO to a flag indicating whether or not NODE itself
167
152
has svn:mergeinfo set on it.
169
Use POOL for all allocations, including to cache the node_revision in
173
155
svn_fs_fs__dag_has_mergeinfo(svn_boolean_t *has_mergeinfo,
177
158
/* Return non-zero IFF NODE is currently mutable. */
178
159
svn_boolean_t svn_fs_fs__dag_check_mutable(const dag_node_t *node);
188
169
If properties do not exist on NODE, *PROPLIST_P will be set to
191
Use POOL for all allocations, including to cache the node_revision in
172
Use POOL for all allocations.
194
174
svn_error_t *svn_fs_fs__dag_get_proplist(apr_hash_t **proplist_p,
195
175
dag_node_t *node,
198
178
/* Set the property list of NODE to PROPLIST, allocating from POOL.
199
179
The node being changed must be mutable.
201
Use POOL for all allocations, including to cache the node_revision in
181
Use POOL for all allocations.
204
183
svn_error_t *svn_fs_fs__dag_set_proplist(dag_node_t *node,
205
184
apr_hash_t *proplist,
208
187
/* Increment the mergeinfo_count field on NODE by INCREMENT. The node
209
188
being changed must be mutable.
211
Use POOL for all allocations, including to cache the node_revision in
190
Use POOL for all allocations.
214
192
svn_error_t *svn_fs_fs__dag_increment_mergeinfo_count(dag_node_t *node,
215
193
apr_int64_t increment,
218
196
/* Set the has-mergeinfo flag on NODE to HAS_MERGEINFO. The node
219
197
being changed must be mutable.
221
Use POOL for all allocations, including to cache the node_revision in
199
Use POOL for all allocations.
224
201
svn_error_t *svn_fs_fs__dag_set_has_mergeinfo(dag_node_t *node,
225
202
svn_boolean_t has_mergeinfo,
276
253
/* Open the node named NAME in the directory PARENT. Set *CHILD_P to
277
the new node, allocated in POOL. NAME must be a single path
254
the new node, allocated in RESULT_POOL. NAME must be a single path
278
255
component; it cannot be a slash-separated directory path.
280
Use POOL for all allocations, including to cache the node_revision in
283
svn_error_t *svn_fs_fs__dag_open(dag_node_t **child_p,
258
svn_fs_fs__dag_open(dag_node_t **child_p,
261
apr_pool_t *result_pool,
262
apr_pool_t *scratch_pool);
289
265
/* Set *ENTRIES_P to a hash table of NODE's entries. The keys of the
290
266
table are entry names, and the values are svn_fs_dirent_t's. The
291
267
returned table (and its keys and values) is allocated in POOL,
292
which is also used for temporary allocations. NODE_POOL is used
293
for any allocation of memory that needs to live as long as NODE
268
which is also used for temporary allocations. */
295
269
svn_error_t *svn_fs_fs__dag_dir_entries(apr_hash_t **entries_p,
296
270
dag_node_t *node,
298
apr_pool_t *node_pool);
300
273
/* Fetches the NODE's entries and returns a copy of the entry selected
301
274
by the key value given in NAME and set *DIRENT to a copy of that
302
275
entry. If such entry was found, the copy will be allocated in POOL.
303
Otherwise, the *DIRENT will be set to NULL. NODE_POOL is used for
304
any allocation of memory that needs to live as long as NODE lives.
276
Otherwise, the *DIRENT will be set to NULL.
278
/* ### This function is currently only called from dag.c. */
306
279
svn_error_t * svn_fs_fs__dag_dir_entry(svn_fs_dirent_t **dirent,
307
280
dag_node_t *node,
308
281
const char* name,
310
apr_pool_t *node_pool);
312
284
/* Set ENTRY_NAME in NODE to point to ID (with kind KIND), allocating
313
285
from POOL. NODE must be a mutable directory. ID can refer to a
344
316
TXN_ID is the Subversion transaction under which this occurs.
346
Use POOL for all allocations, including to cache the node_revision in
318
Use POOL for all allocations.
349
320
svn_error_t *svn_fs_fs__dag_clone_child(dag_node_t **child_p,
350
321
dag_node_t *parent,
366
337
If return SVN_ERR_FS_NO_SUCH_ENTRY, then there is no entry NAME in
369
Use POOL for all allocations, including to cache the node_revision in
340
Use POOL for all allocations.
372
342
svn_error_t *svn_fs_fs__dag_delete(dag_node_t *parent,
373
343
const char *name,
408
378
not currently have an entry named NAME. TXN_ID is the Subversion
409
379
transaction under which this occurs.
411
Use POOL for all allocations, including to cache the node_revision in
381
Use POOL for all allocations.
414
383
svn_error_t *svn_fs_fs__dag_make_dir(dag_node_t **child_p,
415
384
dag_node_t *parent,
429
398
If FILE is not a file, return SVN_ERR_FS_NOT_FILE.
431
Use POOL for all allocations, including to cache the node_revision in
400
Use POOL for all allocations.
434
402
svn_error_t *svn_fs_fs__dag_get_contents(svn_stream_t **contents,
435
403
dag_node_t *file,
436
404
apr_pool_t *pool);
406
/* Attempt to fetch the contents of NODE and pass it along with the BATON
407
to the PROCESSOR. Set *SUCCESS only of the data could be provided
408
and the processor had been called.
410
Use POOL for all allocations.
413
svn_fs_fs__dag_try_process_file_contents(svn_boolean_t *success,
415
svn_fs_process_contents_func_t processor,
439
420
/* Set *STREAM_P to a delta stream that will turn the contents of SOURCE into
440
421
the contents of TARGET, allocated in POOL. If SOURCE is null, the empty
441
422
string will be used.
443
Use POOL for all allocations, including to cache the node_revision in
424
Use POOL for all allocations.
447
427
svn_fs_fs__dag_get_file_delta_stream(svn_txdelta_stream_t **stream_p,
455
435
Any previous edits on the file will be deleted, and a new edit
456
436
stream will be constructed.
458
Use POOL for all allocations, including to cache the node_revision in
438
Use POOL for all allocations.
461
440
svn_error_t *svn_fs_fs__dag_get_edit_stream(svn_stream_t **contents,
462
441
dag_node_t *file,
483
462
/* Set *LENGTH to the length of the contents of FILE.
485
Use POOL for all allocations, including to cache the node_revision in
464
Use POOL for all allocations.
488
466
svn_error_t *svn_fs_fs__dag_file_length(svn_filesize_t *length,
489
467
dag_node_t *file,
495
473
If no stored checksum is available, do not calculate the checksum,
496
474
just put NULL into CHECKSUM.
498
Use POOL for all allocations, including to cache the node_revision in
476
Use POOL for all allocations.
502
479
svn_fs_fs__dag_file_checksum(svn_checksum_t **checksum,
512
489
canonicalized absolute path of the parent directory. TXN_ID is the
513
490
Subversion transaction under which this occurs.
515
Use POOL for all allocations, including to cache the node_revision in
492
Use POOL for all allocations.
518
494
svn_error_t *svn_fs_fs__dag_make_file(dag_node_t **child_p,
519
495
dag_node_t *parent,
539
515
If PRESERVE_HISTORY is false, FROM_PATH and FROM_REV are ignored.
541
Use POOL for all allocations, including to cache the node_revision in
517
Use POOL for all allocations.
544
519
svn_error_t *svn_fs_fs__dag_copy(dag_node_t *to_node,
545
520
const char *entry,
569
544
may leave us with a slight chance of a false positive, though I
570
545
don't really see how that would happen in practice. Nevertheless,
571
546
it should probably be fixed.
573
Use POOL for all allocations, including to cache the node_revision in NODE1
576
548
svn_error_t *svn_fs_fs__dag_things_different(svn_boolean_t *props_changed,
577
549
svn_boolean_t *contents_changed,
578
550
dag_node_t *node1,
583
554
/* Set *REV and *PATH to the copyroot revision and path of node NODE, or
584
555
to SVN_INVALID_REVNUM and NULL if no copyroot exists.
585
Use POOL for all allocations, including to cache the node_revision in NODE.
587
557
svn_error_t *svn_fs_fs__dag_get_copyroot(svn_revnum_t *rev,
588
558
const char **path,
592
561
/* Set *REV to the copyfrom revision associated with NODE.
593
Use POOL for all allocations, including to cache the node_revision in NODE.
595
563
svn_error_t *svn_fs_fs__dag_get_copyfrom_rev(svn_revnum_t *rev,
599
566
/* Set *PATH to the copyfrom path associated with NODE.
600
Use POOL for all allocations, including to cache the node_revision in NODE.
602
568
svn_error_t *svn_fs_fs__dag_get_copyfrom_path(const char **path,
606
571
/* Update *TARGET so that SOURCE is it's predecessor.