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

« back to all changes in this revision

Viewing changes to subversion/libsvn_fs_fs/id.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:
26
26
#include "id.h"
27
27
#include "../libsvn_fs/fs-loader.h"
28
28
#include "private/svn_temp_serializer.h"
 
29
#include "private/svn_string_private.h"
29
30
 
30
31
 
31
32
typedef struct id_private_t {
88
89
svn_fs_fs__id_unparse(const svn_fs_id_t *id,
89
90
                      apr_pool_t *pool)
90
91
{
91
 
  const char *txn_rev_id;
92
92
  id_private_t *pvt = id->fsap_data;
93
93
 
94
94
  if ((! pvt->txn_id))
95
95
    {
96
 
      txn_rev_id = apr_psprintf(pool, "%ld/%"
97
 
                                APR_OFF_T_FMT, pvt->rev, pvt->offset);
 
96
      char rev_string[SVN_INT64_BUFFER_SIZE];
 
97
      char offset_string[SVN_INT64_BUFFER_SIZE];
 
98
 
 
99
      svn__i64toa(rev_string, pvt->rev);
 
100
      svn__i64toa(offset_string, pvt->offset);
 
101
      return svn_string_createf(pool, "%s.%s.r%s/%s",
 
102
                                pvt->node_id, pvt->copy_id,
 
103
                                rev_string, offset_string);
98
104
    }
99
105
  else
100
106
    {
101
 
      txn_rev_id = pvt->txn_id;
 
107
      return svn_string_createf(pool, "%s.%s.t%s",
 
108
                                pvt->node_id, pvt->copy_id,
 
109
                                pvt->txn_id);
102
110
    }
103
 
  return svn_string_createf(pool, "%s.%s.%c%s",
104
 
                            pvt->node_id, pvt->copy_id,
105
 
                            (pvt->txn_id ? 't' : 'r'),
106
 
                            txn_rev_id);
107
111
}
108
112
 
109
113
 
242
246
{
243
247
  svn_fs_id_t *id;
244
248
  id_private_t *pvt;
245
 
  char *data_copy, *str, *last_str;
 
249
  char *data_copy, *str;
246
250
 
247
251
  /* Dup the ID data into POOL.  Our returned ID will have references
248
252
     into this memory. */
255
259
  id->fsap_data = pvt;
256
260
 
257
261
  /* Now, we basically just need to "split" this data on `.'
258
 
     characters.  We will use apr_strtok, which will put terminators
259
 
     where each of the '.'s used to be.  Then our new id field will
260
 
     reference string locations inside our duplicate string.*/
 
262
     characters.  We will use svn_cstring_tokenize, which will put
 
263
     terminators where each of the '.'s used to be.  Then our new
 
264
     id field will reference string locations inside our duplicate
 
265
     string.*/
261
266
 
262
267
  /* Node Id */
263
 
  str = apr_strtok(data_copy, ".", &last_str);
 
268
  str = svn_cstring_tokenize(".", &data_copy);
264
269
  if (str == NULL)
265
270
    return NULL;
266
271
  pvt->node_id = str;
267
272
 
268
273
  /* Copy Id */
269
 
  str = apr_strtok(NULL, ".", &last_str);
 
274
  str = svn_cstring_tokenize(".", &data_copy);
270
275
  if (str == NULL)
271
276
    return NULL;
272
277
  pvt->copy_id = str;
273
278
 
274
279
  /* Txn/Rev Id */
275
 
  str = apr_strtok(NULL, ".", &last_str);
 
280
  str = svn_cstring_tokenize(".", &data_copy);
276
281
  if (str == NULL)
277
282
    return NULL;
278
283
 
284
289
      /* This is a revision type ID */
285
290
      pvt->txn_id = NULL;
286
291
 
287
 
      str = apr_strtok(str + 1, "/", &last_str);
 
292
      data_copy = str + 1;
 
293
      str = svn_cstring_tokenize("/", &data_copy);
288
294
      if (str == NULL)
289
295
        return NULL;
290
296
      pvt->rev = SVN_STR_TO_REV(str);
291
297
 
292
 
      str = apr_strtok(NULL, "/", &last_str);
 
298
      str = svn_cstring_tokenize("/", &data_copy);
293
299
      if (str == NULL)
294
300
        return NULL;
295
301
      err = svn_cstring_atoi64(&val, str);