~ubuntu-branches/ubuntu/trusty/subversion/trusty-proposed

« back to all changes in this revision

Viewing changes to subversion/libsvn_wc/translate.h

  • Committer: Package Import Robot
  • Author(s): Andy Whitcroft
  • Date: 2012-06-21 15:36:36 UTC
  • mfrom: (0.4.13 sid)
  • Revision ID: package-import@ubuntu.com-20120621153636-amqqmuidgwgxz1ly
Tags: 1.7.5-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - Create pot file on build.
  - Build a python-subversion-dbg package.
  - Build-depend on python-dbg.
  - Build-depend on default-jre-headless/-jdk.
  - Do not apply java-build patch.
  - debian/rules: Manually create the doxygen output directory, otherwise
    we get weird build failures when running parallel builds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * translate.h :  eol and keyword translation
3
3
 *
4
4
 * ====================================================================
5
 
 * Copyright (c) 2000-2004 CollabNet.  All rights reserved.
6
 
 *
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.
12
 
 *
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
 
12
 *
 
13
 *      http://www.apache.org/licenses/LICENSE-2.0
 
14
 *
 
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
 
20
 *    under the License.
16
21
 * ====================================================================
17
22
 */
18
23
 
31
36
 
32
37
/* Newline and keyword translation properties */
33
38
 
34
 
/* Query the SVN_PROP_EOL_STYLE property on file PATH.  If STYLE is
35
 
   non-null, set *STYLE to PATH's eol style.  Set *EOL to
 
39
/* If EOL is not-NULL query the SVN_PROP_EOL_STYLE property on file
 
40
   LOCAL_ABSPATH in DB.  If STYLE is non-null, set *STYLE to LOCAL_ABSPATH's
 
41
   eol style.  Set *EOL to
36
42
 
37
43
      - NULL for svn_subst_eol_style_none, or
38
44
 
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.
47
53
 
48
 
   ADM_ACCESS is an access baton set that contains PATH.
49
 
 
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).
 
59
 
 
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.
 
63
 
 
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.
 
66
 
 
67
   If PROPS is not NULL, use PROPS instead of the properties on LOCAL_ABSPATH.
 
68
 
 
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.
 
72
 
 
73
   If FOR_NORMALIZATION is TRUE, just return a list of keywords instead of
 
74
   calculating their intended values.
 
75
 
 
76
   Use SCRATCH_POOL for temporary allocation, RESULT_POOL for allocating
 
77
   *STYLE and *EOL.
51
78
*/
52
 
svn_error_t *svn_wc__get_eol_style(svn_subst_eol_style_t *style,
53
 
                                   const char **eol,
54
 
                                   const char *path,
55
 
                                   svn_wc_adm_access_t *adm_access,
56
 
                                   apr_pool_t *pool);
 
79
svn_error_t *
 
80
svn_wc__get_translate_info(svn_subst_eol_style_t *style,
 
81
                           const char **eol,
 
82
                           apr_hash_t **keywords,
 
83
                           svn_boolean_t *special,
 
84
                           svn_wc__db_t *db,
 
85
                           const char *local_abspath,
 
86
                           apr_hash_t *props,
 
87
                           svn_boolean_t for_normalization,
 
88
                           apr_pool_t *result_pool,
 
89
                           apr_pool_t *scratch_pool);
57
90
 
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,
62
95
                                   const char *eol);
63
96
 
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).
69
102
 
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.
73
106
 
74
 
   ADM_ACCESS must be an access baton for PATH.
75
 
 
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.
 
108
 
 
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.
 
112
 
 
113
   If FOR_NORMALIZATION is TRUE, just return a list of keywords instead of
 
114
   calculating their intended values.
 
115
 
 
116
   Use SCRATCH_POOL for any temporary allocations.
79
117
*/
80
 
svn_error_t *svn_wc__get_keywords(apr_hash_t **keywords,
81
 
                                  const char *path,
82
 
                                  svn_wc_adm_access_t *adm_access,
83
 
                                  const char *force_list,
84
 
                                  apr_pool_t *pool);
85
 
 
86
 
 
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
90
 
   POOL. */
91
 
svn_error_t *svn_wc__get_special(svn_boolean_t *special,
92
 
                                 const char *path,
93
 
                                 svn_wc_adm_access_t *adm_access,
94
 
                                 apr_pool_t *pool);
95
 
 
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. */
100
 
svn_error_t *
101
 
svn_wc__maybe_set_executable(svn_boolean_t *did_set,
102
 
                             const char *path,
103
 
                             svn_wc_adm_access_t *adm_access,
104
 
                             apr_pool_t *pool);
105
 
 
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,
112
 
                                          const char *path,
113
 
                                          svn_wc_adm_access_t *adm_access,
114
 
                                          apr_pool_t *pool);
 
118
svn_error_t *
 
119
svn_wc__expand_keywords(apr_hash_t **keywords,
 
120
                        svn_wc__db_t *db,
 
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);
 
127
 
 
128
/* Sync the write and execute bit for LOCAL_ABSPATH with what is currently
 
129
   indicated by the properties in the database:
 
130
 
 
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
 
133
      read-only.
 
134
    * If the SVN_PROP_EXECUTABLE property is present at all, then set
 
135
      LOCAL_ABSPATH executable.
 
136
 
 
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.)
 
141
 
 
142
   This function looks at the current values of the above properties,
 
143
   including any scheduled-but-not-yet-committed changes.
 
144
 
 
145
   If LOCAL_ABSPATH is a directory, this function is a no-op.
 
146
 
 
147
   Use SCRATCH_POOL for any temporary allocations.
 
148
 */
 
149
svn_error_t *
 
150
svn_wc__sync_flags_with_props(svn_boolean_t *did_set,
 
151
                              svn_wc__db_t *db,
 
152
                              const char *local_abspath,
 
153
                              apr_pool_t *scratch_pool);
 
154
 
 
155
/* Internal version of svn_wc_translated_stream2(), which see. */
 
156
svn_error_t *
 
157
svn_wc__internal_translated_stream(svn_stream_t **stream,
 
158
                                   svn_wc__db_t *db,
 
159
                                   const char *local_abspath,
 
160
                                   const char *versioned_abspath,
 
161
                                   apr_uint32_t flags,
 
162
                                   apr_pool_t *result_pool,
 
163
                                   apr_pool_t *scratch_pool);
 
164
 
 
165
/* Like svn_wc_translated_file2(), except the working copy database
 
166
 * is used directly and the function assumes abspaths. */
 
167
svn_error_t *
 
168
svn_wc__internal_translated_file(const char **xlated_abspath,
 
169
                                 const char *src_abspath,
 
170
                                 svn_wc__db_t *db,
 
171
                                 const char *versioned_abspath,
 
172
                                 apr_uint32_t flags,
 
173
                                 svn_cancel_func_t cancel_func,
 
174
                                 void *cancel_baton,
 
175
                                 apr_pool_t *result_pool,
 
176
                                 apr_pool_t *scratch_pool);
115
177
 
116
178
 
117
179
#ifdef __cplusplus