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 2015/05/18 04:40:53 UTC
svn commit: r1679917 - in /subversion/branches/1.10-cache-improvements: ./
subversion/include/ subversion/include/private/ subversion/libsvn_fs_fs/
subversion/libsvn_fs_x/ subversion/libsvn_subr/ subversion/svnsync/
subversion/tests/cmdline/ subversion...
Author: stefan2
Date: Mon May 18 02:40:52 2015
New Revision: 1679917
URL: http://svn.apache.org/r1679917
Log:
On the 1.10-cache-improvements branch:
Sync with /trunk up to r1679916. Resolve text conflicts in membuffer code
and tree conflicts with deleted pseudo-md5 files.
Modified:
subversion/branches/1.10-cache-improvements/ (props changed)
subversion/branches/1.10-cache-improvements/subversion/include/private/svn_cmdline_private.h
subversion/branches/1.10-cache-improvements/subversion/include/svn_fs.h
subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/fs.c
subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/rep-cache-db.sql
subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/rep-cache.c
subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/rep-cache.h
subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/structure
subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/ (props changed)
subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/fs.c
subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/rep-cache-db.sql
subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/rep-cache.c
subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/rep-cache.h
subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/cache-membuffer.c
subversion/branches/1.10-cache-improvements/subversion/svnsync/svnsync.c
subversion/branches/1.10-cache-improvements/subversion/tests/cmdline/svnmucc_tests.py
subversion/branches/1.10-cache-improvements/subversion/tests/libsvn_fs/fs-test.c
Propchange: subversion/branches/1.10-cache-improvements/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon May 18 02:40:52 2015
@@ -1,6 +1,6 @@
/subversion/branches/1.5.x-r30215:870312
/subversion/branches/1.7.x-fs-verify:1146708,1161180
-/subversion/branches/1.9-cache-improvements:1678990,1679000,1679015,1679022
+/subversion/branches/1.9-cache-improvements:1678948-1679863
/subversion/branches/10Gb:1388102,1388163-1388190,1388195,1388202,1388205,1388211,1388276,1388362,1388375,1388394,1388636,1388639-1388640,1388643-1388644,1388654,1388720,1388789,1388795,1388801,1388805,1388807,1388810,1388816,1389044,1389276,1389289,1389662,1389867,1390017,1390209,1390216,1390407,1390409,1390414,1390419,1390955
/subversion/branches/atomic-revprop:965046-1000689
/subversion/branches/authzperf:1615360
@@ -90,4 +90,4 @@
/subversion/branches/verify-at-commit:1462039-1462408
/subversion/branches/verify-keep-going:1439280-1546110
/subversion/branches/wc-collate-path:1402685-1480384
-/subversion/trunk:1669166-1679137
+/subversion/trunk:1669166-1679916
Modified: subversion/branches/1.10-cache-improvements/subversion/include/private/svn_cmdline_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/include/private/svn_cmdline_private.h?rev=1679917&r1=1679916&r2=1679917&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/include/private/svn_cmdline_private.h (original)
+++ subversion/branches/1.10-cache-improvements/subversion/include/private/svn_cmdline_private.h Mon May 18 02:40:52 2015
@@ -88,7 +88,7 @@ typedef struct svn_cmdline__config_argum
* containing svn_cmdline__config_argument_t* elements, allocating the option
* data in @a pool
*
- * [Since 1.9/1.10:] If the file, section, or option value is not recognized,
+ * [Since 1.9:] If the file, section, or option value is not recognized,
* warn to @c stderr, using @a prefix as in svn_handle_warning2().
*
* @since New in 1.7.
Modified: subversion/branches/1.10-cache-improvements/subversion/include/svn_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/include/svn_fs.h?rev=1679917&r1=1679916&r2=1679917&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/include/svn_fs.h (original)
+++ subversion/branches/1.10-cache-improvements/subversion/include/svn_fs.h Mon May 18 02:40:52 2015
@@ -1425,7 +1425,7 @@ svn_fs_revision_root_revision(svn_fs_roo
* Unicode canonical decomposition and ordering. No directory entry
* may be named '.', '..', or the empty string. Given a directory
* entry name which fails to meet these requirements, a filesystem
- * function returns an SVN_ERR_FS_PATH_SYNTAX error.
+ * function returns an #SVN_ERR_FS_PATH_SYNTAX error.
*
* A directory path is a sequence of zero or more directory entry
* names, separated by slash characters (U+002f), and possibly ending
@@ -1433,7 +1433,7 @@ svn_fs_revision_root_revision(svn_fs_roo
* characters are treated as if they were a single slash. If a path
* ends with a slash, it refers to the same node it would without the
* slash, but that node must be a directory, or else the function
- * returns an SVN_ERR_FS_NOT_DIRECTORY error.
+ * may return an #SVN_ERR_FS_NOT_DIRECTORY error.
*
* A path consisting of the empty string, or a string containing only
* slashes, refers to the root directory.
Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/fs.c?rev=1679917&r1=1679916&r2=1679917&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/fs.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/fs.c Mon May 18 02:40:52 2015
@@ -162,9 +162,11 @@ fs_freeze_body(void *baton,
SVN_ERR(svn_fs_fs__exists_rep_cache(&exists, b->fs, pool));
if (exists)
- SVN_ERR(svn_fs_fs__lock_rep_cache(b->fs, pool));
-
- SVN_ERR(b->freeze_func(b->freeze_baton, pool));
+ SVN_ERR(svn_fs_fs__with_rep_cache_lock(b->fs,
+ b->freeze_func, b->freeze_baton,
+ pool));
+ else
+ SVN_ERR(b->freeze_func(b->freeze_baton, pool));
return SVN_NO_ERROR;
}
Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/rep-cache-db.sql
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/rep-cache-db.sql?rev=1679917&r1=1679916&r2=1679917&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/rep-cache-db.sql (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/rep-cache-db.sql Mon May 18 02:40:52 2015
@@ -63,3 +63,6 @@ WHERE revision > ?1
-- STMT_LOCK_REP
BEGIN TRANSACTION;
INSERT INTO rep_cache VALUES ('dummy', 0, 0, 0, 0)
+
+-- STMT_UNLOCK_REP
+ROLLBACK TRANSACTION;
Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/rep-cache.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/rep-cache.c?rev=1679917&r1=1679916&r2=1679917&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/rep-cache.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/rep-cache.c Mon May 18 02:40:52 2015
@@ -374,9 +374,13 @@ svn_fs_fs__del_rep_reference(svn_fs_t *f
return SVN_NO_ERROR;
}
-svn_error_t *
-svn_fs_fs__lock_rep_cache(svn_fs_t *fs,
- apr_pool_t *pool)
+/* Start a transaction to take an SQLite reserved lock that prevents
+ other writes.
+
+ See unlock_rep_cache(). */
+static svn_error_t *
+lock_rep_cache(svn_fs_t *fs,
+ apr_pool_t *pool)
{
fs_fs_data_t *ffd = fs->fsap_data;
@@ -387,3 +391,31 @@ svn_fs_fs__lock_rep_cache(svn_fs_t *fs,
return SVN_NO_ERROR;
}
+
+/* End the transaction started by lock_rep_cache(). */
+static svn_error_t *
+unlock_rep_cache(svn_fs_t *fs,
+ apr_pool_t *pool)
+{
+ fs_fs_data_t *ffd = fs->fsap_data;
+
+ SVN_ERR_ASSERT(ffd->rep_cache_db); /* was opened by lock_rep_cache() */
+
+ SVN_ERR(svn_sqlite__exec_statements(ffd->rep_cache_db, STMT_UNLOCK_REP));
+
+ return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_fs_fs__with_rep_cache_lock(svn_fs_t *fs,
+ svn_error_t *(*body)(void *,
+ apr_pool_t *),
+ void *baton,
+ apr_pool_t *pool)
+{
+ svn_error_t *err;
+
+ SVN_ERR(lock_rep_cache(fs, pool));
+ err = body(baton, pool);
+ return svn_error_compose_create(err, unlock_rep_cache(fs, pool));
+}
Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/rep-cache.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/rep-cache.h?rev=1679917&r1=1679916&r2=1679917&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/rep-cache.h (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/rep-cache.h Mon May 18 02:40:52 2015
@@ -87,10 +87,14 @@ svn_fs_fs__del_rep_reference(svn_fs_t *f
apr_pool_t *pool);
/* Start a transaction to take an SQLite reserved lock that prevents
- other writes. */
+ other writes, call BODY, end the transaction, and return what BODY returned.
+ */
svn_error_t *
-svn_fs_fs__lock_rep_cache(svn_fs_t *fs,
- apr_pool_t *pool);
+svn_fs_fs__with_rep_cache_lock(svn_fs_t *fs,
+ svn_error_t *(*body)(void *baton,
+ apr_pool_t *pool),
+ void *baton,
+ apr_pool_t *pool);
#ifdef __cplusplus
}
Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/structure
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/structure?rev=1679917&r1=1679916&r2=1679917&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/structure (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/structure Mon May 18 02:40:52 2015
@@ -525,6 +525,7 @@ A revision file contains a concatenation
* Text and property representations
* Node-revisions
* The changed-path data
+ * Two offsets at the very end (physical addressing only)
* Index data (logical addressing only)
* Revision / pack file footer (logical addressing only)
@@ -757,6 +758,9 @@ Format 7 introduces logical addressing t
to be translated / mapped to physical rev / pack file offsets.
These indexes are appended to the respective rev / pack file.
+The indexes map (revision number, item-index) pairs to absolute file offsets
+and absolute file offsets to (revision number, item-index, item metadata).
+
Details of the binary format used by these index files can be
found in structure-indexes.
Propchange: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon May 18 02:40:52 2015
@@ -90,4 +90,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,1653608,
1658482
-/subversion/trunk/subversion/libsvn_fs_x:1414756-1509914,1669166-1679101
+/subversion/trunk/subversion/libsvn_fs_x:1414756-1509914,1669166-1679916
Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/fs.c?rev=1679917&r1=1679916&r2=1679917&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/fs.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/fs.c Mon May 18 02:40:52 2015
@@ -164,9 +164,11 @@ x_freeze_body(void *baton,
SVN_ERR(svn_fs_x__exists_rep_cache(&exists, b->fs, scratch_pool));
if (exists)
- SVN_ERR(svn_fs_x__lock_rep_cache(b->fs, scratch_pool));
-
- SVN_ERR(b->freeze_func(b->freeze_baton, scratch_pool));
+ SVN_ERR(svn_fs_x__with_rep_cache_lock(b->fs,
+ b->freeze_func, b->freeze_baton,
+ scratch_pool));
+ else
+ SVN_ERR(b->freeze_func(b->freeze_baton, scratch_pool));
return SVN_NO_ERROR;
}
Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/rep-cache-db.sql
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/rep-cache-db.sql?rev=1679917&r1=1679916&r2=1679917&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/rep-cache-db.sql (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/rep-cache-db.sql Mon May 18 02:40:52 2015
@@ -65,3 +65,6 @@ WHERE revision > ?1
-- STMT_LOCK_REP
BEGIN TRANSACTION;
INSERT INTO rep_cache VALUES ('dummy', 0, 0, 0, 0)
+
+-- STMT_UNLOCK_REP
+ROLLBACK TRANSACTION;
Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/rep-cache.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/rep-cache.c?rev=1679917&r1=1679916&r2=1679917&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/rep-cache.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/rep-cache.c Mon May 18 02:40:52 2015
@@ -369,16 +369,48 @@ svn_fs_x__del_rep_reference(svn_fs_t *fs
return SVN_NO_ERROR;
}
-svn_error_t *
-svn_fs_x__lock_rep_cache(svn_fs_t *fs,
- apr_pool_t *scratch_pool)
+/* Start a transaction to take an SQLite reserved lock that prevents
+ other writes.
+
+ See unlock_rep_cache(). */
+static svn_error_t *
+lock_rep_cache(svn_fs_t *fs,
+ apr_pool_t *pool)
{
svn_fs_x__data_t *ffd = fs->fsap_data;
if (! ffd->rep_cache_db)
- SVN_ERR(svn_fs_x__open_rep_cache(fs, scratch_pool));
+ SVN_ERR(svn_fs_x__open_rep_cache(fs, pool));
SVN_ERR(svn_sqlite__exec_statements(ffd->rep_cache_db, STMT_LOCK_REP));
return SVN_NO_ERROR;
}
+
+/* End the transaction started by lock_rep_cache(). */
+static svn_error_t *
+unlock_rep_cache(svn_fs_t *fs,
+ apr_pool_t *pool)
+{
+ svn_fs_x__data_t *ffd = fs->fsap_data;
+
+ SVN_ERR_ASSERT(ffd->rep_cache_db); /* was opened by lock_rep_cache() */
+
+ SVN_ERR(svn_sqlite__exec_statements(ffd->rep_cache_db, STMT_UNLOCK_REP));
+
+ return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_fs_x__with_rep_cache_lock(svn_fs_t *fs,
+ svn_error_t *(*body)(void *,
+ apr_pool_t *),
+ void *baton,
+ apr_pool_t *pool)
+{
+ svn_error_t *err;
+
+ SVN_ERR(lock_rep_cache(fs, pool));
+ err = body(baton, pool);
+ return svn_error_compose_create(err, unlock_rep_cache(fs, pool));
+}
Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/rep-cache.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/rep-cache.h?rev=1679917&r1=1679916&r2=1679917&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/rep-cache.h (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/rep-cache.h Mon May 18 02:40:52 2015
@@ -88,12 +88,16 @@ svn_fs_x__del_rep_reference(svn_fs_t *fs
svn_revnum_t youngest,
apr_pool_t *scratch_pool);
+
/* Start a transaction to take an SQLite reserved lock that prevents
- other writes. */
+ other writes, call BODY, end the transaction, and return what BODY returned.
+ */
svn_error_t *
-svn_fs_x__lock_rep_cache(svn_fs_t *fs,
- apr_pool_t *scratch_pool);
-
+svn_fs_x__with_rep_cache_lock(svn_fs_t *fs,
+ svn_error_t *(*body)(void *baton,
+ apr_pool_t *pool),
+ void *baton,
+ apr_pool_t *pool);
#ifdef __cplusplus
}
#endif /* __cplusplus */
Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/cache-membuffer.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/cache-membuffer.c?rev=1679917&r1=1679916&r2=1679917&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/cache-membuffer.c Mon May 18 02:40:52 2015
@@ -1377,6 +1377,10 @@ entry_keys_match(const entry_key_t *lhs,
* new content), an unused entry or a forcibly removed entry (if all
* group entries are currently in use). The entries' hash value will be
* initialized with TO_FIND.
+ *
+ * Note: This function requires the caller to appropriately lock the CACHE.
+ * For FIND_EMPTY==FALSE, a read lock is required, for FIND_EMPTY==TRUE,
+ * the write lock must have been acquired.
*/
static entry_t *
find_entry(svn_membuffer_t *cache,
@@ -2170,7 +2174,7 @@ select_level(svn_membuffer_t *cache,
/* Large but important items go into L2. */
entry_t dummy_entry = { { { 0 } } };
dummy_entry.priority = priority;
- dummy_entry.size = (apr_uint32_t) size;
+ dummy_entry.size = size;
return ensure_data_insertable_l2(cache, &dummy_entry)
? &cache->l2
Modified: subversion/branches/1.10-cache-improvements/subversion/svnsync/svnsync.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/svnsync/svnsync.c?rev=1679917&r1=1679916&r2=1679917&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/svnsync/svnsync.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/svnsync/svnsync.c Mon May 18 02:40:52 2015
@@ -68,7 +68,8 @@ enum svnsync__opt {
svnsync_opt_disable_locking,
svnsync_opt_version,
svnsync_opt_trust_server_cert,
- svnsync_opt_trust_server_cert_failures,
+ svnsync_opt_trust_server_cert_failures_src,
+ svnsync_opt_trust_server_cert_failures_dst,
svnsync_opt_allow_non_empty,
svnsync_opt_steal_lock
};
@@ -79,7 +80,8 @@ enum svnsync__opt {
svnsync_opt_auth_username, \
svnsync_opt_auth_password, \
svnsync_opt_trust_server_cert, \
- svnsync_opt_trust_server_cert_failures, \
+ svnsync_opt_trust_server_cert_failures_src, \
+ svnsync_opt_trust_server_cert_failures_dst, \
svnsync_opt_source_username, \
svnsync_opt_source_password, \
svnsync_opt_sync_username, \
@@ -198,21 +200,35 @@ static const apr_getopt_option_t svnsync
{"trust-server-cert", svnsync_opt_trust_server_cert, 0,
N_("deprecated; same as\n"
" "
- "--trust-server-cert-failures=unknown-ca")},
- {"trust-server-cert-failures", svnsync_opt_trust_server_cert_failures, 1,
- N_("with --non-interactive, accept SSL server\n"
+ "--source-trust-server-cert-failures=unknown-ca\n"
" "
- "certificates with failures; ARG is comma-separated\n"
+ "--sync-trust-server-cert-failures=unknown-ca")},
+ {"source-trust-server-cert-failures", svnsync_opt_trust_server_cert_failures_src, 1,
+ N_("with --non-interactive, accept SSL\n"
" "
- "list of 'unknown-ca' (Unknown Authority),\n"
+ "server certificates with failures.\n"
" "
- "'cn-mismatch' (Hostname mismatch), 'expired'\n"
+ "ARG is a comma-separated list of:\n"
" "
- "(Expired certificate), 'not-yet-valid' (Not yet\n"
+ "- 'unknown-ca' (Unknown Authority)\n"
" "
- "valid certificate) and 'other' (all other not\n"
+ "- 'cn-mismatch' (Hostname mismatch)\n"
" "
- "separately classified certificate errors).")},
+ "- 'expired' (Expired certificate)\n"
+ " "
+ "- 'not-yet-valid' (Not yet valid certificate)\n"
+ " "
+ "- 'other' (all other not separately classified\n"
+ " "
+ " certificate errors).\n"
+ " "
+ "Applied to the source URL.")},
+ {"sync-trust-server-cert-failures", svnsync_opt_trust_server_cert_failures_dst, 1,
+ N_("Like\n"
+ " "
+ "--source-trust-server-cert-failures,\n"
+ " "
+ "but applied to the destination URL.")},
{"source-username", svnsync_opt_source_username, 1,
N_("connect to source repository with username ARG") },
{"source-password", svnsync_opt_source_password, 1,
@@ -266,11 +282,13 @@ static const apr_getopt_option_t svnsync
typedef struct opt_baton_t {
svn_boolean_t non_interactive;
- svn_boolean_t trust_server_cert_unknown_ca;
- svn_boolean_t trust_server_cert_cn_mismatch;
- svn_boolean_t trust_server_cert_expired;
- svn_boolean_t trust_server_cert_not_yet_valid;
- svn_boolean_t trust_server_cert_other_failure;
+ struct {
+ svn_boolean_t trust_server_cert_unknown_ca;
+ svn_boolean_t trust_server_cert_cn_mismatch;
+ svn_boolean_t trust_server_cert_expired;
+ svn_boolean_t trust_server_cert_not_yet_valid;
+ svn_boolean_t trust_server_cert_other_failure;
+ } src_trust, dst_trust;
svn_boolean_t no_auth_cache;
svn_auth_baton_t *source_auth_baton;
svn_auth_baton_t *sync_auth_baton;
@@ -1994,17 +2012,29 @@ sub_main(int *exit_code, int argc, const
break;
case svnsync_opt_trust_server_cert: /* backwards compat */
- opt_baton.trust_server_cert_unknown_ca = TRUE;
+ opt_baton.src_trust.trust_server_cert_unknown_ca = TRUE;
+ opt_baton.dst_trust.trust_server_cert_unknown_ca = TRUE;
+ break;
+
+ case svnsync_opt_trust_server_cert_failures_src:
+ SVN_ERR(svn_utf_cstring_to_utf8(&opt_arg, opt_arg, pool));
+ SVN_ERR(svn_cmdline__parse_trust_options(
+ &opt_baton.src_trust.trust_server_cert_unknown_ca,
+ &opt_baton.src_trust.trust_server_cert_cn_mismatch,
+ &opt_baton.src_trust.trust_server_cert_expired,
+ &opt_baton.src_trust.trust_server_cert_not_yet_valid,
+ &opt_baton.src_trust.trust_server_cert_other_failure,
+ opt_arg, pool));
break;
- case svnsync_opt_trust_server_cert_failures:
+ case svnsync_opt_trust_server_cert_failures_dst:
SVN_ERR(svn_utf_cstring_to_utf8(&opt_arg, opt_arg, pool));
SVN_ERR(svn_cmdline__parse_trust_options(
- &opt_baton.trust_server_cert_unknown_ca,
- &opt_baton.trust_server_cert_cn_mismatch,
- &opt_baton.trust_server_cert_expired,
- &opt_baton.trust_server_cert_not_yet_valid,
- &opt_baton.trust_server_cert_other_failure,
+ &opt_baton.dst_trust.trust_server_cert_unknown_ca,
+ &opt_baton.dst_trust.trust_server_cert_cn_mismatch,
+ &opt_baton.dst_trust.trust_server_cert_expired,
+ &opt_baton.dst_trust.trust_server_cert_not_yet_valid,
+ &opt_baton.dst_trust.trust_server_cert_other_failure,
opt_arg, pool));
break;
@@ -2196,13 +2226,20 @@ sub_main(int *exit_code, int argc, const
/* --trust-* can only be used with --non-interactive */
if (!opt_baton.non_interactive)
{
- if (opt_baton.trust_server_cert_unknown_ca
- || opt_baton.trust_server_cert_cn_mismatch
- || opt_baton.trust_server_cert_expired
- || opt_baton.trust_server_cert_not_yet_valid
- || opt_baton.trust_server_cert_other_failure)
+ if (opt_baton.src_trust.trust_server_cert_unknown_ca
+ || opt_baton.src_trust.trust_server_cert_cn_mismatch
+ || opt_baton.src_trust.trust_server_cert_expired
+ || opt_baton.src_trust.trust_server_cert_not_yet_valid
+ || opt_baton.src_trust.trust_server_cert_other_failure
+ || opt_baton.dst_trust.trust_server_cert_unknown_ca
+ || opt_baton.dst_trust.trust_server_cert_cn_mismatch
+ || opt_baton.dst_trust.trust_server_cert_expired
+ || opt_baton.dst_trust.trust_server_cert_not_yet_valid
+ || opt_baton.dst_trust.trust_server_cert_other_failure)
return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("--trust-server-cert-failures requires "
+ _("--source-trust-server-cert-failures "
+ "and "
+ "--sync-trust-server-cert-failures require "
"--non-interactive"));
}
@@ -2322,11 +2359,11 @@ sub_main(int *exit_code, int argc, const
opt_baton.source_password,
opt_baton.config_dir,
opt_baton.no_auth_cache,
- opt_baton.trust_server_cert_unknown_ca,
- opt_baton.trust_server_cert_cn_mismatch,
- opt_baton.trust_server_cert_expired,
- opt_baton.trust_server_cert_not_yet_valid,
- opt_baton.trust_server_cert_other_failure,
+ opt_baton.src_trust.trust_server_cert_unknown_ca,
+ opt_baton.src_trust.trust_server_cert_cn_mismatch,
+ opt_baton.src_trust.trust_server_cert_expired,
+ opt_baton.src_trust.trust_server_cert_not_yet_valid,
+ opt_baton.src_trust.trust_server_cert_other_failure,
config,
check_cancel, NULL,
pool);
@@ -2338,11 +2375,11 @@ sub_main(int *exit_code, int argc, const
opt_baton.sync_password,
opt_baton.config_dir,
opt_baton.no_auth_cache,
- opt_baton.trust_server_cert_unknown_ca,
- opt_baton.trust_server_cert_cn_mismatch,
- opt_baton.trust_server_cert_expired,
- opt_baton.trust_server_cert_not_yet_valid,
- opt_baton.trust_server_cert_other_failure,
+ opt_baton.dst_trust.trust_server_cert_unknown_ca,
+ opt_baton.dst_trust.trust_server_cert_cn_mismatch,
+ opt_baton.dst_trust.trust_server_cert_expired,
+ opt_baton.dst_trust.trust_server_cert_not_yet_valid,
+ opt_baton.dst_trust.trust_server_cert_other_failure,
config,
check_cancel, NULL,
pool);
Modified: subversion/branches/1.10-cache-improvements/subversion/tests/cmdline/svnmucc_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/tests/cmdline/svnmucc_tests.py?rev=1679917&r1=1679916&r2=1679917&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/tests/cmdline/svnmucc_tests.py (original)
+++ subversion/branches/1.10-cache-improvements/subversion/tests/cmdline/svnmucc_tests.py Mon May 18 02:40:52 2015
@@ -453,47 +453,54 @@ rm A/B/C/Y
'log', '-qvr3', repo_url)
-@XFail()
-@Issue(4579)
-def modify_and_delete_file(sbox):
- "modify and delete file"
+def prohibited_deletes_and_moves(sbox):
+ "test prohibited delete and move operations"
+
+ # These action sequences were allowed in 1.8.13, but are prohibited in 1.9.x
+ # and later. Most of them probably indicate an inadvertent user mistake.
+ # See dev@, 2015-05-11, "Re: Issue 4579 / svnmucc fails to process certain
+ # deletes", <http://svn.haxx.se/dev/archive-2015-05/0038.shtml>
- # This used to fail with:
- # svnmucc: E200009: Can't delete node at 'iota'
sbox.build()
- svntest.main.file_write(sbox.ospath('file'), "New iota")
- test_svnmucc(sbox.repo_url, ['D /iota'],
- '-m', 'r2: modify and delete /iota',
- 'put', sbox.ospath('file'), '/iota',
- 'rm', '/iota')
-
-
-@XFail()
-@Issue(4579)
-def propset_and_delete_file(sbox):
- "propset and delete file"
-
- # This used to fail with:
- # svnmucc: E200009: Can't delete node at 'iota'
- sbox.build(create_wc=False)
- test_svnmucc(sbox.repo_url, ['D /iota'],
- '-m', 'r2: propset and delete /iota',
- 'propset', 'prop', 'val', '/iota',
- 'rm', '/iota')
-
-
-@XFail()
-@Issue(4579)
-def delete_and_delete_file(sbox):
- "delete and delete file"
-
- # This used to fail with:
- # svnmucc: E160013: Can't delete node at 'iota' as it does not exist
- sbox.build(create_wc=False)
- test_svnmucc(sbox.repo_url, ['D /iota'],
- '-m', 'r2: delete and delete /iota',
- 'rm', '/iota',
- 'rm', '/iota')
+ svntest.main.file_write(sbox.ospath('file'), "New contents")
+
+ xtest_svnmucc(sbox.repo_url,
+ ["svnmucc: E200009: Can't delete node at 'iota'",
+ ], #---------
+ '-m', 'r2: modify and delete /iota',
+ 'put', sbox.ospath('file'), 'iota',
+ 'rm', 'iota')
+
+ xtest_svnmucc(sbox.repo_url,
+ ["svnmucc: E200009: Can't delete node at 'iota'",
+ ], #---------
+ '-m', 'r2: propset and delete /iota',
+ 'propset', 'prop', 'val', 'iota',
+ 'rm', 'iota')
+
+ xtest_svnmucc(sbox.repo_url,
+ ["svnmucc: E160013: Can't delete node at 'iota' as it does "
+ "not exist",
+ ], #---------
+ '-m', 'r2: delete and delete /iota',
+ 'rm', 'iota',
+ 'rm', 'iota')
+
+ # Subversion 1.8.13 used to move /iota without applying the text change.
+ xtest_svnmucc(sbox.repo_url,
+ ["svnmucc: E200009: Can't delete node at 'iota'",
+ ], #---------
+ '-m', 'r2: modify and move /iota',
+ 'put', sbox.ospath('file'), 'iota',
+ 'mv', 'iota', 'iota2')
+
+ # Subversion 1.8.13 used to move /A without applying the inner remove.
+ xtest_svnmucc(sbox.repo_url,
+ ["svnmucc: E200009: Can't delete node at 'A'",
+ ], #---------
+ '-m', 'r2: delete /A/B and move /A',
+ 'rm', 'A/B',
+ 'mv', 'A', 'A1')
######################################################################
@@ -505,9 +512,7 @@ test_list = [ None,
too_many_log_messages,
no_log_msg_non_interactive,
nested_replaces,
- modify_and_delete_file,
- propset_and_delete_file,
- delete_and_delete_file,
+ prohibited_deletes_and_moves,
]
if __name__ == '__main__':
Modified: subversion/branches/1.10-cache-improvements/subversion/tests/libsvn_fs/fs-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/tests/libsvn_fs/fs-test.c?rev=1679917&r1=1679916&r2=1679917&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/tests/libsvn_fs/fs-test.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/tests/libsvn_fs/fs-test.c Mon May 18 02:40:52 2015
@@ -6891,6 +6891,71 @@ test_internal_txn_props(const svn_test_o
return SVN_NO_ERROR;
}
+/* A freeze function that expects an 'svn_error_t *' baton, and returns it. */
+/* This function implements svn_fs_freeze_func_t. */
+static svn_error_t *
+freeze_func(void *baton, apr_pool_t *pool)
+{
+ return baton;
+}
+
+static svn_error_t *
+freeze_and_commit(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
+{
+ svn_fs_t *fs;
+ svn_fs_txn_t *txn;
+ svn_fs_root_t *txn_root;
+ svn_revnum_t new_rev = 0;
+ apr_pool_t *subpool = svn_pool_create(pool);
+
+ if (!strcmp(opts->fs_type, "bdb"))
+ return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL,
+ "this will not test BDB repositories");
+
+ SVN_ERR(svn_test__create_fs(&fs, "test-freeze-and-commit", opts, subpool));
+
+ /* This test used to FAIL with an SQLite error since svn_fs_freeze()
+ * wouldn't unlock rep-cache.db. Therefore, part of the role of creating
+ * the Greek tree is to create a rep-cache.db, in order to test that
+ * svn_fs_freeze() unlocks it. */
+
+ /* r1: Commit the Greek tree. */
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, new_rev, subpool));
+ SVN_ERR(svn_fs_txn_root(&txn_root, txn, subpool));
+ SVN_ERR(svn_test__create_greek_tree(txn_root, subpool));
+ SVN_ERR(test_commit_txn(&new_rev, txn, NULL, subpool));
+
+ /* Freeze and unfreeze. */
+ SVN_ERR(svn_fs_freeze(fs, freeze_func, SVN_NO_ERROR, pool));
+
+ /* Freeze again, but have freeze_func fail. */
+ {
+ svn_error_t *err = svn_error_create(APR_EGENERAL, NULL, NULL);
+ SVN_TEST_ASSERT_ERROR(svn_fs_freeze(fs, freeze_func, err, pool),
+ err->apr_err);
+ }
+
+ /* Make some commit using same FS instance. */
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, new_rev, pool));
+ SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
+ SVN_ERR(svn_fs_change_node_prop(txn_root, "/", "temperature",
+ svn_string_create("310.05", pool),
+ pool));
+ SVN_ERR(test_commit_txn(&new_rev, txn, NULL, pool));
+
+ /* Re-open FS and make another commit. */
+ SVN_ERR(svn_fs_open(&fs, "test-freeze-and-commit", NULL, subpool));
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, new_rev, pool));
+ SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
+ SVN_ERR(svn_fs_change_node_prop(txn_root, "/", "temperature",
+ svn_string_create("451", pool),
+ pool));
+ SVN_ERR(test_commit_txn(&new_rev, txn, NULL, pool));
+
+ return SVN_NO_ERROR;
+}
+
/* ------------------------------------------------------------------------ */
/* The test table. */
@@ -7023,6 +7088,8 @@ static struct svn_test_descriptor_t test
"test setting and getting internal txn props"),
SVN_TEST_OPTS_PASS(check_txn_related,
"test svn_fs_check_related for transactions"),
+ SVN_TEST_OPTS_PASS(freeze_and_commit,
+ "freeze and commit"),
SVN_TEST_NULL
};