88
89
svn_fs_fs__id_unparse(const svn_fs_id_t *id,
91
const char *txn_rev_id;
92
92
id_private_t *pvt = id->fsap_data;
94
94
if ((! pvt->txn_id))
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];
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);
101
txn_rev_id = pvt->txn_id;
107
return svn_string_createf(pool, "%s.%s.t%s",
108
pvt->node_id, pvt->copy_id,
103
return svn_string_createf(pool, "%s.%s.%c%s",
104
pvt->node_id, pvt->copy_id,
105
(pvt->txn_id ? 't' : 'r'),
255
259
id->fsap_data = pvt;
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
263
str = apr_strtok(data_copy, ".", &last_str);
268
str = svn_cstring_tokenize(".", &data_copy);
266
271
pvt->node_id = str;
269
str = apr_strtok(NULL, ".", &last_str);
274
str = svn_cstring_tokenize(".", &data_copy);
272
277
pvt->copy_id = str;
275
str = apr_strtok(NULL, ".", &last_str);
280
str = svn_cstring_tokenize(".", &data_copy);
284
289
/* This is a revision type ID */
285
290
pvt->txn_id = NULL;
287
str = apr_strtok(str + 1, "/", &last_str);
293
str = svn_cstring_tokenize("/", &data_copy);
290
296
pvt->rev = SVN_STR_TO_REV(str);
292
str = apr_strtok(NULL, "/", &last_str);
298
str = svn_cstring_tokenize("/", &data_copy);
295
301
err = svn_cstring_atoi64(&val, str);