Author: kotkov
Date: Sat Nov 25 20:23:26 2017
New Revision: 1816348
URL: http://svn.apache.org/viewvc?rev=1816348&view=rev
Log:
fsfs: Don't store SHA1 for property representations in format 8.
This is an extended fix for issues #4623 and #4700 using the format
groundwork (ability to have optional "-" values in the representation
strings) added in r1816347.
While we don't need to serialize SHA1 for props (it is not used), older
formats can only have representation strings that either have both the
SHA1 value *and* the uniquifier, or don't have them at all. For such
formats, both values get written to the disk only if the SHA1 is present.
We cannot omit the uniquifier, as doing so breaks svn_fs_props_changed()
for properties with shared representations, as described in the referenced
issues. Therefore, we skip writing SHA1, but only for the new format 8
where this dependency is untied and we can have the uniquifier written
to the disk without the SHA1.
* subversion/libsvn_fs_fs/transaction.c
(write_final_rev): Don't store SHA1 for property representations
in format 8.
Modified:
subversion/trunk/subversion/libsvn_fs_fs/transaction.c
Modified: subversion/trunk/subversion/libsvn_fs_fs/transaction.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/transaction.c?rev=1816348&r1=1816347&r2=1816348&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/transaction.c Sat Nov 25 20:23:26
2017
@@ -3336,6 +3336,24 @@ write_final_rev(const svn_fs_id_t **new_
if (noderev->data_rep && noderev->kind == svn_node_dir)
noderev->data_rep->has_sha1 = FALSE;
+ /* Compatibility: while we don't need to serialize SHA1 for props (it is
+ not used), older formats can only have representation strings that either
+ have both the SHA1 value *and* the uniquifier, or don't have them at all.
+ For such formats, both values get written to the disk only if the SHA1
+ is present.
+
+ We cannot omit the uniquifier, as doing so breaks svn_fs_props_changed()
+ for properties with shared representations, see issues #4623 and #4700.
+ Therefore, we skip writing SHA1, but only for the newer formats where
+ this dependency is untied and we can write the uniquifier to the disk
+ without the SHA1.
+ */
+ if (ffd->format >= SVN_FS_FS__MIN_REP_STRING_OPTIONAL_VALUES_FORMAT &&
+ noderev->prop_rep)
+ {
+ noderev->prop_rep->has_sha1 = FALSE;
+ }
+
/* Workaround issue #4031: is-fresh-txn-root in revision files. */
noderev->is_fresh_txn_root = FALSE;