~ubuntu-branches/debian/sid/subversion/sid

« back to all changes in this revision

Viewing changes to subversion/libsvn_client/resolved.c

  • Committer: Package Import Robot
  • Author(s): James McCoy, Peter Samuelson, James McCoy
  • Date: 2014-01-12 19:48:33 UTC
  • mfrom: (0.2.10)
  • Revision ID: package-import@ubuntu.com-20140112194833-w3axfwksn296jn5x
Tags: 1.8.5-1
[ Peter Samuelson ]
* New upstream release.  (Closes: #725787) Rediff patches:
  - Remove apr-abi1 (applied upstream), rename apr-abi2 to apr-abi
  - Remove loosen-sqlite-version-check (shouldn't be needed)
  - Remove java-osgi-metadata (applied upstream)
  - svnmucc prompts for a changelog if none is provided. (Closes: #507430)
  - Remove fix-bdb-version-detection, upstream uses "apu-config --dbm-libs"
  - Remove ruby-test-wc (applied upstream)
  - Fix “svn diff -r N file” when file has svn:mime-type set.
    (Closes: #734163)
  - Support specifying an encoding for mod_dav_svn's environment in which
    hooks are run.  (Closes: #601544)
  - Fix ordering of “svnadmin dump” paths with certain APR versions.
    (Closes: #687291)
  - Provide a better error message when authentication fails with an
    svn+ssh:// URL.  (Closes: #273874)
  - Updated Polish translations.  (Closes: #690815)

[ James McCoy ]
* Remove all traces of libneon, replaced by libserf.
* patches/sqlite_3.8.x_workaround: Upstream fix for wc-queries-test test
  failurse.
* Run configure with --with-apache-libexecdir, which allows removing part of
  patches/rpath.
* Re-enable auth-test as upstream has fixed the problem of picking up
  libraries from the environment rather than the build tree.
  (Closes: #654172)
* Point LD_LIBRARY_PATH at the built auth libraries when running the svn
  command during the build.  (Closes: #678224)
* Add a NEWS entry describing how to configure mod_dav_svn to understand
  UTF-8.  (Closes: #566148)
* Remove ancient transitional package, libsvn-ruby.
* Enable compatibility with Sqlite3 versions back to Wheezy.
* Enable hardening flags.  (Closes: #734918)
* patches/build-fixes: Enable verbose build logs.
* Build against the default ruby version.  (Closes: #722393)

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
/*** Includes. ***/
29
29
 
 
30
#include <stdlib.h>
 
31
 
30
32
#include "svn_types.h"
31
33
#include "svn_wc.h"
32
34
#include "svn_client.h"
33
35
#include "svn_error.h"
34
36
#include "svn_dirent_uri.h"
35
37
#include "svn_path.h"
 
38
#include "svn_pools.h"
 
39
#include "svn_hash.h"
 
40
#include "svn_sorts.h"
36
41
#include "client.h"
37
42
#include "private/svn_wc_private.h"
38
43
 
41
46
/*** Code. ***/
42
47
 
43
48
svn_error_t *
 
49
svn_client__resolve_conflicts(svn_boolean_t *conflicts_remain,
 
50
                              apr_hash_t *conflicted_paths,
 
51
                              svn_client_ctx_t *ctx,
 
52
                              apr_pool_t *scratch_pool)
 
53
{
 
54
  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
 
55
  apr_array_header_t *array;
 
56
  int i;
 
57
 
 
58
  if (conflicts_remain)
 
59
    *conflicts_remain = FALSE;
 
60
 
 
61
  SVN_ERR(svn_hash_keys(&array, conflicted_paths, scratch_pool));
 
62
  qsort(array->elts, array->nelts, array->elt_size,
 
63
        svn_sort_compare_paths);
 
64
 
 
65
  for (i = 0; i < array->nelts; i++)
 
66
    {
 
67
      const char *local_abspath = APR_ARRAY_IDX(array, i, const char *);
 
68
 
 
69
      svn_pool_clear(iterpool);
 
70
      SVN_ERR(svn_wc__resolve_conflicts(ctx->wc_ctx, local_abspath,
 
71
                                        svn_depth_empty,
 
72
                                        TRUE /* resolve_text */,
 
73
                                        "" /* resolve_prop (ALL props) */,
 
74
                                        TRUE /* resolve_tree */,
 
75
                                        svn_wc_conflict_choose_unspecified,
 
76
                                        ctx->conflict_func2,
 
77
                                        ctx->conflict_baton2,
 
78
                                        ctx->cancel_func, ctx->cancel_baton,
 
79
                                        ctx->notify_func2, ctx->notify_baton2,
 
80
                                        iterpool));
 
81
 
 
82
      if (conflicts_remain)
 
83
        {
 
84
          svn_error_t *err;
 
85
          svn_boolean_t text_c, prop_c, tree_c;
 
86
 
 
87
          err = svn_wc_conflicted_p3(&text_c, &prop_c, &tree_c,
 
88
                                     ctx->wc_ctx, local_abspath,
 
89
                                     iterpool);
 
90
          if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
 
91
            {
 
92
              svn_error_clear(err);
 
93
              text_c = prop_c = tree_c = FALSE;
 
94
            }
 
95
          else
 
96
            {
 
97
              SVN_ERR(err);
 
98
            }
 
99
          if (text_c || prop_c || tree_c)
 
100
            *conflicts_remain = TRUE;
 
101
        }
 
102
    }
 
103
  svn_pool_destroy(iterpool);
 
104
 
 
105
  return SVN_NO_ERROR;
 
106
}
 
107
 
 
108
svn_error_t *
44
109
svn_client_resolve(const char *path,
45
110
                   svn_depth_t depth,
46
111
                   svn_wc_conflict_choice_t conflict_choice,
48
113
                   apr_pool_t *pool)
49
114
{
50
115
  const char *local_abspath;
 
116
  svn_error_t *err;
 
117
  const char *lock_abspath;
51
118
 
52
119
  if (svn_path_is_url(path))
53
120
    return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
55
122
 
56
123
  SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
57
124
 
58
 
  SVN_ERR(svn_wc_resolved_conflict5(ctx->wc_ctx, local_abspath,
59
 
                                    depth,
60
 
                                    TRUE /* resolve_text */,
61
 
                                    "" /* resolve_prop (ALL props) */,
62
 
                                    TRUE /* resolve_tree */,
63
 
                                    conflict_choice,
64
 
                                    ctx->cancel_func, ctx->cancel_baton,
65
 
                                    ctx->notify_func2, ctx->notify_baton2,
66
 
                                    pool));
67
 
 
68
 
  return SVN_NO_ERROR;
 
125
  /* Similar to SVN_WC__CALL_WITH_WRITE_LOCK but using a custom
 
126
     locking function. */
 
127
 
 
128
  SVN_ERR(svn_wc__acquire_write_lock_for_resolve(&lock_abspath, ctx->wc_ctx,
 
129
                                                 local_abspath, pool, pool));
 
130
  err = svn_wc__resolve_conflicts(ctx->wc_ctx, local_abspath,
 
131
                                  depth,
 
132
                                  TRUE /* resolve_text */,
 
133
                                  "" /* resolve_prop (ALL props) */,
 
134
                                  TRUE /* resolve_tree */,
 
135
                                  conflict_choice,
 
136
                                  ctx->conflict_func2,
 
137
                                  ctx->conflict_baton2,
 
138
                                  ctx->cancel_func, ctx->cancel_baton,
 
139
                                  ctx->notify_func2, ctx->notify_baton2,
 
140
                                  pool);
 
141
 
 
142
  err = svn_error_compose_create(err, svn_wc__release_write_lock(ctx->wc_ctx,
 
143
                                                                 lock_abspath,
 
144
                                                                 pool));
 
145
  svn_io_sleep_for_timestamps(path, pool);
 
146
 
 
147
  return svn_error_trace(err);
69
148
}