2 * entries.h : manipulating entries
4 * ====================================================================
5 * Licensed to the Apache Software Foundation (ASF) under one
6 * or more contributor license agreements. See the NOTICE file
7 * distributed with this work for additional information
8 * regarding copyright ownership. The ASF licenses this file
9 * to you under the Apache License, Version 2.0 (the
10 * "License"); you may not use this file except in compliance
11 * with the License. You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing,
16 * software distributed under the License is distributed on an
17 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 * KIND, either express or implied. See the License for the
19 * specific language governing permissions and limitations
21 * ====================================================================
25 #ifndef SVN_LIBSVN_WC_ENTRIES_H
26 #define SVN_LIBSVN_WC_ENTRIES_H
28 #include <apr_pools.h>
30 #include "svn_types.h"
33 #include "private/svn_sqlite.h"
38 #endif /* __cplusplus */
40 /** Get an ENTRY for the given LOCAL_ABSPATH.
42 * This API does not require an access baton, just a wc_db handle (DB).
43 * The requested entry MUST be present and version-controlled when
44 * ALLOW_UNVERSIONED is FALSE; otherwise, SVN_ERR_WC_PATH_NOT_FOUND is
45 * returned. When ALLOW_UNVERSIONED is TRUE, and the node is not under
46 * version control, *ENTRY will be set to NULL (this is easier for callers
47 * to handle, than detecting the error and clearing it).
49 * If you know the entry is a FILE or DIR, then specify that in KIND. If you
50 * are unsure, then specify 'svn_node_unknown' for KIND. This value will be
51 * used to optimize the access to the entry, so it is best to know the kind.
52 * If you specify FILE/DIR, and the entry is *something else*, then
53 * SVN_ERR_NODE_UNEXPECTED_KIND will be returned.
55 * If KIND == UNKNOWN, and you request the parent stub, and the node turns
56 * out to NOT be a directory, then SVN_ERR_NODE_UNEXPECTED_KIND is returned.
58 * NOTE: if SVN_ERR_NODE_UNEXPECTED_KIND is returned, then the ENTRY *IS*
59 * valid and may be examined. For any other error, ENTRY *IS NOT* valid.
61 * NOTE: if an access baton is available, then it will be examined for
62 * cached entries (and this routine may even cache them for you). It is
63 * not required, however, to do any access baton management for this API.
65 * ENTRY will be allocated in RESULT_POOL, and all temporary allocations
66 * will be performed in SCRATCH_POOL.
69 svn_wc__get_entry(const svn_wc_entry_t **entry,
71 const char *local_abspath,
72 svn_boolean_t allow_unversioned,
74 apr_pool_t *result_pool,
75 apr_pool_t *scratch_pool);
77 /* Is ENTRY in a 'hidden' state in the sense of the 'show_hidden'
78 * switches on svn_wc_entries_read(), svn_wc_walk_entries*(), etc.? */
80 svn_wc__entry_is_hidden(svn_boolean_t *hidden, const svn_wc_entry_t *entry);
83 /* The checksums of one pre-1.7 text-base file. If the text-base file
84 * exists, both checksums are filled in, otherwise both fields are NULL. */
85 typedef struct svn_wc__text_base_file_info_t
87 svn_checksum_t *sha1_checksum;
88 svn_checksum_t *md5_checksum;
89 } svn_wc__text_base_file_info_t;
91 /* The text-base checksums of the normal base and/or the revert-base of one
92 * pre-1.7 versioned text file. */
93 typedef struct svn_wc__text_base_info_t
95 svn_wc__text_base_file_info_t normal_base;
96 svn_wc__text_base_file_info_t revert_base;
97 } svn_wc__text_base_info_t;
99 /* For internal use by upgrade.c to write entries in the wc-ng format.
100 Return in DIR_BATON the baton to be passed as PARENT_BATON when
101 upgrading child directories. Pass a NULL PARENT_BATON when upgrading
104 TEXT_BASES_INFO is a hash of information about all the text bases found
105 in this directory's admin area, keyed on (const char *) name of the
106 versioned file, with (svn_wc__text_base_info_t *) values. */
108 svn_wc__write_upgraded_entries(void **dir_baton,
111 svn_sqlite__db_t *sdb,
112 apr_int64_t repos_id,
114 const char *dir_abspath,
115 const char *new_root_abspath,
117 apr_hash_t *text_bases_info,
118 apr_pool_t *result_pool,
119 apr_pool_t *scratch_pool);
121 /* Parse a file external specification in the NULL terminated STR and
122 place the path in PATH_RESULT, the peg revision in PEG_REV_RESULT
123 and revision number in REV_RESULT. STR may be NULL, in which case
124 PATH_RESULT will be set to NULL and both PEG_REV_RESULT and
125 REV_RESULT set to svn_opt_revision_unspecified.
127 The format that is read is the same as a working-copy path with a
128 peg revision; see svn_opt_parse_path(). */
130 svn_wc__unserialize_file_external(const char **path_result,
131 svn_opt_revision_t *peg_rev_result,
132 svn_opt_revision_t *rev_result,
136 /* Serialize into STR the file external path, peg revision number and
137 the operative revision number into a format that
138 unserialize_file_external() can parse. The format is
139 %{peg_rev}:%{rev}:%{path}
140 where a rev will either be HEAD or the string revision number. If
141 PATH is NULL then STR will be set to NULL. This method writes to a
142 string instead of a svn_stringbuf_t so that the string can be
143 protected by write_str(). */
145 svn_wc__serialize_file_external(const char **str,
147 const svn_opt_revision_t *peg_rev,
148 const svn_opt_revision_t *rev,
151 /* Non-deprecated wrapper variant of svn_wc_entries_read used implement
152 legacy API functions. See svn_wc_entries_read for a detailed description.
155 svn_wc__entries_read_internal(apr_hash_t **entries,
156 svn_wc_adm_access_t *adm_access,
157 svn_boolean_t show_hidden,
162 #endif /* __cplusplus */
164 #endif /* SVN_LIBSVN_WC_ENTRIES_H */