You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2011/08/30 17:02:13 UTC

svn commit: r1163249 - in /subversion/branches/fs-py/subversion/libsvn_fs_py: ./ fs_fs.c

Author: hwright
Date: Tue Aug 30 15:02:13 2011
New Revision: 1163249

URL: http://svn.apache.org/viewvc?rev=1163249&view=rev
Log:
On the fs-py branch:
Bring libsvn_fs_py up-to-date with libsvn_fs_fs.

Modified:
    subversion/branches/fs-py/subversion/libsvn_fs_py/   (props changed)
    subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c

Propchange: subversion/branches/fs-py/subversion/libsvn_fs_py/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 30 15:02:13 2011
@@ -8,7 +8,7 @@
 /subversion/branches/double-delete/subversion/libsvn_fs_py:870511-872970
 /subversion/branches/explore-wc/subversion/libsvn_fs_py: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/subversion/libsvn_fs_py:871779-873302
-/subversion/branches/fs-py/subversion/libsvn_fs_fs:1154225-1157814
+/subversion/branches/fs-py/subversion/libsvn_fs_fs:1154225-1163246
 /subversion/branches/fs-rep-sharing/subversion/libsvn_fs_py:869036-873803
 /subversion/branches/fsfs-pack/subversion/libsvn_fs_py:873717-874575
 /subversion/branches/gnome-keyring/subversion/libsvn_fs_py:870558-871410

Modified: subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c?rev=1163249&r1=1163248&r2=1163249&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_fs_py/fs_fs.c Tue Aug 30 15:02:13 2011
@@ -2347,33 +2347,40 @@ svn_fs_py__get_node_revision(node_revisi
    that represents the location of representation REP.  If
    MUTABLE_REP_TRUNCATED is given, the rep is for props or dir contents,
    and only a "-1" revision number will be given for a mutable rep.
+   If MAY_BE_CORRUPT is true, guard for NULL when constructing the string.
    Perform the allocation from POOL.  */
 static const char *
 representation_string(representation_t *rep,
                       int format,
                       svn_boolean_t mutable_rep_truncated,
+                      svn_boolean_t may_be_corrupt,
                       apr_pool_t *pool)
 {
   if (rep->txn_id && mutable_rep_truncated)
     return "-1";
 
+#define DISPLAY_MAYBE_NULL_CHECKSUM(checksum)          \
+  ((may_be_corrupt == FALSE || (checksum) != NULL)     \
+   ? svn_checksum_to_cstring_display((checksum), pool) \
+   : "(null)")
+
   if (format < SVN_FS_FS__MIN_REP_SHARING_FORMAT || rep->sha1_checksum == NULL)
     return apr_psprintf(pool, "%ld %" APR_OFF_T_FMT " %" SVN_FILESIZE_T_FMT
                         " %" SVN_FILESIZE_T_FMT " %s",
                         rep->revision, rep->offset, rep->size,
                         rep->expanded_size,
-                        svn_checksum_to_cstring_display(rep->md5_checksum,
-                                                        pool));
+                        DISPLAY_MAYBE_NULL_CHECKSUM(rep->md5_checksum));
 
   return apr_psprintf(pool, "%ld %" APR_OFF_T_FMT " %" SVN_FILESIZE_T_FMT
                       " %" SVN_FILESIZE_T_FMT " %s %s %s",
                       rep->revision, rep->offset, rep->size,
                       rep->expanded_size,
-                      svn_checksum_to_cstring_display(rep->md5_checksum,
-                                                      pool),
-                      svn_checksum_to_cstring_display(rep->sha1_checksum,
-                                                      pool),
+                      DISPLAY_MAYBE_NULL_CHECKSUM(rep->md5_checksum),
+                      DISPLAY_MAYBE_NULL_CHECKSUM(rep->sha1_checksum),
                       rep->uniquifier);
+
+#undef DISPLAY_MAYBE_NULL_CHECKSUM
+
 }
 
 
@@ -2406,12 +2413,13 @@ svn_fs_py__write_noderev(svn_stream_t *o
                                                     format,
                                                     (noderev->kind
                                                      == svn_node_dir),
+                                                    FALSE,
                                                     pool)));
 
   if (noderev->prop_rep)
     SVN_ERR(svn_stream_printf(outfile, pool, HEADER_PROPS ": %s\n",
                               representation_string(noderev->prop_rep, format,
-                                                    TRUE, pool)));
+                                                    TRUE, FALSE, pool)));
 
   SVN_ERR(svn_stream_printf(outfile, pool, HEADER_CPATH ": %s\n",
                             noderev->created_path));
@@ -3023,7 +3031,8 @@ create_rep_state(struct rep_state **rep_
       return svn_error_createf(SVN_ERR_FS_CORRUPT, err,
                                "Corrupt representation '%s'",
                                rep 
-                               ? representation_string(rep, format, TRUE, pool)
+                               ? representation_string(rep, format, TRUE,
+                                                       TRUE, pool)
                                : "(null)");
     }
   /* ### Call representation_string() ? */
@@ -6189,10 +6198,11 @@ svn_fs_py__commit(svn_revnum_t *new_rev_
 
   SVN_ERR(svn_fs_py__with_write_lock(fs, commit_body, &cb, pool));
 
+  /* At this point, *NEW_REV_P has been set, so errors below won't affect
+     the success of the commit.  (See svn_fs_commit_txn().)  */
+
   if (ffd->rep_sharing_allowed)
     {
-      /* At this point, *NEW_REV_P has been set, so errors here won't affect
-         the success of the commit.  (See svn_fs_commit_txn().)  */
       SVN_ERR(svn_fs_py__open_rep_cache(fs, pool));
       SVN_ERR(svn_sqlite__with_transaction(ffd->rep_cache_db,
                                            commit_sqlite_txn_callback,