subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmpil...@apache.org
Subject svn commit: r1148426 - in /subversion/trunk/subversion/libsvn_client: client.h merge.c
Date Tue, 19 Jul 2011 16:16:05 GMT
Author: cmpilato
Date: Tue Jul 19 16:16:04 2011
New Revision: 1148426

URL: http://svn.apache.org/viewvc?rev=1148426&view=rev
Log:
Avoid some unnecessary comparisons and such by undoing an
ensure-ra-session-url using svn_ra_reparent() directly.

CONFESSION: This commit has only been sanity-tested.  It should "just
work", right?

* subversion/libsvn_client/client.h
  (svn_client__ensure_ra_session_url): Note the typical (and correct)
    usage pattern of this function.

* subversion/libsvn_client/merge.c
  (get_full_mergeinfo, get_invalid_inherited_mergeinfo): Use
    svn_ra_reparent() instead of svn_client__ensure_ra_session_url()
    where we know the reparent wouldn't be a no-op.

Modified:
    subversion/trunk/subversion/libsvn_client/client.h
    subversion/trunk/subversion/libsvn_client/merge.c

Modified: subversion/trunk/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/client.h?rev=1148426&r1=1148425&r2=1148426&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/client.h (original)
+++ subversion/trunk/subversion/libsvn_client/client.h Tue Jul 19 16:16:04 2011
@@ -223,7 +223,21 @@ svn_client__ra_session_from_path(svn_ra_
    NULL.
 
    If SESSION_URL is NULL, treat this as a magic value meaning "point
-   the RA session to the root of the repository".  */
+   the RA session to the root of the repository".
+
+   NOTE: The typical usage pattern for this functions is:
+
+       const char *old_session_url;
+       SVN_ERR(svn_client__ensure_ra_session_url(&old_session_url,
+                                                 ra_session,
+                                                 new_session_url,
+                                                 pool);
+
+       [...]
+
+       if (old_session_url)
+         SVN_ERR(svn_ra_reparent(ra_session, old_session_url, pool));
+*/
 svn_error_t *
 svn_client__ensure_ra_session_url(const char **old_session_url,
                                   svn_ra_session_t *ra_session,

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1148426&r1=1148425&r2=1148426&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Tue Jul 19 16:16:04 2011
@@ -3263,8 +3263,7 @@ get_invalid_inherited_mergeinfo(svn_merg
       /* If we needed to temporarily reparent RA_SESSION, then point it
          back to its original URL. */
       if (session_url)
-        SVN_ERR(svn_client__ensure_ra_session_url(&session_url, ra_session,
-                                                  session_url, scratch_pool));
+        SVN_ERR(svn_ra_reparent(ra_session, session_url, scratch_pool));
     }
   return SVN_NO_ERROR;
 }
@@ -3434,9 +3433,7 @@ get_full_mergeinfo(svn_mergeinfo_t *reco
                                                        result_pool));
 
           /* Return RA_SESSION back to where it was when we were called. */
-         SVN_ERR(svn_client__ensure_ra_session_url(&session_url,
-                                                   ra_session, session_url,
-                                                   scratch_pool));
+          SVN_ERR(svn_ra_reparent(ra_session, session_url, scratch_pool));
         }
     } /*if (implicit_mergeinfo) */
 



Mime
View raw message