svn_error_t * svn_fs_base__generate_lock_token(const char **token, svn_fs_t *fs, apr_pool_t *pool) { /* Notice that 'fs' is currently unused. But perhaps someday, we'll want to use the fs UUID + some incremented number? For now, we generate a URI that matches the DAV RFC. We could change this to some other URI scheme someday, if we wish. */ *token = apr_pstrcat(pool, "opaquelocktoken:", svn_uuid_generate(pool), NULL); return SVN_NO_ERROR; }
svn_error_t * svn_fs_set_uuid(svn_fs_t *fs, const char *uuid, apr_pool_t *pool) { if (! uuid) { uuid = svn_uuid_generate(pool); } else { apr_uuid_t parsed_uuid; apr_status_t apr_err = apr_uuid_parse(&parsed_uuid, uuid); if (apr_err) return svn_error_createf(SVN_ERR_BAD_UUID, NULL, _("Malformed UUID '%s'"), uuid); } return svn_error_trace(fs->vtable->set_uuid(fs, uuid, pool)); }
svn_error_t * svn_fs_base__set_uuid(svn_fs_t *fs, const char *uuid, apr_pool_t *pool) { struct set_uuid_args args; SVN_ERR(svn_fs__check_fs(fs, TRUE)); if (! uuid) uuid = svn_uuid_generate(pool); args.idx = 1; args.uuid = uuid; SVN_ERR(svn_fs_base__retry_txn(fs, txn_body_set_uuid, &args, TRUE, pool)); /* Toss our value into the cache. */ if (uuid) fs->uuid = apr_pstrdup(fs->pool, uuid); return SVN_NO_ERROR; }