Lines Matching refs:pool
68 apr_pool_t *pool;
95 apr_pool_t *pool; /* Pool provided in the handler call. */
132 svn_ra_svn_conn_t *conn, apr_pool_t *pool)
137 io_err = svn_ra_svn__write_cmd_failure(conn, pool, err);
140 return svn_ra_svn__flush(conn, pool);
146 apr_pool_t *pool,
157 timestr = svn_time_to_cstring(apr_time_now(), pool);
160 log = apr_pvsprintf(pool, fmt, ap);
163 line = apr_psprintf(pool, "%" APR_PID_T_FMT
179 apr_pool_t *pool)
189 timestr = svn_time_to_cstring(apr_time_now(), pool);
192 line = apr_psprintf(pool, "%" APR_PID_T_FMT
212 apr_pool_t *pool)
224 pwdb_path = svn_dirent_internal_style(pwdb_path, pool);
225 pwdb_path = svn_dirent_join(repository->base, pwdb_path, pool);
229 repository->repos, pool);
261 const char *repos_root, apr_pool_t *pool)
265 *access_file = svn_uri_canonicalize(*access_file, pool);
272 pool));
274 repos_root_url, pool));
275 *access_file = svn_uri_canonicalize(*access_file, pool);
279 *access_file = svn_dirent_internal_style(*access_file, pool);
280 *access_file = svn_dirent_join(repository->base, *access_file, pool);
296 apr_pool_t *pool)
315 repos_root, pool);
320 repos_root, pool);
325 repository->repos, pool);
426 apr_pool_t *pool)
448 path = svn_fspath__canonicalize(path, pool);
455 char *authz_user = apr_pstrdup(b->pool, client_info->user);
467 required, allowed, pool));
469 SVN_ERR(log_authz_denied(path, required, b, pool));
482 apr_pool_t *pool)
487 sb->server, pool);
509 apr_pool_t *pool)
513 return authz_check_access(allowed, path, required, sb->server, pool);
562 static svn_error_t *send_mechs(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
567 SVN_ERR(svn_ra_svn__write_word(conn, pool, "ANONYMOUS"));
569 SVN_ERR(svn_ra_svn__write_word(conn, pool, "EXTERNAL"));
571 SVN_ERR(svn_ra_svn__write_word(conn, pool, "CRAM-MD5"));
579 apr_pool_t *pool;
583 the command pool is destroyed. */
605 create_fs_access(server_baton_t *b, apr_pool_t *pool)
613 SVN_ERR(svn_fs_create_access(&fs_access, b->client_info->user, pool));
616 cleanup_baton = apr_pcalloc(pool, sizeof(*cleanup_baton));
617 cleanup_baton->pool = pool;
619 apr_pool_cleanup_register(pool, cleanup_baton, cleanup_fs_access,
631 static svn_error_t *auth(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
644 return svn_ra_svn__write_tuple(conn, pool, "w(c)", "failure",
647 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "w()", "success"));
655 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "w()", "success"));
663 SVN_ERR(svn_ra_svn_cram_server(conn, pool, b->repository->pwdb,
665 b->client_info->user = apr_pstrdup(b->pool, user);
669 return svn_ra_svn__write_tuple(conn, pool, "w(c)", "failure",
675 internal_auth_request(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
682 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "w((!", "success"));
683 SVN_ERR(send_mechs(conn, pool, b, required, needs_username));
684 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "!)c)", b->repository->realm));
687 SVN_ERR(svn_ra_svn__read_tuple(conn, pool, "w(?c)", &mech, &mecharg));
690 SVN_ERR(auth(conn, pool, mech, mecharg, b, required, needs_username,
701 static svn_error_t *auth_request(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
707 return cyrus_auth_request(conn, pool, b, required, needs_username);
710 return internal_auth_request(conn, pool, b, required, needs_username);
718 apr_pool_t *pool, server_baton_t *b)
720 return svn_ra_svn__write_cmd_response(conn, pool, "()c", "");
734 static svn_boolean_t lookup_access(apr_pool_t *pool,
746 err = authz_check_access(&authorized, path, required, baton, pool);
782 apr_pool_t *pool,
794 if (lookup_access(pool, b, required, path, needs_username))
796 SVN_ERR(create_fs_access(b, pool));
797 return trivial_auth_request(conn, pool, b);
810 SVN_ERR(auth_request(conn, pool, b, req, TRUE));
814 if (! lookup_access(pool, b, required, path, needs_username))
821 SVN_ERR(create_fs_access(b, pool));
833 static svn_error_t *set_path(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
843 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "crb?(?c)?w",
848 path = svn_relpath_canonicalize(path, pool);
853 start_empty, lock_token, pool);
860 static svn_error_t *delete_path(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
866 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "c", &path));
867 path = svn_relpath_canonicalize(path, pool);
869 b->err = svn_repos_delete_path(b->report_baton, path, pool);
873 static svn_error_t *link_path(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
883 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "ccrb?(?c)?w",
889 path = svn_relpath_canonicalize(path, pool);
890 url = svn_uri_canonicalize(url, pool);
894 b->err = get_fs_path(svn_path_uri_decode(b->repos_url, pool),
895 svn_path_uri_decode(url, pool),
899 depth, start_empty, lock_token, pool);
904 static svn_error_t *finish_report(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
910 SVN_ERR(trivial_auth_request(conn, pool, b->sb));
912 b->err = svn_repos_finish_report(b->report_baton, pool);
916 static svn_error_t *abort_report(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
922 svn_error_clear(svn_repos_abort_report(b->report_baton, pool));
950 svn_ra_svn_conn_t *conn, apr_pool_t *pool,
969 svn_ra_svn_get_editor(&editor, &edit_baton, conn, pool, NULL, NULL);
978 pool));
981 rb.repos_url = svn_path_uri_decode(b->repository->repos_url, pool);
989 err = svn_ra_svn__handle_commands2(conn, pool, report_commands, &rb, TRUE);
1001 SVN_ERR(svn_ra_svn__write_cmd_response(conn, pool, ""));
1014 apr_pool_t *pool,
1023 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "c(?s)",
1032 apr_pool_t *pool,
1037 cdate = svn_time_to_cstring(lock->creation_date, pool);
1039 ? svn_time_to_cstring(lock->expiration_date, pool) : NULL;
1040 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "ccc(?c)c(?c)", lock->path,
1056 apr_pool_t *pool)
1065 SVN_ERR(svn_fs_node_proplist(props, root, path, pool));
1069 path, pool));
1070 str = svn_string_createf(pool, "%ld", crev);
1072 str = (cdate) ? svn_string_create(cdate, pool) : NULL;
1074 str = (cauthor) ? svn_string_create(cauthor, pool) : NULL;
1078 SVN_ERR(svn_fs_get_uuid(svn_fs_root_fs(root), &uuid, pool));
1079 str = (uuid) ? svn_string_create(uuid, pool) : NULL;
1089 b, pool, pool));
1096 static svn_error_t *reparent(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
1103 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "c", &url));
1104 url = svn_uri_canonicalize(url, pool);
1105 SVN_ERR(trivial_auth_request(conn, pool, b));
1106 SVN_CMD_ERR(get_fs_path(svn_path_uri_decode(b->repository->repos_url, pool),
1107 svn_path_uri_decode(url, pool),
1109 SVN_ERR(log_command(b, conn, pool, "%s", svn_log__reparent(fs_path, pool)));
1111 SVN_ERR(svn_ra_svn__write_cmd_response(conn, pool, ""));
1115 static svn_error_t *get_latest_rev(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
1121 SVN_ERR(log_command(b, conn, pool, "get-latest-rev"));
1123 SVN_ERR(trivial_auth_request(conn, pool, b));
1124 SVN_CMD_ERR(svn_fs_youngest_rev(&rev, b->repository->fs, pool));
1125 SVN_ERR(svn_ra_svn__write_cmd_response(conn, pool, "r", rev));
1129 static svn_error_t *get_dated_rev(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
1137 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "c", ×tr));
1138 SVN_ERR(log_command(b, conn, pool, "get-dated-rev %s", timestr));
1140 SVN_ERR(trivial_auth_request(conn, pool, b));
1141 SVN_CMD_ERR(svn_time_from_cstring(&tm, timestr, pool));
1142 SVN_CMD_ERR(svn_repos_dated_revision(&rev, b->repository->repos, tm, pool));
1143 SVN_ERR(svn_ra_svn__write_cmd_response(conn, pool, "r", rev));
1154 apr_pool_t *pool)
1161 SVN_ERR(must_have_access(conn, pool, b, svn_authz_write, NULL, FALSE));
1162 SVN_ERR(log_command(b, conn, pool, "%s",
1163 svn_log__change_rev_prop(rev, name, pool)));
1169 pool));
1170 SVN_ERR(svn_ra_svn__write_cmd_response(conn, pool, ""));
1175 static svn_error_t *change_rev_prop2(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
1186 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "rc(?s)(b?s)",
1203 return log_fail_and_flush(err, b, conn, pool);
1207 SVN_ERR(do_change_rev_prop(conn, b, rev, name, old_value_p, value, pool));
1212 static svn_error_t *change_rev_prop(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
1222 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "rc?s", &rev, &name, &value));
1224 SVN_ERR(do_change_rev_prop(conn, b, rev, name, NULL, value, pool));
1229 static svn_error_t *rev_proplist(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
1240 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "r", &rev));
1241 SVN_ERR(log_command(b, conn, pool, "%s", svn_log__rev_proplist(rev, pool)));
1243 SVN_ERR(trivial_auth_request(conn, pool, b));
1247 &ab, pool));
1248 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "w((!", "success"));
1249 SVN_ERR(svn_ra_svn__write_proplist(conn, pool, props));
1250 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "!))"));
1254 static svn_error_t *rev_prop(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
1266 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "rc", &rev, &name));
1267 SVN_ERR(log_command(b, conn, pool, "%s",
1268 svn_log__rev_prop(rev, name, pool)));
1270 SVN_ERR(trivial_auth_request(conn, pool, b));
1273 &ab, pool));
1274 SVN_ERR(svn_ra_svn__write_cmd_response(conn, pool, "(?s)", value));
1279 void *baton, apr_pool_t *pool)
1285 ? apr_pstrdup(ccb->pool, commit_info->date): NULL;
1287 ? apr_pstrdup(ccb->pool, commit_info->author) : NULL;
1289 ? apr_pstrdup(ccb->pool, commit_info->post_commit_err) : NULL;
1302 apr_pool_t *pool)
1335 svn_relpath_canonicalize(path, pool),
1336 pool);
1338 if (! lookup_access(pool, sb, svn_authz_write, full_path, TRUE))
1355 apr_pool_t *pool)
1368 apr_pool_t *pool)
1371 apr_pool_t *subpool = svn_pool_create(pool);
1405 static svn_error_t *commit(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
1431 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "c", &log_msg));
1439 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "clb?l", &log_msg,
1449 SVN_ERR(must_have_access(conn, pool, b, svn_authz_write,
1456 SVN_CMD_ERR(add_lock_tokens(lock_tokens, b, pool));
1460 SVN_ERR(svn_ra_svn__parse_proplist(revprop_list, pool, &revprop_table));
1463 revprop_table = apr_hash_make(pool);
1465 svn_string_create(log_msg, pool));
1472 ? svn_string_create(b->client_info->user, pool)
1475 ccb.pool = pool;
1483 svn_path_uri_decode(b->repository->repos_url, pool),
1486 authz_commit_cb, &ab, pool));
1487 SVN_ERR(svn_ra_svn__write_cmd_response(conn, pool, ""));
1488 SVN_ERR(svn_ra_svn_drive_editor2(conn, pool, editor, edit_baton,
1492 SVN_ERR(log_command(b, conn, pool, "%s",
1493 svn_log__commit(new_rev, pool)));
1494 SVN_ERR(trivial_auth_request(conn, pool, b));
1502 SVN_ERR(svn_fs_deltify_revision(b->repository->fs, new_rev, pool));
1506 SVN_ERR(unlock_paths(lock_tokens, b, pool));
1508 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "r(?c)(?c)(?c)",
1512 SVN_ERR(svn_fs_deltify_revision(b->repository->fs, new_rev, pool));
1517 static svn_error_t *get_file(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
1541 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "c(?r)bb?B", &path, &rev,
1549 svn_relpath_canonicalize(path, pool), pool);
1552 SVN_ERR(must_have_access(conn, pool, b, svn_authz_read,
1556 SVN_CMD_ERR(svn_fs_youngest_rev(&rev, b->repository->fs, pool));
1558 SVN_ERR(log_command(b, conn, pool, "%s",
1560 want_contents, want_props, pool)));
1563 SVN_CMD_ERR(svn_fs_revision_root(&root, b->repository->fs, rev, pool));
1565 full_path, TRUE, pool));
1566 hex_digest = svn_checksum_to_cstring_display(checksum, pool);
1575 pool));
1577 SVN_CMD_ERR(svn_fs_file_contents(&contents, root, full_path, pool));
1580 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "w((?c)r(!", "success",
1582 SVN_ERR(svn_ra_svn__write_proplist(conn, pool, props));
1586 apr_pool_t *iterpool = svn_pool_create(pool);
1588 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "!)(?!"));
1604 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "!))"));
1620 SVN_ERR(svn_ra_svn__write_string(conn, pool, &write_str));
1628 write_err = svn_ra_svn__write_cstring(conn, pool, "");
1635 SVN_ERR(svn_ra_svn__write_cmd_response(conn, pool, ""));
1641 static svn_error_t *get_dir(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
1663 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "c(?r)bb?l?B", &path, &rev,
1703 svn_relpath_canonicalize(path, pool), pool);
1706 SVN_ERR(must_have_access(conn, pool, b, svn_authz_read,
1710 SVN_CMD_ERR(svn_fs_youngest_rev(&rev, b->repository->fs, pool));
1712 SVN_ERR(log_command(b, conn, pool, "%s",
1715 dirent_fields, pool)));
1718 SVN_CMD_ERR(svn_fs_revision_root(&root, b->repository->fs, rev, pool));
1727 pool));
1732 SVN_CMD_ERR(svn_fs_dir_entries(&entries, root, full_path, pool));
1735 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "w(r(!", "success", rev));
1736 SVN_ERR(svn_ra_svn__write_proplist(conn, pool, props));
1737 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "!)(!"));
1743 const char *missing_date = svn_time_to_cstring(0, pool);
1747 subpool = svn_pool_create(pool);
1748 for (hi = apr_hash_first(pool, entries); hi; hi = apr_hash_next(hi))
1809 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "cwnbr(?c)(?c)", name,
1820 apr_pool_t *iterpool = svn_pool_create(pool);
1822 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "!)(?!"));
1839 return svn_ra_svn__write_tuple(conn, pool, "!))");
1842 static svn_error_t *update(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
1857 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "(?r)cb?w3?3", &rev, &target,
1860 target = svn_relpath_canonicalize(target, pool);
1867 full_path = svn_fspath__join(b->repository->fs_path->data, target, pool);
1869 SVN_ERR(must_have_access(conn, pool, b, svn_authz_read, full_path, FALSE));
1872 SVN_CMD_ERR(svn_fs_youngest_rev(&rev, b->repository->fs, pool));
1875 conn, pool, b, rev, target, NULL, TRUE,
1881 SVN_ERR(log_command(b, conn, pool, "%s",
1883 depth, pool)));
1887 SVN_ERR(log_command(b, conn, pool, "%s",
1891 pool)));
1897 static svn_error_t *switch_cmd(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
1912 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "(?r)cbc?w?33", &rev, &target,
1915 target = svn_relpath_canonicalize(target, pool);
1916 switch_url = svn_uri_canonicalize(switch_url, pool);
1923 SVN_ERR(trivial_auth_request(conn, pool, b));
1925 SVN_CMD_ERR(svn_fs_youngest_rev(&rev, b->repository->fs, pool));
1928 pool),
1929 svn_path_uri_decode(switch_url, pool),
1934 target, pool);
1935 SVN_ERR(log_command(b, conn, pool, "%s",
1937 depth, pool)));
1941 conn, pool, b, rev, target, switch_path, TRUE,
1947 static svn_error_t *status(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
1959 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "cb?(?r)?w",
1961 target = svn_relpath_canonicalize(target, pool);
1968 SVN_ERR(trivial_auth_request(conn, pool, b));
1970 SVN_CMD_ERR(svn_fs_youngest_rev(&rev, b->repository->fs, pool));
1974 target, pool);
1975 SVN_ERR(log_command(b, conn, pool, "%s",
1976 svn_log__status(full_path, rev, depth, pool)));
1979 return accept_report(NULL, NULL, conn, pool, b, rev, target, NULL, FALSE,
1983 static svn_error_t *diff(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
1999 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "(?r)cbbc", &rev, &target,
2006 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "(?r)cbbcb?w",
2011 target = svn_relpath_canonicalize(target, pool);
2012 versus_url = svn_uri_canonicalize(versus_url, pool);
2019 SVN_ERR(trivial_auth_request(conn, pool, b));
2022 SVN_CMD_ERR(svn_fs_youngest_rev(&rev, b->repository->fs, pool));
2024 pool),
2025 svn_path_uri_decode(versus_url, pool),
2030 target, pool);
2033 conn, pool, b, rev, target, versus_path,
2035 SVN_ERR(log_command(b, conn, pool, "%s",
2038 pool)));
2049 static svn_error_t *get_mergeinfo(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
2067 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "l(?r)wb", &paths, &rev,
2072 canonical_paths = apr_array_make(pool, paths->nelts, sizeof(const char *));
2081 full_path = svn_relpath_canonicalize(item->u.string->data, pool);
2082 full_path = svn_fspath__join(b->repository->fs_path->data, full_path, pool);
2086 SVN_ERR(log_command(b, conn, pool, "%s",
2089 pool)));
2091 SVN_ERR(trivial_auth_request(conn, pool, b));
2097 pool));
2099 b->repository->fs_path->data, pool));
2100 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "w((!", "success"));
2101 iterpool = svn_pool_create(pool);
2102 for (hi = apr_hash_first(pool, mergeinfo); hi; hi = apr_hash_next(hi))
2115 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "!))"));
2123 apr_pool_t *pool)
2155 SVN_ERR(svn_ra_svn__start_list(conn, pool));
2158 SVN_ERR(svn_ra_svn__start_list(conn, pool));
2161 for (h = apr_hash_first(pool, log_entry->changed_paths2); h;
2168 conn, pool,
2179 SVN_ERR(svn_ra_svn__end_list(conn, pool));
2182 SVN_ERR(svn_ra_svn__write_data_log_entry(conn, pool,
2189 SVN_ERR(svn_ra_svn__start_list(conn, pool));
2191 SVN_ERR(svn_ra_svn__write_proplist(conn, pool, log_entry->revprops));
2192 SVN_ERR(svn_ra_svn__end_list(conn, pool));
2195 SVN_ERR(svn_ra_svn__write_boolean(conn, pool, log_entry->subtractive_merge));
2196 SVN_ERR(svn_ra_svn__end_list(conn, pool));
2204 static svn_error_t *log_cmd(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
2223 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "l(?r)(?r)bb?n?Bwl", &paths,
2236 revprops = svn_compat_log_revprops_in(pool);
2243 revprops = apr_array_make(pool, revprop_items->nelts,
2266 full_paths = apr_array_make(pool, paths->nelts, sizeof(const char *));
2273 full_path = svn_relpath_canonicalize(elt->u.string->data, pool),
2275 pool);
2278 SVN_ERR(trivial_auth_request(conn, pool, b));
2280 SVN_ERR(log_command(b, conn, pool, "%s",
2284 revprops, pool)));
2294 log_receiver, &lb, pool);
2296 write_err = svn_ra_svn__write_word(conn, pool, "done");
2303 SVN_ERR(svn_ra_svn__write_cmd_response(conn, pool, ""));
2307 static svn_error_t *check_path(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
2316 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "c(?r)", &path, &rev));
2318 svn_relpath_canonicalize(path, pool), pool);
2321 SVN_ERR(must_have_access(conn, pool, b, svn_authz_read,
2325 SVN_CMD_ERR(svn_fs_youngest_rev(&rev, b->repository->fs, pool));
2327 SVN_ERR(log_command(b, conn, pool, "check-path %s@%d",
2328 svn_path_uri_encode(full_path, pool), rev));
2330 SVN_CMD_ERR(svn_fs_revision_root(&root, b->repository->fs, rev, pool));
2331 SVN_CMD_ERR(svn_fs_check_path(&kind, root, full_path, pool));
2332 SVN_ERR(svn_ra_svn__write_cmd_response(conn, pool, "w",
2337 static svn_error_t *stat_cmd(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
2346 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "c(?r)", &path, &rev));
2348 svn_relpath_canonicalize(path, pool), pool);
2351 SVN_ERR(must_have_access(conn, pool, b, svn_authz_read,
2355 SVN_CMD_ERR(svn_fs_youngest_rev(&rev, b->repository->fs, pool));
2357 SVN_ERR(log_command(b, conn, pool, "stat %s@%d",
2358 svn_path_uri_encode(full_path, pool), rev));
2360 SVN_CMD_ERR(svn_fs_revision_root(&root, b->repository->fs, rev, pool));
2361 SVN_CMD_ERR(svn_repos_stat(&dirent, root, full_path, pool));
2368 SVN_ERR(svn_ra_svn__write_cmd_response(conn, pool, "()"));
2373 : svn_time_to_cstring(dirent->time, pool);
2375 SVN_ERR(svn_ra_svn__write_cmd_response(conn, pool, "((wnbr(?c)(?c)))",
2384 static svn_error_t *get_locations(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
2403 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "crl", &relative_path,
2406 relative_path = svn_relpath_canonicalize(relative_path, pool);
2409 pool);
2411 location_revisions = apr_array_make(pool, loc_revs_proto->nelts,
2423 SVN_ERR(trivial_auth_request(conn, pool, b));
2424 SVN_ERR(log_command(b, conn, pool, "%s",
2426 location_revisions, pool)));
2438 pool);
2447 for (iter = apr_hash_first(pool, fs_locations); iter;
2453 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "rc",
2459 write_err = svn_ra_svn__write_word(conn, pool, "done");
2467 SVN_ERR(svn_ra_svn__write_cmd_response(conn, pool, ""));
2474 apr_pool_t *pool)
2477 return svn_ra_svn__write_tuple(conn, pool, "rr(?c)",
2484 apr_pool_t *pool,
2499 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "c(?r)(?r)(?r)",
2502 relative_path = svn_relpath_canonicalize(relative_path, pool);
2505 pool);
2507 SVN_ERR(trivial_auth_request(conn, pool, b));
2508 SVN_ERR(log_command(baton, conn, pool, "%s",
2511 pool)));
2518 err = svn_fs_youngest_rev(&youngest, b->repository->fs, pool);
2523 svn_ra_svn__write_word(conn, pool, "done"),
2526 return log_fail_and_flush(err, b, conn, pool);
2541 err = svn_ra_svn__write_word(conn, pool, "done");
2545 return log_fail_and_flush(err, b, conn, pool);
2550 err = svn_ra_svn__write_word(conn, pool, "done");
2554 return log_fail_and_flush(err, b, conn, pool);
2567 pool);
2568 write_err = svn_ra_svn__write_word(conn, pool, "done");
2575 SVN_ERR(svn_ra_svn__write_cmd_response(conn, pool, ""));
2590 return svn_ra_svn__write_string(b->conn, b->pool, &str);
2599 SVN_ERR(svn_ra_svn__write_cstring(b->conn, b->pool, ""));
2610 apr_pool_t *pool)
2615 SVN_ERR(svn_ra_svn__write_tuple(frb->conn, pool, "cr(!",
2617 SVN_ERR(svn_ra_svn__write_proplist(frb->conn, pool, rev_props));
2618 SVN_ERR(svn_ra_svn__write_tuple(frb->conn, pool, "!)(!"));
2619 SVN_ERR(write_prop_diffs(frb->conn, pool, prop_diffs));
2620 SVN_ERR(svn_ra_svn__write_tuple(frb->conn, pool, "!)b", merged_revision));
2622 /* Store the pool for the delta stream. */
2623 frb->pool = pool;
2628 stream = svn_stream_create(baton, pool);
2637 svn_ra_svn_compression_level(frb->conn), pool);
2640 svn_ra_svn_compression_level(frb->conn), pool);
2643 SVN_ERR(svn_ra_svn__write_cstring(frb->conn, pool, ""));
2648 static svn_error_t *get_file_revs(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
2665 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "c(?r)(?r)?B",
2668 path = svn_relpath_canonicalize(path, pool);
2669 SVN_ERR(trivial_auth_request(conn, pool, b));
2670 full_path = svn_fspath__join(b->repository->fs_path->data, path, pool);
2677 SVN_ERR(log_command(b, conn, pool, "%s",
2680 pool)));
2683 frb.pool = NULL;
2688 file_rev_handler, &frb, pool);
2689 write_err = svn_ra_svn__write_word(conn, pool, "done");
2696 SVN_ERR(svn_ra_svn__write_cmd_response(conn, pool, ""));
2701 static svn_error_t *lock(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
2712 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "c(?c)b(?r)", &path, &comment,
2715 svn_relpath_canonicalize(path, pool), pool);
2717 SVN_ERR(must_have_access(conn, pool, b, svn_authz_write,
2719 SVN_ERR(log_command(b, conn, pool, "%s",
2720 svn_log__lock_one_path(full_path, steal_lock, pool)));
2724 current_rev, steal_lock, pool));
2726 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "w(!", "success"));
2727 SVN_ERR(write_lock(conn, pool, l));
2728 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "!)"));
2740 apr_pool_t *pool;
2749 apr_pool_t *pool)
2752 struct lock_result_t *result = apr_palloc(b->pool,
2757 svn_hash_sets(b->results, apr_pstrdup(b->pool, path), result);
2775 static svn_error_t *lock_many(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
2785 apr_hash_t *targets = apr_hash_make(pool);
2786 apr_hash_t *authz_results = apr_hash_make(pool);
2790 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "(?c)bl", &comment, &steal_lock,
2793 subpool = svn_pool_create(pool);
2799 SVN_ERR(must_have_access(conn, pool, b, svn_authz_write, NULL, TRUE));
2821 pool);
2822 target = svn_fs_lock_target_create(NULL, current_rev, pool);
2837 for (hi = apr_hash_first(pool, targets); hi; hi = apr_hash_next(hi))
2846 = apr_palloc(pool, sizeof(struct lock_result_t));
2856 lmb.results = apr_hash_make(pool);
2857 lmb.pool = pool;
2863 pool, subpool);
2893 result = apr_palloc(pool, sizeof(struct lock_result_t));
2921 write_err = svn_ra_svn__write_word(conn, pool, "done");
2926 SVN_ERR(svn_ra_svn__write_cmd_response(conn, pool, ""));
2931 static svn_error_t *unlock(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
2938 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "c(?c)b", &path, &token,
2942 svn_relpath_canonicalize(path, pool), pool);
2945 SVN_ERR(must_have_access(conn, pool, b, svn_authz_write,
2947 SVN_ERR(log_command(b, conn, pool, "%s",
2948 svn_log__unlock_one_path(full_path, break_lock, pool)));
2951 break_lock, pool));
2953 SVN_ERR(svn_ra_svn__write_cmd_response(conn, pool, ""));
2958 static svn_error_t *unlock_many(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
2967 apr_hash_t *targets = apr_hash_make(pool);
2968 apr_hash_t *authz_results = apr_hash_make(pool);
2972 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "bl", &break_lock,
2976 SVN_ERR(must_have_access(conn, pool, b, svn_authz_write, NULL, ! break_lock));
2978 subpool = svn_pool_create(pool);
3000 pool);
3015 for (hi = apr_hash_first(pool, targets); hi; hi = apr_hash_next(hi))
3025 = apr_palloc(pool, sizeof(struct lock_result_t));
3035 lmb.results = apr_hash_make(pool);
3036 lmb.pool = pool;
3040 pool, subpool);
3059 pool);
3069 result = apr_palloc(pool, sizeof(struct lock_result_t));
3076 write_err = svn_ra_svn__write_cmd_failure(conn, pool, result->err);
3090 write_err = svn_ra_svn__write_word(conn, pool, "done");
3095 SVN_ERR(svn_ra_svn__write_cmd_response(conn, pool, ""));
3100 static svn_error_t *get_lock(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
3108 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "c", &path));
3111 svn_relpath_canonicalize(path, pool), pool);
3113 SVN_ERR(must_have_access(conn, pool, b, svn_authz_read,
3115 SVN_ERR(log_command(b, conn, pool, "get-lock %s",
3116 svn_path_uri_encode(full_path, pool)));
3118 SVN_CMD_ERR(svn_fs_get_lock(&l, b->repository->fs, full_path, pool));
3120 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "w((!", "success"));
3122 SVN_ERR(write_lock(conn, pool, l));
3123 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "!))"));
3128 static svn_error_t *get_locks(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
3144 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "c?(?w)", &path, &depth_word));
3154 return log_fail_and_flush(err, b, conn, pool);
3158 svn_relpath_canonicalize(path, pool), pool);
3160 SVN_ERR(trivial_auth_request(conn, pool, b));
3162 SVN_ERR(log_command(b, conn, pool, "get-locks %s",
3163 svn_path_uri_encode(full_path, pool)));
3167 pool));
3169 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "w((!", "success"));
3170 for (hi = apr_hash_first(pool, locks); hi; hi = apr_hash_next(hi))
3174 SVN_ERR(write_lock(conn, pool, l));
3176 SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "!))"));
3186 apr_pool_t *pool)
3197 SVN_ERR(log_command(b, conn, pool,
3199 pool)));
3201 svn_ra_svn_get_editor(&editor, &edit_baton, conn, pool, NULL, NULL);
3203 err = svn_fs_revision_root(&root, b->repository->fs, rev, pool);
3208 authz_check_access_cb_func(b), &ab, pool);
3211 svn_error_clear(editor->abort_edit(edit_baton, pool));
3214 return svn_ra_svn__write_cmd_finish_replay(conn, pool);
3217 static svn_error_t *replay(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
3224 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "rrb", &rev, &low_water_mark,
3227 SVN_ERR(trivial_auth_request(conn, pool, b));
3230 send_deltas, pool));
3232 SVN_ERR(svn_ra_svn__write_cmd_response(conn, pool, ""));
3237 static svn_error_t *replay_range(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
3249 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "rrrb", &start_rev,
3253 SVN_ERR(trivial_auth_request(conn, pool, b));
3255 iterpool = svn_pool_create(pool);
3277 SVN_ERR(svn_ra_svn__write_cmd_response(conn, pool, ""));
3284 apr_pool_t *pool,
3294 SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "crr",
3297 svn_relpath_canonicalize(path, pool), pool);
3298 SVN_ERR(log_command(b, conn, pool, "get-deleted-rev"));
3299 SVN_ERR(trivial_auth_request(conn, pool, b));
3301 end_revision, &revision_deleted, pool));
3302 SVN_ERR(svn_ra_svn__write_cmd_response(conn, pool, "r", revision_deleted));
3308 apr_pool_t *pool,
3318 apr_pool_t *iterpool = svn_pool_create(pool);
3329 pool);
3336 SVN_CMD_ERR(svn_fs_youngest_rev(&rev, b->repository->fs, pool));
3338 SVN_ERR(log_command(b, conn, pool, "%s",
3344 SVN_CMD_ERR(get_props(NULL, &inherited_props, &ab, root, full_path, pool));
3598 static const char *get_tunnel_user(serve_params_t *params, apr_pool_t *pool)
3608 return svn_user_get_name(pool);
3625 apr_pool_t *pool)
3632 path = svn_uri_skip_ancestor(sb->repository->repos_url, path, pool);
3633 path = svn_fspath__canonicalize(path, pool);
3640 path = svn_fspath__join(sb->repository->fs_path->data, path, pool);
3654 apr_pool_t *pool)
3659 SVN_ERR(svn_fs_youngest_rev(&revision, sb->repository->fs, pool));
3661 SVN_ERR(svn_fs_revision_root(fs_root, sb->repository->fs, revision, pool));
3749 apr_pool_t *pool)
3751 client_info_t *client_info = apr_pcalloc(pool, sizeof(*client_info));
3754 client_info->tunnel_user = get_tunnel_user(params, pool);
3789 b->pool = conn_pool;
3979 apr_pool_t *pool)
3984 apr_pool_t *iterpool = svn_pool_create(pool);
3987 apr_hash_t *cmd_hash = apr_hash_make(pool);
4016 connection->pool);
4020 connection->params, pool);
4072 apr_pool_t *pool)
4076 SVN_ERR(construct_server_baton(&baton, conn, params, pool));
4077 return svn_ra_svn__handle_commands2(conn, pool, main_commands, baton, FALSE);