subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject svn commit: r1721746 - in /subversion/trunk/subversion: libsvn_repos/commit.c mod_dav_svn/merge.c
Date Sat, 26 Dec 2015 18:33:48 GMT
Author: ivan
Date: Sat Dec 26 18:33:48 2015
New Revision: 1721746

URL: http://svn.apache.org/viewvc?rev=1721746&view=rev
Log:
Obtain svn:author and svn:date using one FS call after commit.

* subversion/libsvn_repos/commit.c
* subversion/mod_dav_svn/merge.c
  (invoke_commit_cb, dav_svn__merge_response): Use svn_fs_revision_proplist2()
   to get svn:author and svn:date instead of two calls separate calls to
   svn_fs_revision_prop2().

Modified:
    subversion/trunk/subversion/libsvn_repos/commit.c
    subversion/trunk/subversion/mod_dav_svn/merge.c

Modified: subversion/trunk/subversion/libsvn_repos/commit.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/commit.c?rev=1721746&r1=1721745&r2=1721746&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/commit.c (original)
+++ subversion/trunk/subversion/libsvn_repos/commit.c Sat Dec 26 18:33:48 2015
@@ -210,15 +210,16 @@ invoke_commit_cb(svn_commit_callback2_t
   /* const */ svn_string_t *date;
   /* const */ svn_string_t *author;
   svn_commit_info_t *commit_info;
+  apr_hash_t *revprops;
 
   if (commit_cb == NULL)
     return SVN_NO_ERROR;
 
-  SVN_ERR(svn_fs_revision_prop2(&date, fs, revision, SVN_PROP_REVISION_DATE,
-                                TRUE, scratch_pool, scratch_pool));
-  SVN_ERR(svn_fs_revision_prop2(&author, fs, revision,
-                                SVN_PROP_REVISION_AUTHOR,
-                                TRUE, scratch_pool, scratch_pool));
+  SVN_ERR(svn_fs_revision_proplist2(&revprops, fs, revision,
+                                    TRUE, scratch_pool, scratch_pool));
+
+  date = svn_hash_gets(revprops, SVN_PROP_REVISION_DATE);
+  author = svn_hash_gets(revprops, SVN_PROP_REVISION_AUTHOR);
 
   commit_info = svn_create_commit_info(scratch_pool);
 

Modified: subversion/trunk/subversion/mod_dav_svn/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/merge.c?rev=1721746&r1=1721745&r2=1721746&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/merge.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/merge.c Sat Dec 26 18:33:48 2015
@@ -226,6 +226,7 @@ dav_svn__merge_response(ap_filter_t *out
   const char *post_commit_err_elem = NULL,
              *post_commit_header_info = NULL;
   apr_status_t status;
+  apr_hash_t *revprops;
 
   serr = svn_fs_revision_root(&root, repos->fs, new_rev, pool);
   if (serr != NULL)
@@ -268,23 +269,17 @@ dav_svn__merge_response(ap_filter_t *out
 
 
   /* get the creationdate and creator-displayname of the new revision, too. */
-  serr = svn_fs_revision_prop2(&creationdate, repos->fs, new_rev,
-                               SVN_PROP_REVISION_DATE, TRUE, pool, pool);
+  serr = svn_fs_revision_proplist2(&revprops, repos->fs, new_rev,
+                                   TRUE, pool, pool);
   if (serr != NULL)
     {
       return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
-                                  "Could not get date of newest revision",
-                                  repos->pool);
-    }
-  serr = svn_fs_revision_prop2(&creator_displayname, repos->fs, new_rev,
-                               SVN_PROP_REVISION_AUTHOR, TRUE, pool, pool);
-  if (serr != NULL)
-    {
-      return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
-                                  "Could not get author of newest revision",
-                                  repos->pool);
+                                  "Could not get date and author of newest "
+                                  "revision", repos->pool);
     }
 
+  creationdate = svn_hash_gets(revprops, SVN_PROP_REVISION_DATE);
+  creator_displayname = svn_hash_gets(revprops, SVN_PROP_REVISION_AUTHOR);
 
   status = ap_fputstrs(output, bb,
                      DAV_XML_HEADER DEBUG_CR



Mime
View raw message