svn commit: r66017 - /dev/subversion/subversion-1.14.3.zip.asc

2023-12-12 Thread kotkov
Author: kotkov
Date: Tue Dec 12 23:21:45 2023
New Revision: 66017

Log:
Add my signature for 1.14.3 (Windows)

Modified:
dev/subversion/subversion-1.14.3.zip.asc

Modified: dev/subversion/subversion-1.14.3.zip.asc
==
--- dev/subversion/subversion-1.14.3.zip.asc (original)
+++ dev/subversion/subversion-1.14.3.zip.asc Tue Dec 12 23:21:45 2023
@@ -15,3 +15,19 @@ gHmBOpJm8xGwNKnoS4q1/gAo7WWAqS89w1LGfMtZ
 rpgCu5k5MYb5D0G6TBhwfQ==
 =uteY
 -END PGP SIGNATURE-
+-BEGIN PGP SIGNATURE-
+
+iQIcBAABCgAGBQJleOC5AAoJELZP/xIJ+fp0lA4P/0n8OI1XJJykPERwl9znjrsR
+I4YUlL2+N0vfcKVYDplNsmR4O91++DstFsL34tp08tXfZFo69YZyIkDOUdxhCUfv
+VARY6LZ5UPtHfc8Gk1g4/KbHx79eNfASCZfxEoVaamHS6TfnPMMFXmwCuuHmtj0x
+v2MS3qe6Mvef6cu26NdEGPV6pmxXYwsFyae3XCBVRrVxaFOwURlbJHqmIYRSAkGO
+r/K79wxGGNesGmZq5arar1OpYzQuTfW50t69KBdZ2FJYKowE8ljAloRvBIfkAPQs
+WC8JZsAOQShbXqyLSyhH5TN2jgNM38jtle4g5UX/6cIF+8yLtkdn/kjDU2GvDFsw
+zRV2vKxKp5WsbIgpsrbbS/4KsgpCwrU/BWlvGaGpYKtZbOQ7Z2NOPEkJHD9xwIXc
+wkfRG+/C1yqd1tZdkllAAaq20F70nA30nqo2dAnjAKJmhZy6gsPnTHorqr5l3rAw
+NYyOOaW/rUlF5k/bBV72qLS+XQsbSJWjmHKRoYcu06MkEgLIRQSMGT/kpr7W2riX
+uJfJuKbJCrEt6MQo68mjL7tqcqc7d+YkxR5AwSXLR1qUMhxkHgEOR0pwfwms7NuY
+h8/G12elOY/avfI7d/d6JBNsLHg72cqSkuDh2GF9jrykuiHSlVP2olUs5JZ46qhv
+BIF3T1ZI6tNM/HrUk6kr
+=VYVw
+-END PGP SIGNATURE-




svn commit: r1908812 - /subversion/branches/pristine-checksum-salt/BRANCH-README

2023-03-30 Thread kotkov
Author: kotkov
Date: Thu Mar 30 19:04:13 2023
New Revision: 1908812

URL: http://svn.apache.org/viewvc?rev=1908812=rev
Log:
On the 'pristine-checksum-salt' branch: Update BRANCH-README.

* BRANCH-README
  (Dynamically salted SHA-1 checksums): Extend and update this section.

Modified:
subversion/branches/pristine-checksum-salt/BRANCH-README

Modified: subversion/branches/pristine-checksum-salt/BRANCH-README
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-salt/BRANCH-README?rev=1908812=1908811=1908812=diff
==
--- subversion/branches/pristine-checksum-salt/BRANCH-README (original)
+++ subversion/branches/pristine-checksum-salt/BRANCH-README Thu Mar 30 
19:04:13 2023
@@ -13,5 +13,26 @@ as currently implemented, will use the n
 Dynamically salted SHA-1 checksums
 --
 
