You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2016/12/03 10:09:55 UTC
svn commit: r1772445 [3/6] - in /subversion/branches/authzperf: ./
build/ac-macros/ notes/ subversion/bindings/javahl/native/
subversion/bindings/swig/perl/libsvn_swig_perl/
subversion/bindings/swig/ruby/test/ subversion/include/
subversion/include/pri...
Modified: subversion/branches/authzperf/subversion/libsvn_client/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_client/deprecated.c?rev=1772445&r1=1772444&r2=1772445&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_client/deprecated.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_client/deprecated.c Sat Dec 3 10:09:54 2016
@@ -1330,6 +1330,26 @@ svn_client_export(svn_revnum_t *result_r
/*** From list.c ***/
+svn_error_t *
+svn_client_list3(const char *path_or_url,
+ const svn_opt_revision_t *peg_revision,
+ const svn_opt_revision_t *revision,
+ svn_depth_t depth,
+ apr_uint32_t dirent_fields,
+ svn_boolean_t fetch_locks,
+ svn_boolean_t include_externals,
+ svn_client_list_func2_t list_func,
+ void *baton,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool)
+{
+ return svn_error_trace(svn_client_list4(path_or_url, peg_revision,
+ revision, NULL, depth,
+ dirent_fields, fetch_locks,
+ include_externals,
+ list_func, baton, ctx, pool));
+}
+
/* Baton for use with wrap_list_func */
struct list_func_wrapper_baton {
void *list_func1_baton;
Modified: subversion/branches/authzperf/subversion/libsvn_client/list.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_client/list.c?rev=1772445&r1=1772444&r2=1772445&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_client/list.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_client/list.c Sat Dec 3 10:09:54 2016
@@ -21,6 +21,8 @@
* ====================================================================
*/
+#include <apr_fnmatch.h>
+
#include "svn_client.h"
#include "svn_dirent_uri.h"
#include "svn_hash.h"
@@ -41,6 +43,7 @@
/* Prototypes for referencing before declaration */
static svn_error_t *
list_externals(apr_hash_t *externals,
+ apr_array_header_t *patterns,
svn_depth_t depth,
apr_uint32_t dirent_fields,
svn_boolean_t fetch_locks,
@@ -53,6 +56,7 @@ static svn_error_t *
list_internal(const char *path_or_url,
const svn_opt_revision_t *peg_revision,
const svn_opt_revision_t *revision,
+ apr_array_header_t *patterns,
svn_depth_t depth,
apr_uint32_t dirent_fields,
svn_boolean_t fetch_locks,
@@ -64,6 +68,25 @@ list_internal(const char *path_or_url,
svn_client_ctx_t *ctx,
apr_pool_t *pool);
+/* Return TRUE if S matches any of the const char * in PATTERNS.
+ * Note that any S will match if PATTERNS is empty. */
+static svn_boolean_t
+match_patterns(const char *s,
+ apr_array_header_t *patterns)
+{
+ int i;
+ if (!patterns)
+ return TRUE;
+
+ for (i = 0; i < patterns->nelts; ++i)
+ {
+ const char *pattern = APR_ARRAY_IDX(patterns, i, const char *);
+ if (apr_fnmatch(pattern, s, APR_FNM_PERIOD) == APR_SUCCESS)
+ return TRUE;
+ }
+
+ return FALSE;
+}
/* Get the directory entries of DIR at REV (relative to the root of
RA_SESSION), getting at least the fields specified by DIRENT_FIELDS.
@@ -75,6 +98,10 @@ list_internal(const char *path_or_url,
if svn_depth_infinity, invoke it on file and directory entries and
recurse into the directory entries with the same depth.
+ If PATTERNS is not empty, the last path segments must match at least
+ one of const char * patterns in it or the respective dirent will not
+ be reported.
+
LOCKS, if non-NULL, is a hash mapping const char * paths to svn_lock_t
objects and FS_PATH is the absolute filesystem path of the RA session.
Use SCRATCH_POOL for temporary allocations.
@@ -94,6 +121,7 @@ get_dir_contents(apr_uint32_t dirent_fie
svn_ra_session_t *ra_session,
apr_hash_t *locks,
const char *fs_path,
+ apr_array_header_t *patterns,
svn_depth_t depth,
svn_client_ctx_t *ctx,
apr_hash_t *externals,
@@ -175,14 +203,15 @@ get_dir_contents(apr_uint32_t dirent_fie
if (the_ent->kind == svn_node_file
|| depth == svn_depth_immediates
|| depth == svn_depth_infinity)
- SVN_ERR(list_func(baton, path, the_ent, lock, fs_path,
- external_parent_url, external_target, iterpool));
+ if (match_patterns(item->key, patterns))
+ SVN_ERR(list_func(baton, path, the_ent, lock, fs_path,
+ external_parent_url, external_target, iterpool));
/* If externals is non-NULL, populate the externals hash table
recursively for all directory entries. */
if (depth == svn_depth_infinity && the_ent->kind == svn_node_dir)
- SVN_ERR(get_dir_contents(dirent_fields, path, rev,
- ra_session, locks, fs_path, depth, ctx,
+ SVN_ERR(get_dir_contents(dirent_fields, path, rev, ra_session,
+ locks, fs_path, patterns, depth, ctx,
externals, external_parent_url,
external_target, list_func, baton,
result_pool, iterpool));
@@ -192,6 +221,53 @@ get_dir_contents(apr_uint32_t dirent_fie
return SVN_NO_ERROR;
}
+/* Baton type to be used with list_receiver. */
+typedef struct receiver_baton_t
+{
+ /* Wrapped callback function to invoke. */
+ svn_client_list_func2_t list_func;
+
+ /* Baton to be used with LIST_FUNC. */
+ void *list_baton;
+
+ /* Client context providing cancellation support. */
+ svn_client_ctx_t *ctx;
+
+ /* All locks found for the whole tree; pick yours. */
+ apr_hash_t *locks;
+
+ /* Start path of the operation. */
+ const char *fs_base_path;
+} receiver_baton_t;
+
+/* Implement svn_ra_dirent_receiver_t.
+ The BATON type must be a receiver_baton_t. */
+static svn_error_t *
+list_receiver(const char *rel_path,
+ svn_dirent_t *dirent,
+ void *baton,
+ apr_pool_t *pool)
+{
+ receiver_baton_t *b = baton;
+ const svn_lock_t *lock = NULL;
+
+ /* We only report the path relative to the start path. */
+ rel_path = svn_dirent_skip_ancestor(b->fs_base_path, rel_path);
+
+ if (b->locks)
+ {
+ const char *abs_path = svn_dirent_join(b->fs_base_path, rel_path, pool);
+ lock = svn_hash_gets(b->locks, abs_path);
+ }
+
+ if (b->ctx->cancel_func)
+ SVN_ERR(b->ctx->cancel_func(b->ctx->cancel_baton));
+
+ SVN_ERR(b->list_func(b->list_baton, rel_path, dirent, lock,
+ b->fs_base_path, NULL, NULL, pool));
+
+ return SVN_NO_ERROR;
+}
/* List the file/directory entries for PATH_OR_URL at REVISION.
The actual node revision selected is determined by the path as
@@ -204,6 +280,10 @@ get_dir_contents(apr_uint32_t dirent_fie
subdirectories (at svn_depth_empty). Else if DEPTH is
svn_depth_empty, just list PATH_OR_URL with none of its entries.
+ If PATTERNS is not NULL, the last path segments must match at least
+ one of const char * patterns in it or the respective dirent will not
+ be reported.
+
DIRENT_FIELDS controls which fields in the svn_dirent_t's are
filled in. To have them totally filled in use SVN_DIRENT_ALL,
otherwise simply bitwise OR together the combination of SVN_DIRENT_*
@@ -230,6 +310,7 @@ static svn_error_t *
list_internal(const char *path_or_url,
const svn_opt_revision_t *peg_revision,
const svn_opt_revision_t *revision,
+ apr_array_header_t *patterns,
svn_depth_t depth,
apr_uint32_t dirent_fields,
svn_boolean_t fetch_locks,
@@ -266,12 +347,6 @@ list_internal(const char *path_or_url,
fs_path = svn_client__pathrev_fspath(loc, pool);
- SVN_ERR(svn_ra_stat(ra_session, "", loc->rev, &dirent, pool));
- if (! dirent)
- return svn_error_createf(SVN_ERR_FS_NOT_FOUND, NULL,
- _("URL '%s' non-existent in revision %ld"),
- loc->url, loc->rev);
-
/* Maybe get all locks under url. */
if (fetch_locks)
{
@@ -290,18 +365,45 @@ list_internal(const char *path_or_url,
else
locks = NULL;
+ /* Try to use the efficient and fully authz-filtered code path. */
+ if (!include_externals)
+ {
+ receiver_baton_t receiver_baton;
+ receiver_baton.list_baton = baton;
+ receiver_baton.ctx = ctx;
+ receiver_baton.list_func = list_func;
+ receiver_baton.locks = locks;
+ receiver_baton.fs_base_path = fs_path;
+
+ err = svn_ra_list(ra_session, "", loc->rev, patterns, depth,
+ dirent_fields, list_receiver, &receiver_baton, pool);
+
+ if (svn_error_find_cause(err, SVN_ERR_UNSUPPORTED_FEATURE))
+ svn_error_clear(err);
+ else
+ return svn_error_trace(err);
+ }
+
+ /* Stat for the file / directory node itself. */
+ SVN_ERR(svn_ra_stat(ra_session, "", loc->rev, &dirent, pool));
+ if (! dirent)
+ return svn_error_createf(SVN_ERR_FS_NOT_FOUND, NULL,
+ _("URL '%s' non-existent in revision %ld"),
+ loc->url, loc->rev);
+
/* Report the dirent for the target. */
- SVN_ERR(list_func(baton, "", dirent, locks
- ? (svn_hash_gets(locks, fs_path))
- : NULL, fs_path, external_parent_url,
- external_target, pool));
+ if (match_patterns(svn_dirent_dirname(fs_path, pool), patterns))
+ SVN_ERR(list_func(baton, "", dirent, locks
+ ? (svn_hash_gets(locks, fs_path))
+ : NULL, fs_path, external_parent_url,
+ external_target, pool));
if (dirent->kind == svn_node_dir
&& (depth == svn_depth_files
|| depth == svn_depth_immediates
|| depth == svn_depth_infinity))
SVN_ERR(get_dir_contents(dirent_fields, "", loc->rev, ra_session, locks,
- fs_path, depth, ctx, externals,
+ fs_path, patterns, depth, ctx, externals,
external_parent_url, external_target, list_func,
baton, pool, pool));
@@ -312,7 +414,7 @@ list_internal(const char *path_or_url,
{
/* The 'externals' hash populated by get_dir_contents() is processed
here. */
- SVN_ERR(list_externals(externals, depth, dirent_fields,
+ SVN_ERR(list_externals(externals, patterns, depth, dirent_fields,
fetch_locks, list_func, baton,
ctx, pool));
}
@@ -349,6 +451,7 @@ wrap_list_error(const svn_client_ctx_t *
static svn_error_t *
list_external_items(apr_array_header_t *external_items,
const char *externals_parent_url,
+ apr_array_header_t *patterns,
svn_depth_t depth,
apr_uint32_t dirent_fields,
svn_boolean_t fetch_locks,
@@ -389,6 +492,7 @@ list_external_items(apr_array_header_t *
list_internal(resolved_url,
&item->peg_revision,
&item->revision,
+ patterns,
depth, dirent_fields,
fetch_locks,
TRUE,
@@ -411,6 +515,7 @@ list_external_items(apr_array_header_t *
passed to svn_client_list(). */
static svn_error_t *
list_externals(apr_hash_t *externals,
+ apr_array_header_t *patterns,
svn_depth_t depth,
apr_uint32_t dirent_fields,
svn_boolean_t fetch_locks,
@@ -440,9 +545,10 @@ list_externals(apr_hash_t *externals,
if (! external_items->nelts)
continue;
- SVN_ERR(list_external_items(external_items, externals_parent_url, depth,
- dirent_fields, fetch_locks, list_func,
- baton, ctx, iterpool));
+ SVN_ERR(list_external_items(external_items, externals_parent_url,
+ patterns, depth, dirent_fields,
+ fetch_locks, list_func, baton, ctx,
+ iterpool));
}
svn_pool_destroy(iterpool);
@@ -452,9 +558,10 @@ list_externals(apr_hash_t *externals,
svn_error_t *
-svn_client_list3(const char *path_or_url,
+svn_client_list4(const char *path_or_url,
const svn_opt_revision_t *peg_revision,
const svn_opt_revision_t *revision,
+ apr_array_header_t *patterns,
svn_depth_t depth,
apr_uint32_t dirent_fields,
svn_boolean_t fetch_locks,
@@ -462,14 +569,14 @@ svn_client_list3(const char *path_or_url
svn_client_list_func2_t list_func,
void *baton,
svn_client_ctx_t *ctx,
- apr_pool_t *pool)
+ apr_pool_t *scratch_pool)
{
return svn_error_trace(list_internal(path_or_url, peg_revision,
- revision,
+ revision, patterns,
depth, dirent_fields,
fetch_locks,
include_externals,
NULL, NULL, list_func,
- baton, ctx, pool));
+ baton, ctx, scratch_pool));
}
Modified: subversion/branches/authzperf/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_client/merge.c?rev=1772445&r1=1772444&r2=1772445&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_client/merge.c Sat Dec 3 10:09:54 2016
@@ -10957,7 +10957,7 @@ find_unsynced_ranges(const svn_client__p
potentially_unmerged_ranges->nelts - 1,
svn_merge_range_t *))->end;
log_find_operative_baton_t log_baton;
- const char *old_session_url;
+ const char *old_session_url = NULL;
svn_error_t *err;
log_baton.merged_catalog = merged_catalog;
@@ -10968,14 +10968,22 @@ find_unsynced_ranges(const svn_client__p
= svn_client__pathrev_fspath(target_loc, scratch_pool);
log_baton.result_pool = result_pool;
- SVN_ERR(svn_client__ensure_ra_session_url(
- &old_session_url, ra_session, target_loc->url, scratch_pool));
+ /* Reparent the session to TARGET_LOC if this target location
+ * exists within the unmerged revision range. */
+ if (target_loc->rev <= youngest_rev && target_loc->rev >= oldest_rev)
+ SVN_ERR(svn_client__ensure_ra_session_url(
+ &old_session_url, ra_session, target_loc->url, scratch_pool));
+
err = get_log(ra_session, "", youngest_rev, oldest_rev,
TRUE, /* discover_changed_paths */
log_find_operative_revs, &log_baton,
scratch_pool);
- SVN_ERR(svn_error_compose_create(
- err, svn_ra_reparent(ra_session, old_session_url, scratch_pool)));
+ if (old_session_url)
+ err = svn_error_compose_create(err,
+ svn_ra_reparent(ra_session,
+ old_session_url,
+ scratch_pool));
+ SVN_ERR(err);
}
return SVN_NO_ERROR;
Modified: subversion/branches/authzperf/subversion/libsvn_fs_fs/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_fs_fs/cached_data.c?rev=1772445&r1=1772444&r2=1772445&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_fs_fs/cached_data.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_fs_fs/cached_data.c Sat Dec 3 10:09:54 2016
@@ -1660,6 +1660,17 @@ read_plain_window(svn_stringbuf_t **nwin
return SVN_NO_ERROR;
}
+/* Skip SIZE bytes from the PLAIN representation RS. */
+static svn_error_t *
+skip_plain_window(rep_state_t *rs,
+ apr_size_t size)
+{
+ /* Update RS. */
+ rs->current += (apr_off_t)size;
+
+ return SVN_NO_ERROR;
+}
+
/* Get the undeltified window that is a result of combining all deltas
from the current desired representation identified in *RB with its
base representation. Store the window in *RESULT. */
@@ -1717,9 +1728,18 @@ get_combined_window(svn_stringbuf_t **re
Also note that we may have short-cut reading the delta chain --
in which case SRC_OPS is 0 and it might not be a PLAIN rep. */
source = buf;
- if (source == NULL && rb->src_state != NULL && window->src_ops)
- SVN_ERR(read_plain_window(&source, rb->src_state, window->sview_len,
- pool, iterpool));
+ if (source == NULL && rb->src_state != NULL)
+ {
+ /* Even if we don't need the source rep now, we still must keep
+ * its read offset in sync with what we might need for the next
+ * window. */
+ if (window->src_ops)
+ SVN_ERR(read_plain_window(&source, rb->src_state,
+ window->sview_len,
+ pool, iterpool));
+ else
+ SVN_ERR(skip_plain_window(rb->src_state, window->sview_len));
+ }
/* Combine this window with the current one. */
new_pool = svn_pool_create(rb->pool);
Propchange: subversion/branches/authzperf/subversion/libsvn_fs_x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Dec 3 10:09:54 2016
@@ -95,4 +95,4 @@
/subversion/branches/verify-keep-going/subversion/libsvn_fs_x:1439280-1492639,1546002-1546110
/subversion/branches/wc-collate-path/subversion/libsvn_fs_x:1402685-1480384
/subversion/trunk/subversion/libsvn_fs_fs:1415133-1596500,1596567,1597414,1597989,1598273,1599140,1600872,1601633,1603485-1603487,1603499,1603605,1604128,1604188,1604413-1604414,1604416-1604417,1604421,1604442,1604700,1604717,1604720,1604726,1604755,1604794,1604802,1604824,1604836,1604844,1604902-1604903,1604911,1604925,1604933,1604947,1605059-1605060,1605064-1605065,1605068,1605071-1605073,1605075,1605123,1605188-1605189,1605191,1605197,1605444,1605633,1606132,1606142,1606144,1606514,1606526,1606528,1606551,1606554,1606564,1606598-1606599,1606656,1606658,1606662,1606744,1606840,1607085,1607572,1612407,1612810,1613339,1613872,1614611,1615348,1615351-1615352,1615356,1616338-1616339,1616613,1617586,1617688,1618138,1618151,1618153,1618226,1618641,1618653,1618662,1619068,1619358,1619413,1619769,1619774,1620602,1620909,1620912,1620928,1620930,1621275,1621635,1622931,1622937,1622942,1622946,1622959-1622960,1622963,1622987,1623007,1623368,1623373,1623377,1623379,1623381,1623398,1623402,162
4011,1624265,1624512,1626246,1626871,1626873,1626886,1627497-1627498,1627502,1627947-1627949,1627966,1628083,1628093,1628158-1628159,1628161,1628392-1628393,1628415,1628427,1628676,1628738,1628762,1628764,1629854-1629855,1629857,1629865,1629873,1629875,1629879,1630067,1630070,1631049-1631051,1631075,1631115,1631171,1631180,1631185-1631186,1631196-1631197,1631239-1631240,1631548,1631550,1631563,1631567,1631588,1631598,1632646,1632776,1632849,1632851-1632853,1632856-1632857,1632868,1632908,1632926,1633232,1633617-1633618,1634872,1634875,1634879-1634880,1634920,1636478,1636483,1636629,1636644,1637184,1637186,1637330,1637358,1637363,1637393,1639319,1639322,1639335,1639348,1639352,1639355,1639358,1639414,1639419,1639426,1639430,1639436,1639440,1639549,1640061-1640062,1640197,1640915,1640966,1641013,1643139,1643233,1645567,1646021,1646712,1646716,1647537,1647540-1647541,1647820,1647905,1648230,1648238,1648241-1648243,1648253,1648272,1648532,1648537-1648539,1648542,1648591,1648612,1649590,
1651567,1652068,1652076,1652441,1652451,1653608,1654932,1654934,1654937,1655635,1655649,1655651,1655664,1656176,1657525,1657972,1657978,1658482,1659212,1659217,1659314,1659509,1662668,1665318,1665854,1665894,1667090,1667101,1667538,1669743,1669746,1669749,1669945,1670139,1670953,1673170,1673197,1673202,1673204,1673445,1673454,1673685,1673689,1673875,1674165,1674341,1674400,1674404,1674631,1674669,1674673,1675396,1676667,1677431,1678149,1678151,1678718,1678725,1679169,1679907,1679920-1679924,1679926,1680347,1680460,1680464,1680476,1680819,1681949,1681966,1681974,1681994,1682008,1682076,1682086,1682093,1682259,1682265,1682739,1682864,1683311,1683330,1683378,1683544,1683553,1684047,1686232,1686542,1686546,1686554,1686557,1687061,1687064,1687070-1687071,1687074,1687078-1687079,1688270,1688425,1692650,1693886,1694489,1694848,1696171,1696185,1696627-1696628,1696630,1696758,1697372,1697381,1697387,1697393,1697403,1697405,1701017,1701053,1702600,1702922,1703069,1703142,1703237,1703240,17052
66,1705638,1705643,1705646,1705724,1705730,1705739,1706612,1706615,1706617,1706619,1706675-1706676,1706679,1706979-1706980,1707308,1707971-1707973,1707986,1707988-1707989,1708004,1709388,1709799,1710017,1710359,1710368,1710370,1711507,1711582,1711672,1712927,1715793,1715947,1716047,1716067,1716784,1716973-1716974,1717332,1717334,1717864,1719269,1719336,1719413,1719730,1720015,1721285,1723715,1723720,1723834,1723839,1725179-1725180,1726004,1726099,1726116,1726897,1726995,1727006-1727007,1727028,1727040,1727707,1727822,1730491,1735916,1736357,1736359,1737355-1737356,1740721-1740722,1741096,1741200,1741206,1741214,1741224,1742540,1745055,1745107,1745852,1746006,1746012,1746026
-/subversion/trunk/subversion/libsvn_fs_x:1414756-1509914,1613053-1764704
+/subversion/trunk/subversion/libsvn_fs_x:1414756-1509914,1613053-1772443
Modified: subversion/branches/authzperf/subversion/libsvn_fs_x/fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_fs_x/fs.h?rev=1772445&r1=1772444&r2=1772445&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_fs_x/fs.h (original)
+++ subversion/branches/authzperf/subversion/libsvn_fs_x/fs.h Sat Dec 3 10:09:54 2016
@@ -545,7 +545,7 @@ typedef struct svn_fs_x__changes_context
svn_fs_x__revision_file_t *revision_file;
/* Index of the next change to fetch. */
- apr_size_t next;
+ int next;
/* Offset, within the changed paths list on disk, of the next change to
fetch. */
Modified: subversion/branches/authzperf/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_ra/ra_loader.c?rev=1772445&r1=1772444&r2=1772445&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_ra/ra_loader.c Sat Dec 3 10:09:54 2016
@@ -645,6 +645,29 @@ svn_error_t *svn_ra_get_dir2(svn_ra_sess
path, revision, dirent_fields, pool);
}
+svn_error_t *
+svn_ra_list(svn_ra_session_t *session,
+ const char *path,
+ svn_revnum_t revision,
+ apr_array_header_t *patterns,
+ svn_depth_t depth,
+ apr_uint32_t dirent_fields,
+ svn_ra_dirent_receiver_t receiver,
+ void *receiver_baton,
+ apr_pool_t *scratch_pool)
+{
+ SVN_ERR_ASSERT(svn_relpath_is_canonical(path));
+ if (!session->vtable->list)
+ return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL, NULL);
+
+ SVN_ERR(svn_ra__assert_capable_server(session, SVN_RA_CAPABILITY_LIST,
+ NULL, scratch_pool));
+
+ return session->vtable->list(session, path, revision, patterns, depth,
+ dirent_fields, receiver, receiver_baton,
+ scratch_pool);
+}
+
svn_error_t *svn_ra_get_mergeinfo(svn_ra_session_t *session,
svn_mergeinfo_catalog_t *catalog,
const apr_array_header_t *paths,
Modified: subversion/branches/authzperf/subversion/libsvn_ra/ra_loader.h
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_ra/ra_loader.h?rev=1772445&r1=1772444&r2=1772445&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_ra/ra_loader.h (original)
+++ subversion/branches/authzperf/subversion/libsvn_ra/ra_loader.h Sat Dec 3 10:09:54 2016
@@ -332,6 +332,17 @@ typedef struct svn_ra__vtable_t {
svn_error_t *(*set_svn_ra_open)(svn_ra_session_t *session,
svn_ra__open_func_t func);
+ /* See svn_ra_list(). */
+ svn_error_t *(*list)(svn_ra_session_t *session,
+ const char *path,
+ svn_revnum_t revision,
+ apr_array_header_t *patterns,
+ svn_depth_t depth,
+ apr_uint32_t dirent_fields,
+ svn_ra_dirent_receiver_t receiver,
+ void *receiver_baton,
+ apr_pool_t *scratch_pool);
+
/* Experimental support below here */
/* See svn_ra__register_editor_shim_callbacks() */
Modified: subversion/branches/authzperf/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_ra_local/ra_plugin.c?rev=1772445&r1=1772444&r2=1772445&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_ra_local/ra_plugin.c Sat Dec 3 10:09:54 2016
@@ -1648,6 +1648,7 @@ svn_ra_local__has_capability(svn_ra_sess
|| strcmp(capability, SVN_RA_CAPABILITY_INHERITED_PROPS) == 0
|| strcmp(capability, SVN_RA_CAPABILITY_EPHEMERAL_TXNPROPS) == 0
|| strcmp(capability, SVN_RA_CAPABILITY_GET_FILE_REVS_REVERSE) == 0
+ || strcmp(capability, SVN_RA_CAPABILITY_LIST) == 0
)
{
*has = TRUE;
@@ -1790,6 +1791,54 @@ svn_ra_local__get_commit_ev2(svn_editor_
result_pool, scratch_pool));
}
+/* Trivially forward repos-layer callbacks to RA-layer callbacks.
+ * Their signatures are the same. */
+typedef struct dirent_receiver_baton_t
+{
+ svn_ra_dirent_receiver_t receiver;
+ void *receiver_baton;
+} dirent_receiver_baton_t;
+
+static svn_error_t *
+dirent_receiver(const char *rel_path,
+ svn_dirent_t *dirent,
+ void *baton,
+ apr_pool_t *pool)
+{
+ dirent_receiver_baton_t *b = baton;
+ return b->receiver(rel_path, dirent, b->receiver_baton, pool);
+}
+
+static svn_error_t *
+svn_ra_local__list(svn_ra_session_t *session,
+ const char *path,
+ svn_revnum_t revision,
+ apr_array_header_t *patterns,
+ svn_depth_t depth,
+ apr_uint32_t dirent_fields,
+ svn_ra_dirent_receiver_t receiver,
+ void *receiver_baton,
+ apr_pool_t *pool)
+{
+ svn_ra_local__session_baton_t *sess = session->priv;
+ svn_fs_root_t *root;
+ svn_boolean_t path_info_only = (dirent_fields & ~SVN_DIRENT_KIND) == 0;
+
+ dirent_receiver_baton_t baton;
+ baton.receiver = receiver;
+ baton.receiver_baton = receiver_baton;
+
+ SVN_ERR(svn_fs_revision_root(&root, sess->fs, revision, pool));
+ path = svn_dirent_join(sess->fs_path->data, path, pool);
+ return svn_error_trace(svn_repos_list(root, path, patterns, depth,
+ path_info_only, NULL, NULL,
+ dirent_receiver, &baton,
+ sess->callbacks
+ ? sess->callbacks->cancel_func
+ : NULL,
+ sess->callback_baton, pool));
+}
+
/*----------------------------------------------------------------*/
static const svn_version_t *
@@ -1840,6 +1889,7 @@ static const svn_ra__vtable_t ra_local_v
svn_ra_local__get_deleted_rev,
svn_ra_local__get_inherited_props,
NULL /* set_svn_ra_open */,
+ svn_ra_local__list ,
svn_ra_local__register_editor_shim_callbacks,
svn_ra_local__get_commit_ev2,
NULL /* replay_range_ev2 */
Modified: subversion/branches/authzperf/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_ra_serf/ra_serf.h?rev=1772445&r1=1772444&r2=1772445&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/authzperf/subversion/libsvn_ra_serf/ra_serf.h Sat Dec 3 10:09:54 2016
@@ -26,7 +26,6 @@
#include <serf.h>
-#include <expat.h> /* for XML_Parser */
#include <apr_uri.h>
#include "svn_types.h"
Modified: subversion/branches/authzperf/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_ra_serf/serf.c?rev=1772445&r1=1772444&r2=1772445&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_ra_serf/serf.c Sat Dec 3 10:09:54 2016
@@ -734,11 +734,14 @@ ra_serf_dup_session(svn_ra_session_t *ne
new_sess->server_allows_bulk = apr_pstrdup(result_pool,
new_sess->server_allows_bulk);
- new_sess->repos_root_str = apr_pstrdup(result_pool,
- new_sess->repos_root_str);
- SVN_ERR(svn_ra_serf__uri_parse(&new_sess->repos_root,
- new_sess->repos_root_str,
- result_pool));
+ if (new_sess->repos_root_str)
+ {
+ new_sess->repos_root_str = apr_pstrdup(result_pool,
+ new_sess->repos_root_str);
+ SVN_ERR(svn_ra_serf__uri_parse(&new_sess->repos_root,
+ new_sess->repos_root_str,
+ result_pool));
+ }
new_sess->session_url_str = apr_pstrdup(result_pool, new_session_url);
@@ -1052,6 +1055,7 @@ static const svn_ra__vtable_t serf_vtabl
svn_ra_serf__get_deleted_rev,
svn_ra_serf__get_inherited_props,
NULL /* set_svn_ra_open */,
+ NULL /* svn_ra_list */,
svn_ra_serf__register_editor_shim_callbacks,
NULL /* commit_ev2 */,
NULL /* replay_range_ev2 */
Modified: subversion/branches/authzperf/subversion/libsvn_ra_serf/xml.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_ra_serf/xml.c?rev=1772445&r1=1772444&r2=1772445&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_ra_serf/xml.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_ra_serf/xml.c Sat Dec 3 10:09:54 2016
@@ -24,7 +24,6 @@
#include <apr_uri.h>
-#include <expat.h>
#include <serf.h>
#include "svn_hash.h"
@@ -43,22 +42,6 @@
#include "ra_serf.h"
-/* Fix for older expat 1.95.x's that do not define
- * XML_STATUS_OK/XML_STATUS_ERROR
- */
-#ifndef XML_STATUS_OK
-#define XML_STATUS_OK 1
-#define XML_STATUS_ERROR 0
-#endif
-
-#ifndef XML_VERSION_AT_LEAST
-#define XML_VERSION_AT_LEAST(major,minor,patch) \
-(((major) < XML_MAJOR_VERSION) \
- || ((major) == XML_MAJOR_VERSION && (minor) < XML_MINOR_VERSION) \
- || ((major) == XML_MAJOR_VERSION && (minor) == XML_MINOR_VERSION && \
- (patch) <= XML_MICRO_VERSION))
-#endif /* XML_VERSION_AT_LEAST */
-
/* Read/write chunks of this size into the spillbuf. */
#define PARSE_CHUNK_SIZE 8000
@@ -149,12 +132,10 @@ struct svn_ra_serf__xml_estate_t {
struct expat_ctx_t {
svn_ra_serf__xml_context_t *xmlctx;
- XML_Parser parser;
+ svn_xml_parser_t *parser;
svn_ra_serf__handler_t *handler;
const int *expected_status;
- svn_error_t *inner_error;
-
/* Do not use this pool for allocation. It is merely recorded for running
the cleanup handler. */
apr_pool_t *cleanup_pool;
@@ -886,106 +867,58 @@ xml_cb_cdata(svn_ra_serf__xml_context_t
return SVN_NO_ERROR;
}
-/* svn_error_t * wrapper around XML_Parse */
+/* Wrapper around svn_xml_parse */
static APR_INLINE svn_error_t *
parse_xml(struct expat_ctx_t *ectx, const char *data, apr_size_t len, svn_boolean_t is_final)
{
- int xml_status = XML_Parse(ectx->parser, data, (int)len, is_final);
- const char *msg;
- int xml_code;
-
- if (xml_status == XML_STATUS_OK)
- return ectx->inner_error;
-
- xml_code = XML_GetErrorCode(ectx->parser);
-
-#if XML_VERSION_AT_LEAST(1, 95, 8)
- /* If we called XML_StopParser() expat will return an abort error. If we
- have a better error stored we should ignore it as it will not help
- the end-user to store it in the error chain. */
- if (xml_code == XML_ERROR_ABORTED && ectx->inner_error)
- return ectx->inner_error;
-#endif
-
- msg = XML_ErrorString(xml_code);
+ svn_error_t *err = svn_xml_parse(ectx->parser, data, len, is_final);
- return svn_error_compose_create(
- ectx->inner_error,
- svn_error_create(SVN_ERR_RA_DAV_MALFORMED_DATA,
- svn_error_createf(SVN_ERR_XML_MALFORMED, NULL,
- _("Malformed XML: %s"),
- msg),
- _("The XML response contains invalid XML")));
-}
-
-/* Apr pool cleanup handler to release an XML_Parser in success and error
- conditions */
-static apr_status_t
-xml_parser_cleanup(void *baton)
-{
- XML_Parser *xmlp = baton;
-
- if (*xmlp)
- {
- (void) XML_ParserFree(*xmlp);
- *xmlp = NULL;
- }
+ if (err && err->apr_err == SVN_ERR_XML_MALFORMED)
+ err = svn_error_create(SVN_ERR_RA_DAV_MALFORMED_DATA, err,
+ _("The XML response contains invalid XML"));
- return APR_SUCCESS;
+ return err;
}
-/* Conforms to Expat's XML_StartElementHandler */
+/* Implements svn_xml_start_elem callback */
static void
-expat_start(void *userData, const char *raw_name, const char **attrs)
+expat_start(void *baton, const char *raw_name, const char **attrs)
{
- struct expat_ctx_t *ectx = userData;
-
- if (ectx->inner_error != NULL)
- return;
+ struct expat_ctx_t *ectx = baton;
+ svn_error_t *err;
- ectx->inner_error = svn_error_trace(xml_cb_start(ectx->xmlctx,
- raw_name, attrs));
+ err = svn_error_trace(xml_cb_start(ectx->xmlctx, raw_name, attrs));
-#if XML_VERSION_AT_LEAST(1, 95, 8)
- if (ectx->inner_error)
- (void) XML_StopParser(ectx->parser, 0 /* resumable */);
-#endif
+ if (err)
+ svn_xml_signal_bailout(err, ectx->parser);
}
-/* Conforms to Expat's XML_EndElementHandler */
+/* Implements svn_xml_end_elem callback */
static void
-expat_end(void *userData, const char *raw_name)
+expat_end(void *baton, const char *raw_name)
{
- struct expat_ctx_t *ectx = userData;
-
- if (ectx->inner_error != NULL)
- return;
+ struct expat_ctx_t *ectx = baton;
+ svn_error_t *err;
- ectx->inner_error = svn_error_trace(xml_cb_end(ectx->xmlctx, raw_name));
+ err = svn_error_trace(xml_cb_end(ectx->xmlctx, raw_name));
-#if XML_VERSION_AT_LEAST(1, 95, 8)
- if (ectx->inner_error)
- (void) XML_StopParser(ectx->parser, 0 /* resumable */);
-#endif
+ if (err)
+ svn_xml_signal_bailout(err, ectx->parser);
}
-/* Conforms to Expat's XML_CharacterDataHandler */
+/* Implements svn_xml_char_data callback */
static void
-expat_cdata(void *userData, const char *data, int len)
+expat_cdata(void *baton, const char *data, apr_size_t len)
{
- struct expat_ctx_t *ectx = userData;
-
- if (ectx->inner_error != NULL)
- return;
+ struct expat_ctx_t *ectx = baton;
+ svn_error_t *err;
- ectx->inner_error = svn_error_trace(xml_cb_cdata(ectx->xmlctx, data, len));
+ err = svn_error_trace(xml_cb_cdata(ectx->xmlctx, data, len));
-#if XML_VERSION_AT_LEAST(1, 95, 8)
- if (ectx->inner_error)
- (void) XML_StopParser(ectx->parser, 0 /* resumable */);
-#endif
+ if (err)
+ svn_xml_signal_bailout(err, ectx->parser);
}
@@ -1036,12 +969,8 @@ expat_response_handler(serf_request_t *r
if (!ectx->parser)
{
- ectx->parser = XML_ParserCreate(NULL);
- apr_pool_cleanup_register(ectx->cleanup_pool, &ectx->parser,
- xml_parser_cleanup, apr_pool_cleanup_null);
- XML_SetUserData(ectx->parser, ectx);
- XML_SetElementHandler(ectx->parser, expat_start, expat_end);
- XML_SetCharacterDataHandler(ectx->parser, expat_cdata);
+ ectx->parser = svn_xml_make_parser(ectx, expat_start, expat_end,
+ expat_cdata, ectx->cleanup_pool);
}
while (1)
@@ -1049,7 +978,6 @@ expat_response_handler(serf_request_t *r
apr_status_t status;
const char *data;
apr_size_t len;
- svn_error_t *err;
svn_boolean_t at_eof = FALSE;
status = serf_bucket_read(response, PARSE_CHUNK_SIZE, &data, &len);
@@ -1058,16 +986,7 @@ expat_response_handler(serf_request_t *r
else if (APR_STATUS_IS_EOF(status))
at_eof = TRUE;
- err = parse_xml(ectx, data, len, at_eof /* isFinal */);
-
- if (at_eof || err)
- {
- /* Release xml parser state/tables. */
- apr_pool_cleanup_run(ectx->cleanup_pool, &ectx->parser,
- xml_parser_cleanup);
- }
-
- SVN_ERR(err);
+ SVN_ERR(parse_xml(ectx, data, len, at_eof /* isFinal */));
/* The parsing went fine. What has the bucket told us? */
if (at_eof)
Modified: subversion/branches/authzperf/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_ra_svn/client.c?rev=1772445&r1=1772444&r2=1772445&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_ra_svn/client.c Sat Dec 3 10:09:54 2016
@@ -1324,6 +1324,35 @@ static svn_error_t *ra_svn_get_file(svn_
return SVN_NO_ERROR;
}
+/* Write the protocol words that correspond to DIRENT_FIELDS to CONN
+ * and use SCRATCH_POOL for temporary allocations. */
+static svn_error_t *
+send_dirent_fields(svn_ra_svn_conn_t *conn,
+ apr_uint32_t dirent_fields,
+ apr_pool_t *scratch_pool)
+{
+ if (dirent_fields & SVN_DIRENT_KIND)
+ SVN_ERR(svn_ra_svn__write_word(conn, scratch_pool,
+ SVN_RA_SVN_DIRENT_KIND));
+ if (dirent_fields & SVN_DIRENT_SIZE)
+ SVN_ERR(svn_ra_svn__write_word(conn, scratch_pool,
+ SVN_RA_SVN_DIRENT_SIZE));
+ if (dirent_fields & SVN_DIRENT_HAS_PROPS)
+ SVN_ERR(svn_ra_svn__write_word(conn, scratch_pool,
+ SVN_RA_SVN_DIRENT_HAS_PROPS));
+ if (dirent_fields & SVN_DIRENT_CREATED_REV)
+ SVN_ERR(svn_ra_svn__write_word(conn, scratch_pool,
+ SVN_RA_SVN_DIRENT_CREATED_REV));
+ if (dirent_fields & SVN_DIRENT_TIME)
+ SVN_ERR(svn_ra_svn__write_word(conn, scratch_pool,
+ SVN_RA_SVN_DIRENT_TIME));
+ if (dirent_fields & SVN_DIRENT_LAST_AUTHOR)
+ SVN_ERR(svn_ra_svn__write_word(conn, scratch_pool,
+ SVN_RA_SVN_DIRENT_LAST_AUTHOR));
+
+ return SVN_NO_ERROR;
+}
+
static svn_error_t *ra_svn_get_dir(svn_ra_session_t *session,
apr_hash_t **dirents,
svn_revnum_t *fetched_rev,
@@ -1340,18 +1369,7 @@ static svn_error_t *ra_svn_get_dir(svn_r
SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "w(c(?r)bb(!", "get-dir", path,
rev, (props != NULL), (dirents != NULL)));
- if (dirent_fields & SVN_DIRENT_KIND)
- SVN_ERR(svn_ra_svn__write_word(conn, pool, SVN_RA_SVN_DIRENT_KIND));
- if (dirent_fields & SVN_DIRENT_SIZE)
- SVN_ERR(svn_ra_svn__write_word(conn, pool, SVN_RA_SVN_DIRENT_SIZE));
- if (dirent_fields & SVN_DIRENT_HAS_PROPS)
- SVN_ERR(svn_ra_svn__write_word(conn, pool, SVN_RA_SVN_DIRENT_HAS_PROPS));
- if (dirent_fields & SVN_DIRENT_CREATED_REV)
- SVN_ERR(svn_ra_svn__write_word(conn, pool, SVN_RA_SVN_DIRENT_CREATED_REV));
- if (dirent_fields & SVN_DIRENT_TIME)
- SVN_ERR(svn_ra_svn__write_word(conn, pool, SVN_RA_SVN_DIRENT_TIME));
- if (dirent_fields & SVN_DIRENT_LAST_AUTHOR)
- SVN_ERR(svn_ra_svn__write_word(conn, pool, SVN_RA_SVN_DIRENT_LAST_AUTHOR));
+ SVN_ERR(send_dirent_fields(conn, dirent_fields, pool));
/* Always send the, nominally optional, want-iprops as "false" to
workaround a bug in svnserve 1.8.0-1.8.8 that causes the server
@@ -2820,6 +2838,7 @@ ra_svn_has_capability(svn_ra_session_t *
SVN_RA_SVN_CAP_EPHEMERAL_TXNPROPS},
{SVN_RA_CAPABILITY_GET_FILE_REVS_REVERSE,
SVN_RA_SVN_CAP_GET_FILE_REVS_REVERSE},
+ {SVN_RA_CAPABILITY_LIST, SVN_RA_SVN_CAP_LIST},
{NULL, NULL} /* End of list marker */
};
@@ -2909,6 +2928,81 @@ ra_svn_get_inherited_props(svn_ra_sessio
return SVN_NO_ERROR;
}
+static svn_error_t *
+ra_svn_list(svn_ra_session_t *session,
+ const char *path,
+ svn_revnum_t revision,
+ apr_array_header_t *patterns,
+ svn_depth_t depth,
+ apr_uint32_t dirent_fields,
+ svn_ra_dirent_receiver_t receiver,
+ void *receiver_baton,
+ apr_pool_t *scratch_pool)
+{
+ svn_ra_svn__session_baton_t *sess_baton = session->priv;
+ svn_ra_svn_conn_t *conn = sess_baton->conn;
+ int i;
+ apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+
+ /* Send the list request. */
+ SVN_ERR(svn_ra_svn__write_tuple(conn, scratch_pool, "w(c(?r)w(!", "list",
+ path, revision, svn_depth_to_word(depth)));
+ SVN_ERR(send_dirent_fields(conn, dirent_fields, scratch_pool));
+
+ if (patterns)
+ {
+ SVN_ERR(svn_ra_svn__write_tuple(conn, scratch_pool, "!)(!"));
+
+ for (i = 0; i < patterns->nelts; ++i)
+ {
+ const char *pattern = APR_ARRAY_IDX(patterns, i, const char *);
+ SVN_ERR(svn_ra_svn__write_cstring(conn, scratch_pool, pattern));
+ }
+ }
+
+ SVN_ERR(svn_ra_svn__write_tuple(conn, scratch_pool, "!))"));
+
+ /* Handle auth request by server */
+ SVN_ERR(handle_auth_request(sess_baton, scratch_pool));
+
+ /* Read and process list response. */
+ while (1)
+ {
+ svn_ra_svn__item_t *item;
+ const char *dirent_path;
+ const char *kind_word, *date;
+ svn_dirent_t dirent = { 0 };
+
+ svn_pool_clear(iterpool);
+
+ /* Read the next dirent or bail out on "done", respectively */
+ SVN_ERR(svn_ra_svn__read_item(conn, iterpool, &item));
+ if (is_done_response(item))
+ break;
+ if (item->kind != SVN_RA_SVN_LIST)
+ return svn_error_create(SVN_ERR_RA_SVN_MALFORMED_DATA, NULL,
+ _("List entry not a list"));
+ SVN_ERR(svn_ra_svn__parse_tuple(&item->u.list,
+ "cw?(?n)(?b)(?r)(?c)(?c)",
+ &dirent_path, &kind_word, &dirent.size,
+ &dirent.has_props, &dirent.created_rev,
+ &date, &dirent.last_author));
+
+ /* Convert data. */
+ dirent.kind = svn_node_kind_from_word(kind_word);
+ if (date)
+ SVN_ERR(svn_time_from_cstring(&dirent.time, date, iterpool));
+
+ /* Invoke RECEIVER */
+ SVN_ERR(receiver(dirent_path, &dirent, receiver_baton, iterpool));
+ }
+ svn_pool_destroy(iterpool);
+
+ /* Read the actual command response. */
+ SVN_ERR(svn_ra_svn__read_cmd_response(conn, scratch_pool, ""));
+ return SVN_NO_ERROR;
+}
+
static const svn_ra__vtable_t ra_svn_vtable = {
svn_ra_svn_version,
ra_svn_get_description,
@@ -2948,6 +3042,7 @@ static const svn_ra__vtable_t ra_svn_vta
ra_svn_get_deleted_rev,
ra_svn_get_inherited_props,
NULL /* ra_set_svn_ra_open */,
+ ra_svn_list,
ra_svn_register_editor_shim_callbacks,
NULL /* commit_ev2 */,
NULL /* replay_range_ev2 */
Modified: subversion/branches/authzperf/subversion/libsvn_ra_svn/marshal.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_ra_svn/marshal.c?rev=1772445&r1=1772444&r2=1772445&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_ra_svn/marshal.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_ra_svn/marshal.c Sat Dec 3 10:09:54 2016
@@ -1671,6 +1671,9 @@ vparse_tuple(const svn_ra_svn__list_t *i
case '3':
*va_arg(*ap, svn_tristate_t *) = svn_tristate_unknown;
break;
+ case 'b':
+ *va_arg(*ap, svn_boolean_t *) = FALSE;
+ break;
case '(':
nesting_level++;
break;
@@ -2912,6 +2915,57 @@ svn_ra_svn__write_data_log_entry(svn_ra_
return SVN_NO_ERROR;
}
+
+svn_error_t *
+svn_ra_svn__write_dirent(svn_ra_svn_conn_t *conn,
+ apr_pool_t *pool,
+ const char *path,
+ svn_dirent_t *dirent,
+ apr_uint64_t dirent_fields)
+{
+ const char *kind = (dirent_fields & SVN_DIRENT_KIND)
+ ? svn_node_kind_to_word(dirent->kind)
+ : "unknown";
+
+ if (dirent_fields & ~SVN_DIRENT_KIND)
+ {
+ SVN_ERR(write_tuple_start_list(conn, pool));
+ SVN_ERR(write_tuple_cstring(conn, pool, path));
+ SVN_ERR(writebuf_write(conn, pool, kind, strlen(kind)));
+
+ SVN_ERR(writebuf_write_literal(conn, pool, " ( "));
+ if (dirent_fields & SVN_DIRENT_SIZE)
+ SVN_ERR(svn_ra_svn__write_number(conn, pool, dirent->size));
+
+ SVN_ERR(writebuf_write_literal(conn, pool, ") ( "));
+ if (dirent_fields & SVN_DIRENT_HAS_PROPS)
+ SVN_ERR(write_tuple_boolean(conn, pool, dirent->has_props));
+
+ SVN_ERR(writebuf_write_literal(conn, pool, ") ( "));
+ if (dirent_fields & SVN_DIRENT_CREATED_REV)
+ SVN_ERR(write_tuple_revision(conn, pool, dirent->created_rev));
+
+ SVN_ERR(writebuf_write_literal(conn, pool, ") ( "));
+ if (dirent_fields & SVN_DIRENT_TIME)
+ SVN_ERR(write_tuple_cstring_opt(conn, pool,
+ svn_time_to_cstring(dirent->time, pool)));
+
+ SVN_ERR(writebuf_write_literal(conn, pool, ") ( "));
+ if (dirent_fields & SVN_DIRENT_LAST_AUTHOR)
+ SVN_ERR(write_tuple_cstring_opt(conn, pool, dirent->last_author));
+
+ SVN_ERR(writebuf_write_literal(conn, pool, ") ) "));
+ }
+ else
+ {
+ SVN_ERR(write_tuple_start_list(conn, pool));
+ SVN_ERR(write_tuple_cstring(conn, pool, path));
+ SVN_ERR(writebuf_write(conn, pool, kind, strlen(kind)));
+ SVN_ERR(writebuf_write_literal(conn, pool, " ) "));
+ }
+
+ return SVN_NO_ERROR;
+}
/* If condition COND is not met, return a "malformed network data" error.
*/
Modified: subversion/branches/authzperf/subversion/libsvn_ra_svn/protocol
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_ra_svn/protocol?rev=1772445&r1=1772444&r2=1772445&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_ra_svn/protocol (original)
+++ subversion/branches/authzperf/subversion/libsvn_ra_svn/protocol Sat Dec 3 10:09:54 2016
@@ -206,6 +206,8 @@ capability and C indicates a client capa
retrieval of inherited properties via the get-dir and
get-file commands and also supports the get-iprops
command (see section 3.1.1).
+[S] list If the server presents this capability, it supports the
+ list command (see section 3.1.1).
3. Commands
-----------
@@ -487,6 +489,21 @@ second place for auth-request point as n
response: ( inherited-props:iproplist )
New in svn 1.8. If rev is not specified, the youngest revision is used.
+ list
+ params: ( path:string [ rev:number ] depth:word
+ ( field:dirent-field ... ) ? ( pattern:string ... ) )
+ Before sending response, server sends dirents, ending with "done".
+ dirent: ( rel-path:string kind:node-kind
+ ? [ size:number ] [ has-props:bool ] [ created-rev:number ]
+ [ created-date:string ] [ last-author:string ] )
+ | done
+ dirent-field: kind | size | has-props | created-rev | time | last-author
+ | word
+ response: ( )
+ New in svn 1.10. If rev is not specified, the youngest revision is used.
+ If the dirent-fields don't contain "kind", "unknown" will be returned
+ in the kind field.
+
3.1.2. Editor Command Set
An edit operation produces only one response, at close-edit or
Modified: subversion/branches/authzperf/subversion/libsvn_repos/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_repos/repos.c?rev=1772445&r1=1772444&r2=1772445&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_repos/repos.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_repos/repos.c Sat Dec 3 10:09:54 2016
@@ -2061,45 +2061,6 @@ svn_repos_version(void)
SVN_VERSION_BODY;
}
-
-
-svn_error_t *
-svn_repos_stat(svn_dirent_t **dirent,
- svn_fs_root_t *root,
- const char *path,
- apr_pool_t *pool)
-{
- svn_node_kind_t kind;
- svn_dirent_t *ent;
- const char *datestring;
-
- SVN_ERR(svn_fs_check_path(&kind, root, path, pool));
-
- if (kind == svn_node_none)
- {
- *dirent = NULL;
- return SVN_NO_ERROR;
- }
-
- ent = svn_dirent_create(pool);
- ent->kind = kind;
-
- if (kind == svn_node_file)
- SVN_ERR(svn_fs_file_length(&(ent->size), root, path, pool));
-
- SVN_ERR(svn_fs_node_has_props(&ent->has_props, root, path, pool));
-
- SVN_ERR(svn_repos_get_committed_info(&(ent->created_rev),
- &datestring,
- &(ent->last_author),
- root, path, pool));
- if (datestring)
- SVN_ERR(svn_time_from_cstring(&(ent->time), datestring, pool));
-
- *dirent = ent;
- return SVN_NO_ERROR;
-}
-
svn_error_t *
svn_repos_remember_client_capabilities(svn_repos_t *repos,
const apr_array_header_t *capabilities)
Modified: subversion/branches/authzperf/subversion/libsvn_subr/cache-membuffer.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_subr/cache-membuffer.c?rev=1772445&r1=1772444&r2=1772445&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_subr/cache-membuffer.c Sat Dec 3 10:09:54 2016
@@ -287,7 +287,7 @@ prefix_pool_create(prefix_pool_t **prefi
* substantially below this. If we accidentally do, we will simply
* run out of entries in the VALUES array before running out of
* allocated memory. */
- ESTIMATED_BYTES_PER_ENTRY = 120,
+ ESTIMATED_BYTES_PER_ENTRY = 120
};
/* Number of entries we are going to support. */
Modified: subversion/branches/authzperf/subversion/libsvn_subr/gpg_agent.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_subr/gpg_agent.c?rev=1772445&r1=1772444&r2=1772445&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_subr/gpg_agent.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_subr/gpg_agent.c Sat Dec 3 10:09:54 2016
@@ -233,6 +233,7 @@ find_running_gpg_agent(int *new_sd, apr_
{
char *buffer;
char *gpg_agent_info = NULL;
+ char *gnupghome = NULL;
const char *socket_name = NULL;
const char *request = NULL;
const char *p = NULL;
@@ -243,10 +244,9 @@ find_running_gpg_agent(int *new_sd, apr_
/* This implements the method of finding the socket as described in
* the gpg-agent man page under the --use-standard-socket option.
- * The manage page misleadingly says the standard socket is
- * "named 'S.gpg-agent' located in the home directory." The standard
- * socket path is actually in the .gnupg directory in the home directory,
- * i.e. ~/.gnupg/S.gpg-agent */
+ * The manage page says the standard socket is "named 'S.gpg-agent' located
+ * in the home directory." GPG's home directory is either the directory
+ * specified by $GNUPGHOME or ~/.gnupg. */
gpg_agent_info = getenv("GPG_AGENT_INFO");
if (gpg_agent_info != NULL)
{
@@ -259,6 +259,11 @@ find_running_gpg_agent(int *new_sd, apr_
pool);
socket_name = APR_ARRAY_IDX(socket_details, 0, const char *);
}
+ else if ((gnupghome = getenv("GNUPGHOME")) != NULL)
+ {
+ const char *homedir = svn_dirent_canonicalize(gnupghome, pool);
+ socket_name = svn_dirent_join(homedir, "S.gpg-agent", pool);
+ }
else
{
const char *homedir = svn_user_get_homedir(pool);
@@ -610,11 +615,10 @@ simple_gpg_agent_next_creds(void **crede
return SVN_NO_ERROR;
}
+ bye_gpg_agent(sd);
+
if (strncmp(buffer, "OK\n", 3) != 0)
- {
- bye_gpg_agent(sd);
- return SVN_NO_ERROR;
- }
+ return SVN_NO_ERROR;
/* TODO: This attempt limit hard codes it at 3 attempts (or 2 retries)
* which matches svn command line client's retry_limit as set in
Modified: subversion/branches/authzperf/subversion/libsvn_subr/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_subr/log.c?rev=1772445&r1=1772444&r2=1772445&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_subr/log.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_subr/log.c Sat Dec 3 10:09:54 2016
@@ -395,3 +395,35 @@ svn_log__get_inherited_props(const char
log_path = "/";
return apr_psprintf(pool, "get-inherited-props %s r%ld", log_path, rev);
}
+
+const char *
+svn_log__list(const char *path, svn_revnum_t revision,
+ apr_array_header_t *patterns, svn_depth_t depth,
+ apr_uint64_t dirent_fields, apr_pool_t *pool)
+{
+ svn_stringbuf_t *pattern_text = svn_stringbuf_create_empty(pool);
+ const char *log_path;
+ int i;
+
+ if (path && path[0] != '\0')
+ log_path = svn_path_uri_encode(path, pool);
+ else
+ log_path = "/";
+
+ if (patterns)
+ {
+ for (i = 0; i < patterns->nelts; ++i)
+ {
+ const char *pattern = APR_ARRAY_IDX(patterns, i, const char *);
+ svn_stringbuf_appendbyte(pattern_text, ' ');
+ svn_stringbuf_appendcstr(pattern_text, pattern);
+ }
+ }
+ else
+ {
+ svn_stringbuf_appendcstr(pattern_text, " <ANY>");
+ }
+
+ return apr_psprintf(pool, "list %s r%ld%s%s", log_path, revision,
+ log_depth(depth, pool), pattern_text->data);
+}
Modified: subversion/branches/authzperf/subversion/libsvn_subr/xml.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_subr/xml.c?rev=1772445&r1=1772444&r2=1772445&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_subr/xml.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_subr/xml.c Sat Dec 3 10:09:54 2016
@@ -42,6 +42,14 @@
#include <expat.h>
#endif
+#ifndef XML_VERSION_AT_LEAST
+#define XML_VERSION_AT_LEAST(major,minor,patch) \
+(((major) < XML_MAJOR_VERSION) \
+ || ((major) == XML_MAJOR_VERSION && (minor) < XML_MINOR_VERSION) \
+ || ((major) == XML_MAJOR_VERSION && (minor) == XML_MINOR_VERSION && \
+ (patch) <= XML_MICRO_VERSION))
+#endif /* XML_VERSION_AT_LEAST */
+
#ifdef XML_UNICODE
#error Expat is unusable -- it has been compiled for wide characters
#endif
@@ -345,6 +353,15 @@ static void expat_start_handler(void *us
svn_xml_parser_t *svn_parser = userData;
(*svn_parser->start_handler)(svn_parser->baton, name, atts);
+
+#if XML_VERSION_AT_LEAST(1, 95, 8)
+ /* Stop XML parsing if svn_xml_signal_bailout() was called.
+ We cannot do this in svn_xml_signal_bailout() because Expat
+ documentation states that XML_StopParser() must be called only from
+ callbacks. */
+ if (svn_parser->error)
+ (void) XML_StopParser(svn_parser->parser, 0 /* resumable */);
+#endif
}
static void expat_end_handler(void *userData, const XML_Char *name)
@@ -352,6 +369,15 @@ static void expat_end_handler(void *user
svn_xml_parser_t *svn_parser = userData;
(*svn_parser->end_handler)(svn_parser->baton, name);
+
+#if XML_VERSION_AT_LEAST(1, 95, 8)
+ /* Stop XML parsing if svn_xml_signal_bailout() was called.
+ We cannot do this in svn_xml_signal_bailout() because Expat
+ documentation states that XML_StopParser() must be called only from
+ callbacks. */
+ if (svn_parser->error)
+ (void) XML_StopParser(svn_parser->parser, 0 /* resumable */);
+#endif
}
static void expat_data_handler(void *userData, const XML_Char *s, int len)
@@ -359,11 +385,55 @@ static void expat_data_handler(void *use
svn_xml_parser_t *svn_parser = userData;
(*svn_parser->data_handler)(svn_parser->baton, s, (apr_size_t)len);
+
+#if XML_VERSION_AT_LEAST(1, 95, 8)
+ /* Stop XML parsing if svn_xml_signal_bailout() was called.
+ We cannot do this in svn_xml_signal_bailout() because Expat
+ documentation states that XML_StopParser() must be called only from
+ callbacks. */
+ if (svn_parser->error)
+ (void) XML_StopParser(svn_parser->parser, 0 /* resumable */);
+#endif
}
+#if XML_VERSION_AT_LEAST(1, 95, 8)
+static void expat_entity_declaration(void *userData,
+ const XML_Char *entityName,
+ int is_parameter_entity,
+ const XML_Char *value,
+ int value_length,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId,
+ const XML_Char *notationName)
+{
+ svn_xml_parser_t *svn_parser = userData;
+
+ /* Stop the parser if an entity declaration is hit. */
+ XML_StopParser(svn_parser->parser, 0 /* resumable */);
+}
+#else
+/* A noop default_handler. */
+static void expat_default_handler(void *userData, const XML_Char *s, int len)
+{
+}
+#endif
/*** Making a parser. ***/
+static apr_status_t parser_cleanup(void *data)
+{
+ svn_xml_parser_t *svn_parser = data;
+
+ /* Free Expat parser. */
+ if (svn_parser->parser)
+ {
+ XML_ParserFree(svn_parser->parser);
+ svn_parser->parser = NULL;
+ }
+ return APR_SUCCESS;
+}
+
svn_xml_parser_t *
svn_xml_make_parser(void *baton,
svn_xml_start_elem start_handler,
@@ -372,8 +442,6 @@ svn_xml_make_parser(void *baton,
apr_pool_t *pool)
{
svn_xml_parser_t *svn_parser;
- apr_pool_t *subpool;
-
XML_Parser parser = XML_ParserCreate(NULL);
XML_SetElementHandler(parser,
@@ -382,22 +450,29 @@ svn_xml_make_parser(void *baton,
XML_SetCharacterDataHandler(parser,
data_handler ? expat_data_handler : NULL);
- /* ### we probably don't want this pool; or at least we should pass it
- ### to the callbacks and clear it periodically. */
- subpool = svn_pool_create(pool);
+#if XML_VERSION_AT_LEAST(1, 95, 8)
+ XML_SetEntityDeclHandler(parser, expat_entity_declaration);
+#else
+ XML_SetDefaultHandler(parser, expat_default_handler);
+#endif
- svn_parser = apr_pcalloc(subpool, sizeof(*svn_parser));
+ svn_parser = apr_pcalloc(pool, sizeof(*svn_parser));
svn_parser->parser = parser;
svn_parser->start_handler = start_handler;
svn_parser->end_handler = end_handler;
svn_parser->data_handler = data_handler;
svn_parser->baton = baton;
- svn_parser->pool = subpool;
+ svn_parser->pool = pool;
/* store our parser info as the UserData in the Expat parser */
XML_SetUserData(parser, svn_parser);
+ /* Register pool cleanup handler to free Expat XML parser on cleanup,
+ if svn_xml_free_parser() was not called explicitly. */
+ apr_pool_cleanup_register(svn_parser->pool, svn_parser,
+ parser_cleanup, apr_pool_cleanup_null);
+
return svn_parser;
}
@@ -406,11 +481,7 @@ svn_xml_make_parser(void *baton,
void
svn_xml_free_parser(svn_xml_parser_t *svn_parser)
{
- /* Free the expat parser */
- XML_ParserFree(svn_parser->parser);
-
- /* Free the subversion parser */
- svn_pool_destroy(svn_parser->pool);
+ apr_pool_cleanup_run(svn_parser->pool, svn_parser, parser_cleanup);
}
@@ -428,6 +499,14 @@ svn_xml_parse(svn_xml_parser_t *svn_pars
/* Parse some xml data */
success = XML_Parse(svn_parser->parser, buf, (int) len, is_final);
+ /* Did an error occur somewhere *inside* the expat callbacks? */
+ if (svn_parser->error)
+ {
+ /* Kill all parsers and return the error */
+ svn_xml_free_parser(svn_parser);
+ return svn_parser->error;
+ }
+
/* If expat choked internally, return its error. */
if (! success)
{
@@ -444,14 +523,6 @@ svn_xml_parse(svn_xml_parser_t *svn_pars
return err;
}
- /* Did an error occur somewhere *inside* the expat callbacks? */
- if (svn_parser->error)
- {
- err = svn_parser->error;
- svn_xml_free_parser(svn_parser);
- return err;
- }
-
return SVN_NO_ERROR;
}
@@ -463,7 +534,9 @@ void svn_xml_signal_bailout(svn_error_t
/* This will cause the current XML_Parse() call to finish quickly! */
XML_SetElementHandler(svn_parser->parser, NULL, NULL);
XML_SetCharacterDataHandler(svn_parser->parser, NULL);
-
+#if XML_VERSION_AT_LEAST(1, 95, 8)
+ XML_SetEntityDeclHandler(svn_parser->parser, NULL);
+#endif
/* Once outside of XML_Parse(), the existence of this field will
cause svn_delta_parse()'s main read-loop to return error. */
svn_parser->error = error;
Modified: subversion/branches/authzperf/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_wc/conflicts.c?rev=1772445&r1=1772444&r2=1772445&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_wc/conflicts.c Sat Dec 3 10:09:54 2016
@@ -3704,14 +3704,14 @@ svn_wc__conflict_tree_update_moved_away_
}
svn_error_t *
-svn_wc__conflict_tree_merge_local_changes(svn_wc_context_t *wc_ctx,
- const char *local_abspath,
- const char *dest_abspath,
- svn_cancel_func_t cancel_func,
- void *cancel_baton,
- svn_wc_notify_func2_t notify_func,
- void *notify_baton,
- apr_pool_t *scratch_pool)
+svn_wc__conflict_tree_update_incoming_move(svn_wc_context_t *wc_ctx,
+ const char *local_abspath,
+ const char *dest_abspath,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ svn_wc_notify_func2_t notify_func,
+ void *notify_baton,
+ apr_pool_t *scratch_pool)
{
svn_wc_conflict_reason_t local_change;
svn_wc_conflict_action_t incoming_change;
@@ -3760,13 +3760,12 @@ svn_wc__conflict_tree_merge_local_change
svn_dirent_local_style(local_abspath,
scratch_pool));
- /* Merge local changes. */
- SVN_ERR(svn_wc__db_merge_local_changes(wc_ctx->db, local_abspath,
- dest_abspath, operation,
- incoming_change, local_change,
- cancel_func, cancel_baton,
- notify_func, notify_baton,
- scratch_pool));
+ SVN_ERR(svn_wc__db_update_incoming_move(wc_ctx->db, local_abspath,
+ dest_abspath, operation,
+ incoming_change, local_change,
+ cancel_func, cancel_baton,
+ notify_func, notify_baton,
+ scratch_pool));
SVN_ERR(svn_wc__wq_run(wc_ctx->db, local_abspath, cancel_func, cancel_baton,
scratch_pool));
Modified: subversion/branches/authzperf/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_wc/wc.h?rev=1772445&r1=1772444&r2=1772445&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_wc/wc.h (original)
+++ subversion/branches/authzperf/subversion/libsvn_wc/wc.h Sat Dec 3 10:09:54 2016
@@ -158,6 +158,7 @@ extern "C" {
* Bumped in r1395109.
*
* == 1.8.x shipped with format 31
+ * == 1.9.x shipped with format 31
*
* Please document any further format changes here.
*/
Modified: subversion/branches/authzperf/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_wc/wc_db.h?rev=1772445&r1=1772444&r2=1772445&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/authzperf/subversion/libsvn_wc/wc_db.h Sat Dec 3 10:09:54 2016
@@ -3408,17 +3408,17 @@ svn_wc__db_update_moved_away_conflict_vi
directory at DEST_ABSPATH. This function requires that LOCAL_ABSPATH is
a directory and a tree-conflict victim. DST_ABSPATH must be a directory. */
svn_error_t *
-svn_wc__db_merge_local_changes(svn_wc__db_t *db,
- const char *local_abspath,
- const char *dest_abspath,
- svn_wc_operation_t operation,
- svn_wc_conflict_action_t action,
- svn_wc_conflict_reason_t reason,
- svn_cancel_func_t cancel_func,
- void *cancel_baton,
- svn_wc_notify_func2_t notify_func,
- void *notify_baton,
- apr_pool_t *scratch_pool);
+svn_wc__db_update_incoming_move(svn_wc__db_t *db,
+ const char *local_abspath,
+ const char *dest_abspath,
+ svn_wc_operation_t operation,
+ svn_wc_conflict_action_t action,
+ svn_wc_conflict_reason_t reason,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ svn_wc_notify_func2_t notify_func,
+ void *notify_baton,
+ apr_pool_t *scratch_pool);
/* LOCAL_ABSPATH is moved to MOVE_DST_ABSPATH. MOVE_SRC_ROOT_ABSPATH
* is the root of the move to MOVE_DST_OP_ROOT_ABSPATH.