2
2
* translate.h : eol and keyword translation
4
4
* ====================================================================
5
* Copyright (c) 2000-2004 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/.
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
16
21
* ====================================================================
45
51
If STYLE is null on entry, ignore it. If *EOL is non-null on exit,
46
52
it is a static string not allocated in POOL.
48
ADM_ACCESS is an access baton set that contains PATH.
50
Use POOL for temporary allocation.
54
If KEYWORDS is not NULL Expand keywords for the file at LOCAL_ABSPATH
55
in DB, by parsing a whitespace-delimited list of keywords. If any keywords
56
are found in the list, allocate *KEYWORDS from RESULT_POOL and populate it
57
with mappings from (const char *) keywords to their (svn_string_t *)
58
values (also allocated in RESULT_POOL).
60
If a keyword is in the list, but no corresponding value is
61
available, do not create a hash entry for it. If no keywords are
62
found in the list, or if there is no list, set *KEYWORDS to NULL.
64
If SPECIAL is not NULL determine if the svn:special flag is set on
65
LOCAL_ABSPATH in DB. If so, set SPECIAL to TRUE, if not, set it to FALSE.
67
If PROPS is not NULL, use PROPS instead of the properties on LOCAL_ABSPATH.
69
If WRI_ABSPATH is not NULL, retrieve the information for LOCAL_ABSPATH
70
from the working copy identified by WRI_ABSPATH. Falling back to file
71
external information if the file is not present as versioned node.
73
If FOR_NORMALIZATION is TRUE, just return a list of keywords instead of
74
calculating their intended values.
76
Use SCRATCH_POOL for temporary allocation, RESULT_POOL for allocating
52
svn_error_t *svn_wc__get_eol_style(svn_subst_eol_style_t *style,
55
svn_wc_adm_access_t *adm_access,
80
svn_wc__get_translate_info(svn_subst_eol_style_t *style,
82
apr_hash_t **keywords,
83
svn_boolean_t *special,
85
const char *local_abspath,
87
svn_boolean_t for_normalization,
88
apr_pool_t *result_pool,
89
apr_pool_t *scratch_pool);
58
91
/* Reverse parser. Given a real EOL string ("\n", "\r", or "\r\n"),
59
92
return an encoded *VALUE ("LF", "CR", "CRLF") that one might see in
61
94
void svn_wc__eol_value_from_string(const char **value,
64
/* Expand keywords for the file at PATH, by parsing a
65
whitespace-delimited list of keywords. If any keywords are found
66
in the list, allocate *KEYWORDS from POOL and populate it with
67
mappings from (const char *) keywords to their (svn_string_t *)
68
values (also allocated in POOL).
97
/* Expand keywords for the file at LOCAL_ABSPATH in DB, by parsing a
98
whitespace-delimited list of keywords KEYWORD_LIST. If any keywords
99
are found in the list, allocate *KEYWORDS from RESULT_POOL and populate
100
it with mappings from (const char *) keywords to their (svn_string_t *)
101
values (also allocated in RESULT_POOL).
70
103
If a keyword is in the list, but no corresponding value is
71
104
available, do not create a hash entry for it. If no keywords are
72
105
found in the list, or if there is no list, set *KEYWORDS to NULL.
74
ADM_ACCESS must be an access baton for PATH.
76
If FORCE_LIST is non-null, use it as the list; else use the
77
SVN_PROP_KEYWORDS property for PATH. In either case, use PATH to
78
expand keyword values.
107
Use LOCAL_ABSPATH to expand keyword values.
109
If WRI_ABSPATH is not NULL, retrieve the information for LOCAL_ABSPATH
110
from the working copy identified by WRI_ABSPATH. Falling back to file
111
external information if the file is not present as versioned node.
113
If FOR_NORMALIZATION is TRUE, just return a list of keywords instead of
114
calculating their intended values.
116
Use SCRATCH_POOL for any temporary allocations.
80
svn_error_t *svn_wc__get_keywords(apr_hash_t **keywords,
82
svn_wc_adm_access_t *adm_access,
83
const char *force_list,
87
/* Determine if the svn:special flag is set on PATH. If so, set
88
SPECIAL to TRUE, if not, set it to FALSE. ADM_ACCESS must be an
89
access baton for PATH. Perform any temporary allocations in
91
svn_error_t *svn_wc__get_special(svn_boolean_t *special,
93
svn_wc_adm_access_t *adm_access,
96
/* If the SVN_PROP_EXECUTABLE property is present at all, then set
97
PATH executable. If DID_SET is non-null, then set *DID_SET to
98
TRUE if did set PATH executable, or to FALSE if not. ADM_ACCESS
99
is an access baton set that contains PATH. */
101
svn_wc__maybe_set_executable(svn_boolean_t *did_set,
103
svn_wc_adm_access_t *adm_access,
106
/* If the SVN_PROP_NEEDS_LOCK property is present and there is no
107
lock token for the file in the working copy, set PATH to
108
read-only. If DID_SET is non-null, then set *DID_SET to TRUE if
109
did set PATH read-write, or to FALSE if not. ADM_ACCESS is an
110
access baton set that contains PATH. */
111
svn_error_t * svn_wc__maybe_set_read_only(svn_boolean_t *did_set,
113
svn_wc_adm_access_t *adm_access,
119
svn_wc__expand_keywords(apr_hash_t **keywords,
121
const char *local_abspath,
122
const char *wri_abspath,
123
const char *keyword_list,
124
svn_boolean_t for_normalization,
125
apr_pool_t *result_pool,
126
apr_pool_t *scratch_pool);
128
/* Sync the write and execute bit for LOCAL_ABSPATH with what is currently
129
indicated by the properties in the database:
131
* If the SVN_PROP_NEEDS_LOCK property is present and there is no
132
lock token for the file in the working copy, set LOCAL_ABSPATH to
134
* If the SVN_PROP_EXECUTABLE property is present at all, then set
135
LOCAL_ABSPATH executable.
137
If DID_SET is non-null, then liberally set *DID_SET to TRUE if we might
138
have change the permissions on LOCAL_ABSPATH. (A TRUE value in *DID_SET
139
does not guarantee that we changed the permissions, simply that more
140
investigation is warrented.)
142
This function looks at the current values of the above properties,
143
including any scheduled-but-not-yet-committed changes.
145
If LOCAL_ABSPATH is a directory, this function is a no-op.
147
Use SCRATCH_POOL for any temporary allocations.
150
svn_wc__sync_flags_with_props(svn_boolean_t *did_set,
152
const char *local_abspath,
153
apr_pool_t *scratch_pool);
155
/* Internal version of svn_wc_translated_stream2(), which see. */
157
svn_wc__internal_translated_stream(svn_stream_t **stream,
159
const char *local_abspath,
160
const char *versioned_abspath,
162
apr_pool_t *result_pool,
163
apr_pool_t *scratch_pool);
165
/* Like svn_wc_translated_file2(), except the working copy database
166
* is used directly and the function assumes abspaths. */
168
svn_wc__internal_translated_file(const char **xlated_abspath,
169
const char *src_abspath,
171
const char *versioned_abspath,
173
svn_cancel_func_t cancel_func,
175
apr_pool_t *result_pool,
176
apr_pool_t *scratch_pool);
117
179
#ifdef __cplusplus