subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svn-r...@apache.org
Subject svn commit: r1499194 - in /subversion/branches/1.8.x: ./ STATUS subversion/libsvn_client/log.c
Date Wed, 03 Jul 2013 04:00:55 GMT
Author: svn-role
Date: Wed Jul  3 04:00:55 2013
New Revision: 1499194

URL: http://svn.apache.org/r1499194
Log:
Merge r1496957 from trunk:

 * r1496957
   Eliminate an extra RA layer roundtrip in 'svn log' on repository roots.
   Justification:
     Minor performance regression against 1.7.x plus requesting e.g. single
     revision logs on a repo root is not a fringe use-case.
   Votes:
     +1: stefan2, stsp, rhuijben

Modified:
    subversion/branches/1.8.x/   (props changed)
    subversion/branches/1.8.x/STATUS
    subversion/branches/1.8.x/subversion/libsvn_client/log.c

Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1496957

Modified: subversion/branches/1.8.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1499194&r1=1499193&r2=1499194&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Wed Jul  3 04:00:55 2013
@@ -208,14 +208,6 @@ Veto-blocked changes:
 Approved changes:
 =================
 
- * r1496957
-   Eliminate an extra RA layer roundtrip in 'svn log' on repository roots.
-   Justification:
-     Minor performance regression against 1.7.x plus requesting e.g. single
-     revision logs on a repo root is not a fringe use-case.
-   Votes:
-     +1: stefan2, stsp, rhuijben
-
  * r1497002
    Avoid temporary files when calling external diff. Fixes issue 4382.
    Justification:

Modified: subversion/branches/1.8.x/subversion/libsvn_client/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/libsvn_client/log.c?rev=1499194&r1=1499193&r2=1499194&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/libsvn_client/log.c (original)
+++ subversion/branches/1.8.x/subversion/libsvn_client/log.c Wed Jul  3 04:00:55 2013
@@ -860,13 +860,32 @@ svn_client_log5(const apr_array_header_t
   SVN_ERR(svn_client__ensure_ra_session_url(&old_session_url, ra_session,
                                             actual_loc->url, pool));
 
-  /* Get the svn_location_segment_t's representing the requested log ranges. */
-  SVN_ERR(svn_client__repos_location_segments(&log_segments, ra_session,
-                                              actual_loc->url,
-                                              actual_loc->rev, /* peg */
-                                              actual_loc->rev, /* start */
-                                              oldest_rev,      /* end */
-                                              ctx, pool));
+  /* Save us an RA layer round trip if we are on the repository root and
+     know the result in advance.  All the revision data has already been
+     validated.
+   */
+  if (strcmp(actual_loc->url, actual_loc->repos_root_url) == 0)
+    {
+      svn_location_segment_t *segment = apr_pcalloc(pool, sizeof(*segment));
+      log_segments = apr_array_make(pool, 1, sizeof(segment));
+
+      segment->range_start = oldest_rev;
+      segment->range_end = actual_loc->rev;
+      segment->path = "";
+      APR_ARRAY_PUSH(log_segments, svn_location_segment_t *) = segment;
+    }
+  else
+    {
+      /* Get the svn_location_segment_t's representing the requested log
+       * ranges. */
+      SVN_ERR(svn_client__repos_location_segments(&log_segments, ra_session,
+                                                  actual_loc->url,
+                                                  actual_loc->rev, /* peg */
+                                                  actual_loc->rev, /* start */
+                                                  oldest_rev,      /* end */
+                                                  ctx, pool));
+    }
+
 
   SVN_ERR(run_ra_get_log(revision_ranges, relative_targets, log_segments,
                          actual_loc, ra_session, targets, limit,



Mime
View raw message