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

« back to all changes in this revision

Viewing changes to subversion/svnrdump/util.c

  • 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:
 
1
/*
 
2
 *  util.c: A few utility functions.
 
3
 *
 
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
 
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.
 
21
 * ====================================================================
 
22
 */
 
23
 
 
24
#include "svn_error.h"
 
25
#include "svn_pools.h"
 
26
#include "svn_string.h"
 
27
#include "svn_props.h"
 
28
#include "svn_subst.h"
 
29
 
 
30
#include "svnrdump.h"
 
31
 
 
32
 
 
33
svn_error_t *
 
34
svn_rdump__normalize_props(apr_hash_t **normal_props,
 
35
                           apr_hash_t *props,
 
36
                           apr_pool_t *result_pool)
 
37
{
 
38
  apr_hash_index_t *hi;
 
39
 
 
40
  *normal_props = apr_hash_make(result_pool);
 
41
 
 
42
  for (hi = apr_hash_first(result_pool, props); hi;
 
43
        hi = apr_hash_next(hi))
 
44
    {
 
45
      const char *key = svn__apr_hash_index_key(hi);
 
46
      const svn_string_t *value = svn__apr_hash_index_val(hi);
 
47
 
 
48
      if (svn_prop_needs_translation(key))
 
49
        {
 
50
          const char *cstring;
 
51
 
 
52
          SVN_ERR(svn_subst_translate_cstring2(value->data, &cstring,
 
53
                                               "\n", TRUE,
 
54
                                               NULL, FALSE,
 
55
                                               result_pool));
 
56
          value = svn_string_create(cstring, result_pool);
 
57
        }
 
58
 
 
59
      apr_hash_set(*normal_props, key, APR_HASH_KEY_STRING, value);
 
60
    }
 
61
  return SVN_NO_ERROR;
 
62
}