-The implementation on the branch uses a dynamically salted SHA-1 checksum kind.
-The dynamic salt is generated during the creation of a wc.db.
+The working copy currently relies on an assumption that files with identical
+checksum values have identical content.  For SHA-1, there are publicly known
+checksum collisions [https://shattered.io] and the situation may become worse
+with the feasibility of chosen-prefix attacks [https://sha-mbles.github.io].
+
+To solve the potential problems and to improve the current state around 
checksum
+collisions, the implementation on the branch starts using a dynamically salted
+SHA-1 checksum kind.
+
+The 32-byte random salt is generated during the creation of a wc.db.  When the
+file content is checksummed, the checksum value is calculated as if the salt 
was
+prepended to the content.  In other words, checksum = SHA1(content) becomes
+checksum = SHA1(salt + content).
+
+With the dynamic salt:
+
+- Publicly known SHA-1 collisions no longer result in collisions when 
checksummed
+  by the working copy.  This is because the actually checksummed content now
+  includes the random prefix salt.
+
+- Constructing a chosen-prefix SHA-1 collision no longer results in a collision
+  when checksummed by the working copy.  This is because the constructed 
collision
+  cannot account for the random prefix salt, because it's unknown in advance.




svn commit: r1908641 - /subversion/branches/pristine-checksum-salt/BRANCH-README

2023-03-22 Thread kotkov
Author: kotkov
Date: Wed Mar 22 15:28:17 2023
New Revision: 1908641

URL: http://svn.apache.org/viewvc?rev=1908641=rev
Log:
On the 'pristine-checksum-salt' branch: Update BRANCH-README.

* BRANCH-README: Tweak the section about pristine checksum kinds.
  Add a section about using the dynamically salted SHA-1.

Modified:
subversion/branches/pristine-checksum-salt/BRANCH-README

Modified: subversion/branches/pristine-checksum-salt/BRANCH-README
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-salt/BRANCH-README?rev=1908641=1908640=1908641=diff
==
--- subversion/branches/pristine-checksum-salt/BRANCH-README (original)
+++ subversion/branches/pristine-checksum-salt/BRANCH-README Wed Mar 22 
15:28:17 2023
@@ -2,7 +2,7 @@ Configurable pristine checksum kind in a
 -
 
 The implementation on the branch allows creating working copies that use a
-checksum kind other than SHA-1.
+checksum kind other than plain SHA-1.
 
 The checksum kind is persisted in the settings table.  Upgraded working copies
 of the older formats will have SHA-1 recorded as their pristine checksum kind
@@ -10,9 +10,8 @@ and will continue to use it for compatib
 of the latest format (with --compatible-version=1.15 or --store-pristine=no),
 as currently implemented, will use the new pristine checksum kind.
 
-Currently, as a proof-of-concept, the branch uses salted SHA-1 as the new
-pristine checksum kind.  For the production-ready state, we could support
-using multiple new checksum types such as SHA-256.  That could be useful
-for future compatibility, because if we encounter any issues with one
-checksum kind, we could then switch to a different kind without having
-to change the working copy format.
+Dynamically salted SHA-1 checksums
+--
+
+The implementation on the branch uses a dynamically salted SHA-1 checksum kind.
+The dynamic salt is generated during the creation of a wc.db.




svn commit: r1908640 [2/3] - in /subversion/branches/pristine-checksum-salt/subversion: include/ include/private/ libsvn_client/ libsvn_wc/ svn/ tests/cmdline/svntest/ tests/libsvn_client/ tests/libsv

2023-03-22 Thread kotkov
Modified: subversion/branches/pristine-checksum-salt/subversion/libsvn_wc/util.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-salt/subversion/libsvn_wc/util.c?rev=1908640=1908639=1908640=diff
==
--- subversion/branches/pristine-checksum-salt/subversion/libsvn_wc/util.c 
(original)
+++ subversion/branches/pristine-checksum-salt/subversion/libsvn_wc/util.c Wed 
Mar 22 15:21:11 2023
@@ -481,7 +481,7 @@ svn_wc__fetch_base_func(const char **fil
 apr_pool_t *scratch_pool)
 {
   struct svn_wc__shim_fetch_baton_t *sfb = baton;
-  const svn_checksum_t *checksum;
+  const svn_wc__db_checksum_t *checksum;
   svn_error_t *err;
   const char *local_abspath = svn_dirent_join(sfb->base_abspath, path,
   scratch_pool);

Modified: 
subversion/branches/pristine-checksum-salt/subversion/libsvn_wc/wc-metadata.sql
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-salt/subversion/libsvn_wc/wc-metadata.sql?rev=1908640=1908639=1908640=diff
==
--- 
subversion/branches/pristine-checksum-salt/subversion/libsvn_wc/wc-metadata.sql 
(original)
+++ 
subversion/branches/pristine-checksum-salt/subversion/libsvn_wc/wc-metadata.sql 
Wed Mar 22 15:21:11 2023
@@ -779,16 +779,29 @@ PRAGMA user_version = 32;
 /* - */
 /* Format 33 adds support for configurable pristine checksum kinds with
the following schema changes:
-   - Add the 'pristine_checksum_kind' column to the SETTINGS table. */
+   - Add the 'pristine_checksum_kind' column to the SETTINGS table.
+   - Add the 'pristine_checksum_use_salt' column to the SETTINGS table.
+   - Add the GLOBAL_SETTINGS table. */
 -- STMT_UPGRADE_TO_33
 ALTER TABLE SETTINGS ADD COLUMN pristine_checksum_kind INTEGER;
+ALTER TABLE SETTINGS ADD COLUMN pristine_checksum_use_salt INTEGER;
 
 UPDATE SETTINGS
-SET pristine_checksum_kind = 1 /* svn_wc__db_pristine_checksum_sha1 */
+SET pristine_checksum_kind = 1 /* svn_wc__db_pristine_checksum_sha1 */,
+pristine_checksum_use_salt = 0
 WHERE pristine_checksum_kind IS NULL;
 
+/* This table contains settings specific to the whole database instance. */
+CREATE TABLE GLOBAL_SETTINGS (
+  id  INTEGER NOT NULL PRIMARY KEY CHECK (id = 0),
+  salt  BLOB NOT NULL
+);
+
 PRAGMA user_version = 33;
 
+--STMT_UPGRADE_33_INSERT_GLOBAL_SETTINGS
+INSERT INTO GLOBAL_SETTINGS VALUES (0, ?1);
+
 /* - */
 /* Format 34   */
 

Modified: 
subversion/branches/pristine-checksum-salt/subversion/libsvn_wc/wc-queries.sql
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-salt/subversion/libsvn_wc/wc-queries.sql?rev=1908640=1908639=1908640=diff
==
--- 
subversion/branches/pristine-checksum-salt/subversion/libsvn_wc/wc-queries.sql 
(original)
+++ 
subversion/branches/pristine-checksum-salt/subversion/libsvn_wc/wc-queries.sql 
Wed Mar 22 15:21:11 2023
@@ -1856,12 +1856,21 @@ SELECT pristine.checksum, pristine.hydra
 FROM pristine WHERE refcount = 0
 
 -- STMT_SELECT_SETTINGS
-SELECT store_pristine, pristine_checksum_kind FROM settings WHERE wc_id = ?1
+SELECT store_pristine,
+   pristine_checksum_kind,
+   pristine_checksum_use_salt,
+   (SELECT salt FROM global_settings WHERE id = 0)
+FROM settings WHERE wc_id = ?1
 
 -- STMT_UPSERT_SETTINGS
-INSERT INTO settings (wc_id, store_pristine, pristine_checksum_kind)
-VALUES (?1, ?2, ?3)
-ON CONFLICT(wc_id) DO UPDATE SET store_pristine=?2, pristine_checksum_kind=?3
+INSERT INTO settings (wc_id,
+  store_pristine,
+  pristine_checksum_kind,
+  pristine_checksum_use_salt)
+VALUES (?1, ?2, ?3, ?4)
+ON CONFLICT(wc_id) DO UPDATE SET store_pristine=?2,
+ pristine_checksum_kind=?3,
+ pristine_checksum_use_salt=?4
 
 /* - */
 

Modified: subversion/branches/pristine-checksum-salt/subversion/libsvn_wc/wc.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-salt/subversion/libsvn_wc/wc.h?rev=1908640=1908639=1908640=diff
==
--- subversion/branches/pristine-checksum-salt/subversion/libsvn_wc/wc.h 
(original)
+++ subversion/branches/pristine-checksum-salt/subversion/libsvn_wc/wc.h Wed 
Mar 22 15:21:11 2023
@@ -232,9 +232,8 @@ extern "C" {
 /* Starting from this version, pristine checksum kind can be configured. */
 #define SVN_WC__HAS_PRISTINE_CHECKSUM_KIND 33
 
-/* Starting from this version, salted SHA-1 can be used as the pristine
-   checksum 

svn commit: r1908640 [1/3] - in /subversion/branches/pristine-checksum-salt/subversion: include/ include/private/ libsvn_client/ libsvn_wc/ svn/ tests/cmdline/svntest/ tests/libsvn_client/ tests/libsv

2023-03-22 Thread kotkov
Author: kotkov
Date: Wed Mar 22 15:21:11 2023
New Revision: 1908640

URL: http://svn.apache.org/viewvc?rev=1908640=rev
Log:
On the 'pristine-checksum-salt' branch: Use a dynamically salted SHA-1 checksum
in the working copy.  The dynamic salt is generated during the creation of
the wc.db.

This changeset introduces a couple of new entities: svn_wc_checksum_kind_t
and the more low-level svn_wc__db_checksum_kind_t and svn_wc__db_checksum_t.
They can be viewed as the augmented versions of our existing checksum objects
that also carry the information about a checksum salt.  These new entities are
used as a drop-in replacement for the existing checksum objects on the various
layers of libsvn_wc.  This allows us to transition into a state where the
pristine checksums use a dynamically generated salt.

* subversion/libsvn_wc/wc-metadata.sql
  (STMT_UPGRADE_TO_33): Add the 'pristine_checksum_use_salt' column to the
   SETTINGS table.  Add the GLOBAL_SETTINGS table, currently containing one
   entry with the salt value used for this wc.db.
  (STMT_UPGRADE_33_INSERT_GLOBAL_SETTINGS): New.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_SELECT_SETTINGS): Return the new `pristine_checksum_use_salt` value.
   Return the salt value from GLOBAL_SETTINGS.
  (STMT_UPSERT_SETTINGS): Allow changing the new `pristine_checksum_use_salt`
   value.

* subversion/include/svn_wc.h
  (struct svn_wc_checksum_kind_t,
   svn_wc_checksum_kind_create,
   svn_wc_checksum_kind_dup): New.
  (struct svn_wc_info_t): Use the new checksum kind object to store the
   information about a pristine checksum kind.

* subversion/include/private/svn_wc_private.h
  (svn_wc__get_settings): Use the new checksum kind object to return the
   information about a pristine checksum kind.

* subversion/libsvn_wc/wc_db.h
  (struct svn_wc__db_checksum_kind_t,
   svn_wc__db_checksum_kind_make,
   svn_wc__db_checksum_kind_dup,
   struct svn_wc__db_checksum_t,
   svn_wc__db_checksum_make,
   svn_wc__db_checksum_dup,
   svn_wc__db_checksum_match,
   svn_wc__db_checksum_stream,
   svn_wc__db_checksum_stream_contents): New.
  (svn_wc__db_init,
   svn_wc__db_upgrade_begin): Accept a new `pristine_checksum_use_salt` 
argument.
  (svn_wc__db_get_settings): Use the new checksum kind object to return the
   information about a pristine checksum kind.
  (svn_wc__db_base_add_file,
   svn_wc__db_base_get_info,
   svn_wc__db_pristine_get_future_path,
   svn_wc__db_pristine_read,
   svn_wc__db_pristine_prepare_install,
   svn_wc__db_pristine_install,
   svn_wc__db_pristine_get_md5,
   svn_wc__db_pristine_lookup_by_md5,
   svn_wc__db_pristine_remove,
   svn_wc__db_pristine_check,
   svn_wc__db_pristine_dehydrate,
   svn_wc__db_external_add_file,
   svn_wc__db_commit_queue_add,
   svn_wc__db_op_copy_file,
   svn_wc__db_read_info,
   svn_wc__db_read_pristine_info,
   svn_wc__db_read_node_install_info,
   svn_wc__db_global_commit,
   svn_wc__db_global_update,
   svn_wc__db_textbase_walk_cb_t): Use the new checksum object.
  (svn_wc__db_op_copy): Accept a new optional `new_checksum` argument
   indicating that the target should use the specified checksum.

* subversion/libsvn_wc/wc_db_private.h
  (struct svn_wc__db_wcroot_t): Use the new checkum kind object for a pristine
   checksum kind.
  (enum svn_wc__db_pristine_checksum_kind_t): Remove the no longer required
   `svn_wc__db_pristine_checksum_sha1_salted` value.
  (svn_wc__db_pdh_create_wcroot): Use the new checksum kind object.
  (svn_wc__db_util_read_settings,
   svn_wc__db_util_column_wc_checksum,
   svn_wc__db_util_bind_wc_checksum): New.
  (svn_wc__db_read_info_internal,
   svn_wc__db_base_get_info_internal,
   svn_wc__db_depth_get_info,
   svn_wc__db_pristine_prepare_install_internal,
   svn_wc__db_pristine_dehydrate_internal): Use the new checksum object.

* subversion/libsvn_wc/wc.h
  (SVN_WC__HAS_PRISTINE_CHECKSUM_SHA1_SALTED): Remove.
  (SVN_WC__HAS_PRISTINE_CHECKSUM_SALT): New.
  (svn_wc__perform_file_merge,
   svn_wc__internal_transmit_text_deltas): Use the new checksum object.

* subversion/libsvn_wc/textbase.h
  (svn_wc__textbase_get_contents,
   svn_wc__textbase_setaside,
   svn_wc__textbase_setaside_wq,
   svn_wc__textbase_prepare_install): Use the new checksum object.

* subversion/libsvn_wc/adm_crawler.c
  (maybe_restore_node, svn_wc_restore2, svn_wc__internal_transmit_text_deltas):
   Use the new checksum object.
  (read_and_checksum_pristine_text): Use the new checksum object.  Adjust the
   MD5 checksum lookup.
  (svn_wc_transmit_text_deltas4): Convert between the new and old checksum
   objects.

* subversion/libsvn_wc/adm_files.c
  (init_adm): Accept a new `pristine_checksum_use_salt` argument.
  (svn_wc__internal_ensure_adm): Determine appropriate checksum salt settings.
   Adjust call to svn_wc__db_get_settings().

* subversion/libsvn_wc/adm_ops.c
  (): Include svn_string_private.h.
  (svn_wc_queue_committed4): Convert between the new and old checksum objects.
  (svn_wc_process_committed_queue2): Use

svn commit: r1908640 [3/3] - in /subversion/branches/pristine-checksum-salt/subversion: include/ include/private/ libsvn_client/ libsvn_wc/ svn/ tests/cmdline/svntest/ tests/libsvn_client/ tests/libsv

2023-03-22 Thread kotkov
Modified: 
subversion/branches/pristine-checksum-salt/subversion/libsvn_wc/wc_db_update_move.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-salt/subversion/libsvn_wc/wc_db_update_move.c?rev=1908640=1908639=1908640=diff
==
--- 
subversion/branches/pristine-checksum-salt/subversion/libsvn_wc/wc_db_update_move.c
 (original)
+++ 
subversion/branches/pristine-checksum-salt/subversion/libsvn_wc/wc_db_update_move.c
 Wed Mar 22 15:21:11 2023
@@ -909,7 +909,7 @@ static svn_error_t *
 tc_editor_add_file(node_move_baton_t *nmb,
const char *relpath,
svn_node_kind_t old_kind,
-   const svn_checksum_t *checksum,
+   const svn_wc__db_checksum_t *checksum,
apr_hash_t *props,
apr_pool_t *scratch_pool)
 {
@@ -1010,7 +1010,7 @@ static svn_error_t *
 tc_editor_incoming_add_file(node_move_baton_t *nmb,
 const char *dst_relpath,
 svn_node_kind_t old_kind,
-const svn_checksum_t *checksum,
+const svn_wc__db_checksum_t *checksum,
 apr_hash_t *props,
 const char *src_relpath,
 const char *content_abspath,
@@ -1090,7 +1090,7 @@ typedef struct working_node_version_t
 {
   svn_wc_conflict_version_t *location_and_kind;
   apr_hash_t *props;
-  const svn_checksum_t *checksum; /* for files only */
+  const svn_wc__db_checksum_t *checksum; /* for files only */
 } working_node_version_t;
 
 /* Return *WORK_ITEMS to create a conflict on LOCAL_ABSPATH. */
@@ -1320,8 +1320,8 @@ tc_editor_alter_directory(node_move_bato
 static svn_error_t *
 tc_editor_alter_file(node_move_baton_t *nmb,
  const char *dst_relpath,
- const svn_checksum_t *old_checksum,
- const svn_checksum_t *new_checksum,
+ const svn_wc__db_checksum_t *old_checksum,
+ const svn_wc__db_checksum_t *new_checksum,
  apr_hash_t *old_props,
  apr_hash_t *new_props,
  apr_pool_t *scratch_pool)
@@ -1373,7 +1373,7 @@ tc_editor_alter_file(node_move_baton_t *
scratch_pool, scratch_pool));
 
   if (!obstructed
-  && !svn_checksum_match(new_version.checksum, old_version.checksum))
+  && !svn_wc__db_checksum_match(new_version.checksum, 
old_version.checksum))
 {
   svn_boolean_t is_locally_modified;
 
@@ -1497,8 +1497,8 @@ static svn_error_t *
 tc_editor_update_incoming_moved_file(node_move_baton_t *nmb,
  const char *dst_relpath,
  const char *src_relpath,
- const svn_checksum_t *src_checksum,
- const svn_checksum_t *dst_checksum,
+ const svn_wc__db_checksum_t *src_checksum,
+ const svn_wc__db_checksum_t *dst_checksum,
  apr_hash_t *dst_props,
  apr_hash_t *src_props,
  svn_boolean_t do_text_merge,
@@ -1952,7 +1952,7 @@ tc_incoming_editor_delete(node_move_bato
than a hash, to allow the driver to process children in a defined order. */
 static svn_error_t *
 get_info(apr_hash_t **props,
- const svn_checksum_t **checksum,
+ const svn_wc__db_checksum_t **checksum,
  apr_array_header_t **children,
  svn_node_kind_t *kind,
  const char *local_relpath,
@@ -2059,7 +2059,7 @@ update_moved_away_node(node_move_baton_t
 {
   update_move_baton_t *b = nmb->umb;
   svn_node_kind_t src_kind, dst_kind;
-  const svn_checksum_t *src_checksum, *dst_checksum;
+  const svn_wc__db_checksum_t *src_checksum, *dst_checksum;
   apr_hash_t *src_props, *dst_props;
   apr_array_header_t *src_children, *dst_children;
 
@@ -2105,7 +2105,7 @@ update_moved_away_node(node_move_baton_t
 
   if (src_kind == svn_node_file || src_kind == svn_node_symlink)
 {
-  if (!props_equal || !svn_checksum_match(src_checksum, dst_checksum))
+  if (!props_equal || !svn_wc__db_checksum_match(src_checksum, 
dst_checksum))
 SVN_ERR(tc_editor_alter_file(nmb, dst_relpath,
  dst_checksum, src_checksum,
  dst_props, src_props, scratch_pool));
@@ -2434,7 +2434,7 @@ svn_wc__db_update_moved_away_conflict_vi
 
 static svn_error_t *
 get_working_info(apr_hash_t **props,
- const svn_checksum_t **checksum,
+ const svn_wc__db_checksum_t **checksum,
  apr_array_header_t **children,
  svn_node_kind_t *kind,
 

svn commit: r1908639 - in /subversion/branches/pristine-checksum-salt/subversion: include/ libsvn_delta/ libsvn_fs_base/ libsvn_fs_fs/ libsvn_fs_x/ libsvn_ra_svn/ libsvn_subr/

2023-03-22 Thread kotkov
Author: kotkov
Date: Wed Mar 22 15:17:31 2023
New Revision: 1908639

URL: http://svn.apache.org/viewvc?rev=1908639=rev
Log:
On the 'pristine-checksum-salt' branch: Lay some groundwork for using a
dynamically salted checksum in a working copy by allowing to create a
checksum context with a specified salt value.

* subversion/include/svn_checksum.h
  (): Include svn_string.h
  (svn_checksum_ctx_create2): New function, accepting a new `salt` argument.
   Revved from …
  (svn_checksum_ctx_create): …this function.
  (svn_checksum_ctx_reset): Update docstring.

* subversion/libsvn_subr/checksum.c
  (struct svn_checksum_ctx_t): Add new `salt` field.
  (svn_checksum_ctx_create2): New.
  (svn_checksum_ctx_reset): Update implementation.
  (wrap_write_stream): Call the new function.
  (svn_checksum_ctx_create): Implement with a call to the new function. Move …

* subversion/libsvn_subr/deprecated.c
  (svn_checksum_ctx_create): …here.

* subversion/libsvn_subr/stream.c,
  subversion/libsvn_delta/text_delta.c,
  subversion/libsvn_fs_base/reps-strings.c,
  subversion/libsvn_fs_fs/cached_data.c,
  subversion/libsvn_fs_fs/index.c,
  subversion/libsvn_fs_fs/transaction.c,
  subversion/libsvn_fs_fs/verify.c,
  subversion/libsvn_fs_x/cached_data.c,
  subversion/libsvn_fs_x/index.c,
  subversion/libsvn_fs_x/transaction.c,
  subversion/libsvn_fs_x/verify.c,
  subversion/libsvn_ra_svn/client.c:

  Update all calls to the now deprecated svn_checksum_ctx_create(): call
  svn_checksum_ctx_create2() with a NULL salt.

Modified:
subversion/branches/pristine-checksum-salt/subversion/include/svn_checksum.h

subversion/branches/pristine-checksum-salt/subversion/libsvn_delta/text_delta.c

subversion/branches/pristine-checksum-salt/subversion/libsvn_fs_base/reps-strings.c

subversion/branches/pristine-checksum-salt/subversion/libsvn_fs_fs/cached_data.c
subversion/branches/pristine-checksum-salt/subversion/libsvn_fs_fs/index.c

subversion/branches/pristine-checksum-salt/subversion/libsvn_fs_fs/transaction.c
subversion/branches/pristine-checksum-salt/subversion/libsvn_fs_fs/verify.c

subversion/branches/pristine-checksum-salt/subversion/libsvn_fs_x/cached_data.c
subversion/branches/pristine-checksum-salt/subversion/libsvn_fs_x/index.c

subversion/branches/pristine-checksum-salt/subversion/libsvn_fs_x/transaction.c
subversion/branches/pristine-checksum-salt/subversion/libsvn_fs_x/verify.c
subversion/branches/pristine-checksum-salt/subversion/libsvn_ra_svn/client.c
subversion/branches/pristine-checksum-salt/subversion/libsvn_subr/checksum.c

subversion/branches/pristine-checksum-salt/subversion/libsvn_subr/deprecated.c
subversion/branches/pristine-checksum-salt/subversion/libsvn_subr/stream.c

Modified: 
subversion/branches/pristine-checksum-salt/subversion/include/svn_checksum.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-salt/subversion/include/svn_checksum.h?rev=1908639=1908638=1908639=diff
==
--- 
subversion/branches/pristine-checksum-salt/subversion/include/svn_checksum.h 
(original)
+++ 
subversion/branches/pristine-checksum-salt/subversion/include/svn_checksum.h 
Wed Mar 22 15:17:31 2023
@@ -31,6 +31,7 @@
 #include   /* for apr_pool_t */
 
 #include "svn_types.h"  /* for svn_boolean_t, svn_error_t */
+#include "svn_string.h" /* for svn_string_t */
 
 #ifdef __cplusplus
 extern "C" {
@@ -214,17 +215,33 @@ svn_checksum_empty_checksum(svn_checksum
 
 /**
  * Create a new @c svn_checksum_ctx_t structure, allocated from @a pool for
- * calculating checksums of type @a kind.  @see svn_checksum_final()
+ * calculating checksums of type @a kind.  If @a salt is non-NULL, its content
+ * will be prepended to the checksummed data.  @a salt doesn't need to have a
+ * specific lifetime, because it will be copied by the function internally.
+ *
+ * @see svn_checksum_final()
+ *
+ * @since New in 1.15.
+ */
+svn_checksum_ctx_t *
+svn_checksum_ctx_create2(svn_checksum_kind_t kind,
+ const svn_string_t *salt,
+ apr_pool_t *pool);
+
+/**
+ * Similar to svn_checksum_ctx_create2(), but with @a salt set to @c NULL.
  *
  * @since New in 1.6.
+ * @deprecated Provided for backward compatibility with the 1.6 API.
  */
+SVN_DEPRECATED
 svn_checksum_ctx_t *
 svn_checksum_ctx_create(svn_checksum_kind_t kind,
 apr_pool_t *pool);
 
 /**
  * Reset an existing checksum @a ctx to initial state.
- * @see svn_checksum_ctx_create()
+ * @see svn_checksum_ctx_create2()
  *
  * @since New in 1.10.
  */

Modified: 
subversion/branches/pristine-checksum-salt/subversion/libsvn_delta/text_delta.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-salt/subversion/libsvn_delta/text_delta.c?rev=1908639=1908638=1908639=diff

svn commit: r1908638 - in /subversion/branches/pristine-checksum-salt/subversion: include/svn_checksum.h libsvn_subr/checksum.c tests/libsvn_subr/checksum-test.c

2023-03-22 Thread kotkov
Author: kotkov
Date: Wed Mar 22 15:10:28 2023
New Revision: 1908638

URL: http://svn.apache.org/viewvc?rev=1908638=rev
Log:
On the 'pristine-checksum-salt' branch: Revert r1906820 that introduced
a new statically salted checksum type, `svn_checksum_sha1_salted`.

I'll try to implement and use a checksum with a dynamically added salt,
which requires going in a slightly different direction than adding a new
svn_checksum_kind_t type.

Modified:
subversion/branches/pristine-checksum-salt/subversion/include/svn_checksum.h
subversion/branches/pristine-checksum-salt/subversion/libsvn_subr/checksum.c

subversion/branches/pristine-checksum-salt/subversion/tests/libsvn_subr/checksum-test.c

Modified: 
subversion/branches/pristine-checksum-salt/subversion/include/svn_checksum.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-salt/subversion/include/svn_checksum.h?rev=1908638=1908637=1908638=diff
==
--- 
subversion/branches/pristine-checksum-salt/subversion/include/svn_checksum.h 
(original)
+++ 
subversion/branches/pristine-checksum-salt/subversion/include/svn_checksum.h 
Wed Mar 22 15:10:28 2023
@@ -58,11 +58,7 @@ typedef enum svn_checksum_kind_t
   /** The checksum is (or should be set to) a modified FNV-1a 32 bit,
* in big endian byte order.
* @since New in 1.9. */
-  svn_checksum_fnv1a_32x4,
-
-  /** The checksum is (or should be set to) a salted SHA1 checksum.
-   * @since New in 1.15. */
-  svn_checksum_sha1_salted
+  svn_checksum_fnv1a_32x4
 } svn_checksum_kind_t;
 
 /**

Modified: 
subversion/branches/pristine-checksum-salt/subversion/libsvn_subr/checksum.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-salt/subversion/libsvn_subr/checksum.c?rev=1908638=1908637=1908638=diff
==
--- 
subversion/branches/pristine-checksum-salt/subversion/libsvn_subr/checksum.c 
(original)
+++ 
subversion/branches/pristine-checksum-salt/subversion/libsvn_subr/checksum.c 
Wed Mar 22 15:10:28 2023
@@ -64,19 +64,12 @@ static const unsigned char fnv1a_32x4_em
   0xcd, 0x6d, 0x9a, 0x85
 };
 
-/* The salted-SHA1 digest for the empty string. */
-static const unsigned char sha1_salted_empty_string_digest_array[] = {
-  0x1f, 0x5d, 0xae, 0x8c, 0x03, 0xf9, 0x6f, 0x6c, 0xc4, 0xd1,
-  0x5c, 0xcc, 0x52, 0x7d, 0xf2, 0xf9, 0x14, 0xa4, 0x33, 0xbb
-};
-
 /* Digests for an empty string, indexed by checksum type */
 static const unsigned char * empty_string_digests[] = {
   md5_empty_string_digest_array,
   sha1_empty_string_digest_array,
   fnv1a_32_empty_string_digest_array,
-  fnv1a_32x4_empty_string_digest_array,
-  sha1_salted_empty_string_digest_array
+  fnv1a_32x4_empty_string_digest_array
 };
 
 /* Digest sizes in bytes, indexed by checksum type */
@@ -84,8 +77,7 @@ static const apr_size_t digest_sizes[] =
   APR_MD5_DIGESTSIZE,
   APR_SHA1_DIGESTSIZE,
   sizeof(apr_uint32_t),
-  sizeof(apr_uint32_t),
-  APR_SHA1_DIGESTSIZE
+  sizeof(apr_uint32_t)
 };
 
 /* Checksum type prefixes used in serialized checksums. */
@@ -94,25 +86,16 @@ static const char *ckind_str[] = {
   "$sha1$",
   "$fnv1$",
   "$fnvm$",
-  "$ssh1$",
   /* ### svn_checksum_deserialize() assumes all these have the same strlen() */
 };
 
 /* Returns the digest size of it's argument. */
 #define DIGESTSIZE(k) \
-  (((k) < svn_checksum_md5 || (k) > svn_checksum_sha1_salted) ? 0 : 
digest_sizes[k])
+  (((k) < svn_checksum_md5 || (k) > svn_checksum_fnv1a_32x4) ? 0 : 
digest_sizes[k])
 
 /* Largest supported digest size */
 #define MAX_DIGESTSIZE (MAX(APR_MD5_DIGESTSIZE,APR_SHA1_DIGESTSIZE))
 
-/* The salt we use for salted-SHA1 checksum. */
-static const unsigned char sha1_salt[] = {
-  0x2e, 0x95, 0x1d, 0xb1, 0xd7, 0x11, 0xa0, 0x77,
-  0xe7, 0x22, 0xbc, 0x1d, 0xc0, 0x93, 0x1f, 0x63,
-  0x24, 0xee, 0x28, 0x3b, 0x6d, 0x3f, 0x08, 0x33,
-  0x57, 0x50, 0xfb, 0x80, 0xd3, 0xa2, 0x03, 0xf4
-};
-
 const unsigned char *
 svn__empty_string_digest(svn_checksum_kind_t kind)
 {
@@ -170,7 +153,7 @@ svn__digests_match(const unsigned char d
 static svn_error_t *
 validate_kind(svn_checksum_kind_t kind)
 {
-  if (kind >= svn_checksum_md5 && kind <= svn_checksum_sha1_salted)
+  if (kind >= svn_checksum_md5 && kind <= svn_checksum_fnv1a_32x4)
 return SVN_NO_ERROR;
   else
 return svn_error_create(SVN_ERR_BAD_CHECKSUM_KIND, NULL, NULL);
@@ -219,7 +202,6 @@ svn_checksum_create(svn_checksum_kind_t
   case svn_checksum_sha1:
   case svn_checksum_fnv1a_32:
   case svn_checksum_fnv1a_32x4:
-  case svn_checksum_sha1_salted:
 digest_size = digest_sizes[kind];
 break;
 
@@ -285,7 +267,6 @@ svn_checksum_match(const svn_checksum_t
   case svn_checksum_sha1:
   case svn_checksum_fnv1a_32:
   case svn_checksum_fnv1a_32x4:
-  cas

svn commit: r1908637 - /subversion/branches/pristine-checksum-salt/

2023-03-22 Thread kotkov
Author: kotkov
Date: Wed Mar 22 15:09:04 2023
New Revision: 1908637

URL: http://svn.apache.org/viewvc?rev=1908637=rev
Log:
Create the pristine-checksum-salt branch from the current state of
^/subversion/branches/pristine-checksum-kind.

Added:
subversion/branches/pristine-checksum-salt/   (props changed)
  - copied from r1908636, subversion/branches/pristine-checksum-kind/

Propchange: subversion/branches/pristine-checksum-salt/
--
--- svn:auto-props (added)
+++ svn:auto-props Wed Mar 22 15:09:04 2023
@@ -0,0 +1,14 @@
+*.c = svn:eol-style=native
+*.cpp = svn:eol-style=native
+*.h = svn:eol-style=native
+*.hpp = svn:eol-style=native
+*.java = svn:eol-style=native
+*.m4 = svn:eol-style=native
+*.py = svn:eol-style=native
+*.pl = svn:eol-style=native
+*.rb = svn:eol-style=native
+*.sql = svn:eol-style=native
+*.txt = svn:eol-style=native
+README = svn:eol-style=native
+BRANCH-README = svn:eol-style=native
+STATUS = svn:eol-style=native

Propchange: subversion/branches/pristine-checksum-salt/
--
--- svn:ignore (added)
+++ svn:ignore Wed Mar 22 15:09:04 2023
@@ -0,0 +1,65 @@
+ChangeLog*
+Makefile
+config.cache
+config.log
+config.nice
+config.status
+configure
+libtool
+.gdb_history
+.swig_checked
+*.orig
+*.rej
+TAGS
+tags
+neon
+build-outputs.mk
+aclocal.m4
+autogen-standalone.mk
+autom4te.cache
+gen-make.opts
+tests.log*
+fails.log*
+db4-win32
+db
+*.o
+*~
+.*~
+apr
+apr-util
+apr-iconv
+Release
+release_win32
+release_win32_static
+release_x64
+Debug
+debug_win32
+debug_win32_static
+debug_x64
+ipch
+subversion_msvc.dsw
+subversion_msvc.ncb
+subversion_msvc.opt
+subversion_msvc.plg
+subversion_vcnet.*
+mkmf.log
+.project
+.classpath
+.cdtproject
+.settings
+.cproject
+py3c
+zlib
+sqlite-amalgamation
+serf
+googlemock
+.git
+.gitignore
+.idea
+compile_commands.json
+.kdev4
+*.kdev4
+.vs
+.swig_pl_checked
+.swig_py_checked
+.swig_rb_checked

Propchange: subversion/branches/pristine-checksum-salt/
--
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed Mar 22 15:09:04 2023
@@ -0,0 +1,114 @@
+/subversion/branches/1.10-cache-improvements:1669168-1694487
+/subversion/branches/1.11.x:1841316,1841548
+/subversion/branches/1.5.x-r30215:870312
+/subversion/branches/1.7.x-fs-verify:1146708,1161180
+/subversion/branches/1.9-cache-improvements:1678948-1679863
+/subversion/branches/1.9.x:1735680
+/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:1613053-1776831
+/subversion/branches/auto-props-sdc:1384106-1401643
+/subversion/branches/bdb-reverse-deltas:872050-872529
+/subversion/branches/better-pristines:1807118-1843075
+/subversion/branches/cache-server:1458643-1476567
+/subversion/branches/decouple-shelving-cli:1874630-1875035
+/subversion/branches/diff-callbacks3:870059-870761
+/subversion/branches/diff-optimizations:1031270-1037352
+/subversion/branches/diff-optimizations-bytes:1037353-1067789
+/subversion/branches/dont-save-plaintext-passwords-by-default:870728-871118
+/subversion/branches/double-delete:870511-872970
+/subversion/branches/dump-load-cross-check:1654853-1657295
+/subversion/branches/ev2-export:1325914,1332738,1413107
+/subversion/branches/explore-wc:875486,875493,875497,875507,875511,875514,875559,875580-875581,875584,875587,875611,875627,875647,875667-875668,875711-875712,875733-875734,875736,875744-875748,875751,875758,875782,875795-875796,875830,875836,875838,875842,875852,875855,875864,875870,875873,875880,875885-875888,875890,875897-875898,875905,875907-875909,875935,875943-875944,875946,875979,875982-875983,875985-875986,875990,875997
+/subversion/branches/file-externals:871779-873302
+/subversion/branches/fs-rep-sharing:869036-873803
+/subversion/branches/fsfs-format7:1426304,1430673,1433848,1438408,1438982,1441129,1442051,1442068,1442504,1442910,1443171,1443803,1444690,1444693,1444695,1445040,1445080,1446103,1451129,1453590,1454307,1460579,1461851,1461865,1462837,1462904,1463120,1467362,1467382,1469487,1471208,1477166,1478055,1481447,1489817,1489949,1490673-1490674,1491784,1493042,1498029,1498103,1498155,1500054,1507729-1507731,1507735-1507736
+/subversion/branches/fsfs-improvements:1499981-1547039
+/subversion/branches/fsfs-lock-many:1571740-1577217
+/subversion/branches/fsfs-pack:873717-874575
+/subversion/branches/fsx:1507845-1509914
+/subversion/branches/fsx-1.10:1658219-1694500
+/subversion/branches/fsx-id:1645603-1649011
+/subversion/branches/gnome-keyring:870558-871410
+/subversion/branches/gpg-agent

svn commit: r1908636 [2/2] - in /subversion/branches/pristine-checksum-kind: ./ build/ build/ac-macros/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_fs_f

2023-03-22 Thread kotkov
Modified: 
subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/store_pristine_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/store_pristine_tests.py?rev=1908636=1908635=1908636=diff
==
--- 
subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/store_pristine_tests.py
 (original)
+++ 
subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/store_pristine_tests.py
 Wed Mar 22 15:08:00 2023
@@ -59,7 +59,6 @@ def simple_checkout_with_pristine(sbox):
 'info', '--show-item=store-pristine', '--no-newline',
 sbox.wc_dir)
 
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
 def simple_checkout_without_pristine(sbox):
   "simple checkout without pristine"
 
@@ -108,7 +107,6 @@ def simple_commit_with_pristine(sbox):
 expected_output,
 expected_status)
 
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
 def simple_commit_without_pristine(sbox):
   "simple commit without pristine"
 
@@ -181,7 +179,6 @@ def simple_update_with_pristine(sbox):
 [], False,
 '-r1', sbox.wc_dir)
 
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
 def simple_update_without_pristine(sbox):
   "simple update without pristine"
 
@@ -278,7 +275,6 @@ def simple_status_with_pristine(sbox):
   svntest.actions.run_and_verify_status(sbox.wc_dir,
 expected_status)
 
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
 def simple_status_without_pristine(sbox):
   "simple status without pristine"
 
@@ -366,7 +362,6 @@ def simple_diff_with_pristine(sbox):
   svntest.actions.run_and_verify_svn(diff_output, [],
  'diff', sbox.ospath('file'))
 
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
 def simple_diff_without_pristine(sbox):
   "simple diff without pristine"
 
@@ -431,7 +426,6 @@ def simple_revert_with_pristine(sbox):
   svntest.actions.run_and_verify_status(sbox.wc_dir,
 expected_status)
 
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
 def simple_revert_without_pristine(sbox):
   "simple revert without pristine"
 
@@ -508,7 +502,6 @@ def update_modified_file_with_pristine(s
 expected_disk,
 expected_status)
 
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
 def update_modified_file_without_pristine(sbox):
   "update locally modified file without pristine"
 
@@ -586,7 +579,6 @@ def simple_copy_with_pristine(sbox):
   svntest.actions.run_and_verify_status(sbox.wc_dir,
 expected_status)
 
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
 def simple_copy_without_pristine(sbox):
   "simple copy without pristine"
 
@@ -655,7 +647,6 @@ def copy_modified_file_with_pristine(sbo
   svntest.actions.run_and_verify_status(sbox.wc_dir,
 expected_status)
 
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
 def copy_modified_file_without_pristine(sbox):
   "copy locally modified file without pristine"
 
@@ -724,7 +715,6 @@ def simple_move_with_pristine(sbox):
   svntest.actions.run_and_verify_status(sbox.wc_dir,
 expected_status)
 
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
 def simple_move_without_pristine(sbox):
   "simple move without pristine"
 
@@ -793,7 +783,6 @@ def move_modified_file_with_pristine(sbo
   svntest.actions.run_and_verify_status(sbox.wc_dir,
 expected_status)
 
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
 def move_modified_file_without_pristine(sbox):
   "move locally modified file without pristine"
 
@@ -829,7 +818,6 @@ def move_modified_file_without_pristine(
   svntest.actions.run_and_verify_status(sbox.wc_dir,
 expected_status)
 
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
 def checkout_incompatible_setting(sbox):
   "checkout with incompatible pristine setting"
 
@@ -862,6 +850,100 @@ def checkout_incompatible_setting(sbox):
 'info', '--show-item=store-pristine', '--no-newline',
 sbox.wc_dir)
 
+def copy_cross_wc_without_src_pristine(sbox):
+  "cross-wc copy without src pristine"
+
+  sbox.build(empty=True, create_wc=False)
+
+  expected_output = svntest.wc.State(sbox.wc_dir, {})
+  expected_wc = svntest.wc.State('', {})
+  svntest.actions.run_and_verify_checkout(sbox.repo_url,
+  sbox.wc_dir,
+  expected_output,
+  expected_wc,
+  

svn commit: r1908636 [1/2] - in /subversion/branches/pristine-checksum-kind: ./ build/ build/ac-macros/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_fs_f

2023-03-22 Thread kotkov
Author: kotkov
Date: Wed Mar 22 15:08:00 2023
New Revision: 1908636

URL: http://svn.apache.org/viewvc?rev=1908636=rev
Log:
On the 'pristine-checksum-kind' branch: Sync with trunk@1908635.

Modified:
subversion/branches/pristine-checksum-kind/   (props changed)
subversion/branches/pristine-checksum-kind/Makefile.in
subversion/branches/pristine-checksum-kind/build.conf
subversion/branches/pristine-checksum-kind/build/ac-macros/apr_memcache.m4
subversion/branches/pristine-checksum-kind/build/ac-macros/serf.m4
subversion/branches/pristine-checksum-kind/build/ac-macros/svn-macros.m4
subversion/branches/pristine-checksum-kind/build/run_tests.py
subversion/branches/pristine-checksum-kind/configure.ac

subversion/branches/pristine-checksum-kind/subversion/include/private/svn_wc_private.h
subversion/branches/pristine-checksum-kind/subversion/include/svn_client.h
subversion/branches/pristine-checksum-kind/subversion/include/svn_config.h

subversion/branches/pristine-checksum-kind/subversion/libsvn_client/checkout.c
subversion/branches/pristine-checksum-kind/subversion/libsvn_client/client.h
subversion/branches/pristine-checksum-kind/subversion/libsvn_client/copy.c

subversion/branches/pristine-checksum-kind/subversion/libsvn_client/deprecated.c

subversion/branches/pristine-checksum-kind/subversion/libsvn_client/externals.c
subversion/branches/pristine-checksum-kind/subversion/libsvn_client/shelf.c

subversion/branches/pristine-checksum-kind/subversion/libsvn_client/upgrade.c
subversion/branches/pristine-checksum-kind/subversion/libsvn_fs_fs/tree.c
subversion/branches/pristine-checksum-kind/subversion/libsvn_fs_x/   (props 
changed)
subversion/branches/pristine-checksum-kind/subversion/libsvn_fs_x/tree.c

subversion/branches/pristine-checksum-kind/subversion/libsvn_subr/config_file.c
subversion/branches/pristine-checksum-kind/subversion/libsvn_subr/time.c
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/copy.c
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/deprecated.c
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/upgrade.c

subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc-queries.sql
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc.h
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db.h

subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db_pristine.c
subversion/branches/pristine-checksum-kind/subversion/svn/upgrade-cmd.c
subversion/branches/pristine-checksum-kind/subversion/svnserve/svnserve.c
subversion/branches/pristine-checksum-kind/subversion/tests/README

subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/checkout_tests.py

subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/externals_tests.py

subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/store_pristine_tests.py

subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/svntest/main.py

subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/upgrade_tests.py

subversion/branches/pristine-checksum-kind/subversion/tests/libsvn_client/client-test.c

subversion/branches/pristine-checksum-kind/subversion/tests/libsvn_fs/fs-test.c

subversion/branches/pristine-checksum-kind/subversion/tests/libsvn_wc/wc-queries-test.c

Propchange: subversion/branches/pristine-checksum-kind/
--
  Merged /subversion/trunk:r1906817-1908635

Modified: subversion/branches/pristine-checksum-kind/Makefile.in
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/Makefile.in?rev=1908636=1908635=1908636=diff
==
--- subversion/branches/pristine-checksum-kind/Makefile.in (original)
+++ subversion/branches/pristine-checksum-kind/Makefile.in Wed Mar 22 15:08:00 
2023
@@ -632,6 +632,12 @@ check: bin @TRANSFORM_LIBTOOL_SCRIPTS@ $
  if test "$(STORE_PRISTINE)" != ""; then\
flags="--store-pristine $(STORE_PRISTINE) $$flags";  \
  fi;\
+ if test "$(VALGRIND)" != ""; then  \
+   flags="--valgrind $(VALGRIND) $$flags";  \
+ fi;\
+ if test "$(VALGRIND_OPTS)" != ""; then \
+   flags="--valgrind-opts $(VALGRIND_OPTS) $$flags";\
+ fi;\
  LD_LIBRARY_PATH='$(auth_plugin_

svn commit: r1908573 - in /subversion/trunk/subversion: libsvn_wc/copy.c libsvn_wc/wc-queries.sql libsvn_wc/wc_db.h libsvn_wc/wc_db_pristine.c tests/cmdline/store_pristine_tests.py tests/libsvn_client

2023-03-20 Thread kotkov
Author: kotkov
Date: Mon Mar 20 14:59:18 2023
New Revision: 1908573

URL: http://svn.apache.org/viewvc?rev=1908573=rev
Log:
Fix an issue where calling `svn copy` between two different working copies
could fail if they had different --store-pristine settings.

Before this change, we were transferring the low-level pristine information
(sqlite entries and files) from one db to another.  This is no longer enough
for some of the cases.  For example, there is a case where we need to copy
from a WC that doesn't store pristines locally into a WC that does, and the
source pristine contents should be read from an unmodified working file.

This changeset switches to a more generic approach where we read and install
the pristine contents using the wc_textbase layer that automatically handles
such cases.

* subversion/libsvn_wc/copy.c
  (copy_versioned_file): Accept the `within_one_wc` parameter.
   Use the textbase layer to read and install the pristines when the copy
   happens between two different WCs.
  (copy_versioned_dir): Accept and propagate the `within_one_wc` parameter.
  (copy_or_move): No longer call svn_wc__db_pristine_transfer().  Pass the
   local `within_one_wc` variable further.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_pristine_transfer): Remove.

* subversion/libsvn_wc/wc_db_pristine.c
  (maybe_transfer_one_pristine,
   pristine_transfer_txn,
   svn_wc__db_pristine_transfer): Remove.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_SELECT_COPY_PRISTINES_F31,
   STMT_SELECT_COPY_PRISTINES_F32): Remove.  Also remove these statements …

* subversion/tests/libsvn_wc/wc-queries-test.c
  (stmt_matches_wc_format): …from here.

* subversion/tests/cmdline/store_pristine_tests.py
  (copy_cross_wc_without_src_pristine): New regression test.
  (copy_cross_wc_without_dst_pristine): New test.
  (test_list): Run the new tests.

* subversion/tests/libsvn_client/client-test.c
  (test_wc_add_scenarios): Skip when running for a working copy without
   pristines.  Despite being located in client-test.c, here we test the
   low-level svn_wc APIs that require svn_wc_textbase_sync() calls to work
   for WCs without pristines.  For now, let's keep testing the old behavior,
   just for WCs that store all pristines locally.

Modified:
subversion/trunk/subversion/libsvn_wc/copy.c
subversion/trunk/subversion/libsvn_wc/wc-queries.sql
subversion/trunk/subversion/libsvn_wc/wc_db.h
subversion/trunk/subversion/libsvn_wc/wc_db_pristine.c
subversion/trunk/subversion/tests/cmdline/store_pristine_tests.py
subversion/trunk/subversion/tests/libsvn_client/client-test.c
subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c

Modified: subversion/trunk/subversion/libsvn_wc/copy.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/copy.c?rev=1908573=1908572=1908573=diff
==
--- subversion/trunk/subversion/libsvn_wc/copy.c (original)
+++ subversion/trunk/subversion/libsvn_wc/copy.c Mon Mar 20 14:59:18 2023
@@ -215,6 +215,8 @@ copy_to_tmpdir(svn_skel_t **work_item,
If IS_MOVE is true, record move information in working copy meta
data in addition to copying the file.
 
+   WITHIN_ONE_WC is TRUE if the copy/move is within a single working copy 
(root)
+
If the versioned file has a text conflict, and the .mine file exists in
the filesystem, copy the .mine file to DST_ABSPATH.  Otherwise, copy the
versioned file itself.
@@ -237,6 +239,7 @@ copy_versioned_file(svn_wc__db_t *db,
 svn_boolean_t metadata_only,
 svn_boolean_t conflicted,
 svn_boolean_t is_move,
+svn_boolean_t within_one_wc,
 const svn_io_dirent2_t *dirent,
 svn_filesize_t recorded_size,
 apr_time_t recorded_time,
@@ -248,8 +251,45 @@ copy_versioned_file(svn_wc__db_t *db,
 {
   svn_skel_t *work_items = NULL;
 
-  /* In case we are copying from one WC to another (e.g. an external dir),
- ensure the destination WC has a copy of the pristine text. */
+  if (within_one_wc)
+{
+  /* In case we are copying within one WC, it already has the pristine. */
+}
+  else
+{
+  /* In case we are copying from one WC to another (e.g. an external dir),
+ ensure the destination WC has a copy of the pristine text. */
+
+  svn_stream_t *contents;
+
+  SVN_ERR(svn_wc__textbase_get_contents(, db, src_abspath, NULL,
+TRUE, scratch_pool, scratch_pool));
+  if (contents)
+{
+  svn_stream_t *install_stream;
+  svn_wc__db_install_data_t *install_data;
+  svn_checksum_t *install_sha1_checksum;
+  svn_checksum_t *install_md5_checksum;
+  svn_error_t *err;
+
+  SVN_ERR(svn_wc__textbase_prepare_install(_stream,
+   _data

svn commit: r1908042 - in /subversion/trunk/subversion: include/private/svn_wc_private.h libsvn_wc/wc.h

2023-03-03 Thread kotkov
Author: kotkov
Date: Sat Mar  4 07:49:18 2023
New Revision: 1908042

URL: http://svn.apache.org/viewvc?rev=1908042=rev
Log:
Following up on r1907965, fix linking issue.

* subversion/libsvn_wc/wc.h
  (svn_wc__version_string_from_format): Export this function by moving its
   declaration …

* subversion/include/private/svn_wc_private.h
  (svn_wc__version_string_from_format): …here.

Modified:
subversion/trunk/subversion/include/private/svn_wc_private.h
subversion/trunk/subversion/libsvn_wc/wc.h

Modified: subversion/trunk/subversion/include/private/svn_wc_private.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_wc_private.h?rev=1908042=1908041=1908042=diff
==
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Sat Mar  4 
07:49:18 2023
@@ -2194,6 +2194,16 @@ svn_wc__format_from_version(int *format,
 const svn_version_t* version,
 apr_pool_t *scratch_pool);
 
+/* Return a string indicating the released version (or versions) of
+ * Subversion that used WC format number WC_FORMAT, or some other
+ * suitable string if no released version used WC_FORMAT.
+ *
+ * ### It's not ideal to encode this sort of knowledge in this low-level
+ * library.  On the other hand, it doesn't need to be updated often and
+ * should be easily found when it does need to be updated.  */
+const char *
+svn_wc__version_string_from_format(int wc_format);
+
 /**
  * Return true iff @a format is a supported format.
  */

Modified: subversion/trunk/subversion/libsvn_wc/wc.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc.h?rev=1908042=1908041=1908042=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc.h Sat Mar  4 07:49:18 2023
@@ -226,16 +226,6 @@ extern "C" {
 /* Starting from this version, the DB stores per-WC settings. */
 #define SVN_WC__HAS_SETTINGS 32
 
-/* Return a string indicating the released version (or versions) of
- * Subversion that used WC format number WC_FORMAT, or some other
- * suitable string if no released version used WC_FORMAT.
- *
- * ### It's not ideal to encode this sort of knowledge in this low-level
- * library.  On the other hand, it doesn't need to be updated often and
- * should be easily found when it does need to be updated.  */
-const char *
-svn_wc__version_string_from_format(int wc_format);
-
 /* Return true iff error E indicates an "is not a working copy" type
of error, either because something wasn't a working copy at all, or
because it's a working copy from a previous version (in need of




svn commit: r1907967 - in /subversion/trunk/subversion/tests/cmdline: store_pristine_tests.py svntest/main.py upgrade_tests.py

2023-03-02 Thread kotkov
Author: kotkov
Date: Thu Mar  2 11:29:45 2023
New Revision: 1907967

URL: http://svn.apache.org/viewvc?rev=1907967=rev
Log:
Remove a few conditional test @Skips that are no longer required, due to
a switch to using the `compatible-version` config option in tests.

* subversion/tests/cmdline/store_pristine_tests.py
  (simple_checkout_without_pristine,
   simple_commit_without_pristine,
   simple_update_without_pristine,
   simple_status_without_pristine,
   simple_diff_without_pristine,
   simple_revert_without_pristine,
   update_modified_file_without_pristine,
   simple_copy_without_pristine,
   copy_modified_file_without_pristine,
   simple_move_without_pristine,
   move_modified_file_without_pristine,
   checkout_incompatible_setting): Run these tests unconditionally.

* subversion/tests/cmdline/upgrade_tests.py
  (upgrade_latest_format): Run this test unconditionally.

* subversion/tests/cmdline/svntest/main.py
  (wc_supports_optional_pristine): Remove this now unused predicate.

Modified:
subversion/trunk/subversion/tests/cmdline/store_pristine_tests.py
subversion/trunk/subversion/tests/cmdline/svntest/main.py
subversion/trunk/subversion/tests/cmdline/upgrade_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/store_pristine_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/store_pristine_tests.py?rev=1907967=1907966=1907967=diff
==
--- subversion/trunk/subversion/tests/cmdline/store_pristine_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/store_pristine_tests.py Thu Mar  
2 11:29:45 2023
@@ -59,7 +59,6 @@ def simple_checkout_with_pristine(sbox):
 'info', '--show-item=store-pristine', '--no-newline',
 sbox.wc_dir)
 
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
 def simple_checkout_without_pristine(sbox):
   "simple checkout without pristine"
 
@@ -108,7 +107,6 @@ def simple_commit_with_pristine(sbox):
 expected_output,
 expected_status)
 
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
 def simple_commit_without_pristine(sbox):
   "simple commit without pristine"
 
@@ -181,7 +179,6 @@ def simple_update_with_pristine(sbox):
 [], False,
 '-r1', sbox.wc_dir)
 
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
 def simple_update_without_pristine(sbox):
   "simple update without pristine"
 
@@ -278,7 +275,6 @@ def simple_status_with_pristine(sbox):
   svntest.actions.run_and_verify_status(sbox.wc_dir,
 expected_status)
 
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
 def simple_status_without_pristine(sbox):
   "simple status without pristine"
 
@@ -366,7 +362,6 @@ def simple_diff_with_pristine(sbox):
   svntest.actions.run_and_verify_svn(diff_output, [],
  'diff', sbox.ospath('file'))
 
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
 def simple_diff_without_pristine(sbox):
   "simple diff without pristine"
 
@@ -431,7 +426,6 @@ def simple_revert_with_pristine(sbox):
   svntest.actions.run_and_verify_status(sbox.wc_dir,
 expected_status)
 
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
 def simple_revert_without_pristine(sbox):
   "simple revert without pristine"
 
@@ -508,7 +502,6 @@ def update_modified_file_with_pristine(s
 expected_disk,
 expected_status)
 
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
 def update_modified_file_without_pristine(sbox):
   "update locally modified file without pristine"
 
@@ -586,7 +579,6 @@ def simple_copy_with_pristine(sbox):
   svntest.actions.run_and_verify_status(sbox.wc_dir,
 expected_status)
 
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
 def simple_copy_without_pristine(sbox):
   "simple copy without pristine"
 
@@ -655,7 +647,6 @@ def copy_modified_file_with_pristine(sbo
   svntest.actions.run_and_verify_status(sbox.wc_dir,
 expected_status)
 
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
 def copy_modified_file_without_pristine(sbox):
   "copy locally modified file without pristine"
 
@@ -724,7 +715,6 @@ def simple_move_with_pristine(sbox):
   svntest.actions.run_and_verify_status(sbox.wc_dir,
 expected_status)
 
-@SkipUnless(svntest.main.wc_supports_optional_pristine)
 def simple_move_without_pristine(sbox):
   "simple move without pristine"
 
@@ -793,7 +783,6 @@ def move_modified_file_with_pristine(sbo
   svntest.actions.run_and

svn commit: r1907966 - in /subversion/trunk/subversion: libsvn_client/checkout.c tests/cmdline/checkout_tests.py

2023-03-02 Thread kotkov
Author: kotkov
Date: Thu Mar  2 11:11:09 2023
New Revision: 1907966

URL: http://svn.apache.org/viewvc?rev=1907966=rev
Log:
Fix an issue where calling `svn checkout` without a format version argument
over an existing 1.15-format working copy for the same URL returned an error:

  $ svn checkout URL wc --compatible-version=1.15
  […]
  $ svn checkout URL wc
  $ svn: E155000: '…' is already a working copy for the same URL but its
   format is 32 instead of the expected 31

As with `svn upgrade`, let's allow a case where a working copy has a supported
format newer than the implicit default.  Note that if the user has explicitly
specified a lower --compatible-version, we're still going to return an error.

* subversion/libsvn_client/checkout.c
  (svn_client__checkout_internal): Fail if the existing WC's format is different
   than requested, but only if the format version was specified explicitly.

* subversion/tests/cmdline/checkout_tests.py
  (checkout_over_existing_wc_same_url): New regression test.
  (test_list): Run the new test.

Modified:
subversion/trunk/subversion/libsvn_client/checkout.c
subversion/trunk/subversion/tests/cmdline/checkout_tests.py

Modified: subversion/trunk/subversion/libsvn_client/checkout.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/checkout.c?rev=1907966=1907965=1907966=diff
==
--- subversion/trunk/subversion/libsvn_client/checkout.c (original)
+++ subversion/trunk/subversion/libsvn_client/checkout.c Thu Mar  2 11:11:09 
2023
@@ -89,6 +89,7 @@ svn_client__checkout_internal(svn_revnum
 {
   int target_format;
   svn_boolean_t target_store_pristine;
+  svn_boolean_t fail_on_format_mismatch;
   svn_node_kind_t kind;
   svn_client__pathrev_t *pathrev;
   svn_opt_revision_t resolved_rev = { svn_opt_revision_number };
@@ -110,6 +111,7 @@ svn_client__checkout_internal(svn_revnum
 _store_pristine,
 ctx->wc_ctx, local_abspath,
 scratch_pool));
+  fail_on_format_mismatch = FALSE;
 }
   else
 {
@@ -125,6 +127,8 @@ svn_client__checkout_internal(svn_revnum
   if (wc_format_version)
 {
   target_format_version = wc_format_version;
+  /* Fail if the existing WC's format is different than requested. */
+  fail_on_format_mismatch = TRUE;
 }
   else
 {
@@ -144,6 +148,8 @@ svn_client__checkout_internal(svn_revnum
  required_version->patch))
 target_format_version = required_version;
 }
+
+  fail_on_format_mismatch = FALSE;
 }
 
   SVN_ERR(svn_wc__format_from_version(_format,
@@ -247,8 +253,7 @@ svn_client__checkout_internal(svn_revnum
 _("'%s' is already a working copy for a different URL"),
 svn_dirent_local_style(local_abspath, scratch_pool));
 
-  /* Warn if the existing WC's format is different than requested. */
-  if (present_format != target_format)
+  if (fail_on_format_mismatch && present_format != target_format)
 return svn_error_createf(
 SVN_ERR_WC_OBSTRUCTED_UPDATE, NULL,
 _("'%s' is already a working copy for the same URL"

Modified: subversion/trunk/subversion/tests/cmdline/checkout_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/checkout_tests.py?rev=1907966=1907965=1907966=diff
==
--- subversion/trunk/subversion/tests/cmdline/checkout_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/checkout_tests.py Thu Mar  2 
11:11:09 2023
@@ -1215,6 +1215,37 @@ def checkout_compatible_version_config(s
 'info', '--show-item=wc-compatible-version', '--no-newline',
 sbox.wc_dir)
 
+def checkout_over_existing_wc_same_url(sbox):
+  "checkout over existing wc with same URL"
+
+  sbox.build(empty=True, create_wc=False)
+  expected_output = svntest.wc.State(sbox.wc_dir, {})
+  expected_disk = svntest.wc.State('', {})
+
+  svntest.actions.run_and_verify_checkout(
+sbox.repo_url, sbox.wc_dir, expected_output, expected_disk, [],
+'--compatible-version=1.15', '--store-pristine=yes')
+  svntest.actions.run_and_verify_svn(
+['1.15'], [],
+'info', '--show-item=wc-compatible-version', '--no-newline',
+sbox.wc_dir)
+  svntest.actions.run_and_verify_svn(
+['yes'], [],
+'info', '--show-item=store-pristine', '--no-newline',
+sbox.wc_dir)
+
+  svntest.actions.run_and_verify_checkout(
+sbox.repo_url, sbox.wc_dir, expected_output, expected_disk, [],
+'--store-pristine=yes')
+  svntest.actions.run_and_verify_svn(
+['1.15'], [],
+'info', '--show-item=wc-compatibl

svn commit: r1907965 - in /subversion/trunk/subversion: include/ include/private/ libsvn_client/ libsvn_wc/ svn/ tests/cmdline/

2023-03-02 Thread kotkov
Author: kotkov
Date: Thu Mar  2 11:10:34 2023
New Revision: 1907965

URL: http://svn.apache.org/viewvc?rev=1907965=rev
Log:
Fix an issue where calling `svn upgrade` without arguments for a 1.15-format
working copy resulted in an error:

  $ svn checkout --compatible-version=1.15 wc
  $ svn upgrade wc
  $ svn: E155021: Working copy '…' is already at version 1.15 (format 32)
and cannot be downgraded to version 1.8 (format 31)

To fix it, we start to distinguish cases where the `--compatible-version`
argument (or the corresponding API parameter) have or have not been specified
explicitly.  If the working copy already has a supported format newer than
the resolved target format, the behavior is as follows:

- If the format version wasn't specified explicitly, meaning the default
  version should be used, the upgrade is no-op and the working copy is left
  at its current format.

- If the format version was specified explicitly, meaning that a concrete
  format version should be used, the upgrade results in an error.

* subversion/include/svn_client.h
  (svn_client_upgrade2): Add the `result_format_version_p` out parameter.
   Rename `wc_format_version` to `target_format_version`.  Adjust docstring.
  (svn_client_upgrade): Adjust docstring.

* subversion/include/private/svn_wc_private.h
  (svn_wc__upgrade): Add the `result_format_p` out parameter.  Adjust docstring.

* subversion/libsvn_client/upgrade.c
  (upgrade_internal): Add the `result_format_p` out parameter.
   Rename `wc_format` to `target_format`.
  (upgrade_external_item): Adjust calling site of upgrade_internal().
  (svn_client_upgrade2): Fill in the resulting format version.
   Fail on downgrade attempts if a format version was passed explicitly.

* subversion/libsvn_client/deprecated.c
  (svn_client_upgrade): Adjust calling site of svn_client_upgrade2().

* subversion/libsvn_wc/upgrade.c
  (svn_wc__upgrade_sdb): Don't check for downgrade attempts here.
   Allow the upgrade to be a no-op by removing corresponding assertions from
   this function and also …
  (svn_wc__update_schema): …here, …
  (svn_wc__upgrade): …and here.  Fill in the resulting format value.

* subversion/libsvn_wc/deprecated.c
  (svn_wc_upgrade): Adjust calling site of svn_wc__upgrade().

* subversion/svn/upgrade-cmd.c
  (svn_cl__upgrade): Use the information about the resulting format version
   to re-implement the "working copy may be upgraded further" message, and
   issue it on a per-wc basis.

* subversion/tests/cmdline/upgrade_tests.py
  (upgrade_latest_format): No longer fails.  Check the resulting format of
   the working copy.

* subversion/tests/cmdline/externals_tests.py
  (switch_relative_externals): Remove Wimp() marker, because the corresponding
   issue is now solved.

Modified:
subversion/trunk/subversion/include/private/svn_wc_private.h
subversion/trunk/subversion/include/svn_client.h
subversion/trunk/subversion/libsvn_client/deprecated.c
subversion/trunk/subversion/libsvn_client/upgrade.c
subversion/trunk/subversion/libsvn_wc/deprecated.c
subversion/trunk/subversion/libsvn_wc/upgrade.c
subversion/trunk/subversion/svn/upgrade-cmd.c
subversion/trunk/subversion/tests/cmdline/externals_tests.py
subversion/trunk/subversion/tests/cmdline/upgrade_tests.py

Modified: subversion/trunk/subversion/include/private/svn_wc_private.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_wc_private.h?rev=1907965=1907964=1907965=diff
==
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Thu Mar  2 
11:10:34 2023
@@ -2290,6 +2290,9 @@ svn_wc__ensure_adm(svn_wc_context_t *wc_
  * format indicated by @a target_format.  @a local_abspath should be
  * an absolute path to the root of the working copy.
  *
+ * If @a result_format_p is non-NULL, it will be set to the resulting
+ * format of the working copy after the upgrade.
+ *
  * If @a cancel_func is non-NULL, invoke it with @a cancel_baton at
  * various points during the operation.  If it returns an error
  * (typically #SVN_ERR_CANCELLED), return that error immediately.
@@ -2306,7 +2309,8 @@ svn_wc__ensure_adm(svn_wc_context_t *wc_
  * @since New in 1.15.
  */
 svn_error_t *
-svn_wc__upgrade(svn_wc_context_t *wc_ctx,
+svn_wc__upgrade(int *result_format_p,
+svn_wc_context_t *wc_ctx,
 const char *local_abspath,
 int target_format,
 svn_wc_upgrade_get_repos_info_t repos_info_func,

Modified: subversion/trunk/subversion/include/svn_client.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_client.h?rev=1907965=1907964=1907965=diff
==
--- subversion/trunk/subversion/include/svn_client.h (original)
+++ subversion/trunk/subversi

svn commit: r1907964 - in /subversion/trunk/subversion: include/ libsvn_client/ libsvn_subr/ svn/ tests/cmdline/ tests/cmdline/svntest/

2023-03-02 Thread kotkov
Author: kotkov
Date: Thu Mar  2 11:09:48 2023
New Revision: 1907964

URL: http://svn.apache.org/viewvc?rev=1907964=rev
Log:
Add a new `compatible-version` config option.

This option sets the default working copy format version, allowing users to
configure the default wc compatibility level globally.  Newly created and
upgraded working copies will by default be compatible with the specified
Subversion version.

In the test suite, use the new config option for the customized runs with the
--wc-format-version argument, instead of manually inserting the corresponding
--compatible-version argument during `svn checkout` and `svn upgrade` calls.

* subversion/include/svn_config.h
  (SVN_CONFIG_OPTION_COMPATIBLE_VERSION): New.

* subversion/libsvn_subr/config_file.c
  (svn_config_ensure): Add new config option.

* subversion/include/svn_client.h
  (svn_client_default_wc_version): Now accepts an svn_client_ctx_t.
  (svn_client_checkout4,
   svn_client_checkout3,
   svn_client_upgrade2,
   svn_client_upgrade): Tweak the docstrings so that they would lead to
   the svn_client_default_wc_version(), as opposed to providing a custom
   description of the same concept.

* subversion/libsvn_client/upgrade.c
  (): Include svn_hash.h and svn_subr_private.h.
  (svn_client_default_wc_version): Check if we have a specific version in
   the config or use the default.
  (svn_client_upgrade2): Call svn_client_default_wc_version().

* subversion/libsvn_client/checkout.c
  (svn_client__checkout_internal):
   Adjust calling site of svn_client_default_wc_version().

* subversion/svn/upgrade-cmd.c
  (svn_cl__upgrade): Adjust calling site of svn_client_default_wc_version().

* subversion/tests/cmdline/svntest/main.py
  (create_config_dir): Accept the wc_format_version and translate it into
   an appropriate config value.
  (execute_tests): Adjust call to create_config_dir().
  (_with_wc_format_version): Remove.
  (run_svn): Don't use the _with_wc_format_version() function.

* subversion/tests/cmdline/checkout_tests.py
  (checkout_compatible_version_arg,
   checkout_compatible_version_config): New tests.
  (test_list): Run new tests.

* subversion/tests/cmdline/upgrade_tests.py
  (upgrade_compatible_version_arg,
   upgrade_compatible_version_config): New tests.
  (test_list): Run new tests.

Modified:
subversion/trunk/subversion/include/svn_client.h
subversion/trunk/subversion/include/svn_config.h
subversion/trunk/subversion/libsvn_client/checkout.c
subversion/trunk/subversion/libsvn_client/upgrade.c
subversion/trunk/subversion/libsvn_subr/config_file.c
subversion/trunk/subversion/svn/upgrade-cmd.c
subversion/trunk/subversion/tests/cmdline/checkout_tests.py
subversion/trunk/subversion/tests/cmdline/svntest/main.py
subversion/trunk/subversion/tests/cmdline/upgrade_tests.py

Modified: subversion/trunk/subversion/include/svn_client.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_client.h?rev=1907964=1907963=1907964=diff
==
--- subversion/trunk/subversion/include/svn_client.h (original)
+++ subversion/trunk/subversion/include/svn_client.h Thu Mar  2 11:09:48 2023
@@ -1242,7 +1242,7 @@ svn_client_args_to_target_array(apr_arra
  *  obstructing items.
  * @param[in] wc_format_version is the version number of the oldest Subversion
  *  client with which the created working copy should be 
compatible;
- *  @c NULL means the library's version.
+ *  @c NULL means the default version.
  *  See svn_client_default_wc_version(),
  *  svn_client_get_wc_formats_supported().
  * @param[in] store_pristine  If #svn_tristate_true, the pristine contents of
@@ -1284,8 +1284,8 @@ svn_client_checkout4(svn_revnum_t *resul
  apr_pool_t *pool);
 
 /**
- * Similar to svn_client_checkout4() but always creates the newest
- * supported working copy format.
+ * Similar to svn_client_checkout4() but with @a wc_format_version set
+ * to @c NULL.
  *
  * @since New in 1.5.
  * @deprecated Provided for backward compatibility with the 1.10 API.
@@ -4405,7 +4405,7 @@ svn_client_cleanup(const char *dir,
  * copies from any older format to a WC metadata storage
  * format supported by Subversion @a wc_format_version.
  *
- * If @a wc_format_version is @c NULL, the library's version is used.
+ * If @a wc_format_version is @c NULL, the default version is used.
  *
  * @a wcroot_dir is the path to the WC root.
  *
@@ -4423,8 +4423,7 @@ svn_client_upgrade2(const char *wcroot_d
 apr_pool_t *scratch_pool);
 
 /**
- * Like svn_client_upgrade2(), but always upgrades to the newest
- * supported format.
+ * Like svn_client_upgrade2(), but with @a wc_format_version set to @c NULL.
  *
  * @since New in 1.7.
  * @deprecated Provided for backward compatibility with the 1.14 API.
@@ -4445,13 +,17 @@ const svn_version_t

svn commit: r1907963 - in /subversion/trunk/subversion/libsvn_client: checkout.c client.h copy.c externals.c shelf.c

2023-03-02 Thread kotkov
Author: kotkov
Date: Thu Mar  2 11:09:02 2023
New Revision: 1907963

URL: http://svn.apache.org/viewvc?rev=1907963=rev
Log:
Slightly refactor the svn_client__checkout_internal() function so that all
parameter processing would happen in one place.

Before this change, this logic was scattered between svn_client_checkout4()
and svn_client__checkout_internal(), with an additional downside that the
internal function could only accept specific parameter combinations.

With this change, all processing happens in svn_client__checkout_internal(),
without any assertions on those parameter combinations.

* subversion/libsvn_client/client.h
  (svn_client__checkout_internal): Accept new `settings_from_context` parameter.
   Adjust docstring.

* subversion/libsvn_client/checkout.c
  (svn_client_checkout4): Move part of the parameter processing into …
  (svn_client__checkout_internal): …this function.

* subversion/libsvn_client/copy.c
  (svn_client__repos_to_wc_copy_dir):
   Adjust calling site of svn_client__checkout_internal().

* subversion/libsvn_client/externals.c
  (switch_dir_external): Adjust calling site of svn_client__checkout_internal().

* subversion/libsvn_client/shelf.c
  (shelf_copy_base): Adjust calling site of svn_client__checkout_internal().

Modified:
subversion/trunk/subversion/libsvn_client/checkout.c
subversion/trunk/subversion/libsvn_client/client.h
subversion/trunk/subversion/libsvn_client/copy.c
subversion/trunk/subversion/libsvn_client/externals.c
subversion/trunk/subversion/libsvn_client/shelf.c

Modified: subversion/trunk/subversion/libsvn_client/checkout.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/checkout.c?rev=1907963=1907962=1907963=diff
==
--- subversion/trunk/subversion/libsvn_client/checkout.c (original)
+++ subversion/trunk/subversion/libsvn_client/checkout.c Thu Mar  2 11:09:02 
2023
@@ -80,6 +80,7 @@ svn_client__checkout_internal(svn_revnum
   svn_depth_t depth,
   svn_boolean_t ignore_externals,
   svn_boolean_t allow_unver_obstructions,
+  svn_boolean_t settings_from_context,
   const svn_version_t *wc_format_version,
   svn_tristate_t store_pristine,
   svn_ra_session_t *ra_session,
@@ -103,7 +104,7 @@ svn_client__checkout_internal(svn_revnum
   && (revision->kind != svn_opt_revision_head))
 return svn_error_create(SVN_ERR_CLIENT_BAD_REVISION, NULL, NULL);
 
-  if (wc_format_version == NULL && store_pristine == svn_tristate_unknown)
+  if (settings_from_context)
 {
   SVN_ERR(svn_wc__settings_from_context(_format,
 _store_pristine,
@@ -112,17 +113,41 @@ svn_client__checkout_internal(svn_revnum
 }
   else
 {
-  SVN_ERR_ASSERT(wc_format_version != NULL);
+  const svn_version_t *target_format_version;
 
-  SVN_ERR(svn_wc__format_from_version(_format, wc_format_version,
-  scratch_pool));
-
-  SVN_ERR_ASSERT(store_pristine != svn_tristate_unknown);
-
-  if (store_pristine == svn_tristate_true)
+  if (store_pristine == svn_tristate_unknown)
+target_store_pristine = TRUE;
+  else if (store_pristine == svn_tristate_true)
 target_store_pristine = TRUE;
   else
 target_store_pristine = FALSE;
+
+  if (wc_format_version)
+{
+  target_format_version = wc_format_version;
+}
+  else
+{
+  /* A NULL wc_format_version translates to the minimum compatible
+ version. */
+  target_format_version = svn_client_default_wc_version(scratch_pool);
+
+  if (!target_store_pristine)
+{
+  const svn_version_t *required_version =
+
svn_client__compatible_wc_version_optional_pristine(scratch_pool);
+
+  if (!svn_version__at_least(target_format_version,
+ required_version->major,
+ required_version->minor,
+ required_version->patch))
+target_format_version = required_version;
+}
+}
+
+  SVN_ERR(svn_wc__format_from_version(_format,
+  target_format_version,
+  scratch_pool));
 }
 
   /* Get the RA connection, if needed. */
@@ -271,32 +296,12 @@ svn_client_checkout4(svn_revnum_t *resul
 
   SVN_ERR(svn_dirent_get_absolute(_abspath, path, pool));
 
-  if (store_pristine == svn_tristate_unknown)
-store_pristine = svn_tristate_true;
-
-  /* A NULL wc_format_version translates to the minimum compatible version. 

svn commit: r1906821 - in /subversion/branches/pristine-checksum-kind/subversion: include/ include/private/ libsvn_client/ libsvn_wc/ svn/ tests/cmdline/getopt_tests_data/ tests/cmdline/svntest/ tests

2023-01-19 Thread kotkov
Author: kotkov
Date: Thu Jan 19 18:51:16 2023
New Revision: 1906821

URL: http://svn.apache.org/viewvc?rev=1906821=rev
Log:
On the 'pristine-checksum-kind' branch: First-cut implementation that makes
the working copy pristine checksum kind configurable.

With this changeset, a user can create working copies that use a checksum kind
other than SHA-1.

The checksum kind is persisted in the settings table.  Upgraded working copies
of the older formats will have SHA-1 recorded as their pristine checksum kind
and will continue to use it for compatibility.  Newly created working copies
of the latest format (with --compatible-version=1.15 or --store-pristine=no),
as currently implemented, will use the new pristine checksum kind.  Currently,
as a proof-of-concept, the branch uses salted SHA-1 as the new pristine
checksum kind.

This changeset bumps the working copy format from 32 to 33.

* subversion/include/svn_wc.h
  (svn_wc_info_t): Add new `pristine_checksum_kind` field.

* subversion/include/private/svn_wc_private.h
  (svn_wc__get_settings): Return the pristine checksum kind.

* subversion/libsvn_wc/wc-metadata.sql
  (): Bump to format 33.  Update some of the comments.
  (STMT_UPGRADE_TO_33): New.  Add the `pristine_checksum_kind` column to
   the SETTINGS table.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_SELECT_SETTINGS): Return the pristine checksum kind.
  (STMT_UPSERT_SETTINGS): Change the pristine checksum kind.

* subversion/libsvn_wc/wc.h
  (SVN_WC__VERSION): Change to 33.
  (SVN_WC__HAS_PRISTINE_CHECKSUM_KIND): New.
  (SVN_WC__HAS_PRISTINE_CHECKSUM_SHA1_SALTED): New.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_init,
   svn_wc__db_upgrade_begin): Accept the pristine checksum kind.
  (svn_wc__db_get_settings): Return the pristine checksum kind.
  (svn_wc__db_pristine_read,
   svn_wc__db_pristine_prepare_install,
   svn_wc__db_pristine_install,
   svn_wc__db_pristine_get_md5,
   svn_wc__db_pristine_lookup_by_md5,
   svn_wc__db_pristine_remove,
   svn_wc__db_pristine_check,
   svn_wc__db_pristine_dehydrate): Tweak comments.

* subversion/libsvn_wc/wc_db_private.h
  (svn_wc__db_wcroot_t): Add the new `pristine_checksum_kind` field.
  (enum svn_wc__db_pristine_checksum_kind_t): New.
  (svn_wc__db_pdh_create_wcroot): Add the new `pristine_checksum_kind` argument.

* subversion/libsvn_client/checkout.c
  (svn_client__checkout_internal): Adjust call to svn_wc__get_settings().

* subversion/libsvn_client/commit.c
  (post_process_commit_item): Tweak comment.

* subversion/libsvn_client/upgrade.c
  (svn_client_wc_version_from_format): Adjust for format 33.

* subversion/libsvn_wc/adm_crawler.c
  (svn_wc__internal_transmit_text_deltas): Tweak comment.

* subversion/libsvn_wc/adm_files.c
  (init_adm): Add the new `pristine_checksum_kind` argument and pass it further.
  (svn_wc__internal_ensure_adm): Determine the pristine checksum kind when
   creating a working copy.  Adjust call to svn_wc__db_get_settings().

* subversion/libsvn_wc/adm_ops.c
  (get_pristine_copy_path): Adjust call to svn_wc__db_get_settings().
  (get_pristine_lazyopen_func): Arrange to look up the actual checksum if
   we have an MD5.

* subversion/libsvn_wc/conflicts.c
  (svn_wc_resolved_conflict5): Adjust call to svn_wc__get_settings().

* subversion/libsvn_wc/deprecated.c
  (svn_wc_crawl_revisions5,
   svn_wc_transmit_text_deltas3,
   svn_wc_restore,
   svn_wc_get_pristine_contents2,
   svn_wc_revert6,
   svn_wc_get_diff_editor6,
   svn_wc_diff6,
   svn_wc_get_status_editor5,
   svn_wc_get_update_editor4,
   svn_wc_get_switch_editor4,
   svn_wc_merge5): Adjust calls to svn_wc__get_settings().

* subversion/libsvn_wc/info.c
  (build_info_for_node): Fill in the pristine checksum kind.
  (svn_wc__get_settings): Update to return the pristine checksum kind.

* subversion/libsvn_wc/textbase.c
  (open_textbase,
   svn_wc_textbase_sync): Adjust calls to svn_wc__db_get_settings().

* subversion/libsvn_wc/update_editor.c
  (handler_baton): Tweak comments.
  (apply_textdelta): Do not assert a specific checksum kind.

* subversion/libsvn_wc/upgrade.c
  (bump_to_33): New.
  (svn_wc__version_string_from_format): Adjust for format 33.
  (svn_wc__update_schema): Adjust for format 33.
  (svn_wc__upgrade): Adjust call to svn_wc__db_upgrade_begin().

* subversion/libsvn_wc/wc_db.c
  (init_db): Write the new pristine checksum kind to the database.
  (svn_wc__db_init, create_db, svn_wc__db_upgrade_begin): Pass the
   `pristine_checksum_kind` argument further.
  (svn_wc__db_get_settings): Return the pristine checksum kind.

* subversion/libsvn_wc/wc_db_wcroot.c
  (svn_wc__db_pdh_create_wcroot): Initialize the `pristine_checksum_kind` field.
  (read_settings): Read the pristine checksum kind from the database.
  (fetch_sdb_info): Return the pristine checksum kind.
  (svn_wc__db_wcroot_parse_local_abspath): Adjust calls to the updated 
functions.

* subversion/libsvn_wc/wc_db_pristine.c
  (*): Do not assert a specific checksum kind (svn_checksum_sha1

svn commit: r1906820 - in /subversion/branches/pristine-checksum-kind/subversion: include/svn_checksum.h libsvn_subr/checksum.c tests/libsvn_subr/checksum-test.c

2023-01-19 Thread kotkov
Author: kotkov
Date: Thu Jan 19 18:50:06 2023
New Revision: 1906820

URL: http://svn.apache.org/viewvc?rev=1906820=rev
Log:
On the 'pristine-checksum-kind' branch: Lay some groundwork for making the
working copy pristine checksum kind configurable by implementing a salted
SHA-1 checksum function.

We'll temporarily use it as the new pristine checksum kind for working copies
of the latest format, as a proof-of-concept.  For the production-ready state,
we could later support using multiple new checksum types such as SHA-256.
That would be useful for future compatibility, because if we encounter any
issues with one checksum kind, we could then switch to a different kind
without having to change the working copy format.

* subversion/include/svn_checksum.h
  (svn_checksum_kind_t): Add `svn_checksum_sha1_salted`.

* subversion/libsvn_subr/checksum.c
  (sha1_salted_empty_string_digest_array, sha1_salt): New.
  (empty_string_digests,
   digest_sizes,
   ckind_str,
   DIGESTSIZE,
   validate_kind,
   svn_checksum_create,
   svn_checksum_match,
   svn_checksum_to_cstring,
   svn_checksum_serialize,
   svn_checksum_deserialize,
   svn_checksum_dup,
   svn_checksum,
   svn_checksum_empty_checksum,
   svn_checksum_ctx_create,
   svn_checksum_ctx_reset,
   svn_checksum_update,
   svn_checksum_final,
   svn_checksum_is_empty_checksum): Provide implementation for the new
   checksum kind.

* subversion/tests/libsvn_subr/checksum-test.c
  (test_checksum_parse,
   test_checksum_empty,
   zero_match,
   zero_cross_match,
   test_serialization,
   test_checksum_parse_all_zero,
   test_checksummed_stream_read,
   test_checksummed_stream_reset): Test the new checksum kind.

Modified:
subversion/branches/pristine-checksum-kind/subversion/include/svn_checksum.h
subversion/branches/pristine-checksum-kind/subversion/libsvn_subr/checksum.c

subversion/branches/pristine-checksum-kind/subversion/tests/libsvn_subr/checksum-test.c

Modified: 
subversion/branches/pristine-checksum-kind/subversion/include/svn_checksum.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/include/svn_checksum.h?rev=1906820=1906819=1906820=diff
==
--- 
subversion/branches/pristine-checksum-kind/subversion/include/svn_checksum.h 
(original)
+++ 
subversion/branches/pristine-checksum-kind/subversion/include/svn_checksum.h 
Thu Jan 19 18:50:06 2023
@@ -58,7 +58,11 @@ typedef enum svn_checksum_kind_t
   /** The checksum is (or should be set to) a modified FNV-1a 32 bit,
* in big endian byte order.
* @since New in 1.9. */
-  svn_checksum_fnv1a_32x4
+  svn_checksum_fnv1a_32x4,
+
+  /** The checksum is (or should be set to) a salted SHA1 checksum.
+   * @since New in 1.15. */
+  svn_checksum_sha1_salted
 } svn_checksum_kind_t;
 
 /**

Modified: 
subversion/branches/pristine-checksum-kind/subversion/libsvn_subr/checksum.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_subr/checksum.c?rev=1906820=1906819=1906820=diff
==
--- 
subversion/branches/pristine-checksum-kind/subversion/libsvn_subr/checksum.c 
(original)
+++ 
subversion/branches/pristine-checksum-kind/subversion/libsvn_subr/checksum.c 
Thu Jan 19 18:50:06 2023
@@ -64,12 +64,19 @@ static const unsigned char fnv1a_32x4_em
   0xcd, 0x6d, 0x9a, 0x85
 };
 
+/* The salted-SHA1 digest for the empty string. */
+static const unsigned char sha1_salted_empty_string_digest_array[] = {
+  0x1f, 0x5d, 0xae, 0x8c, 0x03, 0xf9, 0x6f, 0x6c, 0xc4, 0xd1,
+  0x5c, 0xcc, 0x52, 0x7d, 0xf2, 0xf9, 0x14, 0xa4, 0x33, 0xbb
+};
+
 /* Digests for an empty string, indexed by checksum type */
 static const unsigned char * empty_string_digests[] = {
   md5_empty_string_digest_array,
   sha1_empty_string_digest_array,
   fnv1a_32_empty_string_digest_array,
-  fnv1a_32x4_empty_string_digest_array
+  fnv1a_32x4_empty_string_digest_array,
+  sha1_salted_empty_string_digest_array
 };
 
 /* Digest sizes in bytes, indexed by checksum type */
@@ -77,7 +84,8 @@ static const apr_size_t digest_sizes[] =
   APR_MD5_DIGESTSIZE,
   APR_SHA1_DIGESTSIZE,
   sizeof(apr_uint32_t),
-  sizeof(apr_uint32_t)
+  sizeof(apr_uint32_t),
+  APR_SHA1_DIGESTSIZE
 };
 
 /* Checksum type prefixes used in serialized checksums. */
@@ -86,16 +94,25 @@ static const char *ckind_str[] = {
   "$sha1$",
   "$fnv1$",
   "$fnvm$",
+  "$ssh1$",
   /* ### svn_checksum_deserialize() assumes all these have the same strlen() */
 };
 
 /* Returns the digest size of it's argument. */
 #define DIGESTSIZE(k) \
-  (((k) < svn_checksum_md5 || (k) > svn_checksum_fnv1a_32x4) ? 0 : 
digest_sizes[k])
+  (((k) < svn_checksum_md5 || (k) > svn_checksum_sha1_salted) ? 0 : 
digest_sizes[k])
 
 /* Largest supported digest size */
 #define MAX_DIGESTSIZE (MAX(APR_MD5_DIGESTSIZE,APR_SHA1_DIGESTS

svn commit: r1906819 [2/2] - in /subversion/branches/pristine-checksum-kind/subversion: include/private/ libsvn_client/ libsvn_wc/ tests/libsvn_wc/

2023-01-19 Thread kotkov
Modified: 
subversion/branches/pristine-checksum-kind/subversion/tests/libsvn_wc/pristine-store-test.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/tests/libsvn_wc/pristine-store-test.c?rev=1906819=1906818=1906819=diff
==
--- 
subversion/branches/pristine-checksum-kind/subversion/tests/libsvn_wc/pristine-store-test.c
 (original)
+++ 
subversion/branches/pristine-checksum-kind/subversion/tests/libsvn_wc/pristine-store-test.c
 Thu Jan 19 18:49:23 2023
@@ -84,16 +84,16 @@ pristine_write_read(const svn_test_opts_
 
   const char data[] = "Blah";
   svn_string_t *data_string = svn_string_create(data, pool);
-  svn_checksum_t *data_sha1, *data_md5;
+  svn_checksum_t *data_checksum, *data_md5;
 
   SVN_ERR(create_repos_and_wc(_abspath, ,
   "pristine_write_read", opts, pool));
 
   /* Write DATA into a new temporary pristine file, set PRISTINE_TMP_ABSPATH
-   * to its path and set DATA_SHA1 and DATA_MD5 to its checksums. */
+   * to its path and set DATA_CHECKSUM and DATA_MD5 to its checksums. */
   SVN_ERR(svn_wc__db_pristine_prepare_install(_stream,
   _data,
-  _sha1, _md5,
+  _checksum, _md5,
   db, wc_abspath, TRUE,
   pool, pool));
 
@@ -107,14 +107,14 @@ pristine_write_read(const svn_test_opts_
 svn_boolean_t hydrated;
 
 SVN_ERR(svn_wc__db_pristine_check(, , db, wc_abspath,
-  data_sha1, pool));
+  data_checksum, pool));
 SVN_TEST_ASSERT(! present);
 SVN_TEST_ASSERT(! hydrated);
   }
 
   /* Install the new pristine file, referenced by its checksum. */
   SVN_ERR(svn_wc__db_pristine_install(install_data,
-  data_sha1, data_md5, pool));
+  data_checksum, data_md5, pool));
 
   /* Ensure it is now found in the store. */
   {
@@ -122,7 +122,7 @@ pristine_write_read(const svn_test_opts_
 svn_boolean_t hydrated;
 
 SVN_ERR(svn_wc__db_pristine_check(, , db, wc_abspath,
-  data_sha1, pool));
+  data_checksum, pool));
 SVN_TEST_ASSERT(present);
 SVN_TEST_ASSERT(hydrated);
   }
@@ -132,7 +132,7 @@ pristine_write_read(const svn_test_opts_
 const svn_checksum_t *looked_up_md5;
 
 SVN_ERR(svn_wc__db_pristine_get_md5(_up_md5, db, wc_abspath,
-data_sha1, pool, pool));
+data_checksum, pool, pool));
 SVN_TEST_ASSERT(looked_up_md5->kind == svn_checksum_md5);
 SVN_TEST_ASSERT(svn_checksum_match(data_md5, looked_up_md5));
   }
@@ -144,7 +144,7 @@ pristine_write_read(const svn_test_opts_
 svn_boolean_t same;
 
 SVN_ERR(svn_wc__db_pristine_read(_read_back, NULL, db, wc_abspath,
- data_sha1, pool, pool));
+ data_checksum, pool, pool));
 SVN_ERR(svn_stream_contents_same2(, data_read_back, data_stream,
   pool));
 SVN_TEST_ASSERT(same);
@@ -156,9 +156,9 @@ pristine_write_read(const svn_test_opts_
 svn_error_t *err;
 svn_stream_t *data_read_back;
 
-SVN_ERR(svn_wc__db_pristine_remove(db, wc_abspath, data_sha1, pool));
+SVN_ERR(svn_wc__db_pristine_remove(db, wc_abspath, data_checksum, pool));
 err = svn_wc__db_pristine_read(_read_back, NULL, db, wc_abspath,
-   data_sha1, pool, pool);
+   data_checksum, pool, pool);
 SVN_TEST_ASSERT_ERROR(err, SVN_ERR_WC_PATH_NOT_FOUND);
   }
 
@@ -168,7 +168,7 @@ pristine_write_read(const svn_test_opts_
 svn_boolean_t hydrated;
 
 SVN_ERR(svn_wc__db_pristine_check(, , db, wc_abspath,
-  data_sha1, pool));
+  data_checksum, pool));
 SVN_TEST_ASSERT(! present);
 SVN_TEST_ASSERT(! hydrated);
   }
@@ -189,14 +189,14 @@ pristine_delete_while_open(const svn_tes
   apr_size_t sz;
 
   const char data[] = "Blah";
-  svn_checksum_t *data_sha1, *data_md5;
+  svn_checksum_t *data_checksum, *data_md5;
 
   SVN_ERR(create_repos_and_wc(_abspath, ,
   "pristine_delete_while_open", opts, pool));
 
   SVN_ERR(svn_wc__db_pristine_prepare_install(_stream,
   _data,
-  _sha1, _md5,
+  _checksum, _md5,
   db, wc_abspath, TRUE,
   pool, pool));
 
@@ -204,14 +204,14 @@ 

svn commit: r1906819 [1/2] - in /subversion/branches/pristine-checksum-kind/subversion: include/private/ libsvn_client/ libsvn_wc/ tests/libsvn_wc/

2023-01-19 Thread kotkov
Author: kotkov
Date: Thu Jan 19 18:49:23 2023
New Revision: 1906819

URL: http://svn.apache.org/viewvc?rev=1906819=rev
Log:
On the 'pristine-checksum-kind' branch: Lay some groundwork for making the
working copy pristine checksum kind configurable by renaming variables that
include the checksum type in their names, such as `sha1_checksum`.
Rename a couple of internal functions and related names as well.

No functional changes are intended.

* subversion/include/private/svn_wc_private.h
  (svn_wc__node_get_md5_from_sha1): Rename …
  (svn_wc__node_get_md5): …to this.  Adjust the argument name.

* subversion/libsvn_wc/node.c
  (svn_wc__node_get_md5_from_sha1): Rename …
  (svn_wc__node_get_md5): …to this.  Adjust the argument name.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_pristine_get_sha1): Rename …
  (svn_wc__db_pristine_lookup_by_md5): …to this.  Adjust the argument name.

* subversion/libsvn_wc/wc_db_pristine.c:
  (svn_wc__db_pristine_get_sha1): Rename …
  (svn_wc__db_pristine_lookup_by_md5): …to this.  Adjust the argument name.

* subversion/libsvn_wc/adm_crawler.c
  (svn_wc__internal_transmit_text_deltas): Rename `verify_checksum` to
   `verify_md5_checksum`.

* subversion/libsvn_client/client.h,
* subversion/libsvn_client/commit.c,
* subversion/libsvn_client/commit_util.c,
* subversion/libsvn_client/deprecated.c,
* subversion/libsvn_wc/adm_crawler.c,
* subversion/libsvn_wc/adm_ops.c,
* subversion/libsvn_wc/deprecated.c,
* subversion/libsvn_wc/externals.c,
* subversion/libsvn_wc/textbase.h,
* subversion/libsvn_wc/textbase.c,
* subversion/libsvn_wc/update_editor.c,
* subversion/libsvn_wc/wc.h,
* subversion/libsvn_wc/wc_db.h,
* subversion/libsvn_wc/wc_db_private.h,
* subversion/libsvn_wc/wc_db.c,
* subversion/libsvn_wc/wc_db_pristine.c,
* subversion/libsvn_wc/wc_db_textbase.c,
* subversion/tests/libsvn_wc/pristine-store-test.c:
  (): Rename variables such as `sha1_checksum` to `checksum`.
  Update the related names and comments.

Modified:

subversion/branches/pristine-checksum-kind/subversion/include/private/svn_wc_private.h
subversion/branches/pristine-checksum-kind/subversion/libsvn_client/client.h
subversion/branches/pristine-checksum-kind/subversion/libsvn_client/commit.c

subversion/branches/pristine-checksum-kind/subversion/libsvn_client/commit_util.c

subversion/branches/pristine-checksum-kind/subversion/libsvn_client/deprecated.c

subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/adm_crawler.c
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/adm_ops.c
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/deprecated.c
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/externals.c
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/node.c
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/textbase.c
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/textbase.h

subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/update_editor.c
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc.h
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db.c
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db.h

subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db_pristine.c

subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db_private.h

subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/wc_db_textbase.c

subversion/branches/pristine-checksum-kind/subversion/tests/libsvn_wc/pristine-store-test.c

Modified: 
subversion/branches/pristine-checksum-kind/subversion/include/private/svn_wc_private.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/include/private/svn_wc_private.h?rev=1906819=1906818=1906819=diff
==
--- 
subversion/branches/pristine-checksum-kind/subversion/include/private/svn_wc_private.h
 (original)
+++ 
subversion/branches/pristine-checksum-kind/subversion/include/private/svn_wc_private.h
 Thu Jan 19 18:49:23 2023
@@ -1027,18 +1027,18 @@ svn_wc__node_get_commit_status(svn_boole
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
 
-/* Gets the md5 checksum for the pristine file identified by a sha1_checksum 
in the
+/* Gets the md5 checksum for the pristine file identified by checksum in the
working copy identified by wri_abspath.
 
Wraps svn_wc__db_pristine_get_md5().
  */
 svn_error_t *
-svn_wc__node_get_md5_from_sha1(const svn_checksum_t **md5_checksum,
-   svn_wc_context_t *wc_ctx,
-   const char *wri_abspath,
-   const svn_checksum_t *sha1_checksum,
-   apr_pool_t *result_pool,
-   apr_pool_t

svn commit: r1906818 - /subversion/branches/pristine-checksum-kind/BRANCH-README

2023-01-19 Thread kotkov
Author: kotkov
Date: Thu Jan 19 18:48:31 2023
New Revision: 1906818

URL: http://svn.apache.org/viewvc?rev=1906818=rev
Log:
On the 'pristine-checksum-kind' branch: Add BRANCH-README.

* BRANCH-README: New file.

Added:
subversion/branches/pristine-checksum-kind/BRANCH-README   (with props)

Added: subversion/branches/pristine-checksum-kind/BRANCH-README
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/BRANCH-README?rev=1906818=auto
==
--- subversion/branches/pristine-checksum-kind/BRANCH-README (added)
+++ subversion/branches/pristine-checksum-kind/BRANCH-README Thu Jan 19 
18:48:31 2023
@@ -0,0 +1,18 @@
+Configurable pristine checksum kind in a working copy
+-
+
+The implementation on the branch allows creating working copies that use a
+checksum kind other than SHA-1.
+
+The checksum kind is persisted in the settings table.  Upgraded working copies
+of the older formats will have SHA-1 recorded as their pristine checksum kind
+and will continue to use it for compatibility.  Newly created working copies
+of the latest format (with --compatible-version=1.15 or --store-pristine=no),
+as currently implemented, will use the new pristine checksum kind.
+
+Currently, as a proof-of-concept, the branch uses salted SHA-1 as the new
+pristine checksum kind.  For the production-ready state, we could support
+using multiple new checksum types such as SHA-256.  That could be useful
+for future compatibility, because if we encounter any issues with one
+checksum kind, we could then switch to a different kind without having
+to change the working copy format.

Propchange: subversion/branches/pristine-checksum-kind/BRANCH-README
--
svn:eol-style = native




svn commit: r1906817 - /subversion/branches/pristine-checksum-kind/

2023-01-19 Thread kotkov
Author: kotkov
Date: Thu Jan 19 18:47:18 2023
New Revision: 1906817

URL: http://svn.apache.org/viewvc?rev=1906817=rev
Log:
Create the pristine-checksum-kind branch.

Added:
subversion/branches/pristine-checksum-kind/   (props changed)
  - copied from r1906816, subversion/trunk/

Propchange: subversion/branches/pristine-checksum-kind/
--
--- svn:auto-props (added)
+++ svn:auto-props Thu Jan 19 18:47:18 2023
@@ -0,0 +1,14 @@
+*.c = svn:eol-style=native
+*.cpp = svn:eol-style=native
+*.h = svn:eol-style=native
+*.hpp = svn:eol-style=native
+*.java = svn:eol-style=native
+*.m4 = svn:eol-style=native
+*.py = svn:eol-style=native
+*.pl = svn:eol-style=native
+*.rb = svn:eol-style=native
+*.sql = svn:eol-style=native
+*.txt = svn:eol-style=native
+README = svn:eol-style=native
+BRANCH-README = svn:eol-style=native
+STATUS = svn:eol-style=native

Propchange: subversion/branches/pristine-checksum-kind/
--
--- svn:ignore (added)
+++ svn:ignore Thu Jan 19 18:47:18 2023
@@ -0,0 +1,65 @@
+ChangeLog*
+Makefile
+config.cache
+config.log
+config.nice
+config.status
+configure
+libtool
+.gdb_history
+.swig_checked
+*.orig
+*.rej
+TAGS
+tags
+neon
+build-outputs.mk
+aclocal.m4
+autogen-standalone.mk
+autom4te.cache
+gen-make.opts
+tests.log*
+fails.log*
+db4-win32
+db
+*.o
+*~
+.*~
+apr
+apr-util
+apr-iconv
+Release
+release_win32
+release_win32_static
+release_x64
+Debug
+debug_win32
+debug_win32_static
+debug_x64
+ipch
+subversion_msvc.dsw
+subversion_msvc.ncb
+subversion_msvc.opt
+subversion_msvc.plg
+subversion_vcnet.*
+mkmf.log
+.project
+.classpath
+.cdtproject
+.settings
+.cproject
+py3c
+zlib
+sqlite-amalgamation
+serf
+googlemock
+.git
+.gitignore
+.idea
+compile_commands.json
+.kdev4
+*.kdev4
+.vs
+.swig_pl_checked
+.swig_py_checked
+.swig_rb_checked

Propchange: subversion/branches/pristine-checksum-kind/
--
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Jan 19 18:47:18 2023
@@ -0,0 +1,113 @@
+/subversion/branches/1.10-cache-improvements:1669168-1694487
+/subversion/branches/1.11.x:1841316,1841548
+/subversion/branches/1.5.x-r30215:870312
+/subversion/branches/1.7.x-fs-verify:1146708,1161180
+/subversion/branches/1.9-cache-improvements:1678948-1679863
+/subversion/branches/1.9.x:1735680
+/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:1613053-1776831
+/subversion/branches/auto-props-sdc:1384106-1401643
+/subversion/branches/bdb-reverse-deltas:872050-872529
+/subversion/branches/better-pristines:1807118-1843075
+/subversion/branches/cache-server:1458643-1476567
+/subversion/branches/decouple-shelving-cli:1874630-1875035
+/subversion/branches/diff-callbacks3:870059-870761
+/subversion/branches/diff-optimizations:1031270-1037352
+/subversion/branches/diff-optimizations-bytes:1037353-1067789
+/subversion/branches/dont-save-plaintext-passwords-by-default:870728-871118
+/subversion/branches/double-delete:870511-872970
+/subversion/branches/dump-load-cross-check:1654853-1657295
+/subversion/branches/ev2-export:1325914,1332738,1413107
+/subversion/branches/explore-wc:875486,875493,875497,875507,875511,875514,875559,875580-875581,875584,875587,875611,875627,875647,875667-875668,875711-875712,875733-875734,875736,875744-875748,875751,875758,875782,875795-875796,875830,875836,875838,875842,875852,875855,875864,875870,875873,875880,875885-875888,875890,875897-875898,875905,875907-875909,875935,875943-875944,875946,875979,875982-875983,875985-875986,875990,875997
+/subversion/branches/file-externals:871779-873302
+/subversion/branches/fs-rep-sharing:869036-873803
+/subversion/branches/fsfs-format7:1426304,1430673,1433848,1438408,1438982,1441129,1442051,1442068,1442504,1442910,1443171,1443803,1444690,1444693,1444695,1445040,1445080,1446103,1451129,1453590,1454307,1460579,1461851,1461865,1462837,1462904,1463120,1467362,1467382,1469487,1471208,1477166,1478055,1481447,1489817,1489949,1490673-1490674,1491784,1493042,1498029,1498103,1498155,1500054,1507729-1507731,1507735-1507736
+/subversion/branches/fsfs-improvements:1499981-1547039
+/subversion/branches/fsfs-lock-many:1571740-1577217
+/subversion/branches/fsfs-pack:873717-874575
+/subversion/branches/fsx:1507845-1509914
+/subversion/branches/fsx-1.10:1658219-1694500
+/subversion/branches/fsx-id:1645603-1649011
+/subversion/branches/gnome-keyring:870558-871410
+/subversion/branches/gpg-agent-password-store:1005036-1150766
+/subversion/branches/gtest_addition:1452117-1502138
+/subversion

svn commit: r1906769 - /subversion/trunk/subversion/libsvn_wc/wc-metadata.sql

2023-01-18 Thread kotkov
Author: kotkov
Date: Wed Jan 18 12:58:50 2023
New Revision: 1906769

URL: http://svn.apache.org/viewvc?rev=1906769=rev
Log:
Move the comment to a more appropriate location in wc-metadata.sql.

No functional change.

* subversion/libsvn_wc/wc-metadata.sql
  (): As above.

Modified:
subversion/trunk/subversion/libsvn_wc/wc-metadata.sql

Modified: subversion/trunk/subversion/libsvn_wc/wc-metadata.sql
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-metadata.sql?rev=1906769=1906768=1906769=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-metadata.sql Wed Jan 18 12:58:50 
2023
@@ -718,19 +718,6 @@ WHERE l.op_depth = 0
 /* True iff the pristine contents are currently available on disk. */
 ALTER TABLE PRISTINE ADD COLUMN hydrated INTEGER NOT NULL DEFAULT 1;
 
-  /* Note: we use checksums to detect if the file contents have been modified
- in textbase.c and in the svn_wc__internal_file_modified_p() function.
-
- The new working copy format SHOULD incorporate a switch to a different
- checksum type without known collisions.
-
- For the updated pristine table schema, we MAY want to add a new column
- containing a checksum of the first 8KB of the file to allow saying that
- the file is modified without reading all its content.  That could speed
- up the check for large modified files whose size did not change, for
- example if they are allocated in certain extents.
-   */
-
 CREATE INDEX I_PRISTINE_UNREFERENCED ON PRISTINE (refcount, refcount=0);
 
 /* This table contains references to the on disk text-base contents.
@@ -791,6 +778,19 @@ PRAGMA user_version = 32;
 
 /* - */
 /* Format 33   */
+
+/* Note: we use checksums to detect if the file contents have been modified
+   in textbase.c and in the svn_wc__internal_file_modified_p() function.
+
+   The new working copy format SHOULD incorporate a switch to a different
+   checksum type without known collisions.
+
+   For the updated pristine table schema, we MAY want to add a new column
+   containing a checksum of the first 8KB of the file to allow saying that
+   the file is modified without reading all its content.  That could speed
+   up the check for large modified files whose size did not change, for
+   example if they are allocated in certain extents. */
+
 /* -- STMT_UPGRADE_TO_33
 PRAGMA user_version = 33; */
 




svn commit: r1906768 - in /subversion/trunk/subversion/libsvn_wc: wc-metadata.sql wc_db_wcroot.c

2023-01-18 Thread kotkov
Author: kotkov
Date: Wed Jan 18 12:55:44 2023
New Revision: 1906768

URL: http://svn.apache.org/viewvc?rev=1906768=rev
Log:
When upgrading a working copy to format 32, ensure that we always have the
corresponding rows in the SETTINGS table.

Before this change, we treated an absent row as having the "old" settings
when making a query.  Let's instead change the upgrade routine so that the
row is always present — so that both newly created and upgraded working
copies would have the same entries in the SETTINGS table.

* subversion/libsvn_wc/wc-metadata.sql
  (STMT_UPGRADE_TO_32): Populate the SETTINGS table.

* subversion/libsvn_wc/wc_db_wcroot.c
  (read_settings): Expect the query to return a single row.

Modified:
subversion/trunk/subversion/libsvn_wc/wc-metadata.sql
subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c

Modified: subversion/trunk/subversion/libsvn_wc/wc-metadata.sql
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-metadata.sql?rev=1906768=1906767=1906768=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-metadata.sql Wed Jan 18 12:55:44 
2023
@@ -784,6 +784,9 @@ CREATE TABLE SETTINGS (
   store_pristine  INTEGER
 );
 
+/* Migrate existing working copy settings. */
+INSERT OR IGNORE INTO SETTINGS SELECT id, 1 FROM WCROOT;
+
 PRAGMA user_version = 32;
 
 /* - */

Modified: subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c?rev=1906768=1906767=1906768=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c Wed Jan 18 12:55:44 
2023
@@ -507,18 +507,14 @@ read_settings(svn_boolean_t *store_prist
   if (format >= SVN_WC__HAS_SETTINGS)
 {
   svn_sqlite__stmt_t *stmt;
-  svn_boolean_t have_row;
 
   SVN_ERR(svn_sqlite__get_statement(, sdb, STMT_SELECT_SETTINGS));
   SVN_ERR(svn_sqlite__bindf(stmt, "i", wc_id));
-  SVN_ERR(svn_sqlite__step(_row, stmt));
+  SVN_ERR(svn_sqlite__step_row(stmt));
 
-  if (have_row)
-*store_pristine_p = svn_sqlite__column_boolean(stmt, 0);
-  else
-*store_pristine_p = TRUE;
+  *store_pristine_p = svn_sqlite__column_boolean(stmt, 0);
 
-  SVN_ERR(svn_sqlite__reset(stmt));
+  SVN_ERR(svn_sqlite__step_done(stmt));
 }
   else
 {




svn commit: r1906766 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

2023-01-18 Thread kotkov
Author: kotkov
Date: Wed Jan 18 12:03:44 2023
New Revision: 1906766

URL: http://svn.apache.org/viewvc?rev=1906766=rev
Log:
Fix an invalid usage of SVN_VA_NULL.

* subversion/libsvn_wc/wc_db.c
  (init_db): SVN_VA_NULL is a sentinel, so don't use it in the middle of
   the argument list for svn_sqlite__bindf().  Use a regular NULL instead.

Modified:
subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1906766=1906765=1906766=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Wed Jan 18 12:03:44 2023
@@ -1409,7 +1409,7 @@ init_db(/* output values */
 *wc_id,  /* 1 */
 "",  /* 2 */
 0,   /* op_depth is 0 for base 
*/
-SVN_VA_NULL, /* 4 */
+NULL,/* 4 */
 *repos_id,
 root_node_repos_relpath,
 root_node_revision,




svn commit: r1906765 - in /subversion/trunk/subversion: include/private/svn_wc_private.h libsvn_client/upgrade.c libsvn_wc/deprecated.c libsvn_wc/upgrade.c

2023-01-18 Thread kotkov
Author: kotkov
Date: Wed Jan 18 11:58:12 2023
New Revision: 1906765

URL: http://svn.apache.org/viewvc?rev=1906765=rev
Log:
Remove the `store_pristine` argument from svn_wc__upgrade().

When upgrading a WC-NG working copy, we migrate the current pristine mode
without an ability to change it, so the argument is actually unused.

When upgrading a pre-NG working copy, we know that the working copy
stores pristines, so this can be specified explicitly.

* subversion/include/private/svn_wc_private.h
  (svn_wc__upgrade): Remove the `store_pristine` argument.

* subversion/libsvn_client/upgrade.c
  (upgrade_externals_from_properties,
   upgrade_external_item,
   upgrade_internal): Remove the `store_pristine` argument.
  (svn_client_upgrade2): Adjust this calling site of upgrade_internal().

* subversion/libsvn_wc/deprecated.c
  (svn_wc_upgrade): Adjust this calling site of svn_wc__upgrade().

* subversion/libsvn_wc/upgrade.c
  (svn_wc__upgrade): Remove the `store_pristine` argument.  Explicitly pass
   the appropriate value when upgrading a pre-NG working copy.

Modified:
subversion/trunk/subversion/include/private/svn_wc_private.h
subversion/trunk/subversion/libsvn_client/upgrade.c
subversion/trunk/subversion/libsvn_wc/deprecated.c
subversion/trunk/subversion/libsvn_wc/upgrade.c

Modified: subversion/trunk/subversion/include/private/svn_wc_private.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_wc_private.h?rev=1906765=1906764=1906765=diff
==
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Wed Jan 18 
11:58:12 2023
@@ -2287,9 +2287,8 @@ svn_wc__ensure_adm(svn_wc_context_t *wc_
 
 /**
  * Upgrade the working copy at @a local_abspath to the metadata storage
- * format indicated by @a target_format.  Use the @a store_pristine
- * settings value for the upgraded working copy.  @a local_abspath
- * should be an absolute path to the root of the working copy.
+ * format indicated by @a target_format.  @a local_abspath should be
+ * an absolute path to the root of the working copy.
  *
  * If @a cancel_func is non-NULL, invoke it with @a cancel_baton at
  * various points during the operation.  If it returns an error
@@ -2310,7 +2309,6 @@ svn_error_t *
 svn_wc__upgrade(svn_wc_context_t *wc_ctx,
 const char *local_abspath,
 int target_format,
-svn_boolean_t store_pristine,
 svn_wc_upgrade_get_repos_info_t repos_info_func,
 void *repos_info_baton,
 svn_cancel_func_t cancel_func,

Modified: subversion/trunk/subversion/libsvn_client/upgrade.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/upgrade.c?rev=1906765=1906764=1906765=diff
==
--- subversion/trunk/subversion/libsvn_client/upgrade.c (original)
+++ subversion/trunk/subversion/libsvn_client/upgrade.c Wed Jan 18 11:58:12 2023
@@ -93,14 +93,12 @@ static svn_error_t *
 upgrade_externals_from_properties(svn_client_ctx_t *ctx,
   const char *local_abspath,
   int wc_format,
-  svn_boolean_t store_pristine,
   struct repos_info_baton *info_baton,
   apr_pool_t *scratch_pool);
 
 static svn_error_t *
 upgrade_internal(const char *path,
  int wc_format,
- svn_boolean_t store_pristine,
  svn_client_ctx_t *ctx,
  apr_pool_t *scratch_pool)
 {
@@ -118,8 +116,7 @@ upgrade_internal(const char *path,
  _("'%s' is not a local path"), path);
 
   SVN_ERR(svn_dirent_get_absolute(_abspath, path, scratch_pool));
-  SVN_ERR(svn_wc__upgrade(ctx->wc_ctx, local_abspath,
-  wc_format, store_pristine,
+  SVN_ERR(svn_wc__upgrade(ctx->wc_ctx, local_abspath, wc_format,
   fetch_repos_info, _baton,
   ctx->cancel_func, ctx->cancel_baton,
   ctx->notify_func2, ctx->notify_baton2,
@@ -158,8 +155,7 @@ upgrade_internal(const char *path,
   if (kind == svn_node_dir)
 {
   svn_error_t *err = upgrade_internal(ext_abspath, wc_format,
-  store_pristine, ctx,
-  iterpool);
+  ctx, iterpool);
 
   if (err)
 {
@@ -183,8 +179,7 @@ upgrade_internal(const char *path,
   /* Upgrading from <= 1.6, or no svn:properties defined.
  (There is no way to detect the difference from libsvn_client :( ) */
 
-  SVN_ERR(up

svn commit: r1906011 - /subversion/trunk/build/generator/templates/vcnet_vcxproj.ezt

2022-12-15 Thread kotkov
Author: kotkov
Date: Thu Dec 15 10:09:50 2022
New Revision: 1906011

URL: http://svn.apache.org/viewvc?rev=1906011=rev
Log:
Use `/MP` (Build with multiple processes [1]) when compiling on Windows.

I tested a couple of build environments, and enabling this option seems to
improve the build times by ~20-30 seconds.  For example, 4:38 → 4:19.

[1] 
https://learn.microsoft.com/en-us/cpp/build/reference/mp-build-with-multiple-processes

* build/generator/templates/vcnet_vcxproj.ezt
  (): Enable multi-processor compilation.

Modified:
subversion/trunk/build/generator/templates/vcnet_vcxproj.ezt

Modified: subversion/trunk/build/generator/templates/vcnet_vcxproj.ezt
URL: 
http://svn.apache.org/viewvc/subversion/trunk/build/generator/templates/vcnet_vcxproj.ezt?rev=1906011=1906010=1906011=diff
==
--- subversion/trunk/build/generator/templates/vcnet_vcxproj.ezt (original)
+++ subversion/trunk/build/generator/templates/vcnet_vcxproj.ezt Thu Dec 15 
10:09:50 2022
@@ -66,6 +66,7 @@
   ProgramDatabase
   
4100;4127;4206;4512;4701;4706;4800;%(DisableSpecificWarnings)
   
4002;4003;4013;4020;4022;4024;4028;4029;4030;4031;4033;4047;4089;4113;4133;4204;4700;4715;4789;%(TreatSpecificWarningsAsErrors)
+  true
 [if-any configs.forced_include_files]  [for 
configs.forced_include_files][configs.forced_include_files];[end]%(ForcedIncludeFiles)
 [end]
 




svn commit: r1905955 [2/6] - in /subversion/trunk: ./ build/ build/generator/ notes/i525/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_fs_x/ subversion/l

2022-12-13 Thread kotkov
Modified: subversion/trunk/subversion/libsvn_client/conflicts.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/conflicts.c?rev=1905955=1905954=1905955=diff
==
--- subversion/trunk/subversion/libsvn_client/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_client/conflicts.c Tue Dec 13 09:49:29 
2022
@@ -6411,6 +6411,55 @@ resolve_postpone(svn_client_conflict_opt
   return SVN_NO_ERROR; /* Nothing to do. */
 }
 
+static svn_error_t *
+begin_resolve(const char **root_abspath_p,
+  const char *local_abspath,
+  svn_client_ctx_t *ctx,
+  apr_pool_t *result_pool,
+  apr_pool_t *scratch_pool)
+{
+  const char *lock_abspath;
+  svn_error_t *err;
+
+  SVN_ERR(svn_wc__acquire_write_lock_for_resolve(_abspath, ctx->wc_ctx,
+ local_abspath,
+ result_pool, scratch_pool));
+
+  /* This will open the RA session internally if needed. */
+  err = svn_client__textbase_sync(NULL, lock_abspath, TRUE, TRUE, ctx,
+  NULL, scratch_pool, scratch_pool);
+  if (err)
+{
+  return svn_error_compose_create(
+   err,
+   svn_wc__release_write_lock(ctx->wc_ctx, lock_abspath,
+  scratch_pool));
+}
+
+  *root_abspath_p = lock_abspath;
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+finish_resolve(const char *root_abspath,
+   svn_client_ctx_t *ctx,
+   svn_error_t *resolve_err,
+   apr_pool_t *scratch_pool)
+{
+  svn_error_t *err = resolve_err;
+
+  err = svn_error_compose_create(
+  err,
+  svn_client__textbase_sync(NULL, root_abspath, FALSE, TRUE, ctx,
+NULL, scratch_pool, scratch_pool));
+
+  err = svn_error_compose_create(
+  err,
+  svn_wc__release_write_lock(ctx->wc_ctx, root_abspath, scratch_pool));
+
+  return err;
+}
+
 /* Implements conflict_option_resolve_func_t. */
 static svn_error_t *
 resolve_text_conflict(svn_client_conflict_option_t *option,
@@ -6428,9 +6477,8 @@ resolve_text_conflict(svn_client_conflic
   conflict_choice = conflict_option_id_to_wc_conflict_choice(option_id);
   local_abspath = svn_client_conflict_get_local_abspath(conflict);
 
-  SVN_ERR(svn_wc__acquire_write_lock_for_resolve(_abspath, ctx->wc_ctx,
- local_abspath,
- scratch_pool, scratch_pool));
+  SVN_ERR(begin_resolve(_abspath, local_abspath, ctx,
+scratch_pool, scratch_pool));
   err = svn_wc__conflict_text_mark_resolved(ctx->wc_ctx,
 local_abspath,
 conflict_choice,
@@ -6439,9 +6487,7 @@ resolve_text_conflict(svn_client_conflic
 ctx->notify_func2,
 ctx->notify_baton2,
 scratch_pool);
-  err = svn_error_compose_create(err, svn_wc__release_write_lock(ctx->wc_ctx,
- lock_abspath,
- 
scratch_pool));
+  err = finish_resolve(lock_abspath, ctx, err, scratch_pool);
   svn_io_sleep_for_timestamps(local_abspath, scratch_pool);
   SVN_ERR(err);
 
@@ -6474,18 +6520,15 @@ resolve_prop_conflict(svn_client_conflic
   else
 merged_value = NULL;
 
-  SVN_ERR(svn_wc__acquire_write_lock_for_resolve(_abspath, ctx->wc_ctx,
- local_abspath,
- scratch_pool, scratch_pool));
+  SVN_ERR(begin_resolve(_abspath, local_abspath, ctx,
+scratch_pool, scratch_pool));
   err = svn_wc__conflict_prop_mark_resolved(ctx->wc_ctx, local_abspath,
 propname, conflict_choice,
 merged_value,
 ctx->notify_func2,
 ctx->notify_baton2,
 scratch_pool);
-  err = svn_error_compose_create(err, svn_wc__release_write_lock(ctx->wc_ctx,
- lock_abspath,
- 
scratch_pool));
+  err = finish_resolve(lock_abspath, ctx, err, scratch_pool);
   svn_io_sleep_for_timestamps(local_abspath, scratch_pool);
   SVN_ERR(err);
 
@@ -6550,9 +6593,8 @@ resolve_accept_current_wc_state(svn_clie
  svn_dirent_local_style(local_abspath,
 scratch_pool));
 
-  

svn commit: r1905955 [4/6] - in /subversion/trunk: ./ build/ build/generator/ notes/i525/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_fs_x/ subversion/l

2022-12-13 Thread kotkov
Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=1905955=1905954=1905955=diff
==
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Tue Dec 13 09:49:29 
2022
@@ -48,6 +48,7 @@
 #include "conflicts.h"
 #include "translate.h"
 #include "workqueue.h"
+#include "textbase.h"
 
 #include "private/svn_subr_private.h"
 #include "private/svn_wc_private.h"
@@ -439,7 +440,8 @@ struct handler_baton
 
 /* Get an empty file in the temporary area for WRI_ABSPATH.  The file will
not be set for automatic deletion, and the name will be returned in
-   TMP_FILENAME.
+   TMP_FILENAME_P.  Set *CLEANUP_WORK_ITEM_P to a new work item that will
+   remove the temporary file.
 
This implementation creates a new empty file with a unique name.
 
@@ -451,19 +453,35 @@ struct handler_baton
### file name to create later.  A better way may not be readily available.
  */
 static svn_error_t *
-get_empty_tmp_file(const char **tmp_filename,
+get_empty_tmp_file(const char **tmp_filename_p,
+   svn_skel_t **cleanup_work_item_p,
svn_wc__db_t *db,
const char *wri_abspath,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
 {
   const char *temp_dir_abspath;
+  const char *tmp_filename;
+  svn_skel_t *work_item;
+  svn_error_t *err;
 
   SVN_ERR(svn_wc__db_temp_wcroot_tempdir(_dir_abspath, db, wri_abspath,
  scratch_pool, scratch_pool));
-  SVN_ERR(svn_io_open_unique_file3(NULL, tmp_filename, temp_dir_abspath,
+  SVN_ERR(svn_io_open_unique_file3(NULL, _filename, temp_dir_abspath,
svn_io_file_del_none,
scratch_pool, scratch_pool));
+  err = svn_wc__wq_build_file_remove(_item, db, wri_abspath,
+ tmp_filename,
+ result_pool, scratch_pool);
+  if (err)
+{
+  return svn_error_compose_create(
+   err,
+   svn_io_remove_file2(tmp_filename, TRUE, scratch_pool));
+}
+
+  *tmp_filename_p = tmp_filename;
+  *cleanup_work_item_p = work_item;
 
   return SVN_NO_ERROR;
 }
@@ -3726,10 +3744,10 @@ lazy_open_source(svn_stream_t **stream,
 {
   struct file_baton *fb = baton;
 
-  SVN_ERR(svn_wc__db_pristine_read(stream, NULL, fb->edit_baton->db,
-   fb->local_abspath,
-   fb->original_checksum,
-   result_pool, scratch_pool));
+  SVN_ERR(svn_wc__textbase_get_contents(stream, fb->edit_baton->db,
+fb->local_abspath,
+fb->original_checksum, FALSE,
+result_pool, scratch_pool));
 
 
   return SVN_NO_ERROR;
@@ -3748,19 +3766,35 @@ lazy_open_target(svn_stream_t **stream_p
   svn_stream_t *pristine_install_stream;
   svn_wc__working_file_writer_t *file_writer;
   svn_stream_t *stream;
+  svn_boolean_t hydrated;
+
+  if (fb->shadowed || fb->obstruction_found || fb->edit_obstructed)
+{
+  hydrated = TRUE;
+}
+  else if (fb->adding_file && !fb->add_existed)
+{
+  /* Clean new file, hint that we don't need the text-base. */
+  hydrated = FALSE;
+}
+  else
+{
+  hydrated = TRUE;
+}
 
   /* By convention return value is undefined on error, but we rely
  on HB->INSTALL_DATA value in window_handler() and abort
  INSTALL_STREAM if is not NULL on error.
  So we store INSTALL_DATA to local variable first, to leave
  HB->INSTALL_DATA unchanged on error. */
-  SVN_ERR(svn_wc__db_pristine_prepare_install(_install_stream,
-  _install_data,
-  >new_text_base_sha1_checksum,
-  NULL,
-  fb->edit_baton->db,
-  fb->dir_baton->local_abspath,
-  result_pool, scratch_pool));
+  SVN_ERR(svn_wc__textbase_prepare_install(_install_stream,
+   _install_data,
+   >new_text_base_sha1_checksum,
+   NULL,
+   fb->edit_baton->db,
+   fb->local_abspath,
+   hydrated,
+   result_pool, scratch_pool));
 
   if (fb->shadowed || fb->obstruction_found || fb->edit_obstructed)
 {
@@ -4063,17 +4097,19 @@ 

svn commit: r1905955 [1/6] - in /subversion/trunk: ./ build/ build/generator/ notes/i525/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_fs_x/ subversion/l

2022-12-13 Thread kotkov
Author: kotkov
Date: Tue Dec 13 09:49:29 2022
New Revision: 1905955

URL: http://svn.apache.org/viewvc?rev=1905955=rev
Log:
Merge the `pristines-on-demand-on-mwf` branch to trunk.

What's included
---

- Core implementation of the new mode where required pristines are fetched
  at the beginning of the operation.

- A new --store-pristine=yes/no option for `svn checkout` that is persisted
  as a working copy setting.

- An update for `svn info` to display the value of this new setting.

- A standalone test harness that tests main operations in both
  --store-pristine modes and gets executed on every test run.

- A new --store-pristine=yes/no option for the test suite that forces all
  tests to run with a specific pristine mode.


Description of the approach in the new mode
---

The core idea is that we start to maintain the following invariant: only the
modified files have their pristine text-base files available on the disk.

- To avoid having to access the text-base, the "is the file modified?" check
  is performed by calculating the checksum of a file and comparing that to
  what's recorded in the working copy.

- A text-base of the unmodified file is the file itself, appropriately
  detranslated.

- To get into the appropriate state at the beginning of the operation, we walk
  through the current text-base info in the db and check if the corresponding
  working files are modified.  The missing text-bases are fetched using the
  svn_ra layer.  The operations also include a final step during which the
  no longer required text-bases are removed from disk.

- The operations that don't need to access the text-bases (such as "svn ls"
  or the updated "svn st") do not perform this walk and do not synchronize
  the text-base state.


References
--

[1] https://issues.apache.org/jira/browse/SVN-525
[2] https://lists.apache.org/thread/f3nrp0q2qtqbngg92897rhkkgx8qs8sp
[3] https://lists.apache.org/thread/rx975btbtwx2klj8ykmz4t3v8vx49kjn

Added:
subversion/trunk/notes/i525/
  - copied from r1905954, 
subversion/branches/pristines-on-demand-on-mwf/notes/i525/
subversion/trunk/subversion/libsvn_client/textbase.c
  - copied unchanged from r1905954, 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/textbase.c
subversion/trunk/subversion/libsvn_wc/textbase.c
  - copied unchanged from r1905954, 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/textbase.c
subversion/trunk/subversion/libsvn_wc/textbase.h
  - copied unchanged from r1905954, 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/textbase.h
subversion/trunk/subversion/libsvn_wc/wc_db_textbase.c
  - copied unchanged from r1905954, 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c
subversion/trunk/subversion/tests/cmdline/store_pristine_tests.py
  - copied unchanged from r1905954, 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py
Modified:
subversion/trunk/   (props changed)
subversion/trunk/INSTALL
subversion/trunk/Makefile.in
subversion/trunk/build/generator/gen_win_dependencies.py
subversion/trunk/build/run_tests.py
subversion/trunk/configure.ac
subversion/trunk/get-deps.sh
subversion/trunk/subversion/include/private/svn_wc_private.h
subversion/trunk/subversion/include/svn_client.h
subversion/trunk/subversion/include/svn_error_codes.h
subversion/trunk/subversion/include/svn_ra.h
subversion/trunk/subversion/include/svn_wc.h
subversion/trunk/subversion/libsvn_client/cat.c
subversion/trunk/subversion/libsvn_client/checkout.c
subversion/trunk/subversion/libsvn_client/client.h
subversion/trunk/subversion/libsvn_client/commit.c
subversion/trunk/subversion/libsvn_client/commit_util.c
subversion/trunk/subversion/libsvn_client/conflicts.c
subversion/trunk/subversion/libsvn_client/copy.c
subversion/trunk/subversion/libsvn_client/deprecated.c
subversion/trunk/subversion/libsvn_client/diff.c
subversion/trunk/subversion/libsvn_client/export.c
subversion/trunk/subversion/libsvn_client/externals.c
subversion/trunk/subversion/libsvn_client/layout.c
subversion/trunk/subversion/libsvn_client/merge.c
subversion/trunk/subversion/libsvn_client/ra.c
subversion/trunk/subversion/libsvn_client/resolved.c
subversion/trunk/subversion/libsvn_client/revert.c
subversion/trunk/subversion/libsvn_client/shelf.c
subversion/trunk/subversion/libsvn_client/shelf2.c
subversion/trunk/subversion/libsvn_client/status.c
subversion/trunk/subversion/libsvn_client/switch.c
subversion/trunk/subversion/libsvn_client/update.c
subversion/trunk/subversion/libsvn_client/upgrade.c
subversion/trunk/subversion/libsvn_client/util.c
subversion/trunk/subversion/libsvn_fs_x/   (props changed)
 

svn commit: r1905955 [5/6] - in /subversion/trunk: ./ build/ build/generator/ notes/i525/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_fs_x/ subversion/l

2022-12-13 Thread kotkov
Modified: subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c?rev=1905955=1905954=1905955=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c Tue Dec 13 
09:49:29 2022
@@ -154,6 +154,7 @@
 #include "conflicts.h"
 #include "workqueue.h"
 #include "token-map.h"
+#include "textbase.h"
 
 /* Helper functions */
 /* Return the absolute path, in local path style, of LOCAL_RELPATH
@@ -970,15 +971,28 @@ tc_editor_add_file(node_move_baton_t *nm
 }
   else
 {
+  const char *src_abspath;
+  const char *install_from;
+  svn_skel_t *cleanup_work_item;
+
+  src_abspath = svn_dirent_join(b->wcroot->abspath, nmb->src_relpath,
+scratch_pool);
+
   /* Update working file. */
+  SVN_ERR(svn_wc__textbase_setaside_wq(_from,
+   _work_item,
+   b->db, src_abspath, NULL,
+   b->cancel_func, b->cancel_baton,
+   scratch_pool, scratch_pool));
   SVN_ERR(svn_wc__wq_build_file_install(_item, b->db,
 svn_dirent_join(b->wcroot->abspath,
 relpath,
 scratch_pool),
-NULL,
+install_from,
 FALSE /*FIXME: use_commit_times?*/,
 TRUE  /* record_file_info */,
 scratch_pool, scratch_pool));
+  work_item = svn_wc__wq_merge(work_item, cleanup_work_item, scratch_pool);
 }
 
   SVN_ERR(update_move_list_add(b->wcroot, relpath, b->db,
@@ -1369,33 +1383,56 @@ tc_editor_alter_file(node_move_baton_t *
scratch_pool));
   if (!is_locally_modified)
 {
+  const char *src_abspath;
+  const char *install_from;
+  svn_skel_t *cleanup_work_item;
+
+  src_abspath = svn_dirent_join(b->wcroot->abspath, nmb->src_relpath,
+scratch_pool);
+
+  SVN_ERR(svn_wc__textbase_setaside_wq(_from,
+   _work_item,
+   b->db, src_abspath, NULL,
+   b->cancel_func, b->cancel_baton,
+   scratch_pool, scratch_pool));
   SVN_ERR(svn_wc__wq_build_file_install(_item, b->db,
 local_abspath,
-NULL,
+install_from,
 FALSE /* FIXME: 
use_commit_times? */,
 TRUE  /* record_file_info */,
 scratch_pool, scratch_pool));
 
   work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
+  work_items = svn_wc__wq_merge(work_items, cleanup_work_item, 
scratch_pool);
 
   content_state = svn_wc_notify_state_changed;
 }
   else
 {
+  svn_skel_t *cleanup_queue = NULL;
+
   /*
* Run a 3-way merge to update the file, using the pre-update
* pristine text as the merge base, the post-update pristine
* text as the merge-left version, and the current content of the
* moved-here working file as the merge-right version.
*/
-  SVN_ERR(svn_wc__db_pristine_get_path(_pristine_abspath,
-   b->db, b->wcroot->abspath,
+  SVN_ERR(svn_wc__textbase_setaside_wq(_pristine_abspath,
+   _item, b->db,
+   local_abspath,
old_version.checksum,
+   b->cancel_func, b->cancel_baton,
scratch_pool, scratch_pool));
-  SVN_ERR(svn_wc__db_pristine_get_path(_pristine_abspath,
-   b->db, b->wcroot->abspath,
+  cleanup_queue = svn_wc__wq_merge(cleanup_queue, work_item, 
scratch_pool);
+
+  SVN_ERR(svn_wc__textbase_setaside_wq(_pristine_abspath,
+   _item, b->db,
+   local_abspath,
   

svn commit: r1905955 [3/6] - in /subversion/trunk: ./ build/ build/generator/ notes/i525/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_fs_x/ subversion/l

2022-12-13 Thread kotkov
Modified: subversion/trunk/subversion/libsvn_wc/adm_crawler.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_crawler.c?rev=1905955=1905954=1905955=diff
==
--- subversion/trunk/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_crawler.c Tue Dec 13 09:49:29 2022
@@ -46,6 +46,7 @@
 #include "translate.h"
 #include "workqueue.h"
 #include "conflicts.h"
+#include "textbase.h"
 
 #include "svn_private_config.h"
 
@@ -74,13 +75,22 @@ restore_file(svn_wc__db_t *db,
  apr_pool_t *scratch_pool)
 {
   svn_skel_t *work_item;
+  const char *install_from;
+  svn_skel_t *cleanup_work_item;
 
+  SVN_ERR(svn_wc__textbase_setaside_wq(_from,
+   _work_item,
+   db, local_abspath, NULL,
+   cancel_func, cancel_baton,
+   scratch_pool, scratch_pool));
   SVN_ERR(svn_wc__wq_build_file_install(_item,
 db, local_abspath,
-NULL /* source_abspath */,
+install_from,
 use_commit_times,
 TRUE /* record_fileinfo */,
 scratch_pool, scratch_pool));
+  work_item = svn_wc__wq_merge(work_item, cleanup_work_item, scratch_pool);
+
   /* ### we need an existing path for wq_add. not entirely WRI_ABSPATH yet  */
   SVN_ERR(svn_wc__db_wq_add(db,
 svn_dirent_dirname(local_abspath, scratch_pool),
@@ -211,10 +221,10 @@ maybe_restore_node(svn_wc__db_t *db,
 }
 
 svn_error_t *
-svn_wc_restore(svn_wc_context_t *wc_ctx,
-   const char *local_abspath,
-   svn_boolean_t use_commit_times,
-   apr_pool_t *scratch_pool)
+svn_wc_restore2(svn_wc_context_t *wc_ctx,
+const char *local_abspath,
+svn_boolean_t use_commit_times,
+apr_pool_t *scratch_pool)
 {
   /* ### If ever revved: Add cancel func. */
   svn_wc__db_status_t status;
@@ -297,7 +307,7 @@ svn_wc_restore(svn_wc_context_t *wc_ctx,
passed here to avoid another database query.
 
DEPTH_COMPATIBILITY_TRICK means the same thing here as it does
-   in svn_wc_crawl_revisions5().
+   in svn_wc_crawl_revisions6().
 
If RESTORE_FILES is set, then unexpectedly missing working files
will be restored from text-base and NOTIFY_FUNC/NOTIFY_BATON
@@ -665,7 +675,7 @@ report_revisions_and_depths(svn_wc__db_t
 
 
 svn_error_t *
-svn_wc_crawl_revisions5(svn_wc_context_t *wc_ctx,
+svn_wc_crawl_revisions6(svn_wc_context_t *wc_ctx,
 const char *local_abspath,
 const svn_ra_reporter3_t *reporter,
 void *report_baton,
@@ -979,8 +989,8 @@ read_and_checksum_pristine_text(svn_stre
 {
   svn_stream_t *base_stream;
 
-  SVN_ERR(svn_wc__get_pristine_contents(_stream, NULL, db, local_abspath,
-result_pool, scratch_pool));
+  SVN_ERR(svn_wc__textbase_get_contents(_stream, db, local_abspath, NULL,
+TRUE, result_pool, scratch_pool));
   if (base_stream == NULL)
 {
   base_stream = svn_stream_empty(result_pool);
@@ -1096,11 +1106,11 @@ svn_wc__internal_transmit_text_deltas(sv
 {
   svn_stream_t *new_pristine_stream;
 
-  SVN_ERR(svn_wc__db_pristine_prepare_install(_pristine_stream,
-  _data,
-  _sha1_checksum, NULL,
-  db, local_abspath,
-  scratch_pool, scratch_pool));
+  SVN_ERR(svn_wc__textbase_prepare_install(_pristine_stream,
+   _data,
+   _sha1_checksum, NULL,
+   db, local_abspath, FALSE,
+   scratch_pool, scratch_pool));
   local_stream = copying_stream(local_stream, new_pristine_stream,
 scratch_pool);
 }
@@ -1117,11 +1127,23 @@ svn_wc__internal_transmit_text_deltas(sv
   /* We will be computing a delta against the pristine contents */
   /* We need the expected checksum to be an MD-5 checksum rather than a
* SHA-1 because we want to pass it to apply_textdelta(). */
-  SVN_ERR(read_and_checksum_pristine_text(_stream,
-  _md5_checksum,
-  _checksum,
-  db, local_abspath,
-  scratch_pool, 

svn commit: r1905955 [6/6] - in /subversion/trunk: ./ build/ build/generator/ notes/i525/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_fs_x/ subversion/l

2022-12-13 Thread kotkov
Modified: subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c?rev=1905955=1905954=1905955=diff
==
--- subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c Tue Dec 13 
09:49:29 2022
@@ -106,14 +106,24 @@ static const int slow_statements[] =
   STMT_SELECT_PRESENT_HIGHEST_WORKING_NODES_BY_BASENAME_AND_KIND,
   STMT_SELECT_COPIES_OF_REPOS_RELPATH,
 
-  /* Designed as slow to avoid penalty on other queries */
-  STMT_SELECT_UNREFERENCED_PRISTINES,
-
   /* Slow, but just if foreign keys are enabled:
* STMT_DELETE_PRISTINE_IF_UNREFERENCED,
*/
   STMT_HAVE_STAT1_TABLE, /* Queries sqlite_master which has no index */
 
+  /* Currently uses a temporary B-tree for GROUP BY */
+  STMT_TEXTBASE_SYNC,
+
+  -1 /* final marker */
+};
+
+/* These statements are slow in WC format 31, but not in latest format. */
+static const int slow_statements_f31[] =
+{
+  /* Format 31: "designed as slow to avoid penalty on other queries"
+   * Format 32: now indexed. */
+  STMT_SELECT_UNREFERENCED_PRISTINES,
+
   -1 /* final marker */
 };
 
@@ -145,7 +155,9 @@ in_list(const int list[], int stmt_idx)
 }
 
 /* Helpers to determine if a statement is in a common list */
-#define is_slow_statement(stmt_idx) in_list(slow_statements, stmt_idx)
+#define is_slow_statement(stmt_idx, wc_format) \
+(in_list(slow_statements, stmt_idx) \
+ || (wc_format == 31 && in_list(slow_statements_f31, stmt_idx)))
 #define is_schema_statement(stmt_idx) \
 ((stmt_idx >= STMT_SCHEMA_FIRST) || in_list(schema_statements, stmt_idx))
 
@@ -216,6 +228,40 @@ test_sqlite_version(apr_pool_t *scratch_
 #endif
 }
 
+/* Return TRUE iff statement STMT_NUM is valid in the schema for
+ * WC format FORMAT. */
+static svn_boolean_t
+stmt_matches_wc_format(int stmt_num,
+   const svn_test_opts_t *opts,
+   apr_pool_t *pool)
+{
+  int wc_format = -1;
+
+  svn_error_clear(svn_wc__format_from_version(
+_format, opts->wc_format_version, pool));
+  switch (stmt_num)
+{
+case STMT_INSERT_OR_IGNORE_PRISTINE_F31:
+case STMT_UPSERT_PRISTINE_F31:
+case STMT_SELECT_PRISTINE_F31:
+case STMT_SELECT_COPY_PRISTINES_F31:
+  return (wc_format <= 31);
+case STMT_INSERT_OR_IGNORE_PRISTINE_F32:
+case STMT_UPSERT_PRISTINE_F32:
+case STMT_SELECT_PRISTINE_F32:
+case STMT_SELECT_COPY_PRISTINES_F32:
+case STMT_UPDATE_PRISTINE_HYDRATED:
+case STMT_TEXTBASE_ADD_REF:
+case STMT_TEXTBASE_REMOVE_REF:
+case STMT_TEXTBASE_WALK:
+case STMT_TEXTBASE_SYNC:
+case STMT_SELECT_SETTINGS:
+case STMT_UPSERT_SETTINGS:
+  return (wc_format >= 32);
+}
+  return TRUE;
+}
+
 /* Parse all normal queries */
 static svn_error_t *
 test_parsable(const svn_test_opts_t *opts,
@@ -234,6 +280,9 @@ test_parsable(const svn_test_opts_t *opt
   if (is_schema_statement(i))
 continue;
 
+  if (!stmt_matches_wc_format(i, opts, scratch_pool))
+continue;
+
   /* Some of our statement texts contain multiple queries. We prepare
  them all. */
   while (*text != '\0')
@@ -651,6 +700,10 @@ test_query_expectations(const svn_test_o
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   svn_error_t *warnings = NULL;
   svn_boolean_t supports_query_info;
+  int wc_format;
+
+  SVN_ERR(svn_wc__format_from_version(_format, opts->wc_format_version,
+  scratch_pool));
 
   SVN_ERR(create_memory_db(, opts, scratch_pool));
 
@@ -674,6 +727,9 @@ test_query_expectations(const svn_test_o
   if (is_schema_statement(i))
 continue;
 
+  if (!stmt_matches_wc_format(i, opts, scratch_pool))
+continue;
+
   /* Prepare statement to find if it is a single statement. */
   r = sqlite3_prepare_v2(sdb, wc_queries[i], -1, , );
 
@@ -734,7 +790,7 @@ test_query_expectations(const svn_test_o
   && item->automatic_index)
 {
   warned = TRUE;
-  if (!is_slow_statement(i))
+  if (!is_slow_statement(i, wc_format))
 {
   warnings = svn_error_createf(SVN_ERR_TEST_FAILED, warnings,
 "%s: "
@@ -761,7 +817,7 @@ test_query_expectations(const svn_test_o
  statements is not our concern here. */
 
   /* "Slow" statements do expect to see a warning, however. */
-  if (is_slow_statement(i))
+  if (is_slow_statement(i, wc_format))
 warned = TRUE;
 }
   else if (in_list(primary_key_statements, i))
@@ -770,7 +826,7 @@ test_query_expectations(const svn_test_o
  as table scan in 3.8+, while the execution plan 

svn commit: r1905839 - in /subversion/branches/pristines-on-demand-on-mwf: ./ subversion/libsvn_wc/adm_files.c

2022-12-07 Thread kotkov
Author: kotkov
Date: Wed Dec  7 10:58:26 2022
New Revision: 1905839

URL: http://svn.apache.org/viewvc?rev=1905839=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Sync with trunk@1905838.

Modified:
subversion/branches/pristines-on-demand-on-mwf/   (props changed)

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/adm_files.c

Propchange: subversion/branches/pristines-on-demand-on-mwf/
--
  Merged /subversion/trunk:r1905811-1905838

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/adm_files.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/adm_files.c?rev=1905839=1905838=1905839=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/adm_files.c 
(original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/adm_files.c 
Wed Dec  7 10:58:26 2022
@@ -310,7 +310,8 @@ svn_wc__internal_ensure_adm(svn_wc__db_t
   return svn_error_createf(
   SVN_ERR_WC_OBSTRUCTED_UPDATE, NULL,
   _("Format %d doesn't match existing format %d in '%s'"),
-  target_format, present_format, local_abspath);
+  target_format, present_format,
+  svn_dirent_local_style(local_abspath, scratch_pool));
 }
 
   SVN_ERR(svn_wc__db_get_settings(NULL, _store_pristine, db,
@@ -349,7 +350,9 @@ svn_wc__internal_ensure_adm(svn_wc__db_t
   svn_error_createf(SVN_ERR_WC_OBSTRUCTED_UPDATE, NULL,
 _("Revision %ld doesn't match existing "
   "revision %ld in '%s'"),
-revision, db_revision, local_abspath);
+revision, db_revision,
+svn_dirent_local_style(local_abspath,
+   scratch_pool));
 
   if (!db_repos_root_url)
 {
@@ -395,7 +398,8 @@ svn_wc__internal_ensure_adm(svn_wc__db_t
 db_repos_relpath,
 scratch_pool),
 repos_uuid,
-local_abspath);
+svn_dirent_local_style(local_abspath,
+   scratch_pool));
 }
 }
 




svn commit: r1905838 - /subversion/trunk/subversion/libsvn_wc/adm_files.c

2022-12-07 Thread kotkov
Author: kotkov
Date: Wed Dec  7 10:53:40 2022
New Revision: 1905838

URL: http://svn.apache.org/viewvc?rev=1905838=rev
Log:
In the svn_wc__internal_ensure_adm() function, do not forget to convert
internal paths to local style when constructing error messages.

* subversion/libsvn_wc/adm_files.c
  (svn_wc__internal_ensure_adm): Add missing calls to svn_dirent_local_style().

Modified:
subversion/trunk/subversion/libsvn_wc/adm_files.c

Modified: subversion/trunk/subversion/libsvn_wc/adm_files.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_files.c?rev=1905838=1905837=1905838=diff
==
--- subversion/trunk/subversion/libsvn_wc/adm_files.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_files.c Wed Dec  7 10:53:40 2022
@@ -435,7 +435,8 @@ svn_wc__internal_ensure_adm(svn_wc__db_t
 return svn_error_createf(
 SVN_ERR_WC_OBSTRUCTED_UPDATE, NULL,
 _("Format %d doesn't match existing format %d in '%s'"),
-target_format, present_format, local_abspath);
+target_format, present_format,
+svn_dirent_local_style(local_abspath, scratch_pool));
 
   /* ### Should we match copyfrom_revision? */
   if (db_revision != revision)
@@ -443,7 +444,9 @@ svn_wc__internal_ensure_adm(svn_wc__db_t
   svn_error_createf(SVN_ERR_WC_OBSTRUCTED_UPDATE, NULL,
 _("Revision %ld doesn't match existing "
   "revision %ld in '%s'"),
-revision, db_revision, local_abspath);
+revision, db_revision,
+svn_dirent_local_style(local_abspath,
+   scratch_pool));
 
   if (!db_repos_root_url)
 {
@@ -489,7 +492,8 @@ svn_wc__internal_ensure_adm(svn_wc__db_t
 db_repos_relpath,
 scratch_pool),
 repos_uuid,
-local_abspath);
+svn_dirent_local_style(local_abspath,
+   scratch_pool));
 }
 }
 




svn commit: r1905812 - in /subversion/branches/pristines-on-demand-on-mwf: ./ subversion/include/private/svn_wc_private.h subversion/libsvn_wc/wc_db_wcroot.c

2022-12-06 Thread kotkov
Author: kotkov
Date: Tue Dec  6 20:21:45 2022
New Revision: 1905812

URL: http://svn.apache.org/viewvc?rev=1905812=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Sync with trunk@1905810.

Resolve conflicts in the svn_wc_private.h and wc_db_wcroot.c files.

Modified:
subversion/branches/pristines-on-demand-on-mwf/   (props changed)

subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_wcroot.c

Propchange: subversion/branches/pristines-on-demand-on-mwf/
--
  Merged /subversion/trunk:r1905755-1905810

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h?rev=1905812=1905811=1905812=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h
 Tue Dec  6 20:21:45 2022
@@ -2233,9 +2233,7 @@ svn_wc__min_supported_format_version(voi
 /**
  * Set @a *format_p and @a *store_pristine_p to the settings of the
  * nearest parent working copy root of @a local_abspath in @a wc_ctx,
- * or to settings of any root stored there, preferring the one with
- * the oldest format. If @a wc_ctx is empty, return the library's
- * default settings.
+ * or to the library's default settings if there are no such roots.
  *
  * Use @a scratch_pool for temporary allocations.
  *

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_wcroot.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_wcroot.c?rev=1905812=1905811=1905812=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_wcroot.c
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_wcroot.c
 Tue Dec  6 20:21:45 2022
@@ -31,8 +31,6 @@
 #include "svn_pools.h"
 #include "svn_version.h"
 
-#include "private/svn_sorts_private.h"
-
 #include "wc.h"
 #include "adm_files.h"
 #include "wc_db_private.h"
@@ -1070,14 +1068,6 @@ svn_wc__db_drop_root(svn_wc__db_t *db,
 }
 
 
-/*
- * ### FIXME:
- *
- * There must surely be a better way to find the nearest enclosing wcroot of a
- * path than by copying the hash keys to an array and sorting the array.
- *
- * TODO: Convert the svn_wc__db_t::dir_data hash to a sorted dictionary?.
- */
 svn_error_t *
 svn_wc__settings_from_context(int *format_p,
   svn_boolean_t *store_pristine_p,
@@ -1085,77 +1075,25 @@ svn_wc__settings_from_context(int *forma
   const char *local_abspath,
   apr_pool_t *scratch_pool)
 {
-  apr_hash_t *const dir_data = wc_ctx->db->dir_data;
-  apr_array_header_t *keys;
-  int index;
-
-  /* This is what we return if we don't find a concrete format version. */
-  SVN_ERR(svn_hash_keys(, dir_data, scratch_pool));
-  if (0 == keys->nelts)
+  const char *current_path = local_abspath;
+
+  do
 {
-  *format_p = SVN_WC__DEFAULT_VERSION;
-  *store_pristine_p = TRUE;
-  return SVN_NO_ERROR;
-}
+  svn_wc__db_wcroot_t *wcroot;
 
-  svn_sort__array(keys, svn_sort_compare_paths);
-  index = svn_sort__bsearch_lower_bound(keys, _abspath,
-svn_sort_compare_paths);
-
-  /* If the previous key is a parent of the local_abspath, use its format. */
-  {
-const char *const here = (index >= keys->nelts ? NULL
-  : APR_ARRAY_IDX(keys, index, const char*));
-const char *const prev = (index == 0 ? NULL
-  : APR_ARRAY_IDX(keys, index - 1, const char*));
-
-if (here)
-  {
-const char *const child = svn_dirent_skip_ancestor(here, 
local_abspath);
-if (child && !*child)
-  {
-/* Found an exact match in the WC context. */
-svn_wc__db_wcroot_t *wcroot = svn_hash_gets(dir_data, here);
-*format_p = wcroot->format;
-*store_pristine_p = wcroot->store_pristine;
-return SVN_NO_ERROR;
-  }
-  }
-
-if (prev)
-  {
-const char *const child = svn_dirent_skip_ancestor(prev, 
local_abspath);
-if (child)
-  {
-/* Found the parent path in the WC context. */
-svn_wc__db_wcroot_t *wcroot = svn_hash_gets(dir_data, prev);
-*format_p = wcroot->forma

svn commit: r1905810 - in /subversion/trunk/subversion: include/private/svn_wc_private.h libsvn_wc/wc_db_wcroot.c

2022-12-06 Thread kotkov
Author: kotkov
Date: Tue Dec  6 20:09:44 2022
New Revision: 1905810

URL: http://svn.apache.org/viewvc?rev=1905810=rev
Log:
Switch to an alternative implementation of svn_wc__format_from_context().

The previous implementation seems to have a potential issue in how it finds
the parent wcroot.  We were sorting the paths in the depth-first order by using
svn_path_compare_paths().  This function orders children in subdirectories
directly after their parents.  We would then check if the path of the previous
entry, closest to the `local_abspath`, is its parent path.  If it is, we would
use that entry, or stop searching for a parent otherwise.

The problem is that the previous entry in the sort order may point to the
sibling of the current path.  For example, if the sorted entries are
["/A", "/A/B", "/A/Z"], and we are looking for "/A/C", we would check
that "/A/B" is not a parent of that path, and stop before testing "/A" that
actually is a parent of the path.

This change switches to the implementation that doesn't require sorting all
context entries and instead checks the parents of the `local_abspath`, picking
the closest one.  It also attempts to have predictable behavior in case there's
no such parent, by returning the defaults instead of additionally scanning
through the other context entries that may be unrelated.  The fallback code
currently is not triggered in the test suite, and I assume that this should
not affect the visible behavior.

* subversion/include/private/svn_wc_private.h
  (svn_wc__format_from_context): Adjust documentation.

* subversion/libsvn_wc/wc_db_wcroot.c
  (): Remove include of "private/svn_sorts_private.h". 
  (svn_wc__format_from_context): Remove TODO. Switch to a new implementation.

Modified:
subversion/trunk/subversion/include/private/svn_wc_private.h
subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c

Modified: subversion/trunk/subversion/include/private/svn_wc_private.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_wc_private.h?rev=1905810=1905809=1905810=diff
==
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Tue Dec  6 
20:09:44 2022
@@ -2232,8 +2232,8 @@ svn_wc__min_supported_format_version(voi
 
 /**
  * Set @a format to the format of the nearest parent working copy root of
- * @a local_abspath in @a wc_ctx, or to the oldest format of any root stored
- * there. If @a wc_ctx is empty, return the library's default format.
+ * @a local_abspath in @a wc_ctx, or to the library's default format if
+ * there are no such roots.
  *
  * Use @a scratch_pool for temporary allocations.
  *

Modified: subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c?rev=1905810=1905809=1905810=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c Tue Dec  6 20:09:44 
2022
@@ -31,8 +31,6 @@
 #include "svn_pools.h"
 #include "svn_version.h"
 
-#include "private/svn_sorts_private.h"
-
 #include "wc.h"
 #include "adm_files.h"
 #include "wc_db_private.h"
@@ -1032,83 +1030,29 @@ svn_wc__db_drop_root(svn_wc__db_t *db,
 }
 
 
-/*
- * ### FIXME:
- *
- * There must surely be a better way to find the nearest enclosing wcroot of a
- * path than by copying the hash keys to an array and sorting the array.
- *
- * TODO: Convert the svn_wc__db_t::dir_data hash to a sorted dictionary?.
- */
 svn_error_t *
 svn_wc__format_from_context(int *format,
 svn_wc_context_t *wc_ctx,
 const char *local_abspath,
 apr_pool_t *scratch_pool)
 {
-  apr_hash_t *const dir_data = wc_ctx->db->dir_data;
-  apr_array_header_t *keys;
-  int index;
-
-  /* This is what we return if we don't find a concrete format version. */
-  SVN_ERR(svn_hash_keys(, dir_data, scratch_pool));
-  if (0 == keys->nelts)
+  const char *current_path = local_abspath;
+
+  do
 {
-  *format = SVN_WC__DEFAULT_VERSION;
-  return SVN_NO_ERROR;
-}
+  svn_wc__db_wcroot_t *wcroot;
+
+  wcroot = svn_hash_gets(wc_ctx->db->dir_data, current_path);
+  if (wcroot)
+{
+  *format = wcroot->format;
+  return SVN_NO_ERROR;
+}
 
-  svn_sort__array(keys, svn_sort_compare_paths);
-  index = svn_sort__bsearch_lower_bound(keys, _abspath,
-svn_sort_compare_paths);
-
-  /* If the previous key is a parent of the local_abspath, use its format. */
-  {
-const char *const here = (ind

svn commit: r1905777 - in /subversion/branches/pristines-on-demand-on-mwf/subversion: libsvn_wc/adm_ops.c tests/libsvn_wc/wc-test.c

2022-12-05 Thread kotkov
Author: kotkov
Date: Mon Dec  5 19:03:27 2022
New Revision: 1905777

URL: http://svn.apache.org/viewvc?rev=1905777=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Provide a custom implementation
for the deprecated svn_wc_get_pristine_copy_path() to ensure that we keep
its existing behavior, instead of emulating it with the new textbase layer
functions.

* subversion/libsvn_wc/adm_ops.c
  (get_pristine_copy_path): New function with a custom implementation that
   keeps the original behavior of svn_wc_get_pristine_copy_path().
  (svn_wc_get_pristine_copy_path): Call the new function.
  (nonexistent_path): Remove, was inlined into get_pristine_copy_path().

* subversion/tests/libsvn_wc/wc-test.c
  (test_get_pristine_copy_path): New test.
  (test_funcs): Run the new test.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/adm_ops.c

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/wc-test.c

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/adm_ops.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/adm_ops.c?rev=1905777=1905776=1905777=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/adm_ops.c 
(original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/adm_ops.c 
Mon Dec  5 19:03:27 2022
@@ -754,13 +754,86 @@ svn_wc_add_from_disk3(svn_wc_context_t *
   return SVN_NO_ERROR;
 }
 
-/* Return a path where nothing exists on disk, within the admin directory
-   belonging to the WCROOT_ABSPATH directory.  */
-static const char *
-nonexistent_path(const char *wcroot_abspath, apr_pool_t *scratch_pool)
+
+static svn_error_t *
+get_pristine_copy_path(const char **pristine_path_p,
+   const char *local_abspath,
+   svn_wc__db_t *db,
+   apr_pool_t *result_pool,
+   apr_pool_t *scratch_pool)
 {
-  return svn_wc__adm_child(wcroot_abspath, SVN_WC__ADM_NONEXISTENT_PATH,
-   scratch_pool);
+  svn_boolean_t store_pristine;
+  svn_wc__db_status_t status;
+  svn_node_kind_t kind;
+  const svn_checksum_t *checksum;
+  const char *wcroot_abspath;
+
+  SVN_ERR(svn_wc__db_get_settings(NULL, _pristine, db,
+  local_abspath, scratch_pool));
+  if (!store_pristine)
+return svn_error_create(SVN_ERR_WC_DEPRECATED_API_STORE_PRISTINE,
+NULL, NULL);
+
+  SVN_ERR(svn_wc__db_read_pristine_info(, , NULL, NULL, NULL, NULL,
+, NULL, NULL, NULL,
+db, local_abspath,
+scratch_pool, scratch_pool));
+
+  /* Sanity */
+  if (kind != svn_node_file)
+return svn_error_createf(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,
+ _("Can only get the pristine contents of files; "
+   "'%s' is not a file"),
+ svn_dirent_local_style(local_abspath,
+scratch_pool));
+
+  if (status == svn_wc__db_status_not_present)
+/* We know that the delete of this node has been committed.
+   This should be the same as if called on an unknown path. */
+return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+ _("Cannot get the pristine contents of '%s' "
+   "because its delete is already committed"),
+ svn_dirent_local_style(local_abspath,
+scratch_pool));
+  else if (status == svn_wc__db_status_server_excluded
+  || status == svn_wc__db_status_excluded
+  || status == svn_wc__db_status_incomplete)
+return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
+ _("Cannot get the pristine contents of '%s' "
+   "because it has an unexpected status"),
+ svn_dirent_local_style(local_abspath,
+scratch_pool));
+
+  SVN_ERR(svn_wc__db_get_wcroot(_abspath, db, local_abspath,
+scratch_pool, scratch_pool));
+
+  if (checksum == NULL)
+{
+  /* Return a path where nothing exists on disk, within the admin directory
+ belonging to the WCROOT_ABSPATH directory.  */
+  *pristine_path_p = svn_wc__adm_child(wcroot_abspath,
+   SVN_WC__ADM_NONEXISTENT_PATH,
+   result_pool);
+}
+  else
+{
+  svn_boolean_t present;
+
+  SVN_ERR(svn_wc__db_pristine_check(, NULL, db, local_abspath,
+ 

svn commit: r1905768 - /subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h

2022-12-05 Thread kotkov
Author: kotkov
Date: Mon Dec  5 15:34:05 2022
New Revision: 1905768

URL: http://svn.apache.org/viewvc?rev=1905768=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Tweak a docstring.

No functional change.

* subversion/include/svn_wc.h
  (svn_wc_textbase_sync): Document cancel_func and cancel_baton.

Modified:
subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h?rev=1905768=1905767=1905768=diff
==
--- subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h 
(original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h 
Mon Dec  5 15:34:05 2022
@@ -7533,6 +7533,10 @@ typedef svn_error_t *(*svn_wc_textbase_f
  * If @a allow_dehydrate is true, remove the on disk text-base contents
  * that is not required.
  *
+ * If @a cancel_func is non-NULL, invoke it with @a cancel_baton at various
+ * points during the operation.  If it returns an error (typically
+ * #SVN_ERR_CANCELLED), return that error immediately.
+ *
  * If @a notify_func is non-NULL, invoke it with @a notify_baton to report
  * the progress of the operation.
  *




svn commit: r1905767 - in /subversion/branches/pristines-on-demand-on-mwf/subversion: include/svn_wc.h libsvn_client/textbase.c libsvn_wc/textbase.c

2022-12-05 Thread kotkov
Author: kotkov
Date: Mon Dec  5 15:32:05 2022
New Revision: 1905767

URL: http://svn.apache.org/viewvc?rev=1905767=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Send notifications from the
svn_wc_textbase_sync() function, rather from an internal svn_client function.

Do this to ensure that we'll only send the notifications when a working copy
doesn't store local pristines, as we check that in svn_wc_textbase_sync().
Also this should allow users of the svn_wc API to use the notifications
as well.

* subversion/include/svn_wc.h
  (svn_wc_textbase_sync): Add notify_func and notify_baton.

* subversion/libsvn_wc/textbase.c
  (): Include "svn_path.h".
  (textbase_sync_baton_t): Add `notify_func` and `notify_baton`.
  (textbase_fetch_cb, svn_wc_textbase_sync): Send the notifications from this
   layer instead of sending them from …

* subversion/libsvn_client/textbase.c
  (textbase_fetch_cb, svn_client__textbase_sync): …here.

Modified:
subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/textbase.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/textbase.c

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h?rev=1905767=1905766=1905767=diff
==
--- subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h 
(original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h 
Mon Dec  5 15:32:05 2022
@@ -7533,6 +7533,9 @@ typedef svn_error_t *(*svn_wc_textbase_f
  * If @a allow_dehydrate is true, remove the on disk text-base contents
  * that is not required.
  *
+ * If @a notify_func is non-NULL, invoke it with @a notify_baton to report
+ * the progress of the operation.
+ *
  * @see svn_wc_textbase_fetch_cb_t
  * @see svn_client__textbase_sync for usage/implementation example.
  *
@@ -7547,6 +7550,8 @@ svn_wc_textbase_sync(svn_wc_context_t *w
  void *fetch_baton,
  svn_cancel_func_t cancel_func,
  void *cancel_baton,
+ svn_wc_notify_func2_t notify_func,
+ void *notify_baton,
  apr_pool_t *scratch_pool);
 
 /**

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/textbase.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/textbase.c?rev=1905767=1905766=1905767=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/textbase.c
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/textbase.c
 Mon Dec  5 15:32:05 2022
@@ -64,16 +64,6 @@ textbase_fetch_cb(void *baton,
   b->ra_session = session;
 }
 
-  if (b->ctx->notify_func2)
-{
-  svn_wc_notify_t *notify
-= svn_wc_create_notify(".", svn_wc_notify_hydrating_file,
-   scratch_pool);
-  notify->revision = revision;
-  notify->url = url;
-  b->ctx->notify_func2(b->ctx->notify_baton2, notify, scratch_pool);
-}
-
   SVN_ERR(svn_client__ensure_ra_session_url(_url, b->ra_session, url,
 scratch_pool));
   SVN_ERR(svn_ra_fetch_file_contents(b->ra_session, "", revision, contents,
@@ -109,14 +99,6 @@ svn_client__textbase_sync(svn_ra_session
   fetch_baton.ctx = ctx;
   fetch_baton.ra_session = ra_session;
 
-  if (ctx->notify_func2 && allow_hydrate)
-{
-  svn_wc_notify_t *notify
-= svn_wc_create_notify(local_abspath, svn_wc_notify_hydrating_start,
-   scratch_pool);
-  ctx->notify_func2(ctx->notify_baton2, notify, scratch_pool);
-}
-
   if (ra_session)
 SVN_ERR(svn_ra_get_session_url(ra_session, _session_url, 
scratch_pool));
 
@@ -124,19 +106,12 @@ svn_client__textbase_sync(svn_ra_session
allow_hydrate, allow_dehydrate,
textbase_fetch_cb, _baton,
ctx->cancel_func, ctx->cancel_baton,
+   ctx->notify_func2, ctx->notify_baton2,
scratch_pool));
 
   if (ra_session)
 SVN_ERR(svn_ra_reparent(ra_session, old_session_url, scratch_pool));
 
-  if (ctx->notify_func2 && allow_hydrate)
-{
-  svn_wc_notify_t *notify
-= svn_wc_create_notify(local_abspath, svn_wc_notify_hydrating_end,
-   scratch_pool);
-  ctx->notify_func2(ctx->notify_baton2, notify, scratch_pool);
-}
-

svn commit: r1905763 - /subversion/branches/pristines-on-demand-on-mwf/BRANCH-README

2022-12-05 Thread kotkov
Author: kotkov
Date: Mon Dec  5 14:15:32 2022
New Revision: 1905763

URL: http://svn.apache.org/viewvc?rev=1905763=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Update BRANCH-README.

* BRANCH-README
  (): Remove point about remaining TODOs, as they were resolved.

Modified:
subversion/branches/pristines-on-demand-on-mwf/BRANCH-README

Modified: subversion/branches/pristines-on-demand-on-mwf/BRANCH-README
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/BRANCH-README?rev=1905763=1905762=1905763=diff
==
--- subversion/branches/pristines-on-demand-on-mwf/BRANCH-README (original)
+++ subversion/branches/pristines-on-demand-on-mwf/BRANCH-README Mon Dec  5 
14:15:32 2022
@@ -41,8 +41,6 @@ For the production-ready state, it would
  2. For the new working copy format, incorporate a switch to a different
 checksum type without known collisions instead of SHA-1.
 
-3. Fix the minor issues written down as TODOs in the code.
-
 
 References:
 ---




svn commit: r1905761 - /subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_pristine.c

2022-12-05 Thread kotkov
Author: kotkov
Date: Mon Dec  5 14:12:07 2022
New Revision: 1905761

URL: http://svn.apache.org/viewvc?rev=1905761=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Following up to r1905602, remove
a bogus semicolon in the svn_wc__db_pristine_dehydrate_internal() function.

* subversion/libsvn_wc/wc_db_pristine.c
  (svn_wc__db_pristine_dehydrate_internal): Remove semicolon.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_pristine.c

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_pristine.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_pristine.c?rev=1905761=1905760=1905761=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_pristine.c
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_pristine.c
 Mon Dec  5 14:12:07 2022
@@ -1024,7 +1024,6 @@ svn_wc__db_pristine_dehydrate_internal(s
const svn_checksum_t *sha1_checksum,
apr_pool_t *scratch_pool)
 {
-  ;
   const char *pristine_abspath;
   svn_sqlite__stmt_t *stmt;
 




svn commit: r1905760 - in /subversion/branches/pristines-on-demand-on-mwf/subversion: include/svn_wc.h libsvn_wc/deprecated.c

2022-12-05 Thread kotkov
Author: kotkov
Date: Mon Dec  5 13:51:52 2022
New Revision: 1905760

URL: http://svn.apache.org/viewvc?rev=1905760=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: In svn_wc_crawl_revisions5(),
do not return SVN_ERR_WC_DEPRECATED_API_STORE_PRISTINE unless this
deprecated function is called with restore_files set to true.

Other usages of this function, except when restoring files, don't require
access to the pristine contents, so let's not limit them more than necessary.

* subversion/include/svn_wc.h
  (svn_wc_crawl_revisions5): Tweak documentation.

* subversion/libsvn_wc/deprecated.c
  (svn_wc_crawl_revisions5): Check the working copy settings and return an
   error only when restore_files is true.

Modified:
subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/deprecated.c

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h?rev=1905760=1905759=1905760=diff
==
--- subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h 
(original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h 
Mon Dec  5 13:51:52 2022
@@ -5579,10 +5579,13 @@ svn_wc_crawl_revisions6(svn_wc_context_t
 apr_pool_t *scratch_pool);
 
 /**
- * Similar to svn_wc_crawl_revisions6, but this function can only be used
- * for working copies that store local copies of all pristine contents.
- * Otherwise, an #SVN_ERR_WC_DEPRECATED_API_STORE_PRISTINE error will be
- * returned.
+ * Similar to svn_wc_crawl_revisions6, but if @a restore_files is @c TRUE,
+ * this function can only be used for working copies that store local
+ * copies of all pristine contents.
+ *
+ * If @a restore_files is @c TRUE and a working copy doesn't store local copies
+ * of all pristine contents, an #SVN_ERR_WC_DEPRECATED_API_STORE_PRISTINE
+ * error will be returned.
  *
  * @since New in 1.7.
  * @deprecated Provided for compatibility with the 1.7 API.

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/deprecated.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/deprecated.c?rev=1905760=1905759=1905760=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/deprecated.c
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/deprecated.c
 Mon Dec  5 13:51:52 2022
@@ -170,12 +170,16 @@ svn_wc_crawl_revisions5(svn_wc_context_t
 void *notify_baton,
 apr_pool_t *scratch_pool)
 {
-  svn_boolean_t store_pristine;
+  if (restore_files)
+{
+  svn_boolean_t store_pristine;
 
-  SVN_ERR(svn_wc__get_settings(NULL, _pristine, wc_ctx, local_abspath,
-   scratch_pool));
-  if (!store_pristine)
-return svn_error_create(SVN_ERR_WC_DEPRECATED_API_STORE_PRISTINE, NULL, 
NULL);
+  SVN_ERR(svn_wc__get_settings(NULL, _pristine, wc_ctx, 
local_abspath,
+   scratch_pool));
+  if (!store_pristine)
+return svn_error_create(SVN_ERR_WC_DEPRECATED_API_STORE_PRISTINE,
+NULL, NULL);
+}
 
   SVN_ERR(svn_wc_crawl_revisions6(wc_ctx,
   local_abspath,




svn commit: r1905758 - in /subversion/branches/pristines-on-demand-on-mwf: INSTALL build/generator/gen_win_dependencies.py configure.ac get-deps.sh subversion/libsvn_subr/sqlite.c subversion/libsvn_wc

2022-12-05 Thread kotkov
Author: kotkov
Date: Mon Dec  5 13:01:48 2022
New Revision: 1905758

URL: http://svn.apache.org/viewvc?rev=1905758=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Bump the minimum required
SQLite version to 3.24.0, as that is required for UPSERT syntax [1].
Bump the recommended version to the latest available 3.39.x patch version,
which is 3.39.4.

[1] https://www.sqlite.org/lang_UPSERT.html

* subversion/libsvn_subr/sqlite.c
  (): Bump minimum required SQLite version to 3.24.0.

* subversion/libsvn_wc/wc-queries.sql
  (): Remove a TODO comment.

* build/generator/gen_win_dependencies.py
  (_find_sqlite): Bump minimum required SQLite version to 3.24.0.

* configure.ac
  (SQLITE_MINIMUM_VER): Bump to 3.24.0.
  (SQLITE_RECOMMENDED_VER): Bump to 3.39.4.
  (SQLITE_RECOMMENDED_VER_REL_YEAR): Change to 2022.

* get-deps.sh
  (SQLITE_VERSION): Bump to 3.39.4.
  (SQLITE_VERSION_REL_YEAR): Change to 2022.

* INSTALL
  (C.2.SQLite): Bump minimum required SQLite version to 3.24.0.
  (E.1.Prerequisites): Bump the minimum and recommended SQLite versions.

Modified:
subversion/branches/pristines-on-demand-on-mwf/INSTALL

subversion/branches/pristines-on-demand-on-mwf/build/generator/gen_win_dependencies.py
subversion/branches/pristines-on-demand-on-mwf/configure.ac
subversion/branches/pristines-on-demand-on-mwf/get-deps.sh

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_subr/sqlite.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc-queries.sql

Modified: subversion/branches/pristines-on-demand-on-mwf/INSTALL
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/INSTALL?rev=1905758=1905757=1905758=diff
==
--- subversion/branches/pristines-on-demand-on-mwf/INSTALL (original)
+++ subversion/branches/pristines-on-demand-on-mwf/INSTALL Mon Dec  5 13:01:48 
2022
@@ -262,7 +262,7 @@ I.INTRODUCTION
 
   2.  SQLite  (REQUIRED)
 
-  Subversion requires SQLite version 3.8.2 or above.  You can meet this
+  Subversion requires SQLite version 3.24.0 or above.  You can meet this
   dependency several ways:
 * Use an SQLite amalgamation file.
 * Specify an SQLite installation to use.
@@ -841,8 +841,8 @@ II.   INSTALLATION
 1.4 or later (1.2 for apr-iconv). If you are building from a Subversion
 checkout and have not downloaded Apache 2, then get these 3 libraries
 from https://www.apache.org/dist/apr/.
-  * SQLite 3.8.2 or higher from https://www.sqlite.org/download.html
-(3.8.11.1 or higher recommended)
+  * SQLite 3.24.0 or higher from https://www.sqlite.org/download.html
+(3.39.4 or higher recommended)
   * ZLib 1.2 or higher is required and can be obtained from
 http://www.zlib.net/
   * Either a Subversion client binary from

Modified: 
subversion/branches/pristines-on-demand-on-mwf/build/generator/gen_win_dependencies.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/build/generator/gen_win_dependencies.py?rev=1905758=1905757=1905758=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/build/generator/gen_win_dependencies.py
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/build/generator/gen_win_dependencies.py
 Mon Dec  5 13:01:48 2022
@@ -1482,7 +1482,7 @@ class GenDependenciesBase(gen_base.Gener
   def _find_sqlite(self, show_warnings):
 "Find the Sqlite library and version"
 
-minimal_sqlite_version = (3, 8, 2)
+minimal_sqlite_version = (3, 24, 0)
 
 # For SQLite we support 3 scenarios:
 # - Installed in standard directory layout

Modified: subversion/branches/pristines-on-demand-on-mwf/configure.ac
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/configure.ac?rev=1905758=1905757=1905758=diff
==
--- subversion/branches/pristines-on-demand-on-mwf/configure.ac (original)
+++ subversion/branches/pristines-on-demand-on-mwf/configure.ac Mon Dec  5 
13:01:48 2022
@@ -178,10 +178,10 @@ SVN_FIND_APACHE(20051115, $apache_whitel
 dnl Search for SQLite.  If you change SQLITE_URL from a .zip to
 dnl something else also update build/ac-macros/sqlite.m4 to reflect
 dnl the correct command to unpack the downloaded file.
-SQLITE_MINIMUM_VER="3.8.2"
-SQLITE_RECOMMENDED_VER="3.8.11.1"
+SQLITE_MINIMUM_VER="3.24.0"
+SQLITE_RECOMMENDED_VER="3.39.4"
 dnl Used to construct the SQLite download URL.
-SQLITE_RECOMMENDED_VER_REL_YEAR="2015"
+SQLITE_RECOMMENDED_VER_REL_YEAR="2022"
 
SQLITE_URL="https://www.sqlite.org/$SQLITE_RECOMMENDED_VER_REL_YEAR/sqlite-amalgamation-$(printf
 %d%02d%02d%02d $(echo ${SQLITE_RECOMMENDED_VER} | sed -e 's/\./ /

svn commit: r1905756 - /subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/revert_tests.py

2022-12-05 Thread kotkov
Author: kotkov
Date: Mon Dec  5 12:35:54 2022
New Revision: 1905756

URL: http://svn.apache.org/viewvc?rev=1905756=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Skip the revert_reexpand_keyword()
test for working copies that don't store local pristines.

The test expects two different things to happen during revert, depending
on whether an `svn cleanup` or any other command that repairs the timestamps
was called in between:

- In the first part, we expect a revert to change file contents and
  re-expand its keywords, because a revert happens right after editing
  the file.

- In the second part, we expect a revert to skip the file with exactly
  the same contents, because there's an in-between operation that has
  recorded the new unmodified timestamp in the db.

This is a problem, because we expect two different things to happen for
two identical on-disk file states.  The only difference is whether any
of the commands that perform the internal timestamp bookkeeping was
called in between.  For example, calling `svn cleanup` after editing the
file makes the first and the second parts of the test behave identically.

This problem currently prevents us from testing the `--store-pristine=no`
case, because when we walk the text-bases we use that opportunity to repair
timestamps, but that also makes the first and the second reverts in this
test behave identically.  So let's postpone testing this case until we
resolve the described problem with opposite expectations.

* subversion/tests/cmdline/revert_tests.py
  (revert_reexpand_keyword): Remove XFail() marker.  Skip for working copies
   that don't store local pristines.  Adjust comments.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/revert_tests.py

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/revert_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/revert_tests.py?rev=1905756=1905755=1905756=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/revert_tests.py
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/revert_tests.py
 Mon Dec  5 12:35:54 2022
@@ -243,15 +243,6 @@ def revert_from_wc_root(sbox):
   svntest.actions.run_and_verify_status('', expected_output)
 
 @Issue(1663)
-# Walking the text-bases automatically repairs timestamps, so now the
-# first and the second reverts in this test behave identically, as if
-# 'svn cleanup' or any other command that repairs the timestamps had been
-# called beforehand.  Judging by the second part of the test, we're fine
-# with revert doing nothing in that case, but that essentially contradicts
-# the expectation in its first part.
-#
-# I temporarily mark the test XFail.  See r1101730 and r1101817 for details.
-@XFail()
 def revert_reexpand_keyword(sbox):
   "revert reexpands manually contracted keyword"
 
@@ -269,6 +260,34 @@ def revert_reexpand_keyword(sbox):
 
   sbox.build()
   wc_dir = sbox.wc_dir
+
+  # The test expects two different things to happen during revert, depending
+  # on whether an `svn cleanup` or any other command that repairs the
+  # timestamps was called in between:
+  #
+  # - In the first part, we expect a revert to change file contents and
+  #   re-expand its keywords, because a revert happens right after editing
+  #   the file.
+  #
+  # - In the second part, we expect a revert to skip the file with exactly
+  #   the same contents, because there's an in-between operation that has
+  #   recorded the new unmodified timestamp in the db.  (See r1101730 and
+  #   r1101817.)
+  #
+  # This is a problem, because we expect two different things to happen for
+  # two identical on-disk file states.  The only difference is whether any
+  # of the commands that perform the internal timestamp bookkeeping was
+  # called in between.  For example, calling `svn cleanup` after editing the
+  # file makes the first and the second parts of the test behave identically.
+  #
+  # This problem prevents us from properly testing the `--store-pristine=no`
+  # case, because when we walk the text-bases we use that opportunity to
+  # repair timestamps, but that also makes the first and the second reverts
+  # in this test behave identically.  Let's skip testing this case for now,
+  # until we resolve the described problem with opposite expectations.
+  if not svntest.actions.get_wc_store_pristine(wc_dir):
+raise svntest.Skip()
+
   newfile_path = os.path.join(wc_dir, "newfile")
   unexpanded_contents = "This is newfile: $Rev$.\n"
 




svn commit: r1905755 - in /subversion/branches/pristines-on-demand-on-mwf: ./ subversion/tests/cmdline/revert_tests.py subversion/tests/cmdline/upgrade_tests.py

2022-12-05 Thread kotkov
Author: kotkov
Date: Mon Dec  5 11:47:44 2022
New Revision: 1905755

URL: http://svn.apache.org/viewvc?rev=1905755=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Sync with trunk@1905754.

Modified:
subversion/branches/pristines-on-demand-on-mwf/   (props changed)

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/revert_tests.py

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/upgrade_tests.py

Propchange: subversion/branches/pristines-on-demand-on-mwf/
--
  Merged /subversion/trunk:r1905504-1905754

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/revert_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/revert_tests.py?rev=1905755=1905754=1905755=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/revert_tests.py
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/revert_tests.py
 Mon Dec  5 11:47:44 2022
@@ -300,7 +300,7 @@ def revert_reexpand_keyword(sbox):
   svntest.main.file_write(newfile_path, unexpanded_contents)
 
   # Revert the file.  The keyword should reexpand.
-  svntest.main.run_svn(None, 'revert', newfile_path)
+  run_and_verify_revert([newfile_path], [], [newfile_path])
 
   # Verify that the keyword got re-expanded.
   check_expanded(newfile_path)
@@ -333,7 +333,7 @@ def revert_reexpand_keyword(sbox):
 '-m', "Shouldn't be committed")
 
   # Revert the file.  The file is not reverted!
-  svntest.actions.run_and_verify_svn([], [], 'revert', newfile_path)
+  run_and_verify_revert([newfile_path], [], [])
 
 
 #--

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/upgrade_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/upgrade_tests.py?rev=1905755=1905754=1905755=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/upgrade_tests.py
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/upgrade_tests.py
 Mon Dec  5 11:47:44 2022
@@ -1583,6 +1583,27 @@ def upgrade_1_0_with_externals(sbox):
  })
   run_and_verify_status_no_server(sbox.wc_dir, expected_status)
 
+@XFail()
+@SkipUnless(lambda: svntest.main.options.wc_format_version is None)
+def upgrade_latest_format(sbox):
+  "upgrade latest format without arguments"
+
+  sbox.build(empty=True, create_wc=False)
+  expected_output = svntest.wc.State(sbox.wc_dir, {})
+  expected_disk = svntest.wc.State('', {})
+  latest_ver = svntest.main.svn_wc__max_supported_format_version()
+  svntest.actions.run_and_verify_checkout(sbox.repo_url,
+  sbox.wc_dir,
+  expected_output,
+  expected_disk,
+  [],
+  '--compatible-version',
+  latest_ver)
+  # XFAIL:
+  # svn: E155021: Working copy '...' is already at version 1.15 (format 32)
+  # and cannot be downgraded to version 1.8 (format 31)
+  svntest.actions.run_and_verify_svn(None, [], 'upgrade', sbox.wc_dir)
+
 
 # Run the tests
 
@@ -1639,6 +1660,7 @@ test_list = [ None,
   upgrade_1_7_dir_external,
   auto_analyze,
   upgrade_1_0_with_externals,
+  upgrade_latest_format,
  ]
 
 




svn commit: r1905754 - /subversion/trunk/subversion/tests/cmdline/revert_tests.py

2022-12-05 Thread kotkov
Author: kotkov
Date: Mon Dec  5 11:45:37 2022
New Revision: 1905754

URL: http://svn.apache.org/viewvc?rev=1905754=rev
Log:
In the revert_reexpand_keyword() test, use a helper to run the revert command.

This should be consistent with other tests in this file and should also test
the output of the command.

* subversion/tests/cmdline/revert_tests.py
  (revert_reexpand_keyword): Use run_and_verify_revert().

Modified:
subversion/trunk/subversion/tests/cmdline/revert_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/revert_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/revert_tests.py?rev=1905754=1905753=1905754=diff
==
--- subversion/trunk/subversion/tests/cmdline/revert_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/revert_tests.py Mon Dec  5 
11:45:37 2022
@@ -291,7 +291,7 @@ def revert_reexpand_keyword(sbox):
   svntest.main.file_write(newfile_path, unexpanded_contents)
 
   # Revert the file.  The keyword should reexpand.
-  svntest.main.run_svn(None, 'revert', newfile_path)
+  run_and_verify_revert([newfile_path], [], [newfile_path])
 
   # Verify that the keyword got re-expanded.
   check_expanded(newfile_path)
@@ -324,7 +324,7 @@ def revert_reexpand_keyword(sbox):
 '-m', "Shouldn't be committed")
 
   # Revert the file.  The file is not reverted!
-  svntest.actions.run_and_verify_svn([], [], 'revert', newfile_path)
+  run_and_verify_revert([newfile_path], [], [])
 
 
 #--




svn commit: r1905753 - /subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/externals_tests.py

2022-12-05 Thread kotkov
Author: kotkov
Date: Mon Dec  5 10:38:45 2022
New Revision: 1905753

URL: http://svn.apache.org/viewvc?rev=1905753=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Convert the externals_tests.py#52
into a Wimp(), because the test may run into issue with `svn upgrade` that
currently exists in trunk.

See r1905752 and upgrade_tests.py:upgrade_latest_format() for more details.

* subversion/tests/cmdline/externals_tests.py
  (switch_relative_externals): Add a Wimp() marker.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/externals_tests.py

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/externals_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/externals_tests.py?rev=1905753=1905752=1905753=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/externals_tests.py
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/externals_tests.py
 Mon Dec  5 10:38:45 2022
@@ -3431,6 +3431,7 @@ def update_deletes_file_external(sbox):
 
 
 @Issue(4519)
+@Wimp("May trigger an existing issue, see 
upgrade_tests.py:upgrade_latest_format()")
 def switch_relative_externals(sbox):
   "switch relative externals"
 




svn commit: r1905752 - /subversion/trunk/subversion/tests/cmdline/upgrade_tests.py

2022-12-05 Thread kotkov
Author: kotkov
Date: Mon Dec  5 10:20:08 2022
New Revision: 1905752

URL: http://svn.apache.org/viewvc?rev=1905752=rev
Log:
Add a failing test for a case where `svn upgrade` currently returns an error
when invoked without parameters for a working copy of the latest format.

* subversion/tests/cmdline/upgrade_tests.py
  (upgrade_latest_format): New test, marked as XFail().
  (test_list): Run new test.

Modified:
subversion/trunk/subversion/tests/cmdline/upgrade_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/upgrade_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/upgrade_tests.py?rev=1905752=1905751=1905752=diff
==
--- subversion/trunk/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/upgrade_tests.py Mon Dec  5 
10:20:08 2022
@@ -1584,6 +1584,27 @@ def upgrade_1_0_with_externals(sbox):
  })
   run_and_verify_status_no_server(sbox.wc_dir, expected_status)
 
+@XFail()
+@SkipUnless(lambda: svntest.main.options.wc_format_version is None)
+def upgrade_latest_format(sbox):
+  "upgrade latest format without arguments"
+
+  sbox.build(empty=True, create_wc=False)
+  expected_output = svntest.wc.State(sbox.wc_dir, {})
+  expected_disk = svntest.wc.State('', {})
+  latest_ver = svntest.main.svn_wc__max_supported_format_version()
+  svntest.actions.run_and_verify_checkout(sbox.repo_url,
+  sbox.wc_dir,
+  expected_output,
+  expected_disk,
+  [],
+  '--compatible-version',
+  latest_ver)
+  # XFAIL:
+  # svn: E155021: Working copy '...' is already at version 1.15 (format 32)
+  # and cannot be downgraded to version 1.8 (format 31)
+  svntest.actions.run_and_verify_svn(None, [], 'upgrade', sbox.wc_dir)
+
 
 # Run the tests
 
@@ -1640,6 +1661,7 @@ test_list = [ None,
   upgrade_1_7_dir_external,
   auto_analyze,
   upgrade_1_0_with_externals,
+  upgrade_latest_format,
  ]
 
 




svn commit: r1905691 - /subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/commit.c

2022-12-02 Thread kotkov
Author: kotkov
Date: Fri Dec  2 13:03:15 2022
New Revision: 1905691

URL: http://svn.apache.org/viewvc?rev=1905691=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Following up on r1897291,
describe the commit-specific optimization where we don't fetch the
text bases before the operation.

No functional changes.

* subversion/libsvn_client/commit.c
  (svn_client_commit6): Add a comment.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/commit.c

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/commit.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/commit.c?rev=1905691=1905690=1905691=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/commit.c
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/commit.c
 Fri Dec  2 13:03:15 2022
@@ -728,6 +728,9 @@ svn_client_commit6(const apr_array_heade
   if (cmt_err)
 goto cleanup;
 
+  /* Optimization: for commit, we avoid fetching the text-bases at the
+ beginning of the operation and only delta against the text-bases that
+ are available locally.  See svn_wc__internal_transmit_text_deltas(). 
*/
   cmt_err = svn_error_trace(
 svn_client__textbase_sync(NULL, lock_root,
   FALSE, TRUE, ctx,




svn commit: r1905690 - /subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db.h

2022-12-02 Thread kotkov
Author: kotkov
Date: Fri Dec  2 12:42:32 2022
New Revision: 1905690

URL: http://svn.apache.org/viewvc?rev=1905690=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Tweak documentation for the
svn_wc__db_pristine_read() function.  No functional changes.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_pristine_read): Adjust a docstring.

Modified:
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db.h

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db.h?rev=1905690=1905689=1905690=diff
==
--- subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db.h 
(original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db.h 
Fri Dec  2 12:42:32 2022
@@ -944,7 +944,8 @@ svn_wc__db_pristine_get_future_path(cons
 
 /* If requested set *CONTENTS to a readable stream that will yield the pristine
text identified by SHA1_CHECKSUM (must be a SHA-1 checksum) within the WC
-   identified by WRI_ABSPATH in DB.
+   identified by WRI_ABSPATH in DB.  If the pristine is present in the store,
+   but dehydrated, set *CONTENTS to NULL.
 
If requested set *SIZE to the size of the pristine stream in bytes,
 




svn commit: r1905689 - in /subversion/branches/pristines-on-demand-on-mwf/subversion: include/svn_error_codes.h include/svn_wc.h libsvn_wc/adm_crawler.c libsvn_wc/adm_ops.c libsvn_wc/externals.c libsv

2022-12-02 Thread kotkov
Author: kotkov
Date: Fri Dec  2 12:38:02 2022
New Revision: 1905689

URL: http://svn.apache.org/viewvc?rev=1905689=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Rework how we handle a situation
where the caller attempts to access a dehydrated pristine.  Ensure that all
newer APIs return a distinguishable error code in this case.

* subversion/include/svn_error_codes.h
  (SVN_ERR_WC_PRISTINE_DEHYDRATED): New error code.

* subversion/include/svn_wc.h
  (svn_wc_crawl_revisions6,
   svn_wc_diff7,
   svn_wc_merge6,
   svn_wc_get_pristine_contents3,
   svn_wc_revert7,
   svn_wc_restore2): Adjust documentation for these functions.
   Explain the circumstances when the new error will be returned.

* subversion/libsvn_wc/adm_crawler.c
  (svn_wc__internal_transmit_text_deltas): Handle the new error code
   internally, using it to send a fulltext instead of a delta.

* subversion/libsvn_wc/adm_ops.c
  (get_pristine_lazyopen_func): Return the new specific error code.

* subversion/libsvn_wc/externals.c
  (close_file): Return the new specific error code.

* subversion/libsvn_wc/textbase.h
  (svn_wc__textbase_get_contents): Adjust documentation.

* subversion/libsvn_wc/textbase.c
  (open_textbase): Return the new error on an attempt to access the
   missing contents of an optional pristine.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_error_codes.h
subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/adm_crawler.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/adm_ops.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/externals.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/textbase.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/textbase.h

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_error_codes.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_error_codes.h?rev=1905689=1905688=1905689=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_error_codes.h
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_error_codes.h
 Fri Dec  2 12:38:02 2022
@@ -587,6 +587,11 @@ SVN_ERROR_START
  "This client uses a deprecated API that does not support "
  "working copies without local pristines")
 
+  /** @since New in 1.15 */
+  SVN_ERRDEF(SVN_ERR_WC_PRISTINE_DEHYDRATED,
+ SVN_ERR_WC_CATEGORY_START + 44,
+ "No local pristine contents for a file")
+
   /* fs errors */
 
   SVN_ERRDEF(SVN_ERR_FS_GENERAL,

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h?rev=1905689=1905688=1905689=diff
==
--- subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h 
(original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h 
Fri Dec  2 12:38:02 2022
@@ -5549,7 +5549,10 @@ svn_wc_process_committed(const char *pat
  * @a notify_baton and the path of the restored file. @a notify_func may
  * be @c NULL if this notification is not required.  If @a
  * use_commit_times is TRUE, then set restored files' timestamps to
- * their last-commit-times.
+ * their last-commit-times.  For working copies that do not store local
+ * pristine contents for all files, return @c SVN_ERR_WC_PRISTINE_DEHYDRATED
+ * on an attempt to restore a file whose pristine contents is not present
+ * locally.
  *
  * @note This is a relatively low-level function operating directly on a
  * working copy, so a caller is expected to be able to handle working copies
@@ -5557,9 +5560,6 @@ svn_wc_process_committed(const char *pat
  * achieved by synchronizing the text-base state before and optionally
  * after the function call.  @see svn_wc_textbase_sync().
  *
- * Currently, the pristine contents may be required when @a restore_files
- * is TRUE.
- *
  * @since New in 1.15.
  */
 svn_error_t *
@@ -6815,6 +6815,10 @@ svn_wc_get_diff_editor(svn_wc_adm_access
  * points during the operation.  If it returns an error (typically
  * #SVN_ERR_CANCELLED), return that error immediately.
  *
+ * For working copies that do not store local pristine contents for all
+ * files, return @c SVN_ERR_WC_PRISTINE_DEHYDRATED on an attempt to diff
+ * a file whose pristine contents is not present locally.
+ *
  * @note For general purposes, please consider using APIs from svn_client.h,
  * @see svn_client_diff7().
  *
@@ -7111,6 +7115,10 @@ typedef enum svn_wc_merge_outcome_t
  *
 

Re: svn commit: r1905663 - in /subversion/branches/pristines-on-demand-on-mwf/subversion: include/ include/private/ libsvn_client/ libsvn_wc/

2022-12-01 Thread Evgeny Kotkov via commits
Daniel Sahlberg  writes:

>> +  /** @since New in 1.15 */
>> +  SVN_ERRDEF(SVN_ERR_WC_DEPRECATED_API_STORE_PRISTINE,
>> + SVN_ERR_WC_CATEGORY_START + 43,
>> + "This client was not updated to support working copies "
>> + "without local pristines")
>> +
>>/* fs errors */
>
> Is it really "This client"? It looks more to be based on the WC setting.

This new error should only occur when someone (a 3rd party client) uses the
deprecated API function for a working copy without pristines.

>From that point of view, I would say that the problem is in the client that is
still using the deprecated API and thus cannot properly handle such working
copies.

Also, the current message aims to be somewhat consistent with another existing
error for a case when a client is too old to read a newer working copy format:
 "This client is too old to work with the working copy […] (format 32)"

(After writing this, I realized that the "was not updated" part of the message
 may be misinterpreted as a requirement to update to the newer version of the
 software.  In r1905682, I slightly rephrased that part so that it would say:
   "This client uses a deprecated API that does not support working copies
without local pristines")


Thanks,
Evgeny Kotkov


svn commit: r1905682 - /subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_error_codes.h

2022-12-01 Thread kotkov
Author: kotkov
Date: Thu Dec  1 19:03:31 2022
New Revision: 1905682

URL: http://svn.apache.org/viewvc?rev=1905682=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Slightly rephrase an error message.

The previous message could potentially be misinterpreted as a requirement
to update to a newer version of the software.

* subversion/include/svn_error_codes.h
  (SVN_ERR_WC_DEPRECATED_API_STORE_PRISTINE): Tweak the error message.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_error_codes.h

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_error_codes.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_error_codes.h?rev=1905682=1905681=1905682=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_error_codes.h
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_error_codes.h
 Thu Dec  1 19:03:31 2022
@@ -584,8 +584,8 @@ SVN_ERROR_START
   /** @since New in 1.15 */
   SVN_ERRDEF(SVN_ERR_WC_DEPRECATED_API_STORE_PRISTINE,
  SVN_ERR_WC_CATEGORY_START + 43,
- "This client was not updated to support working copies "
- "without local pristines")
+ "This client uses a deprecated API that does not support "
+ "working copies without local pristines")
 
   /* fs errors */
 




svn commit: r1905665 - /subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h

2022-12-01 Thread kotkov
Author: kotkov
Date: Thu Dec  1 10:49:19 2022
New Revision: 1905665

URL: http://svn.apache.org/viewvc?rev=1905665=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Following up on r1905662,
fix an invalid @see reference in a docstring.  No functional changes.

* subversion/include/svn_wc.h
  (svn_wc_textbase_sync): Refer to svn_wc_textbase_fetch_cb_t.

Modified:
subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h?rev=1905665=1905664=1905665=diff
==
--- subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h 
(original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h 
Thu Dec  1 10:49:19 2022
@@ -7516,7 +7516,7 @@ typedef svn_error_t *(*svn_wc_textbase_f
  * If @a allow_dehydrate is true, remove the on disk text-base contents
  * that is not required.
  *
- * @see svn_wc_textbase_hydrate_cb_t
+ * @see svn_wc_textbase_fetch_cb_t
  * @see svn_client__textbase_sync for usage/implementation example.
  *
  * @since New in 1.15.




svn commit: r1905664 - /subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h

2022-12-01 Thread kotkov
Author: kotkov
Date: Thu Dec  1 10:44:28 2022
New Revision: 1905664

URL: http://svn.apache.org/viewvc?rev=1905664=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Following up on r1905662,
fix invalid indentation in a docstring.  No functional changes.

* subversion/include/svn_wc.h
  (svn_wc_textbase_sync): Fix indentation in a docstring.

Modified:
subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h?rev=1905664=1905663=1905664=diff
==
--- subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h 
(original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h 
Thu Dec  1 10:44:28 2022
@@ -7505,22 +7505,22 @@ typedef svn_error_t *(*svn_wc_textbase_f
   void *cancel_baton,
   apr_pool_t *scratch_pool);
 
- /** Synchronize the state of the text-base contents for the
-  * @a local_abspath tree.
-  *
-  * If @a allow_hydrate is true, fetch the required but missing text-base
-  * contents using the provided @a fetch_callback and @a fetch_baton.
-  * If @a allow_hydrate is false, @a fetch_callback will not be used and
-  * may be @c NULL.
-  *
-  * If @a allow_dehydrate is true, remove the on disk text-base contents
-  * that is not required.
-  *
-  * @see svn_wc_textbase_hydrate_cb_t
-  * @see svn_client__textbase_sync for usage/implementation example.
-  *
-  * @since New in 1.15.
-  */
+/** Synchronize the state of the text-base contents for the
+ * @a local_abspath tree.
+ *
+ * If @a allow_hydrate is true, fetch the required but missing text-base
+ * contents using the provided @a fetch_callback and @a fetch_baton.
+ * If @a allow_hydrate is false, @a fetch_callback will not be used and
+ * may be @c NULL.
+ *
+ * If @a allow_dehydrate is true, remove the on disk text-base contents
+ * that is not required.
+ *
+ * @see svn_wc_textbase_hydrate_cb_t
+ * @see svn_client__textbase_sync for usage/implementation example.
+ *
+ * @since New in 1.15.
+ */
 svn_error_t *
 svn_wc_textbase_sync(svn_wc_context_t *wc_ctx,
  const char *local_abspath,




svn commit: r1905663 - in /subversion/branches/pristines-on-demand-on-mwf/subversion: include/ include/private/ libsvn_client/ libsvn_wc/

2022-12-01 Thread kotkov
Author: kotkov
Date: Thu Dec  1 10:42:41 2022
New Revision: 1905663

URL: http://svn.apache.org/viewvc?rev=1905663=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Bump libsvn_wc APIs that may
need to access pristine contents and adjust their deprecated versions so
that they would return an error for working copies without pristines.

Additionally, change the existing deprecated function that may need to
access pristines so that they would also return an error in such cases.

With this change, the deprecated functions will fail predictably — instead
of only failing on attempts to read a pristine that was not fetched during
any of the previous API calls.

* subversion/include/svn_error_codes.h
  (SVN_ERR_WC_DEPRECATED_API_STORE_PRISTINE): New error code.

* subversion/include/svn_wc.h
  (svn_wc_crawl_revisions6): New, revved from …
  (svn_wc_crawl_revisions5): …this function, which is now deprecated.
  (svn_wc_diff7): New, revved from …
  (svn_wc_diff6): …this function, which is now deprecated.
  (svn_wc_merge6): New, revved from …
  (svn_wc_merge5): …this function, which is now deprecated.
  (svn_wc_get_pristine_contents3): New, revved from …
  (svn_wc_get_pristine_contents2): …this function, which is now deprecated.
  (svn_wc_revert7): New, revved from …
  (svn_wc_revert6): …this function, which is now deprecated.
  (svn_wc_restore2): New, revved from …
  (svn_wc_restore): …this function, which is now deprecated.
  (svn_wc_transmit_text_deltas4): New, revved from …
  (svn_wc_transmit_text_deltas3): …this function, which is now deprecated.

* subversion/libsvn_wc/deprecated.c
  (svn_wc_crawl_revisions5,
   svn_wc_diff6,
   svn_wc_merge5,
   svn_wc_get_pristine_contents2,
   svn_wc_revert6,
   svn_wc_restore,
   svn_wc_transmit_text_deltas3): Now reside in this file.
   Check working copy settings and forward call to the newer version.

* subversion/libsvn_wc/adm_crawler.c
  (svn_wc_restore): Replace with …
  (svn_wc_restore2): …this new function.
  (svn_wc_crawl_revisions5): Replace with …
  (svn_wc_crawl_revisions6): …this new function.
  (svn_wc_transmit_text_deltas3): Replace with …
  (svn_wc_transmit_text_deltas4): …this new function.
  (report_revisions_and_depths): Update comment.

* subversion/libsvn_wc/adm_ops.c
  (svn_wc_get_pristine_copy_path): Make this existing deprecated function
   return an error for working copies without pristines.
  (svn_wc_get_pristine_contents2): Replace with …
  (svn_wc_get_pristine_contents3): …this new function.

* subversion/libsvn_wc/conflicts.c
  (svn_wc_resolved_conflict5): Make this existing deprecated function
   return an error for working copies without pristines.

* subversion/libsvn_wc/diff_local.c
  (svn_wc_diff6): Replace with …
  (svn_wc_diff7): …this new function.

* subversion/libsvn_wc/externals.c
  (svn_wc__crawl_file_external): Switch to a newer version of the API.

* subversion/libsvn_wc/merge.c
  (svn_wc_merge5): Replace with …
  (svn_wc_merge6): …this new function.
 
* subversion/libsvn_wc/revert.c
  (svn_wc_revert6): Replace with …
  (svn_wc_revert7): …this new function.

* subversion/libsvn_wc/wc.h
  (svn_wc__internal_merge,
   svn_wc__internal_transmit_text_deltas): Update docstrings.

* subversion/include/private/svn_wc_private.h
  (svn_wc__get_pristine_contents_by_checksum,
   svn_wc__get_diff_editor,
   svn_wc__diff7): Update docstrings.

* subversion/libsvn_client/cat.c
  (svn_client__get_normalized_stream): Switch to a newer version of the API.

* subversion/libsvn_client/commit_util.c
  (svn_client__do_commit): Switch to a newer version of the API.

* subversion/libsvn_client/conflicts.c
  (resolve_merge_incoming_added_file_text_update,
   resolve_merge_incoming_added_file_text_merge,
   resolve_merge_incoming_added_file_replace_and_merge,
   merge_added_files,
   resolve_update_incoming_added_dir_merge,
   resolve_incoming_move_file_text_merge,
   resolve_both_moved_file_text_merge,
   resolve_both_moved_dir_merge,
   resolve_both_moved_dir_move_merge,
   resolve_incoming_move_dir_merge,
   resolve_local_move_file_merge,
   resolve_both_moved_file_update_keep_local_move,
   resolve_both_moved_file_update_keep_incoming_move):
   Switch to newer versions of the API.

* subversion/libsvn_client/diff.c
  (diff_repos_wc): Switch to a newer version of the API.

* subversion/libsvn_client/export.c
  (export_node): Switch to a newer version of the API.

* subversion/libsvn_client/layout.c
  (svn_client__layout_list): Switch to a newer version of the API.

* subversion/libsvn_client/merge.c
  (merge_file_changed): Switch to a newer version of the API.

* subversion/libsvn_client/ra.c
  (svn_client__ra_provide_base): Switch to a newer version of the API.

* subversion/libsvn_client/revert.c
  (revert): Switch to a newer version of the API.

* subversion/libsvn_client/status.c
  (svn_client_status6): Switch to a newer version of the API.

* subversion/libsvn_client/switch.c
  (switch_internal): Switch to a newer version of the API

svn commit: r1905662 - in /subversion/branches/pristines-on-demand-on-mwf/subversion: include/private/svn_wc_private.h include/svn_wc.h libsvn_client/textbase.c libsvn_wc/textbase.c

2022-12-01 Thread kotkov
Author: kotkov
Date: Thu Dec  1 10:15:09 2022
New Revision: 1905662

URL: http://svn.apache.org/viewvc?rev=1905662=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Expose the working copy text-base
sync function as a new public svn_wc API.

* subversion/include/private/svn_wc_private.h
  (svn_wc__textbase_fetch_cb_t, svn_wc__textbase_sync): Promote these
   private members …

* subversion/include/svn_wc.h
  (svn_wc_textbase_fetch_cb_t, svn_wc_textbase_sync): …into these new APIs.

* subversion/libsvn_client/textbase.c
  (): Adjust includes.
  (textbase_fetch_cb, svn_client__textbase_sync): Use the new public API.

* subversion/libsvn_wc/textbase.c
  (svn_wc__textbase_sync): Rename to …
  (svn_wc_textbase_sync): …this.  Adjust the type of `fetch_callback`.
  (textbase_sync_baton_t): Adjust the type of `fetch_callback`.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h
subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/textbase.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/textbase.c

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h?rev=1905662=1905661=1905662=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h
 Thu Dec  1 10:15:09 2022
@@ -2321,33 +2321,6 @@ svn_wc__upgrade(svn_wc_context_t *wc_ctx
 void *notify_baton,
 apr_pool_t *scratch_pool);
 
-/* The callback invoked by svn_wc__textbase_sync() to fetch the text-base
-   contents identified by REPOS_ROOT_URL, REPOS_RELPATH and REVISION. */
-typedef svn_error_t *(*svn_wc__textbase_fetch_cb_t)(
-  void *baton,
-  const char *repos_root_url,
-  const char *repos_relpath,
-  svn_revnum_t revision,
-  svn_stream_t *contents,
-  svn_cancel_func_t cancel_func,
-  void *cancel_baton,
-  apr_pool_t *scratch_pool);
-
-/* Synchronize the state of the text-base contents for the LOCAL_ABSPATH tree.
-   If ALLOW_HYDRATE is true, fetch the required but missing text-base contents
-   using the provided FETCH_CALLBACK and FETCH_BATON.  If ALLOW_DEHYDRATE
-   is true, remove the on disk text-base contents that is not required. */
-svn_error_t *
-svn_wc__textbase_sync(svn_wc_context_t *wc_ctx,
-  const char *local_abspath,
-  svn_boolean_t allow_hydrate,
-  svn_boolean_t allow_dehydrate,
-  svn_wc__textbase_fetch_cb_t fetch_callback,
-  void *fetch_baton,
-  svn_cancel_func_t cancel_func,
-  void *cancel_baton,
-  apr_pool_t *scratch_pool);
-
 /* Return the working copy settings *FORMAT_P and *STORE_PRISTINE_P for
LOCAL_ABSPATH in WC_CTX. */
 svn_error_t *

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h?rev=1905662=1905661=1905662=diff
==
--- subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h 
(original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_wc.h 
Thu Dec  1 10:15:09 2022
@@ -7358,6 +7358,51 @@ svn_wc_get_pristine_copy_path(const char
   apr_pool_t *pool);
 
 
+/** The callback invoked by svn_wc_textbase_sync() to provide the text-base
+ * contents identified by @a repos_root_url, @a repos_relpath and @a revision.
+ *
+ * The callback is expected to write the contents to @a contents and close
+ * the stream.
+ *
+ * @since New in 1.15.
+ */
+typedef svn_error_t *(*svn_wc_textbase_fetch_cb_t)(
+  void *baton,
+  const char *repos_root_url,
+  const char *repos_relpath,
+  svn_revnum_t revision,
+  svn_stream_t *contents,
+  svn_cancel_func_t cancel_func,
+  void *cancel_baton,
+  apr_pool_t *scratch_pool);
+
+ /** Synchronize the state of the text-base contents for the
+  * @a local_abspath tree.
+  *
+  * If @a allow_hydrate is true, fetch the required but missing text-base
+  * contents using the provided @a fetch_callback and @a fetch_baton.
+  * If @a allow_hydrate is false, @a fetch_callback will not be used and
+  * may be @c NULL.
+  *
+  * If @a allow_dehydrate is true, remove the on disk text-base contents
+  * that is not required.
+  *
+  * @see svn_wc_textbase_hydrate_cb_t
+  * @see svn_client__textbase_sync for usage/implementation example.
+  *
+  * @since New

svn commit: r1905659 - in /subversion/branches/pristines-on-demand-on-mwf/subversion: include/private/svn_wc_private.h libsvn_client/textbase.c libsvn_wc/textbase.c libsvn_wc/wc_db.h libsvn_wc/wc_db_t

2022-12-01 Thread kotkov
Author: kotkov
Date: Thu Dec  1 09:57:44 2022
New Revision: 1905659

URL: http://svn.apache.org/viewvc?rev=1905659=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Rename "hydrate callback" to
a "fetch callback".

Our callbacks currently only fetch the contents, whereas hydrating is a
composite operation that involves fetching the contents *and* marking the
pristine as hydrated in the working copy.  So let's use a more appropriate
name for them.

* subversion/include/private/svn_wc_private.h
  (svn_wc__textbase_hydrate_cb_t): Rename …
  (svn_wc__textbase_fetch_cb_t): …to this.
  (svn_wc__textbase_sync): Rename `hydrate_callback` and `hydrate_baton`
   to `fetch_callback` and `fetch_baton` respectively.

* subversion/libsvn_client/textbase.c
  (textbase_hydrate_baton_t, textbase_hydrate_cb): Rename …
  (textbase_fetch_baton_t, textbase_fetch_cb): …to this.
  (svn_client__textbase_sync): Use new names.  Rename `baton` to `fetch_baton`.

* subversion/libsvn_wc/textbase.c
  (textbase_hydrate_cb): Rename …
  (textbase_fetch_cb): …to this.
  (textbase_sync_baton_t, svn_wc__textbase_sync): Use new names.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_textbase_hydrate_cb_t): Rename …
  (svn_wc__db_textbase_fetch_cb_t): …to this.
  (svn_wc__db_textbase_sync): Rename `hydrate_callback` and `hydrate_baton`
   to `fetch_callback` and `fetch_baton` respectively.

* subversion/libsvn_wc/wc_db_textbase.c
  (textbase_hydrate, svn_wc__db_textbase_sync): Use new names.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/textbase.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/textbase.c
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db.h

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h?rev=1905659=1905658=1905659=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/include/private/svn_wc_private.h
 Thu Dec  1 09:57:44 2022
@@ -2323,7 +2323,7 @@ svn_wc__upgrade(svn_wc_context_t *wc_ctx
 
 /* The callback invoked by svn_wc__textbase_sync() to fetch the text-base
contents identified by REPOS_ROOT_URL, REPOS_RELPATH and REVISION. */
-typedef svn_error_t *(*svn_wc__textbase_hydrate_cb_t)(
+typedef svn_error_t *(*svn_wc__textbase_fetch_cb_t)(
   void *baton,
   const char *repos_root_url,
   const char *repos_relpath,
@@ -2335,15 +2335,15 @@ typedef svn_error_t *(*svn_wc__textbase_
 
 /* Synchronize the state of the text-base contents for the LOCAL_ABSPATH tree.
If ALLOW_HYDRATE is true, fetch the required but missing text-base contents
-   using the provided HYDRATE_CALLBACK and HYDRATE_BATON.  If ALLOW_DEHYDRATE
+   using the provided FETCH_CALLBACK and FETCH_BATON.  If ALLOW_DEHYDRATE
is true, remove the on disk text-base contents that is not required. */
 svn_error_t *
 svn_wc__textbase_sync(svn_wc_context_t *wc_ctx,
   const char *local_abspath,
   svn_boolean_t allow_hydrate,
   svn_boolean_t allow_dehydrate,
-  svn_wc__textbase_hydrate_cb_t hydrate_callback,
-  void *hydrate_baton,
+  svn_wc__textbase_fetch_cb_t fetch_callback,
+  void *fetch_baton,
   svn_cancel_func_t cancel_func,
   void *cancel_baton,
   apr_pool_t *scratch_pool);

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/textbase.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/textbase.c?rev=1905659=1905658=1905659=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/textbase.c
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/textbase.c
 Thu Dec  1 09:57:44 2022
@@ -27,27 +27,27 @@
 
 #include "client.h"
 
-/* A baton for use with textbase_hydrate_cb(). */
-typedef struct textbase_hydrate_baton_t
+/* A baton for use with textbase_fetch_cb(). */
+typedef struct textbase_fetch_baton_t
 {
   apr_pool_t *result_pool;
   const char *base_abspath;
   svn_client_ctx_t *ctx;
   svn_ra_session_t *ra_session;
-} textbase_hydrate_baton_t;
+} textbase_fetch_baton_t;
 
-/* Implements svn_wc__textbase_hydrate_cb_t. */
+/* Implements svn_wc__t

svn commit: r1905658 - /subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/client.h

2022-12-01 Thread kotkov
Author: kotkov
Date: Thu Dec  1 09:46:44 2022
New Revision: 1905658

URL: http://svn.apache.org/viewvc?rev=1905658=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Fix a docstring.

* subversion/libsvn_client/client.h
  (svn_client__textbase_sync): Don't mention non-existing `hydrate_callback`
   and `hydrate_baton` parameters.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/client.h

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/client.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/client.h?rev=1905658=1905657=1905658=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/client.h
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/client.h
 Thu Dec  1 09:46:44 2022
@@ -1253,9 +1253,9 @@ svn_client__merge_locked(svn_client__con
 
 /* Synchronize the state of the text-base contents for the LOCAL_ABSPATH tree.
  *
- * If ALLOW_HYDRATE is true, fetch the required but missing text-base contents
- * using the provided HYDRATE_CALLBACK and HYDRATE_BATON.  If ALLOW_DEHYDRATE
- * is true, remove the on disk text-base contents that are not required.
+ * If ALLOW_HYDRATE is true, fetch the required but missing text-base contents.
+ * If ALLOW_DEHYDRATE is true, remove the on disk text-base contents that are
+ * not required.
  *
  * The missing contents will be fetched using the provided RA_SESSION if it
  * is not NULL.  If RA_SESSION is NULL and some of the text-bases have to be




svn commit: r1905643 - /subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py

2022-11-30 Thread kotkov
Author: kotkov
Date: Wed Nov 30 10:44:28 2022
New Revision: 1905643

URL: http://svn.apache.org/viewvc?rev=1905643=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Add a test for an attempt to
checkout into an existing working copy while changing the --store-pristine
setting.

* subversion/tests/cmdline/store_pristine_tests.py
  (checkout_incompatible_setting): New test.
  (test_list): Run new test.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py?rev=1905643=1905642=1905643=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py
 Wed Nov 30 10:44:28 2022
@@ -829,6 +829,39 @@ def move_modified_file_without_pristine(
   svntest.actions.run_and_verify_status(sbox.wc_dir,
 expected_status)
 
+@SkipUnless(svntest.main.wc_supports_optional_pristine)
+def checkout_incompatible_setting(sbox):
+  "checkout with incompatible pristine setting"
+
+  sbox.build(empty=True, create_wc=False)
+  expected_output = svntest.wc.State(sbox.wc_dir, {})
+  expected_wc = svntest.wc.State('', {})
+  svntest.actions.run_and_verify_checkout(sbox.repo_url,
+  sbox.wc_dir,
+  expected_output,
+  expected_wc,
+  [],
+  '--store-pristine=yes')
+  svntest.actions.run_and_verify_svn(
+['yes'], [],
+'info', '--show-item=store-pristine', '--no-newline',
+sbox.wc_dir)
+
+  expected_output = svntest.wc.State(sbox.wc_dir, {})
+  expected_wc = svntest.wc.State('', {})
+  expected_error = "svn: E155042: .*" # SVN_ERR_WC_INCOMPATIBLE_SETTINGS
+  svntest.actions.run_and_verify_checkout(sbox.repo_url,
+  sbox.wc_dir,
+  expected_output,
+  expected_wc,
+  expected_error,
+  '--store-pristine=no')
+  # Ensure that the settings didn't change.
+  svntest.actions.run_and_verify_svn(
+['yes'], [],
+'info', '--show-item=store-pristine', '--no-newline',
+sbox.wc_dir)
+
 
 # Run the tests
 
@@ -857,6 +890,7 @@ test_list = [ None,
   simple_move_without_pristine,
   move_modified_file_with_pristine,
   move_modified_file_without_pristine,
+  checkout_incompatible_setting,
  ]
 serial_only = True
 




svn commit: r1905642 - /subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py

2022-11-30 Thread kotkov
Author: kotkov
Date: Wed Nov 30 10:34:11 2022
New Revision: 1905642

URL: http://svn.apache.org/viewvc?rev=1905642=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: A minor test code cleanup.

* subversion/tests/cmdline/store_pristine_tests.py:
  (): For consistency, use single quotes for arguments of svn checkout.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py?rev=1905642=1905641=1905642=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py
 Wed Nov 30 10:34:11 2022
@@ -53,7 +53,7 @@ def simple_checkout_with_pristine(sbox):
   expected_output,
   expected_disk,
   [],
-  "--store-pristine=yes")
+  '--store-pristine=yes')
   svntest.actions.run_and_verify_svn(
 ['yes'], [],
 'info', '--show-item=store-pristine', '--no-newline',
@@ -71,7 +71,7 @@ def simple_checkout_without_pristine(sbo
   expected_output,
   expected_disk,
   [],
-  "--store-pristine=no")
+  '--store-pristine=no')
   svntest.actions.run_and_verify_svn(
 ['no'], [],
 'info', '--show-item=store-pristine', '--no-newline',
@@ -88,7 +88,7 @@ def simple_commit_with_pristine(sbox):
   expected_output,
   expected_disk,
   [],
-  "--store-pristine=yes")
+  '--store-pristine=yes')
   svntest.actions.run_and_verify_svn(
 ['yes'], [],
 'info', '--show-item=store-pristine', '--no-newline',
@@ -120,7 +120,7 @@ def simple_commit_without_pristine(sbox)
   expected_output,
   expected_disk,
   [],
-  "--store-pristine=no")
+  '--store-pristine=no')
   svntest.actions.run_and_verify_svn(
 ['no'], [],
 'info', '--show-item=store-pristine', '--no-newline',
@@ -151,7 +151,7 @@ def simple_update_with_pristine(sbox):
   expected_output,
   expected_wc,
   [],
-  "--store-pristine=yes")
+  '--store-pristine=yes')
   svntest.actions.run_and_verify_svn(
 ['yes'], [],
 'info', '--show-item=store-pristine', '--no-newline',
@@ -193,7 +193,7 @@ def simple_update_without_pristine(sbox)
   expected_output,
   expected_wc,
   [],
-  "--store-pristine=no")
+  '--store-pristine=no')
   svntest.actions.run_and_verify_svn(
 ['no'], [],
 'info', '--show-item=store-pristine', '--no-newline',
@@ -234,7 +234,7 @@ def simple_status_with_pristine(sbox):
   expected_output,
   expected_wc,
   [],
-  "--store-pristine=yes")
+  '--store-pristine=yes')
   svntest.actions.run_and_verify_svn(
 ['yes'], [],
 'info', '--show-item=store-pristine', '--no-newline',
@@ -290,7 +290,7 @@ def simple_status_without_pristine(sbox)
   expected_output,
   expected_wc,
   [],
-  "--store-pristine=no")
+  '--store-pristine=no')
   svntest.actions.run_and_verify_svn(
 ['no'], [],
 'info', '--show-item=store-pristine', '--no-newline',
@@ -345,7 +345,7 @@ def simple_diff_with_pristine(sbox):
  

svn commit: r1905641 - /subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py

2022-11-30 Thread kotkov
Author: kotkov
Date: Wed Nov 30 10:32:07 2022
New Revision: 1905641

URL: http://svn.apache.org/viewvc?rev=1905641=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Add tests for moves in the
--store-pristine=yes/no modes.

* subversion/tests/cmdline/store_pristine_tests.py
  (simple_move_with_pristine,
   simple_move_without_pristine,
   move_modified_file_with_pristine,
   move_modified_file_without_pristine): New tests.
  (test_list): Run new tests.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py?rev=1905641=1905640=1905641=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py
 Wed Nov 30 10:32:07 2022
@@ -691,6 +691,144 @@ def copy_modified_file_without_pristine(
   svntest.actions.run_and_verify_status(sbox.wc_dir,
 expected_status)
 
+def simple_move_with_pristine(sbox):
+  "simple move with pristine"
+
+  sbox.build(empty=True, create_wc=False)
+  expected_output = svntest.wc.State(sbox.wc_dir, {})
+  expected_wc = svntest.wc.State('', {})
+  svntest.actions.run_and_verify_checkout(sbox.repo_url,
+  sbox.wc_dir,
+  expected_output,
+  expected_wc,
+  [],
+  "--store-pristine=yes")
+  svntest.actions.run_and_verify_svn(
+['yes'], [],
+'info', '--show-item=store-pristine', '--no-newline',
+sbox.wc_dir)
+
+  sbox.simple_append('file', 'foo')
+  sbox.simple_add('file')
+  sbox.simple_commit(message='r1')
+
+  svntest.actions.run_and_verify_svn(None, [], 'move',
+ sbox.ospath('file'),
+ sbox.ospath('file2'))
+
+  expected_status = svntest.wc.State(sbox.wc_dir, {
+''  : Item(status='  ', wc_rev=0),
+'file'  : Item(status='D ', wc_rev=1, moved_to='file2'),
+'file2' : Item(status='A ', wc_rev='-', copied='+', moved_from='file'),
+})
+  svntest.actions.run_and_verify_status(sbox.wc_dir,
+expected_status)
+
+@SkipUnless(svntest.main.wc_supports_optional_pristine)
+def simple_move_without_pristine(sbox):
+  "simple move without pristine"
+
+  sbox.build(empty=True, create_wc=False)
+  expected_output = svntest.wc.State(sbox.wc_dir, {})
+  expected_wc = svntest.wc.State('', {})
+  svntest.actions.run_and_verify_checkout(sbox.repo_url,
+  sbox.wc_dir,
+  expected_output,
+  expected_wc,
+  [],
+  "--store-pristine=no")
+  svntest.actions.run_and_verify_svn(
+['no'], [],
+'info', '--show-item=store-pristine', '--no-newline',
+sbox.wc_dir)
+
+  sbox.simple_append('file', 'foo')
+  sbox.simple_add('file')
+  sbox.simple_commit(message='r1')
+
+  svntest.actions.run_and_verify_svn(None, [], 'move',
+ sbox.ospath('file'),
+ sbox.ospath('file2'))
+
+  expected_status = svntest.wc.State(sbox.wc_dir, {
+''  : Item(status='  ', wc_rev=0),
+'file'  : Item(status='D ', wc_rev=1, moved_to='file2'),
+'file2' : Item(status='A ', wc_rev='-', copied='+', moved_from='file'),
+})
+  svntest.actions.run_and_verify_status(sbox.wc_dir,
+expected_status)
+
+def move_modified_file_with_pristine(sbox):
+  "move locally modified file with pristine"
+
+  sbox.build(empty=True, create_wc=False)
+  expected_output = svntest.wc.State(sbox.wc_dir, {})
+  expected_wc = svntest.wc.State('', {})
+  svntest.actions.run_and_verify_checkout(sbox.repo_url,
+  sbox.wc_dir,
+  expected_output,
+  expected_wc,
+  [],
+  "--store-pristine=yes")
+  svntest.actions.run_and_verify_svn(
+['yes'], [],
+'info', '--show-item=store-pristine', '--no-newline',
+sbox.wc_dir)
+
+  sbox.simple_append('file', 'foo')
+  sbox.simple_add('file')
+  sbox.simple_commit(message='r1')
+
+  sbox.simple_append('file', 'b

svn commit: r1905640 - /subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py

2022-11-30 Thread kotkov
Author: kotkov
Date: Wed Nov 30 10:29:53 2022
New Revision: 1905640

URL: http://svn.apache.org/viewvc?rev=1905640=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Add tests for copies in the
--store-pristine=yes/no modes.

* subversion/tests/cmdline/store_pristine_tests.py
  (simple_copy_with_pristine,
   simple_copy_without_pristine,
   copy_modified_file_with_pristine,
   copy_modified_file_without_pristine): New tests.
  (test_list): Run new tests.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py?rev=1905640=1905639=1905640=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py
 Wed Nov 30 10:29:53 2022
@@ -553,6 +553,144 @@ def update_modified_file_without_pristin
 expected_disk,
 expected_status)
 
+def simple_copy_with_pristine(sbox):
+  "simple copy with pristine"
+
+  sbox.build(empty=True, create_wc=False)
+  expected_output = svntest.wc.State(sbox.wc_dir, {})
+  expected_wc = svntest.wc.State('', {})
+  svntest.actions.run_and_verify_checkout(sbox.repo_url,
+  sbox.wc_dir,
+  expected_output,
+  expected_wc,
+  [],
+  "--store-pristine=yes")
+  svntest.actions.run_and_verify_svn(
+['yes'], [],
+'info', '--show-item=store-pristine', '--no-newline',
+sbox.wc_dir)
+
+  sbox.simple_append('file', 'foo')
+  sbox.simple_add('file')
+  sbox.simple_commit(message='r1')
+
+  svntest.actions.run_and_verify_svn(None, [], 'copy',
+ sbox.ospath('file'),
+ sbox.ospath('file2'))
+
+  expected_status = svntest.wc.State(sbox.wc_dir, {
+''  : Item(status='  ', wc_rev=0),
+'file'  : Item(status='  ', wc_rev=1),
+'file2' : Item(status='A ', wc_rev='-', copied='+'),
+})
+  svntest.actions.run_and_verify_status(sbox.wc_dir,
+expected_status)
+
+@SkipUnless(svntest.main.wc_supports_optional_pristine)
+def simple_copy_without_pristine(sbox):
+  "simple copy without pristine"
+
+  sbox.build(empty=True, create_wc=False)
+  expected_output = svntest.wc.State(sbox.wc_dir, {})
+  expected_wc = svntest.wc.State('', {})
+  svntest.actions.run_and_verify_checkout(sbox.repo_url,
+  sbox.wc_dir,
+  expected_output,
+  expected_wc,
+  [],
+  "--store-pristine=no")
+  svntest.actions.run_and_verify_svn(
+['no'], [],
+'info', '--show-item=store-pristine', '--no-newline',
+sbox.wc_dir)
+
+  sbox.simple_append('file', 'foo')
+  sbox.simple_add('file')
+  sbox.simple_commit(message='r1')
+
+  svntest.actions.run_and_verify_svn(None, [], 'copy',
+ sbox.ospath('file'),
+ sbox.ospath('file2'))
+
+  expected_status = svntest.wc.State(sbox.wc_dir, {
+''  : Item(status='  ', wc_rev=0),
+'file'  : Item(status='  ', wc_rev=1),
+'file2' : Item(status='A ', wc_rev='-', copied='+'),
+})
+  svntest.actions.run_and_verify_status(sbox.wc_dir,
+expected_status)
+
+def copy_modified_file_with_pristine(sbox):
+  "copy locally modified file with pristine"
+
+  sbox.build(empty=True, create_wc=False)
+  expected_output = svntest.wc.State(sbox.wc_dir, {})
+  expected_wc = svntest.wc.State('', {})
+  svntest.actions.run_and_verify_checkout(sbox.repo_url,
+  sbox.wc_dir,
+  expected_output,
+  expected_wc,
+  [],
+  "--store-pristine=yes")
+  svntest.actions.run_and_verify_svn(
+['yes'], [],
+'info', '--show-item=store-pristine', '--no-newline',
+sbox.wc_dir)
+
+  sbox.simple_append('file', 'foo')
+  sbox.simple_add('file')
+  sbox.simple_commit(message='r1')
+
+  sbox.simple_append('file', 'bar')
+
+  svntest.actions.run_and_verify_svn(None, [], 'co

svn commit: r1905602 - in /subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc: wc_db_pristine.c wc_db_private.h wc_db_textbase.c

2022-11-29 Thread kotkov
Author: kotkov
Date: Tue Nov 29 12:08:53 2022
New Revision: 1905602

URL: http://svn.apache.org/viewvc?rev=1905602=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Fix a layering violation in
the implementation of svn_wc__db_textbase_sync() by using the single
svn_wc__db_wcroot_t that we've opened, instead of passing DB+WRI_ABSPATH
further and letting the following functions open and use their own wcroot
object.

* subversion/libsvn_wc/wc_db_private.h
  (svn_wc__db_pristine_prepare_install_internal,
   svn_wc__db_pristine_dehydrate_internal): New internal versions of the
   corresponding functions, accepting a svn_wc__db_wcroot_t.

* subversion/libsvn_wc/wc_db_pristine.c
  (svn_wc__db_pristine_prepare_install,
   svn_wc__db_pristine_prepare_install_internal,
   svn_wc__db_pristine_dehydrate,
   svn_wc__db_pristine_dehydrate_internal): Implement the original versions
   of these functions by calling their new internal versions.

* subversion/libsvn_wc/wc_db_textbase.c
  (svn_wc__db_textbase_sync, textbase_hydrate): Switch to the new internal
   versions of the functions.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_pristine.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_private.h

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_pristine.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_pristine.c?rev=1905602=1905601=1905602=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_pristine.c
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_pristine.c
 Tue Nov 29 12:08:53 2022
@@ -401,11 +401,8 @@ svn_wc__db_pristine_prepare_install(svn_
 apr_pool_t *result_pool,
 apr_pool_t *scratch_pool)
 {
-  svn_stream_t *stream;
-  svn_wc__db_install_data_t *install_data;
   svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
-  const char *temp_dir_abspath;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
 
@@ -413,6 +410,27 @@ svn_wc__db_pristine_prepare_install(svn_
   wri_abspath, scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
+  SVN_ERR(svn_wc__db_pristine_prepare_install_internal(
+stream_p, install_data_p, sha1_checksum_p, md5_checksum_p,
+wcroot, hydrated, result_pool, scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_wc__db_pristine_prepare_install_internal(svn_stream_t **stream_p,
+ svn_wc__db_install_data_t 
**install_data_p,
+ svn_checksum_t **sha1_checksum_p,
+ svn_checksum_t **md5_checksum_p,
+ svn_wc__db_wcroot_t *wcroot,
+ svn_boolean_t hydrated,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+  svn_stream_t *stream;
+  svn_wc__db_install_data_t *install_data;
+  const char *temp_dir_abspath;
+
   temp_dir_abspath = pristine_get_tempdir(wcroot, scratch_pool, scratch_pool);
 
   install_data = apr_pcalloc(result_pool, sizeof(*install_data));
@@ -987,16 +1005,31 @@ svn_wc__db_pristine_dehydrate(svn_wc__db
 {
   svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
-  const char *pristine_abspath;
-  svn_sqlite__stmt_t *stmt;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
-  SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(, _relpath, db,
   wri_abspath, scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
+  SVN_ERR(svn_wc__db_pristine_dehydrate_internal(wcroot, sha1_checksum,
+ scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
+
+svn_error_t *
+svn_wc__db_pristine_dehydrate_internal(svn_wc__db_wcroot_t *wcroot,
+   const svn_checksum_t *sha1_checksum,
+   apr_pool_t *scratch_pool)
+{
+  ;
+  const char *pristine_abspath;
+  svn_sqlite__stmt_t *stmt;
+
+  SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
+
   SVN_ERR(get_pristine_fname(_abspath, wcroot->abspath,
  sha1_checksum,
  scratch_pool, scratch_pool));

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_private.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/

svn commit: r1905601 - /subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/update_tests.py

2022-11-29 Thread kotkov
Author: kotkov
Date: Tue Nov 29 11:30:49 2022
New Revision: 1905601

URL: http://svn.apache.org/viewvc?rev=1905601=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: In the update_tests.py#57, specify
and test the current behavior.

For a working copy that doesn't store local pristine contents, we don't
skip access violation errors when determining if a file was modified.
Because if we did that (and treated such files as modified, as we do for
working copies with pristines), we'd also find ourselves uncontrollably
fetching and removing pristines based on transient errors — which probably
is an undesired property.

* subversion/tests/cmdline/update_tests.py
  (skip_access_denied): Remove Wimp() marker.  Expect an error if
   the working copy doesn't store local pristine copies.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/update_tests.py

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/update_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/update_tests.py?rev=1905601=1905600=1905601=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/update_tests.py
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/update_tests.py
 Tue Nov 29 11:30:49 2022
@@ -5150,9 +5150,6 @@ def revive_children_of_copy(sbox):
 raise svntest.Failure('psi unexpectedly non-existent')
 
 @SkipUnless(svntest.main.is_os_windows)
-# Needs work: the access denied error now happens when we use the
-# working file as the base in update_editor.c:apply_textdelta().
-@Wimp("Need to update the access denied handling in update_editor.c")
 def skip_access_denied(sbox):
   """access denied paths should be skipped"""
 
@@ -5190,14 +5187,27 @@ def skip_access_denied(sbox):
   expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
   expected_status.tweak('iota', status='M ', wc_rev=2)
 
-  # And now check that update skips the path
-  # *and* status shows the path as modified.
-  svntest.actions.run_and_verify_update(wc_dir,
-expected_output,
-None,
-expected_status,
-[], False,
-wc_dir, '-r', '1')
+  if svntest.actions.get_wc_store_pristine(wc_dir):
+# And now check that update skips the path *and* status shows
+# the path as modified.
+svntest.actions.run_and_verify_update(wc_dir,
+  expected_output,
+  None,
+  expected_status,
+  [], False,
+  wc_dir, '-r', '1')
+  else:
+# For a working copy that doesn't store local pristine contents, don't
+# skip access violation errors when determining if a file was modified.
+# Because if we did that (and treated such files as modified, see above),
+# we'd also find ourselves uncontrollably fetching and removing pristines
+# based on transient errors -- which probably is an undesired property.
+# So we currently expect to receive an error:
+expected_err = ".*svn: E155039: Couldn't open a working copy file*"
+svntest.actions.run_and_verify_update(wc_dir,
+  None, None, None,
+  expected_err, False,
+  wc_dir, '-r', '1')
 
   f.close()
 




svn commit: r1905600 - /subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c

2022-11-29 Thread kotkov
Author: kotkov
Date: Tue Nov 29 10:07:24 2022
New Revision: 1905600

URL: http://svn.apache.org/viewvc?rev=1905600=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Ensure that the hydrated pristine
contents has the expected checksum before completing its install it into the
pristine store.

* subversion/libsvn_wc/wc_db_textbase.c
  (textbase_hydrate): Compare expected and actual checksums.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c?rev=1905600=1905599=1905600=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c
 Tue Nov 29 10:07:24 2022
@@ -196,6 +196,16 @@ textbase_hydrate(svn_wc__db_t *db,
 return svn_error_compose_create(err,
  svn_wc__db_pristine_install_abort(install_data, scratch_pool));
 
+  if (!svn_checksum_match(checksum, install_sha1_checksum))
+{
+  err = svn_checksum_mismatch_err(
+  checksum, install_sha1_checksum, scratch_pool,
+  _("Checksum mismatch while fetching text base"));
+
+  return svn_error_compose_create(err,
+   svn_wc__db_pristine_install_abort(install_data, scratch_pool));
+}
+
   err = svn_wc__db_pristine_install(install_data,
 install_sha1_checksum,
 install_md5_checksum,




svn commit: r1905599 - /subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c

2022-11-29 Thread kotkov
Author: kotkov
Date: Tue Nov 29 10:03:50 2022
New Revision: 1905599

URL: http://svn.apache.org/viewvc?rev=1905599=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: A minor refactoring.

* subversion/libsvn_wc/wc_db_textbase.c
  (textbase_hydrate): Rewrite the error handling returns in a slightly more
   compact form, without braces.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c?rev=1905599=1905598=1905599=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c
 Tue Nov 29 10:03:50 2022
@@ -193,22 +193,16 @@ textbase_hydrate(svn_wc__db_t *db,
  cancel_func, cancel_baton,
  scratch_pool);
   if (err)
-{
-  return svn_error_compose_create(
-   err, svn_wc__db_pristine_install_abort(install_data,
-  scratch_pool));
-}
+return svn_error_compose_create(err,
+ svn_wc__db_pristine_install_abort(install_data, scratch_pool));
 
   err = svn_wc__db_pristine_install(install_data,
 install_sha1_checksum,
 install_md5_checksum,
 scratch_pool);
   if (err)
-{
-  return svn_error_compose_create(
-   err, svn_wc__db_pristine_install_abort(install_data,
-  scratch_pool));
-}
+return svn_error_compose_create(err,
+ svn_wc__db_pristine_install_abort(install_data, scratch_pool));
 
   return SVN_NO_ERROR;
 }




svn commit: r1905598 - /subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c

2022-11-29 Thread kotkov
Author: kotkov
Date: Tue Nov 29 10:01:35 2022
New Revision: 1905598

URL: http://svn.apache.org/viewvc?rev=1905598=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: A minor refactoring.

* subversion/libsvn_wc/wc_db_textbase.c
  (textbase_hydrate): Rename `sha1_checksum` and `md5_checksum` to
   `install_sha1_checksum` and `install_md5_checksum` respectively,
   so that these variables would be distinguishable from the `checksum`
   parameter.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c?rev=1905598=1905597=1905598=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c
 Tue Nov 29 10:01:35 2022
@@ -174,14 +174,16 @@ textbase_hydrate(svn_wc__db_t *db,
 {
   svn_stream_t *install_stream;
   svn_wc__db_install_data_t *install_data;
-  svn_checksum_t *sha1_checksum;
-  svn_checksum_t *md5_checksum;
+  svn_checksum_t *install_sha1_checksum;
+  svn_checksum_t *install_md5_checksum;
   svn_error_t *err;
 
   /* ### Use svn_wc__db_wcroot_t */
 
-  SVN_ERR(svn_wc__db_pristine_prepare_install(_stream, _data,
-  _checksum, _checksum,
+  SVN_ERR(svn_wc__db_pristine_prepare_install(_stream,
+  _data,
+  _sha1_checksum,
+  _md5_checksum,
   db, wri_abspath, TRUE,
   scratch_pool, scratch_pool));
 
@@ -197,8 +199,10 @@ textbase_hydrate(svn_wc__db_t *db,
   scratch_pool));
 }
 
-  err = svn_wc__db_pristine_install(install_data, sha1_checksum,
-md5_checksum, scratch_pool);
+  err = svn_wc__db_pristine_install(install_data,
+install_sha1_checksum,
+install_md5_checksum,
+scratch_pool);
   if (err)
 {
   return svn_error_compose_create(




svn commit: r1905570 - /subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/basic_tests.py

2022-11-28 Thread kotkov
Author: kotkov
Date: Mon Nov 28 12:58:42 2022
New Revision: 1905570

URL: http://svn.apache.org/viewvc?rev=1905570=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Skip basic_tests.py#9 when
a working copy is created with --store-pristine=no.

The test manually edits mu's text-base when mu is unmodified.  Unmodified
files don't have their text-bases available with --store-pristine=no, so
I don't think we can adjust this test case to run without making significant
changes.  We could add a separate test that would corrupt the text-base of
the file with local mods and run update, but I'd rather keep the original
test case as-is.

* subversion/tests/cmdline/basic_tests.py
  (basic_update_corruption): Remove Wimp() marker.  Skip if the working
   copy is configured not to store local pristines.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/basic_tests.py

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/basic_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/basic_tests.py?rev=1905570=1905569=1905570=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/basic_tests.py
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/basic_tests.py
 Mon Nov 28 12:58:42 2022
@@ -424,7 +424,6 @@ def basic_commit_corruption(sbox):
 expected_status)
 
 #--
-@Wimp("Relies on wc.text_base_path()")
 def basic_update_corruption(sbox):
   "basic corruption detection on update"
 
@@ -449,6 +448,12 @@ def basic_update_corruption(sbox):
   svntest.actions.run_and_verify_svn(None, [],
  'co', sbox.repo_url, other_wc)
 
+  # The test manually edits mu's text-base when mu is unmodified.
+  # Unmodified files don't have their text-bases available with
+  # --store-pristine=no, so skip if that is the case.
+  if not svntest.actions.get_wc_store_pristine(other_wc):
+raise svntest.Skip('Test assumes a working copy with pristine')
+
   # Make a local mod to mu
   mu_path = sbox.ospath('A/mu')
   svntest.main.file_append(mu_path, 'appended mu text')




svn commit: r1905568 - /subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/textbase.c

2022-11-28 Thread kotkov
Author: kotkov
Date: Mon Nov 28 12:41:57 2022
New Revision: 1905568

URL: http://svn.apache.org/viewvc?rev=1905568=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Following up on r1905324, fix
an issue where we inadvertently started to use unmodified working files as
text-bases even in working copies created with --store-pristine=yes.

This was causing basic_tests.py#9 to fail.

* subversion/libsvn_wc/textbase.c
  (open_textbase): Only use an unmodified working file as the text-base
   if the working copy is not configured to store local pristines.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/textbase.c

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/textbase.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/textbase.c?rev=1905568=1905567=1905568=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/textbase.c 
(original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/textbase.c 
Mon Nov 28 12:41:57 2022
@@ -271,21 +271,33 @@ open_textbase(svn_stream_t **contents_p,
 
   if (checksum && svn_checksum_match(checksum, target_checksum))
 {
-  svn_boolean_t modified;
+  svn_boolean_t store_pristine;
 
-  SVN_ERR(check_file_modified(, db, local_abspath, recorded_size,
-  recorded_time, target_checksum, have_props,
-  props_mod, scratch_pool));
-  if (!modified)
+  SVN_ERR(svn_wc__db_get_settings(NULL, _pristine, db, local_abspath,
+  scratch_pool));
+  if (!store_pristine)
 {
-  SVN_ERR(svn_wc__internal_translated_stream(contents_p, db,
- local_abspath,
- local_abspath,
- SVN_WC_TRANSLATE_TO_NF,
- result_pool,
- scratch_pool));
+  svn_boolean_t modified;
 
-  return SVN_NO_ERROR;
+  /* If the working copy doesn't store local copies of all pristine
+   * contents, a text-base of the unmodified file is the file itself,
+   * appropriately detranslated. */
+
+  SVN_ERR(check_file_modified(, db, local_abspath,
+  recorded_size, recorded_time,
+  target_checksum, have_props,
+  props_mod, scratch_pool));
+  if (!modified)
+{
+  SVN_ERR(svn_wc__internal_translated_stream(contents_p, db,
+ local_abspath,
+ local_abspath,
+ 
SVN_WC_TRANSLATE_TO_NF,
+ result_pool,
+ scratch_pool));
+
+  return SVN_NO_ERROR;
+}
 }
 }
 




svn commit: r1905567 - in /subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client: cat.c client.h commit.c conflicts.c diff.c resolved.c revert.c switch.c textbase.c update.c upgrade.

2022-11-28 Thread kotkov
Author: kotkov
Date: Mon Nov 28 11:59:27 2022
New Revision: 1905567

URL: http://svn.apache.org/viewvc?rev=1905567=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Reuse an RA session when fetching
the text-base contents.

More specifically, we teach svn_client__textbase_sync() to use the passed-in
RA session when available.  If there is no such session, this function will
open one internally, optionally returning it to the caller so that it could
be reused further on.

* subversion/libsvn_client/client.h
  (svn_client__textbase_sync): Add `ra_session_p`, `ra_session` and the
   `result_pool` parameters.

* subversion/libsvn_client/textbase.c
  (textbase_hydrate_baton_t): Rename `pool` to `result_pool`. Store the
   new `base_abspath` field.
  (textbase_hydrate_cb): Open the RA session with standard settings, so
   that it could be reused further on if necessary.  Starting from r1905528,
   there is no performance loss from using an RA session that corresponds to
   a working copy.  Remove the TODO comment.
  (svn_client__textbase_sync): Handle the new input and output RA session
   parameters.  If the session has been provided by the caller, reparent it
   back to the original URL after sync.

* subversion/libsvn_client/cat.c
  (svn_client_cat3): Adjust calls to svn_client__textbase_sync().

* subversion/libsvn_client/commit.c
  (svn_client_commit6): Adjust calls to svn_client__textbase_sync().

* subversion/libsvn_client/conflicts.c
  (begin_resolve, finish_resolve): Adjust calls to svn_client__textbase_sync().

* subversion/libsvn_client/diff.c
  (diff_wc_wc): Adjust calls to svn_client__textbase_sync().
  (diff_repos_wc): Reuse the available RA session.

* subversion/libsvn_client/resolved.c
  (resolve_locked): Adjust calls to svn_client__textbase_sync().
  (svn_client__resolve_conflicts): Reuse one RA session across multiple calls
   to svn_client__textbase_sync().

* subversion/libsvn_client/revert.c
  (revert_with_write_lock_baton): Add `ra_session_p` field.
  (revert, svn_client_revert4): Reuse one RA session across multiple calls
   to svn_client__textbase_sync().

* subversion/libsvn_client/switch.c
  (switch_internal): Reuse the available RA session.

* subversion/libsvn_client/update.c
  (update_internal): Reuse the available RA session.

* subversion/libsvn_client/upgrade.c
  (upgrade_internal): Adjust a call to svn_client__textbase_sync().

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/cat.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/client.h

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/commit.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/conflicts.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/diff.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/resolved.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/revert.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/switch.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/textbase.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/update.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/upgrade.c

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/cat.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/cat.c?rev=1905567=1905566=1905567=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/cat.c 
(original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/cat.c 
Mon Nov 28 11:59:27 2022
@@ -217,8 +217,9 @@ svn_client_cat3(apr_hash_t **returned_pr
   SVN_ERR(svn_dirent_get_absolute(_abspath, path_or_url,
   scratch_pool));
 
-  SVN_ERR(svn_client__textbase_sync(local_abspath, TRUE, TRUE,
-ctx, scratch_pool));
+  /* This will open the RA session internally if needed. */
+  SVN_ERR(svn_client__textbase_sync(NULL, local_abspath, TRUE, TRUE, ctx,
+NULL, scratch_pool, scratch_pool));
 
   SVN_ERR(svn_client__get_normalized_stream(_stream, ctx->wc_ctx,
 local_abspath, revision,
@@ -237,8 +238,8 @@ svn_client_cat3(apr_hash_t **returned_pr
ctx->cancel_func,
ctx->cancel_baton, scratch_pool));
 
-  SVN_ERR(svn_client__textbase_sync(local_abspath, FALSE, TRUE,
-ctx, scratch_pool));
+  SVN_ERR(svn_client__textbase_sync(NULL, local_abspath, FALSE, TRUE, ctx,
+   

svn commit: r1905528 - in /subversion/branches/pristines-on-demand-on-mwf/subversion: include/ libsvn_client/ libsvn_ra/ libsvn_ra_local/ libsvn_ra_serf/ libsvn_ra_svn/

2022-11-25 Thread kotkov
Author: kotkov
Date: Fri Nov 25 17:13:55 2022
New Revision: 1905528

URL: http://svn.apache.org/viewvc?rev=1905528=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Rework the RA part of the
text-base fetching.

This changeset solves a performance issue where fetching a single text-base
over ra_serf required two requests (PROPFIND + GET) instead of one (GET).

It also lays the groundwork for reusing RA sessions.  Such reuse was partly
blocked by having to open a session that is not associated with a specific
working copy, because otherwise a content fetch would first try the local
pristine cache — which is a waste of resources for the case when we are
fetching the pristines ourselves.

* subversion/include/svn_ra.h
  (svn_ra_fetch_file_contents): New.

* subversion/libsvn_ra/ra_loader.h
  (svn_ra__vtable_t.fetch_file_contents): New

* subversion/libsvn_ra/ra_loader.c
  (svn_ra_fetch_file_contents): Call the new vtable member.

* subversion/libsvn_ra_local/ra_plugin.c
  (get_file): Factor out this helper function.  Always close the stream.
  (svn_ra_local__get_file): Call the helper function, disowning the stream
   to keep the current behavior.
  (svn_ra_local__fetch_file_contents): New, implemented with a call to the
   new helper function.
  (ra_local_vtable): Add new function to vtable.

* subversion/libsvn_ra_svn/client.c
  (get_file): Factor out this helper function.  Always close the stream.
  (ra_svn_get_file): Call the helper function, disowning the stream
   to keep the current behavior.
  (ra_svn_fetch_file_contents): New, implemented with a call to the
   new helper function.
  (ra_svn_vtable): Add new function to vtable.

* subversion/libsvn_ra_serf/ra_serf.h
  (svn_ra_serf__fetch_file_contents): New.

* subversion/libsvn_ra_serf/get_file.c
  (svn_ra_serf__fetch_file_contents): New.

* subversion/libsvn_ra_serf/serf.c
  (serf_vtable): Add new function to vtable.

* subversion/libsvn_client/textbase.c
  (textbase_hydrate_cb): Use the new RA function to fetch the contents.

Modified:
subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_ra.h

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/textbase.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_ra/ra_loader.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_ra/ra_loader.h

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_ra_local/ra_plugin.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_ra_serf/get_file.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_ra_serf/ra_serf.h

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_ra_serf/serf.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_ra_svn/client.c

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_ra.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_ra.h?rev=1905528=1905527=1905528=diff
==
--- subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_ra.h 
(original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/include/svn_ra.h 
Fri Nov 25 17:13:55 2022
@@ -2164,6 +2164,29 @@ svn_ra_get_inherited_props(svn_ra_sessio
apr_pool_t *scratch_pool);
 
 /**
+ * Fetch the contents of file @a path at @a revision.  Interpret @a path
+ * relative to the URL in @a session.  @a revision must be a valid revision
+ * number.  Use @a scratch_pool for scratch allocations.
+ *
+ * The contents of the file will be pushed to @a stream, and the stream will
+ * be closed when finished.  If the closure is not desired, then you can use
+ * svn_stream_disown() to protect the stream from being closed.  The stream
+ * handlers for @a stream may not perform any RA operations using @a session.
+ *
+ * The contents may be expected to be fetched directly from the remote
+ * endpoint, rather from any local caches such as the one provided by
+ * #svn_ra_get_wc_contents_func_t.
+ *
+ * @since New in 1.15.
+ */
+svn_error_t *
+svn_ra_fetch_file_contents(svn_ra_session_t *session,
+   const char *path,
+   svn_revnum_t revision,
+   svn_stream_t *stream,
+   apr_pool_t *scratch_pool);
+
+/**
  * @defgroup Capabilities Dynamically query the server's capabilities.
  *
  * @{

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/textbase.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/textbase.c?rev=1905528=1905527=1905528=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/textbase.c
 (original)
+++ 
subversion/branches

svn commit: r1905513 - /subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c

2022-11-24 Thread kotkov
Author: kotkov
Date: Thu Nov 24 16:03:06 2022
New Revision: 1905513

URL: http://svn.apache.org/viewvc?rev=1905513=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: A minor refactoring.

* subversion/libsvn_wc/wc_db_textbase.c
  (SQLITE_PROPERTIES_AVAILABLE, get_recorded_size): Inline these helpers
   to their only calling site…
  (svn_wc__db_textbase_walk): …here.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c?rev=1905513=1905512=1905513=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_textbase.c
 Thu Nov 24 16:03:06 2022
@@ -31,19 +31,6 @@
 #include "wc-queries.h"
 #include "wc_db_private.h"
 
-/* ### Copied from wc_db.c: SQLITE_PROPERTIES_AVAILABLE() */
-#define SQLITE_PROPERTIES_AVAILABLE(stmt, i) \
- (svn_sqlite__column_bytes(stmt, i) > 2)
-
-/* ### Copied from wc_db.c: get_recorded_size() */
-static svn_filesize_t
-get_recorded_size(svn_sqlite__stmt_t *stmt, int slot)
-{
-  if (svn_sqlite__column_is_null(stmt, slot))
-return SVN_INVALID_FILESIZE;
-  return svn_sqlite__column_int64(stmt, slot);
-}
-
 static svn_error_t *
 textbase_add_ref(svn_wc__db_wcroot_t *wcroot,
  const char *local_relpath,
@@ -137,8 +124,12 @@ svn_wc__db_textbase_walk(svn_wc__db_t *d
   if (err)
 return svn_error_compose_create(err, svn_sqlite__reset(stmt));
 
-  have_props = SQLITE_PROPERTIES_AVAILABLE(stmt, 4);
-  recorded_size = get_recorded_size(stmt, 5);
+  /* The empty set of properties is stored as "()". */
+  have_props = svn_sqlite__column_bytes(stmt, 4) > 2;
+  if (svn_sqlite__column_is_null(stmt, 5))
+recorded_size = SVN_INVALID_FILESIZE;
+  else
+recorded_size = svn_sqlite__column_int64(stmt, 5);
   recorded_time = svn_sqlite__column_int64(stmt, 6);
   props_mod = !svn_sqlite__column_is_null(stmt, 7);
   max_op_depth = svn_sqlite__column_int(stmt, 8);




svn commit: r1905512 - /subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/authz_tests.py

2022-11-24 Thread kotkov
Author: kotkov
Date: Thu Nov 24 15:58:35 2022
New Revision: 1905512

URL: http://svn.apache.org/viewvc?rev=1905512=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: In the authz_tests.py#31, specify
and test the current behavior.

An `svn update` currently requires hydrating all text-bases beforehand.
If some of them cannot be fetched due to an authz access denied error
(or any other error, actually), then the whole operation is currently
expected to fail.

* subversion/tests/cmdline/authz_tests.py
  (remove_access_after_commit): Remove Wimp() marker.  Expect an error if
   the working copy doesn't store local pristine copies.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/authz_tests.py

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/authz_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/authz_tests.py?rev=1905512=1905511=1905512=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/authz_tests.py
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/authz_tests.py
 Thu Nov 24 15:58:35 2022
@@ -1613,7 +1613,6 @@ def authz_log_censor_revprops(sbox):
   '-r1', sbox.repo_url])
 
 @Skip(svntest.main.is_ra_type_file)
-@Wimp("Applying delta to a local mod needs access to the text base")
 def remove_access_after_commit(sbox):
   "remove a subdir with authz file"
 
@@ -1658,11 +1657,26 @@ def remove_access_after_commit(sbox):
 
   # And expect a mixed rev copy
   expected_status.tweak('A/D/G/rho', status='A ', entry_status='  ')
-  svntest.actions.run_and_verify_update(wc_dir,
-expected_output,
-expected_disk,
-expected_status,
-[], True)
+
+  if svntest.actions.get_wc_store_pristine(wc_dir):
+svntest.actions.run_and_verify_update(wc_dir,
+  expected_output,
+  expected_disk,
+  expected_status,
+  [], True)
+  else:
+# We are unable to fetch the pristine without read access.
+# So in a working copy without local pristines, the update is
+# currently expected to fail.
+if svntest.main.is_ra_type_dav():
+  expected_err = ".*svn: E175013: .*[Ff]orbidden.*"
+elif svntest.main.is_ra_type_svn():
+  expected_err = ".*svn: E170001: Authorization failed.*"
+else:
+  raise svntest.Failure
+
+svntest.actions.run_and_verify_update(wc_dir, None, None, None,
+  expected_err, True)
 
 @Issue(4793)
 @Skip(svntest.main.is_ra_type_file)




svn commit: r1905511 - /subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/authz_tests.py

2022-11-24 Thread kotkov
Author: kotkov
Date: Thu Nov 24 15:57:31 2022
New Revision: 1905511

URL: http://svn.apache.org/viewvc?rev=1905511=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Following up on r1900103,
expect different errors in the newly added authz_tests.py#37 for http://
and svn:// protocols.

* subversion/tests/cmdline/authz_tests.py
  (cat_base_after_repo_access_removed): Use separate expectations for
   different protocols.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/authz_tests.py

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/authz_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/authz_tests.py?rev=1905511=1905510=1905511=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/authz_tests.py
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/authz_tests.py
 Thu Nov 24 15:57:31 2022
@@ -1839,7 +1839,14 @@ def cat_base_after_repo_access_removed(s
 svntest.actions.run_and_verify_svn("This is the file 'pi'.\n", [],
'cat', sbox.ospath('A/D/G/pi') + 
'@BASE')
   else:
-svntest.actions.run_and_verify_svn(None, '.*E170001: Authorization failed',
+if svntest.main.is_ra_type_dav():
+  expected_err = ".*svn: E175013: .*[Ff]orbidden.*"
+elif svntest.main.is_ra_type_svn():
+  expected_err = ".*svn: E170001: Authorization failed.*"
+else:
+  raise svntest.Failure
+
+svntest.actions.run_and_verify_svn(None, expected_err,
'cat', sbox.ospath('A/D/G/pi') + 
'@BASE')
 
 




svn commit: r1905509 - /subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/basic_tests.py

2022-11-24 Thread kotkov
Author: kotkov
Date: Thu Nov 24 14:52:59 2022
New Revision: 1905509

URL: http://svn.apache.org/viewvc?rev=1905509=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Update basic_tests.py#8 so that
it would work in both pristine modes.

The test performs direct manipulations on the pristine file.  But with
--store-pristine=no, we don't have that file available on disk, so let's
fix that by running `svn diff` for the modified file, as that will fetch
the required pristine.

* subversion/tests/cmdline/basic_tests.py
  (basic_commit_corruption): Remove Wimp() marker.  Call `svn diff` for
   the modified file to have its pristine available locally.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/basic_tests.py

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/basic_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/basic_tests.py?rev=1905509=1905508=1905509=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/basic_tests.py
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/basic_tests.py
 Thu Nov 24 14:52:59 2022
@@ -355,7 +355,6 @@ def basic_mkdir_wc_with_parents(sbox):
 
 
 #--
-@Wimp("Relies on wc.text_base_path()")
 def basic_commit_corruption(sbox):
   "basic corruption detection on commit"
 
@@ -378,6 +377,10 @@ def basic_commit_corruption(sbox):
   mu_path = sbox.ospath('A/mu')
   svntest.main.file_append(mu_path, 'appended mu text')
 
+  # We are about to manually edit mu's text-base, so run "diff" to
+  # guarantee that the text-base is available in all pristine modes.
+  svntest.actions.run_and_verify_svn(None, [], 'diff', mu_path)
+
   # Created expected output tree for 'svn ci'
   expected_output = wc.State(wc_dir, {
 'A/mu' : Item(verb='Sending'),




svn commit: r1905506 - /subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/pristine-store-test.c

2022-11-24 Thread kotkov
Author: kotkov
Date: Thu Nov 24 10:48:03 2022
New Revision: 1905506

URL: http://svn.apache.org/viewvc?rev=1905506=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: In the pristine-store-test, check
the actual working copy settings, instead of trying to predict them based
on the test options.

* subversion/tests/libsvn_wc/pristine-store-test.c
  (pristine_install_dehydrated,
   pristine_dehydrate): Check the working copy settings.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/pristine-store-test.c

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/pristine-store-test.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/pristine-store-test.c?rev=1905506=1905505=1905506=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/pristine-store-test.c
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/pristine-store-test.c
 Thu Nov 24 10:48:03 2022
@@ -328,17 +328,16 @@ pristine_install_dehydrated(const svn_te
   const char data[] = "Blah";
   svn_checksum_t *data_sha1, *data_md5;
 
-  int wc_format;
-
-  SVN_ERR(svn_wc__format_from_version(_format, opts->wc_format_version, 
pool));
-
-  if (wc_format < SVN_WC__HAS_OPTIONAL_PRISTINE)
-return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL,
-"Not supported in WC format under test");
+  svn_boolean_t store_pristine;
 
   SVN_ERR(create_repos_and_wc(_abspath, ,
   "pristine_install_dehydrated", opts, pool));
 
+  SVN_ERR(svn_wc__db_get_settings(NULL, _pristine, db, wc_abspath, 
pool));
+  if (store_pristine)
+return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL,
+"Test assumes a working copy without pristine");
+
   /* Write DATA into a new temporary pristine file, set PRISTINE_TMP_ABSPATH
* to its path and set DATA_SHA1 and DATA_MD5 to its checksums. */
   SVN_ERR(svn_wc__db_pristine_prepare_install(_stream,
@@ -439,17 +438,16 @@ pristine_dehydrate(const svn_test_opts_t
   svn_string_t *data_string = svn_string_create(data, pool);
   svn_checksum_t *data_sha1, *data_md5;
 
-  int wc_format;
-
-  SVN_ERR(svn_wc__format_from_version(_format, opts->wc_format_version, 
pool));
-
-  if (wc_format < SVN_WC__HAS_OPTIONAL_PRISTINE)
-return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL,
-"Not supported in WC format under test");
+  svn_boolean_t store_pristine;
 
   SVN_ERR(create_repos_and_wc(_abspath, ,
   "pristine_dehydrate", opts, pool));
 
+  SVN_ERR(svn_wc__db_get_settings(NULL, _pristine, db, wc_abspath, 
pool));
+  if (store_pristine)
+return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL,
+"Test assumes a working copy without pristine");
+
   /* Write DATA into a new temporary pristine file, set PRISTINE_TMP_ABSPATH
* to its path and set DATA_SHA1 and DATA_MD5 to its checksums. */
   SVN_ERR(svn_wc__db_pristine_prepare_install(_stream,




svn commit: r1905505 - /subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/update_tests.py

2022-11-24 Thread kotkov
Author: kotkov
Date: Thu Nov 24 10:19:01 2022
New Revision: 1905505

URL: http://svn.apache.org/viewvc?rev=1905505=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Undo the modifications to
update_tests.py#83, restoring it to how it's currently written in trunk.

With r1905503 in place, we now provide distinguishable errors in all cases
where we fail to create a file install stream, so there is no need to change
the test expectations.

* subversion/tests/cmdline/upgrade_tests.py
  (missing_tmp_update): Expect the same error output as in trunk.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/update_tests.py

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/update_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/update_tests.py?rev=1905505=1905504=1905505=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/update_tests.py
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/update_tests.py
 Thu Nov 24 10:19:01 2022
@@ -6804,7 +6804,7 @@ def missing_tmp_update(sbox):
 
   os.rmdir(sbox.ospath(svntest.main.get_admin_name() + '/tmp'))
 
-  svntest.actions.run_and_verify_svn(None, ".*(Unable to create|Can't 
create).*",
+  svntest.actions.run_and_verify_svn(None, '.*Unable to create.*',
  'up', wc_dir, '--set-depth', 'infinity')
 
   # This re-creates .svn/tmp as a side-effect.




svn commit: r1905504 - in /subversion/branches/pristines-on-demand-on-mwf: ./ subversion/libsvn_wc/working_file_writer.c

2022-11-24 Thread kotkov
Author: kotkov
Date: Thu Nov 24 10:12:10 2022
New Revision: 1905504

URL: http://svn.apache.org/viewvc?rev=1905504=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Sync with trunk@1905503.

Modified:
subversion/branches/pristines-on-demand-on-mwf/   (props changed)

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/working_file_writer.c

Propchange: subversion/branches/pristines-on-demand-on-mwf/
--
  Merged /subversion/trunk:r1905480-1905503

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/working_file_writer.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/working_file_writer.c?rev=1905504=1905503=1905504=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/working_file_writer.c
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/working_file_writer.c
 Thu Nov 24 10:12:10 2022
@@ -25,6 +25,7 @@
 #include "svn_subst.h"
 #include "svn_time.h"
 #include "svn_path.h"
+#include "svn_private_config.h"
 
 #include "private/svn_io_private.h"
 #include "private/svn_wc_private.h"
@@ -71,8 +72,9 @@ svn_wc__working_file_writer_open(svn_wc_
   svn_stream_t *install_stream;
   svn_stream_t *write_stream;
 
-  SVN_ERR(svn_stream__create_for_install(_stream, tmp_abspath,
- result_pool, scratch_pool));
+  SVN_ERR_W(svn_stream__create_for_install(_stream, tmp_abspath,
+   result_pool, scratch_pool),
+_("Unable to create file install stream"));
 
   if (is_readonly)
 svn_stream__install_set_read_only(install_stream, TRUE);




svn commit: r1905503 - /subversion/trunk/subversion/libsvn_wc/working_file_writer.c

2022-11-24 Thread kotkov
Author: kotkov
Date: Thu Nov 24 10:11:00 2022
New Revision: 1905503

URL: http://svn.apache.org/viewvc?rev=1905503=rev
Log:
In the working copy file writer, improve error reporting for cases where
we cannot create a file install stream.

See r1702203 that adds similar error reporting to another place where
create an install stream for the pristine file.

* subversion/libsvn_wc/working_file_writer.c
  (): Include svn_private_config.h
  (svn_wc__working_file_writer_open): Wrap error message.

Modified:
subversion/trunk/subversion/libsvn_wc/working_file_writer.c

Modified: subversion/trunk/subversion/libsvn_wc/working_file_writer.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/working_file_writer.c?rev=1905503=1905502=1905503=diff
==
--- subversion/trunk/subversion/libsvn_wc/working_file_writer.c (original)
+++ subversion/trunk/subversion/libsvn_wc/working_file_writer.c Thu Nov 24 
10:11:00 2022
@@ -25,6 +25,7 @@
 #include "svn_subst.h"
 #include "svn_time.h"
 #include "svn_path.h"
+#include "svn_private_config.h"
 
 #include "private/svn_io_private.h"
 #include "private/svn_wc_private.h"
@@ -71,8 +72,9 @@ svn_wc__working_file_writer_open(svn_wc_
   svn_stream_t *install_stream;
   svn_stream_t *write_stream;
 
-  SVN_ERR(svn_stream__create_for_install(_stream, tmp_abspath,
- result_pool, scratch_pool));
+  SVN_ERR_W(svn_stream__create_for_install(_stream, tmp_abspath,
+   result_pool, scratch_pool),
+_("Unable to create file install stream"));
 
   if (is_readonly)
 svn_stream__install_set_read_only(install_stream, TRUE);




svn commit: r1905492 - /subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/basic_tests.py

2022-11-23 Thread kotkov
Author: kotkov
Date: Wed Nov 23 14:12:05 2022
New Revision: 1905492

URL: http://svn.apache.org/viewvc?rev=1905492=rev
Log:
On the 'pristines-on-demand-on-mwf' branch:

* subversion/tests/cmdline/basic_tests.py
  (basic_auth_test): Explicitly pass options.store_pristine in this test,
   similarly to what we already do with options.wc_format_version.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/basic_tests.py

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/basic_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/basic_tests.py?rev=1905492=1905491=1905492=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/basic_tests.py
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/basic_tests.py
 Wed Nov 23 14:12:05 2022
@@ -2546,6 +2546,9 @@ def basic_auth_test(sbox):
   if svntest.main.options.wc_format_version:
 common_opts += ('--compatible-version',
 svntest.main.options.wc_format_version)
+  if svntest.main.options.store_pristine:
+common_opts += ('--store-pristine',
+svntest.main.options.store_pristine)
 
   # Checkout with jrandom
   exit_code, output, errput = svntest.main.run_command(




svn commit: r1905490 - in /subversion/branches/pristines-on-demand-on-mwf/subversion: libsvn_client/ libsvn_wc/ tests/cmdline/ tests/cmdline/svntest/ tests/libsvn_wc/

2022-11-23 Thread kotkov
Author: kotkov
Date: Wed Nov 23 14:02:11 2022
New Revision: 1905490

URL: http://svn.apache.org/viewvc?rev=1905490=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Without any functional change,
switch to a more lightweight internal term "optional pristine" when talking
about the new low-level working copy capabilities.

* subversion/libsvn_wc/wc-metadata.sql
  (STMT_UPGRADE_TO_32): Tweak comment.

* subversion/libsvn_wc/wc.h
  (SVN_WC__PRISTINES_ON_DEMAND_VERSION): Rename to…
  (SVN_WC__HAS_OPTIONAL_PRISTINE): …this.
  (SVN_WC__SETTINGS_VERSION): Rename to…
  (SVN_WC__HAS_SETTINGS): …this, for consistency.

* subversion/libsvn_client/client.h
  (svn_client__compatible_wc_version_pristines_on_demand): Rename to…
  (svn_client__compatible_wc_version_optional_pristine): …this.

* subversion/libsvn_client/checkout.c,
  subversion/libsvn_client/upgrade.c,
  subversion/libsvn_wc/adm_files.c,
  subversion/libsvn_wc/wc_db.c,
  subversion/libsvn_wc/wc_db_pristine.c,
  subversion/libsvn_wc/wc_db_wcroot.c,
  subversion/tests/libsvn_wc/pristine-store-test.c:
  (): Update symbol references.

* subversion/tests/cmdline/svntest/main.py
  (is_wc_pristines_on_demand_supported): Rename to…
  (wc_supports_optional_pristine): …this.

* subversion/tests/cmdline/store_pristine_tests.py
  (): Update symbol references.

* subversion/tests/cmdline/trans_tests.py
  (keywords_from_birth): Tweak comment.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/checkout.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/client.h

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/upgrade.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/adm_files.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc-metadata.sql
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc.h
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_pristine.c

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db_wcroot.c

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/store_pristine_tests.py

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/svntest/main.py

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/trans_tests.py

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/pristine-store-test.c

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/checkout.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/checkout.c?rev=1905490=1905489=1905490=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/checkout.c
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/checkout.c
 Wed Nov 23 14:02:11 2022
@@ -282,7 +282,7 @@ svn_client_checkout4(svn_revnum_t *resul
   if (store_pristine == svn_tristate_false)
 {
   const svn_version_t *required_version =
-svn_client__compatible_wc_version_pristines_on_demand(pool);
+svn_client__compatible_wc_version_optional_pristine(pool);
 
   if (!svn_version__at_least(wc_format_version,
  required_version->major,

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/client.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/client.h?rev=1905490=1905489=1905490=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/client.h
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/client.h
 Wed Nov 23 14:02:11 2022
@@ -1261,9 +1261,9 @@ svn_client__textbase_sync(const char *lo
   apr_pool_t *scratch_pool);
 
 /* Returns the first version that supported the working copy metadata format
- * where pristines can be fetched on demand. */
+ * where pristine content is optional and can be fetched on demand. */
 const svn_version_t *
-svn_client__compatible_wc_version_pristines_on_demand(apr_pool_t *result_pool);
+svn_client__compatible_wc_version_optional_pristine(apr_pool_t *result_pool);
 
 #ifdef __cplusplus
 }

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/upgrade.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_client/upgrade.c?rev=1905490=1905489=1905490=diff
==
--- 
subversion/branches/pristines-on-demand-on-m

svn commit: r1905489 - /subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/op-depth-test.c

2022-11-23 Thread kotkov
Author: kotkov
Date: Wed Nov 23 13:39:08 2022
New Revision: 1905489

URL: http://svn.apache.org/viewvc?rev=1905489=rev
Log:
On the 'pristines-on-demand-on-mwf' branch:

* subversion/tests/libsvn_wc/op-depth-test.c
  (stmt_for_f31_or_f32): Test for a concrete version number, instead of
   relying on (one of) the working copy capabilities added in format 32.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/op-depth-test.c

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/op-depth-test.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/op-depth-test.c?rev=1905489=1905488=1905489=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/op-depth-test.c
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/op-depth-test.c
 Wed Nov 23 13:39:08 2022
@@ -2084,8 +2084,7 @@ stmt_for_f31_or_f32(svn_test__sandbox_t
   return -1;
 }
 
-  return (wcroot->format >= SVN_WC__PRISTINES_ON_DEMAND_VERSION
-  ? stmt_for_f32 : stmt_for_f31);
+  return (wcroot->format >= 32 ? stmt_for_f32 : stmt_for_f31);
 }
 
 static svn_error_t *




svn commit: r1905488 - /subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/op-depth-test.c

2022-11-23 Thread kotkov
Author: kotkov
Date: Wed Nov 23 13:37:32 2022
New Revision: 1905488

URL: http://svn.apache.org/viewvc?rev=1905488=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Following up on r1897977,
fix an incorrect check in the stmt_for_f31_or_f32() test helper.

* subversion/tests/libsvn_wc/op-depth-test.c
  (stmt_for_f31_or_f32): Fix the inverted check.
  (insert_actual): Swap the arguments when calling stmt_for_f31_or_f32().

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/op-depth-test.c

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/op-depth-test.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/op-depth-test.c?rev=1905488=1905487=1905488=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/op-depth-test.c
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/op-depth-test.c
 Wed Nov 23 13:37:32 2022
@@ -2085,7 +2085,7 @@ stmt_for_f31_or_f32(svn_test__sandbox_t
 }
 
   return (wcroot->format >= SVN_WC__PRISTINES_ON_DEMAND_VERSION
-  ? stmt_for_f31 : stmt_for_f32);
+  ? stmt_for_f32 : stmt_for_f31);
 }
 
 static svn_error_t *
@@ -2119,8 +2119,8 @@ insert_actual(svn_test__sandbox_t *b,
   SVN_ERR(svn_sqlite__get_statement(, sdb,
 stmt_for_f31_or_f32(
   b,
-  STMT_ENSURE_EMPTY_PRISTINE_F32,
-  
STMT_ENSURE_EMPTY_PRISTINE_F31)));
+  STMT_ENSURE_EMPTY_PRISTINE_F31,
+  
STMT_ENSURE_EMPTY_PRISTINE_F32)));
   SVN_ERR(svn_sqlite__step_done(stmt));
   SVN_ERR(svn_sqlite__get_statement(, sdb, STMT_NODES_SET_FILE));
   SVN_ERR(svn_sqlite__bindf(stmt, "s", actual->local_relpath));




svn commit: r1905487 - /subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc-metadata.sql

2022-11-23 Thread kotkov
Author: kotkov
Date: Wed Nov 23 13:18:21 2022
New Revision: 1905487

URL: http://svn.apache.org/viewvc?rev=1905487=rev
Log:
On the 'pristines-on-demand-on-mwf' branch:

* subversion/libsvn_wc/wc-metadata.sql
  (): Remove an unrelated formatting change (added newlines).

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc-metadata.sql

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc-metadata.sql
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc-metadata.sql?rev=1905487=1905486=1905487=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc-metadata.sql
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc-metadata.sql
 Wed Nov 23 13:18:21 2022
@@ -570,6 +570,7 @@ CREATE UNIQUE INDEX I_EXTERNALS_DEFINED
   def_local_relpath,
   local_relpath);
 
+
 /* Identify the WC format corresponding to the schema we have created. */
 PRAGMA user_version =
 -- define: SVN_WC__SUPPORTED_VERSION
@@ -705,6 +706,7 @@ WHERE l.op_depth = 0
   AND ((l.repos_id IS NOT r.repos_id)
OR (l.repos_path IS NOT RELPATH_SKIP_JOIN(r.local_relpath, 
r.repos_path, l.local_relpath)))
 
+
 /* - */
 /* Format 32 adds support for optional text-base contents with the
following schema changes:




svn commit: r1905486 - /subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/questions.c

2022-11-23 Thread kotkov
Author: kotkov
Date: Wed Nov 23 13:04:55 2022
New Revision: 1905486

URL: http://svn.apache.org/viewvc?rev=1905486=rev
Log:
On the 'pristines-on-demand-on-mwf' branch:

* subversion/libsvn_wc/questions.c
  (compare_and_verify): Fix typo in a docstring. No functional change.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/questions.c

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/questions.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/questions.c?rev=1905486=1905485=1905486=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/questions.c 
(original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/questions.c 
Wed Nov 23 13:04:55 2022
@@ -84,7 +84,7 @@
  *
  * If EXACT_COMPARISON is FALSE, translate VERSIONED_FILE_ABSPATH's EOL
  * style and keywords to repository-normal form according to its properties,
- * calculate checksum and compare the result with PRISTINE_STREAM.
+ * calculate checksum and compare the result with PRISTINE_CHECKSUM.
  * If EXACT_COMPARISON is TRUE, also check that VERSIONED_FILE_ABSPATH
  * contents remains the same when retranslated according to its properties.
  *




svn commit: r1905483 - /subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/upgrade_tests.py

2022-11-23 Thread kotkov
Author: kotkov
Date: Wed Nov 23 12:42:06 2022
New Revision: 1905483

URL: http://svn.apache.org/viewvc?rev=1905483=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Remove the XFail() marker from
upgrade_tests.py#16.

The underlying problem has been fixed in r1905324, where we started to persist
the pristine mode in a working copy.  The upgrade now preserves the available
pristines in a working copy, so a revert completes without errors.

* subversion/tests/cmdline/upgrade_tests.py
  (replaced_files): Remove the XFail() marker.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/upgrade_tests.py

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/upgrade_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/upgrade_tests.py?rev=1905483=1905482=1905483=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/upgrade_tests.py
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/upgrade_tests.py
 Wed Nov 23 12:42:06 2022
@@ -861,10 +861,6 @@ def delete_in_copy_upgrade(sbox):
'b347d1da69df9a6a70433ceeaa0d46c8483e8c03']])
 
 
-# XFAIL when pristines-on-demand enabled: at the revert step the pristines
-# are missing and it can't fetch them as repo no longer exists. See #4891.
-@Issue(4891)
-@XFail(lambda: svntest.main.options.wc_format_version=='1.15')
 def replaced_files(sbox):
   "upgrade with base and working replaced files"
 




svn commit: r1905482 - in /subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline: authz_tests.py move_tests.py svntest/actions.py svntest/sandbox.py trans_tests.py update_tests.py up

2022-11-23 Thread kotkov
Author: kotkov
Date: Wed Nov 23 12:30:51 2022
New Revision: 1905482

URL: http://svn.apache.org/viewvc?rev=1905482=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Rework the conditional checks
in the Python test suite.

Now the pristine mode is a property of the working copy [settings], rather
than format.  So let's use `svn info --show-item=store-pristine` to access
that state where it is necessary.

* subversion/tests/cmdline/svntest/sandbox.py
  (Sandbox.pristines_on_demand_enabled): Remove.

* subversion/tests/cmdline/svntest/actions.py
  (get_wc_store_pristine): New helper.  Use it …

* subversion/tests/cmdline/authz_tests.py
  (cat_base_after_repo_access_removed): …here, …

* subversion/tests/cmdline/move_tests.py
  (move_conflict_details): …here, …

* subversion/tests/cmdline/trans_tests.py
  (keywords_from_birth, eol_change_is_text_mod): …here, …

* subversion/tests/cmdline/update_tests.py
  (another_hudson_problem): …and here.

* subversion/tests/cmdline/upgrade_tests.py
  (check_pristine): Use the new helper to skip white-box check of the
   file contents at wc.text_base_path().

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/authz_tests.py

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/move_tests.py

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/svntest/actions.py

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/svntest/sandbox.py

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/trans_tests.py

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/update_tests.py

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/upgrade_tests.py

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/authz_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/authz_tests.py?rev=1905482=1905481=1905482=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/authz_tests.py
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/authz_tests.py
 Wed Nov 23 12:30:51 2022
@@ -1835,11 +1835,11 @@ def cat_base_after_repo_access_removed(s
 
   # With repository read access denied, expect we can still access the
   # text base locally, if and only if text bases are present.
-  if sbox.pristines_on_demand_enabled():
-svntest.actions.run_and_verify_svn(None, '.*E170001: Authorization failed',
+  if svntest.actions.get_wc_store_pristine(wc_dir):
+svntest.actions.run_and_verify_svn("This is the file 'pi'.\n", [],
'cat', sbox.ospath('A/D/G/pi') + 
'@BASE')
   else:
-svntest.actions.run_and_verify_svn("This is the file 'pi'.\n", [],
+svntest.actions.run_and_verify_svn(None, '.*E170001: Authorization failed',
'cat', sbox.ospath('A/D/G/pi') + 
'@BASE')
 
 

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/move_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/move_tests.py?rev=1905482=1905481=1905482=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/move_tests.py
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/move_tests.py
 Wed Nov 23 12:30:51 2022
@@ -1599,10 +1599,10 @@ def move_conflict_details(sbox):
   sbox.simple_append('B/E/new-dir3', 'something')
   sbox.simple_add('B/E/new-dir3')
 
+  store_pristine = svntest.actions.get_wc_store_pristine(sbox.wc_dir)
 
   expected_output = svntest.verify.RegexListOutput(
-(["Fetching text bases [.]+done"]
-  if sbox.pristines_on_demand_enabled() else [])
+([] if store_pristine else ["Fetching text bases [.]+done"])
 +
 [re.escape(x) for x in [
   " C   %s\n" % sbox.ospath('B'), # Property conflicted

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/svntest/actions.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/svntest/actions.py?rev=1905482=1905481=1905482=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/svntest/actions.py
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/svntest/actions.py
 Wed Nov 23 12:30:51 2022
@@ -2089,6 +2089,20 @@ def get_wc_base_rev(wc_dir):
   "Return the BASE revision of the working copy at WC_DIR."
   return run_and_parse_info(wc_dir)[0]['Revisio

svn commit: r1905480 - in /subversion/branches/pristines-on-demand-on-mwf: ./ subversion/libsvn_wc/wc_db.h subversion/tests/cmdline/depth_tests.py subversion/tests/cmdline/patch_tests.py subversion/te

2022-11-23 Thread kotkov
Author: kotkov
Date: Wed Nov 23 11:17:42 2022
New Revision: 1905480

URL: http://svn.apache.org/viewvc?rev=1905480=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Sync with trunk@1905479,
resolving conflicts in depth_tests.py and patch_tests.py.

Modified:
subversion/branches/pristines-on-demand-on-mwf/   (props changed)
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db.h

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/depth_tests.py

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/patch_tests.py

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/svn_test_main.c

Propchange: subversion/branches/pristines-on-demand-on-mwf/
--
  Merged /subversion/trunk:r1905437-1905479

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db.h?rev=1905480=1905479=1905480=diff
==
--- subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db.h 
(original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc_db.h 
Wed Nov 23 11:17:42 2022
@@ -2274,25 +2274,6 @@ svn_wc__db_read_inherited_props(apr_arra
 apr_pool_t *result_pool,
 apr_pool_t *scratch_pool);
 
-/* Read a BASE node's inherited property information.
-
-   Set *IPROPS to to a depth-first ordered array of
-   svn_prop_inherited_item_t * structures representing the cached
-   inherited properties for the BASE node at LOCAL_ABSPATH.
-
-   If no cached properties are found, then set *IPROPS to NULL.
-   If LOCAL_ABSPATH represents the root of the repository, then set
-   *IPROPS to an empty array.
-
-   Allocate *IPROPS in RESULT_POOL, use SCRATCH_POOL for temporary
-   allocations. */
-svn_error_t *
-svn_wc__db_read_cached_iprops(apr_array_header_t **iprops,
-  svn_wc__db_t *db,
-  const char *local_abspath,
-  apr_pool_t *result_pool,
-  apr_pool_t *scratch_pool);
-
 /* Find BASE nodes with cached inherited properties.
 
Set *IPROPS_PATHS to a hash mapping const char * absolute working copy

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/depth_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/depth_tests.py?rev=1905480=1905479=1905480=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/depth_tests.py
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/depth_tests.py
 Wed Nov 23 11:17:42 2022
@@ -2781,14 +2781,12 @@ def revert_depth_files(sbox):
 
   sbox.build(read_only = True)
 
-  expected_paths = [sbox.ospath('A/mu')]
-
   # Apply an unrelated delete one level to deep
   sbox.simple_rm('A/D/gamma')
 
   sbox.simple_rm('A/mu')
   # Expect reversion of just 'mu'
-  svntest.actions.run_and_verify_revert(expected_paths,
+  svntest.actions.run_and_verify_revert([sbox.ospath('A/mu')],
 '--depth=immediates', sbox.ospath('A'))
 
   # Apply an unrelated directory delete
@@ -2796,7 +2794,7 @@ def revert_depth_files(sbox):
 
   sbox.simple_rm('A/mu')
   # Expect reversion of just 'mu'
-  svntest.actions.run_and_verify_revert(expected_paths,
+  svntest.actions.run_and_verify_revert([sbox.ospath('A/mu')],
 '--depth=files', sbox.ospath('A'))
 
 @Issue(4257)

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/patch_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/patch_tests.py?rev=1905480=1905479=1905480=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/patch_tests.py
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/cmdline/patch_tests.py
 Wed Nov 23 11:17:42 2022
@@ -1662,8 +1662,7 @@ def patch_no_svn_eol_style(sbox):
 [], True, True,
 keep_eol_style=True)
 
-  expected_paths = [mu_path]
-  svntest.actions.run_and_verify_revert(expected_paths,
+  svntest.actions.run_and_verify_revert([mu_path],
 '-R', wc_dir)
 
 def patch_with_svn_eol_style(sbox):
@@ -1779,8 +1778,7 @@ def patch_with_svn_eol_style(sbox):
 1, # dry-run

svn commit: r1905479 - /subversion/branches/pristines-on-demand-on-mwf/tools/client-side/bash_completion

2022-11-23 Thread kotkov
Author: kotkov
Date: Wed Nov 23 11:14:15 2022
New Revision: 1905479

URL: http://svn.apache.org/viewvc?rev=1905479=rev
Log:
On the 'pristines-on-demand-on-mwf' branch:

* tools/client-side/bash_completion: Following up on r1905439, update the
  option name here as well.

Modified:

subversion/branches/pristines-on-demand-on-mwf/tools/client-side/bash_completion

Modified: 
subversion/branches/pristines-on-demand-on-mwf/tools/client-side/bash_completion
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/tools/client-side/bash_completion?rev=1905479=1905478=1905479=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/tools/client-side/bash_completion
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/tools/client-side/bash_completion
 Wed Nov 23 11:14:15 2022
@@ -882,7 +882,7 @@ _svn()
;;
checkout|co)
cmdOpts="$rOpts $qOpts $nOpts $pOpts --ignore-externals \
- --force --store-pristines"
+ --force --store-pristine"
;;
cleanup)
cmdOpts="$pOpts --include-externals -q --quiet\




svn commit: r1905478 - /subversion/branches/pristines-on-demand-on-mwf/BRANCH-README

2022-11-23 Thread kotkov
Author: kotkov
Date: Wed Nov 23 11:11:55 2022
New Revision: 1905478

URL: http://svn.apache.org/viewvc?rev=1905478=rev
Log:
On the 'pristines-on-demand-on-mwf' branch:

* BRANCH-README: Remove the part related to the 'multi-wc-format' branch that
  has been merged to trunk in r1897946.  Update the high-level task list to
  reflect this merge.

Modified:
subversion/branches/pristines-on-demand-on-mwf/BRANCH-README

Modified: subversion/branches/pristines-on-demand-on-mwf/BRANCH-README
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/BRANCH-README?rev=1905478=1905477=1905478=diff
==
--- subversion/branches/pristines-on-demand-on-mwf/BRANCH-README (original)
+++ subversion/branches/pristines-on-demand-on-mwf/BRANCH-README Wed Nov 23 
11:11:55 2022
@@ -1,72 +1,3 @@
-This branch is the rebase of the 'pristines-on-demand' branch on top
-of the 'multi-format-wc' branch, as part of resolving issue #525.
-
-Each of the two original branches had its own 'BRANCH-README' file;
-what follows is just those two files concatenated one after the other.
-(If this combined branch turns out to be long-lived, then we may do a
-more thoughtful merge of the two files at some point, but for now we
-expect this branch to be merged to trunk pretty soon anyway.)
-
-
-BRANCH-README from 'multi-format-wc':
-
-
-Client support for multiple working copy versions
--
-
-Currently the working copy code can use exactly one WC version at a
-time. This limitation is a problem for users who, for one reason or
-another, have to use multiple client versions at the same time. The
-fact that 1.8.x and 1.9.x use the same WC version was a boon to such
-users, and there's no good reason that the WC implementation couldn't
-have some leeway.
-
-To this end, we'll introduce the concept of "supported version" to the
-working copy. This is the minimum WC format supported by a particular
-client. By default, the client will create new working copies with the
-latest format[*], but will support a small range of older versions as
-well.
-
-The client should be able to not only use but also create working
-copies in an older, non-current format. To this end, certain client
-commands will get a new option, "--compatible-version", which behaves
-analogously to the option in "svnadmin create".
-
-For example:
-
-svn checkout --compatible-version=1.8
-
-will create a new working copy with format 31. However,
-
-svn checkout --compatible-version=1.7
-
-will fail, because we (currently) do not support 1.7 working copies in
-newer clients.
-
-Analogously,
-
-svn upgrade --compatible-version=1.9
-
-will upgrade an older working copy to format 31.
-
-The "svn --version" command will display a list of compatible working
-copy versions.
-
-OPTIONAL: The "svn upgrade" command may grow an option to only show
-  the current and target working copy versions.
-
-
-[*] New externals working copies must inherit the format from their
-   parent working copy, because mixed-format working copies are a) a
-   Bad Thing, and b) defeat the purpose of this feature, which is
-   support for multiple versions of the client in the same working
-   copy.
-
-   
-
-BRANCH-README from 'pristines-on-demand':
-
-
 Pristines-on-Demand
 ---
 
@@ -105,6 +36,8 @@ For the production-ready state, it would
 client would work with both the new and old working copy formats, for
 a seamless user experience and better compatibility.
 
+(Done in r1897946)
+
  2. For the new working copy format, incorporate a switch to a different
 checksum type without known collisions instead of SHA-1.
 




svn commit: r1905477 - /subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/db-test.c

2022-11-23 Thread kotkov
Author: kotkov
Date: Wed Nov 23 11:03:02 2022
New Revision: 1905477

URL: http://svn.apache.org/viewvc?rev=1905477=rev
Log:
On the 'pristines-on-demand-on-mwf' branch:

* subversion/tests/libsvn_wc/db-test.c
  (TESTING_DATA): Clean up an unrelated formatting change.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/db-test.c

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/db-test.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/db-test.c?rev=1905477=1905476=1905477=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/db-test.c
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/db-test.c
 Wed Nov 23 11:03:02 2022
@@ -88,7 +88,7 @@ static const char * const TESTING_DATA =
"insert into wcroot values (1, null); "
 
"insert into pristine values ('$sha1$" SHA1_1 "', NULL, 15, 1, '$md5 $" 
MD5_1 "'); "
-   );
+);
 
 #define NOT_MOVED FALSE, NULL
 #define NO_COPY_FROM 0, NULL, SVN_INVALID_REVNUM




svn commit: r1905476 - /subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc-metadata.sql

2022-11-23 Thread kotkov
Author: kotkov
Date: Wed Nov 23 11:02:39 2022
New Revision: 1905476

URL: http://svn.apache.org/viewvc?rev=1905476=rev
Log:
On the 'pristines-on-demand-on-mwf' branch:

* subversion/libsvn_wc/wc-metadata.sql
  (): Clean up an unrelated formatting change.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc-metadata.sql

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc-metadata.sql
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc-metadata.sql?rev=1905476=1905475=1905476=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc-metadata.sql
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/libsvn_wc/wc-metadata.sql
 Wed Nov 23 11:02:39 2022
@@ -570,8 +570,6 @@ CREATE UNIQUE INDEX I_EXTERNALS_DEFINED
   def_local_relpath,
   local_relpath);
 
-/* - */
-
 /* Identify the WC format corresponding to the schema we have created. */
 PRAGMA user_version =
 -- define: SVN_WC__SUPPORTED_VERSION
@@ -708,7 +706,6 @@ WHERE l.op_depth = 0
OR (l.repos_path IS NOT RELPATH_SKIP_JOIN(r.local_relpath, 
r.repos_path, l.local_relpath)))
 
 /* - */
-
 /* Format 32 adds support for optional text-base contents with the
following schema changes:
- Add the 'hydrated' column to the PRISTINE table.




svn commit: r1905475 - in /subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc: db-test.c entries-compat.c pristine-store-test.c wc-queries-test.c

2022-11-23 Thread kotkov
Author: kotkov
Date: Wed Nov 23 10:56:27 2022
New Revision: 1905475

URL: http://svn.apache.org/viewvc?rev=1905475=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: Clean up some unrelated changes.

* subversion/tests/libsvn_wc/db-test.c,
  subversion/tests/libsvn_wc/entries-compat.c,
  subversion/tests/libsvn_wc/pristine-store-test.c,
  subversion/tests/libsvn_wc/wc-queries-test.c:
  (): Do not include svn_version.h.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/db-test.c

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/entries-compat.c

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/pristine-store-test.c

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/wc-queries-test.c

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/db-test.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/db-test.c?rev=1905475=1905474=1905475=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/db-test.c
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/db-test.c
 Wed Nov 23 10:56:27 2022
@@ -36,7 +36,6 @@
 
 #include "svn_dirent_uri.h"
 #include "svn_pools.h"
-#include "svn_version.h"
 
 #include "private/svn_sqlite.h"
 

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/entries-compat.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/entries-compat.c?rev=1905475=1905474=1905475=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/entries-compat.c
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/entries-compat.c
 Wed Nov 23 10:56:27 2022
@@ -37,7 +37,6 @@
 #include "svn_dirent_uri.h"
 #include "svn_pools.h"
 #include "svn_wc.h"
-#include "svn_version.h"
 
 #include "../../libsvn_wc/wc.h"
 #include "../../libsvn_wc/wc_db.h"

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/pristine-store-test.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/pristine-store-test.c?rev=1905475=1905474=1905475=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/pristine-store-test.c
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/pristine-store-test.c
 Wed Nov 23 10:56:27 2022
@@ -39,7 +39,6 @@
 #include "svn_repos.h"
 #include "svn_wc.h"
 #include "svn_client.h"
-#include "svn_version.h"
 
 #include "utils.h"
 

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/wc-queries-test.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/wc-queries-test.c?rev=1905475=1905474=1905475=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/wc-queries-test.c
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/wc-queries-test.c
 Wed Nov 23 10:56:27 2022
@@ -24,7 +24,6 @@
 #include "svn_pools.h"
 #include "svn_hash.h"
 #include "svn_ctype.h"
-#include "svn_version.h"
 #include "private/svn_dep_compat.h"
 #include "private/svn_wc_private.h"
 #include "../../libsvn_wc/wc.h"




svn commit: r1905474 - in /subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc: db-test.c entries-compat.c pristine-store-test.c utils.c

2022-11-23 Thread kotkov
Author: kotkov
Date: Wed Nov 23 10:49:17 2022
New Revision: 1905474

URL: http://svn.apache.org/viewvc?rev=1905474=rev
Log:
On the 'pristines-on-demand-on-mwf' branch: In the C test suite, make a step
towards less parametrized tests for two supported working copy formats.

I'll try to avoid having format-specific sets of initial data, helpers and
intertwined expectations that have different outcomes depending on the format.

* subversion/tests/libsvn_wc/db-test.c
  (testing_wc_format_32): Remove.
  (TESTING_DATA_F31, TESTING_DATA_F32): Convert to…
  (TESTING_DATA): …this.
  (create_open): Use `TESTING_DATA`.

* subversion/tests/libsvn_wc/entries-compat.c
  (testing_wc_format_32): Remove.
  (TESTING_DATA_F31, TESTING_DATA_F32): Convert to…
  (TESTING_DATA): …this.
  (create_fake_wc): Use `TESTING_DATA`.

* subversion/tests/libsvn_wc/pristine-store-test.c
  (testing_wc_format_32): Remove.
  (pristine_install_dehydrated, pristine_dehydrate): Skip these tests
   with a capability check.  Remove all conditional test expectations.

* subversion/tests/libsvn_wc/utils.c
  (svn_test__create_fake_wc): Upgrade the working copy after running the extra
   statements, to allow using the same initial data set.

Modified:

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/db-test.c

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/entries-compat.c

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/pristine-store-test.c

subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/utils.c

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/db-test.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/db-test.c?rev=1905474=1905473=1905474=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/db-test.c
 (original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/db-test.c
 Wed Nov 23 10:49:17 2022
@@ -78,7 +78,7 @@
 #define F_TC_DATA "(conflict F file update edited deleted (version 22 " 
ROOT_ONE " 1 2 branch1/ft/F none) (version 22 " ROOT_ONE " 1 3 branch1/ft/F 
file))"
 #define G_TC_DATA "(conflict G file update edited deleted (version 22 " 
ROOT_ONE " 1 2 branch1/ft/F none) (version 22 " ROOT_ONE " 1 3 branch1/ft/F 
file))"
 
-static const char * const TESTING_DATA_F31 = (
+static const char * const TESTING_DATA = (
/* Load our test data.
 
   Note: do not use named-column insertions. This allows us to test
@@ -91,19 +91,6 @@ static const char * const TESTING_DATA_F
"insert into pristine values ('$sha1$" SHA1_1 "', NULL, 15, 1, '$md5 $" 
MD5_1 "'); "
);
 
-static const char * const TESTING_DATA_F32 = (
-   /* Load our test data.
-
-  Note: do not use named-column insertions. This allows us to test
-  the column count in the schema matches our expectation here. */
-
-   "insert into repository values (1, '" ROOT_ONE "', '" UUID_ONE "'); "
-   "insert into repository values (2, '" ROOT_TWO "', '" UUID_TWO "'); "
-   "insert into wcroot values (1, null); "
-
-   "insert into pristine values ('$sha1$" SHA1_1 "', NULL, 15, 1, '$md5 $" 
MD5_1 "', 1); "
-   );
-
 #define NOT_MOVED FALSE, NULL
 #define NO_COPY_FROM 0, NULL, SVN_INVALID_REVNUM
 
@@ -302,13 +289,6 @@ static const svn_test__actual_data_t act
   { 0 }
 };
 
-/* Are we testing WC format 32+? */
-static svn_boolean_t
-testing_wc_format_32(const svn_test_opts_t *opts)
-{
-  return opts->wc_format_version->minor >= 15;
-}
-
 static svn_error_t *
 create_open(svn_wc__db_t **db,
 const char **local_abspath,
@@ -325,9 +305,7 @@ create_open(svn_wc__db_t **db,
   SVN_ERR(svn_io_remove_dir2(*local_abspath, TRUE, NULL, NULL, pool));
 
   SVN_ERR(svn_wc__db_open(db, NULL, FALSE, TRUE, pool, pool));
-  SVN_ERR(svn_test__create_fake_wc(*local_abspath,
-   testing_wc_format_32(opts)
- ? TESTING_DATA_F32 : TESTING_DATA_F31,
+  SVN_ERR(svn_test__create_fake_wc(*local_abspath, TESTING_DATA,
nodes_init_data, actual_init_data,
opts->wc_format_version, pool));
 

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/entries-compat.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/entries-compat.c?rev=1905474=1905473=1905474=diff
==
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/tests/libsvn_wc/entries-co

svn commit: r1905472 - in /subversion/trunk/subversion/tests/cmdline: depth_tests.py merge_tests.py patch_tests.py schedule_tests.py

2022-11-23 Thread kotkov
Author: kotkov
Date: Wed Nov 23 09:56:17 2022
New Revision: 1905472

URL: http://svn.apache.org/viewvc?rev=1905472=rev
Log:
In the Python test suite, avoid having to hand-craft the expected output
of "svn revert" by using the run_and_verify_revert() test action.

* subversion/tests/cmdline/depth_tests.py
  (revert_depth_files): Use run_and_verify_revert().

* subversion/tests/cmdline/merge_tests.py
  (merge_to_switched_path,
   dont_add_mergeinfo_from_own_history): Use run_and_verify_revert().

* subversion/tests/cmdline/patch_tests.py
  (patch_no_svn_eol_style,
   patch_with_svn_eol_style,
   patch_with_svn_eol_style_uncommitted): Use run_and_verify_revert().

* subversion/tests/cmdline/schedule_tests.py
  (check_reversion): Remove.
  (revert_add_files,
   revert_add_directories,
   revert_nested_adds,
   revert_add_executable,
   revert_delete_files,
   revert_delete_dirs): Use run_and_verify_revert().

Modified:
subversion/trunk/subversion/tests/cmdline/depth_tests.py
subversion/trunk/subversion/tests/cmdline/merge_tests.py
subversion/trunk/subversion/tests/cmdline/patch_tests.py
subversion/trunk/subversion/tests/cmdline/schedule_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/depth_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/depth_tests.py?rev=1905472=1905471=1905472=diff
==
--- subversion/trunk/subversion/tests/cmdline/depth_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/depth_tests.py Wed Nov 23 
09:56:17 2022
@@ -2781,23 +2781,21 @@ def revert_depth_files(sbox):
 
   sbox.build(read_only = True)
 
-  expected_output = "Reverted '" + re.escape(sbox.ospath('A/mu')) + "'"
-
   # Apply an unrelated delete one level to deep
   sbox.simple_rm('A/D/gamma')
 
   sbox.simple_rm('A/mu')
   # Expect reversion of just 'mu'
-  svntest.actions.run_and_verify_svn(expected_output, [],
- 'revert', '--depth=immediates', 
sbox.ospath('A'))
+  svntest.actions.run_and_verify_revert([sbox.ospath('A/mu')],
+'--depth=immediates', sbox.ospath('A'))
 
   # Apply an unrelated directory delete
   sbox.simple_rm('A/D')
 
   sbox.simple_rm('A/mu')
   # Expect reversion of just 'mu'
-  svntest.actions.run_and_verify_svn(expected_output, [],
- 'revert', '--depth=files', 
sbox.ospath('A'))
+  svntest.actions.run_and_verify_revert([sbox.ospath('A/mu')],
+'--depth=files', sbox.ospath('A'))
 
 @Issue(4257)
 def spurious_nodes_row(sbox):

Modified: subversion/trunk/subversion/tests/cmdline/merge_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/merge_tests.py?rev=1905472=1905471=1905472=diff
==
--- subversion/trunk/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/merge_tests.py Wed Nov 23 
09:56:17 2022
@@ -5067,11 +5067,10 @@ def merge_to_switched_path(sbox):
   # but as it is switched this empty mergeinfo just elides to the
   # repository (empty mergeinfo on a path can elide if that path doesn't
   # inherit *any* mergeinfo).
-  svntest.actions.run_and_verify_svn(["Reverted '" + A_COPY_path+ "'\n",
-  "Reverted '" + A_COPY_D_G_path+ "'\n",
-  "Reverted '" + A_COPY_D_G_rho_path +
-  "'\n"],
- [], 'revert', '-R', wc_dir)
+  svntest.actions.run_and_verify_revert([A_COPY_path,
+ A_COPY_D_G_path,
+ A_COPY_D_G_rho_path],
+'-R', wc_dir)
   svntest.actions.run_and_verify_svn(["property '" + SVN_PROP_MERGEINFO +
   "' set on '" + A_COPY_D_path+ "'" +
   "\n"], [], 'ps', SVN_PROP_MERGEINFO,
@@ -9635,9 +9634,9 @@ def dont_add_mergeinfo_from_own_history(
'--allow-mixed-revisions', A_path)
 
   # Revert all local mods
-  svntest.actions.run_and_verify_svn(["Reverted '" + A_path + "'\n",
-  "Reverted '" + mu_path + "'\n"],
- [], 'revert', '-R', wc_dir)
+  svntest.actions.run_and_verify_revert([A_path,
+ mu_path],
+'-R', wc_dir)
 
   # Move 'A' to 'A_MOVED' and once again merge r7 from 'A_COPY', this time
   # to 'A_MOVED'.  This attempts to add the mergeinfo '/A:3' to
@@ -9772,9 +9771,

svn commit: r1905471 - /subversion/trunk/subversion/libsvn_wc/wc_db.h

2022-11-23 Thread kotkov
Author: kotkov
Date: Wed Nov 23 09:23:47 2022
New Revision: 1905471

URL: http://svn.apache.org/viewvc?rev=1905471=rev
Log:
A minor code cleanup in wc_db.h.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_read_cached_iprops): Remove this unused function declaration.

Modified:
subversion/trunk/subversion/libsvn_wc/wc_db.h

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=1905471=1905470=1905471=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Wed Nov 23 09:23:47 2022
@@ -2270,25 +2270,6 @@ svn_wc__db_read_inherited_props(apr_arra
 apr_pool_t *result_pool,
 apr_pool_t *scratch_pool);
 
-/* Read a BASE node's inherited property information.
-
-   Set *IPROPS to to a depth-first ordered array of
-   svn_prop_inherited_item_t * structures representing the cached
-   inherited properties for the BASE node at LOCAL_ABSPATH.
-
-   If no cached properties are found, then set *IPROPS to NULL.
-   If LOCAL_ABSPATH represents the root of the repository, then set
-   *IPROPS to an empty array.
-
-   Allocate *IPROPS in RESULT_POOL, use SCRATCH_POOL for temporary
-   allocations. */
-svn_error_t *
-svn_wc__db_read_cached_iprops(apr_array_header_t **iprops,
-  svn_wc__db_t *db,
-  const char *local_abspath,
-  apr_pool_t *result_pool,
-  apr_pool_t *scratch_pool);
-
 /* Find BASE nodes with cached inherited properties.
 
Set *IPROPS_PATHS to a hash mapping const char * absolute working copy




  1   2   3   4   5   6   7   8   >