subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1296627 - /subversion/trunk/subversion/libsvn_repos/rev_hunt.c
Date Sat, 03 Mar 2012 14:25:06 GMT
Author: stefan2
Date: Sat Mar  3 14:25:06 2012
New Revision: 1296627

URL: http://svn.apache.org/viewvc?rev=1296627&view=rev
Log:
Reduce the number of revprop lookups during e.g. svn ls.

* subversion/libsvn_repos/rev_hunt.c
  (svn_repos_get_committed_info): fetch the revprops only once

Modified:
    subversion/trunk/subversion/libsvn_repos/rev_hunt.c

Modified: subversion/trunk/subversion/libsvn_repos/rev_hunt.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/rev_hunt.c?rev=1296627&r1=1296626&r2=1296627&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/rev_hunt.c (original)
+++ subversion/trunk/subversion/libsvn_repos/rev_hunt.c Sat Mar  3 14:25:06 2012
@@ -154,6 +154,8 @@ svn_repos_get_committed_info(svn_revnum_
                              const char *path,
                              apr_pool_t *pool)
 {
+  apr_hash_t *revprops;
+  
   svn_fs_t *fs = svn_fs_root_fs(root);
 
   /* ### It might be simpler just to declare that revision
@@ -164,13 +166,16 @@ svn_repos_get_committed_info(svn_revnum_
   /* Get the CR field out of the node's skel. */
   SVN_ERR(svn_fs_node_created_rev(committed_rev, root, path, pool));
 
-  /* Get the date property of this revision. */
-  SVN_ERR(svn_fs_revision_prop(&committed_date_s, fs, *committed_rev,
-                               SVN_PROP_REVISION_DATE, pool));
-
-  /* Get the author property of this revision. */
-  SVN_ERR(svn_fs_revision_prop(&last_author_s, fs, *committed_rev,
-                               SVN_PROP_REVISION_AUTHOR, pool));
+  /* Get the revision properties of this revision. */
+  SVN_ERR(svn_fs_revision_proplist(&revprops, fs, *committed_rev, pool));
+
+  /* Extract date and author from these revprops. */
+  committed_date_s = apr_hash_get(revprops, 
+                                  SVN_PROP_REVISION_DATE, 
+                                  8);
+  last_author_s = apr_hash_get(revprops, 
+                               SVN_PROP_REVISION_AUTHOR, 
+                               10);
 
   *committed_date = committed_date_s ? committed_date_s->data : NULL;
   *last_author = last_author_s ? last_author_s->data : NULL;



Mime
View raw message