You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2012/05/08 10:23:39 UTC

svn commit: r1335377 - /subversion/trunk/subversion/libsvn_client/locking_commands.c

Author: rhuijben
Date: Tue May  8 08:23:39 2012
New Revision: 1335377

URL: http://svn.apache.org/viewvc?rev=1335377&view=rev
Log:
Simplify some path processing in libsvn_client's lock processing by just
storing the absolute path in the baton.

* subversion/libsvn_client/locking_commands.c
  (lock_baton): Rename field.
  (store_locks_callback): Use a simple join. Update user.
  (svn_client_lock, svn_client_unlock): Store abspath in baton.

Modified:
    subversion/trunk/subversion/libsvn_client/locking_commands.c

Modified: subversion/trunk/subversion/libsvn_client/locking_commands.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/locking_commands.c?rev=1335377&r1=1335376&r2=1335377&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/locking_commands.c (original)
+++ subversion/trunk/subversion/libsvn_client/locking_commands.c Tue May  8 08:23:39 2012
@@ -44,7 +44,7 @@
 /* For use with store_locks_callback, below. */
 struct lock_baton
 {
-  const char *base_path;
+  const char *base_dir_abspath;
   apr_hash_t *urls_to_paths;
   svn_client_ctx_t *ctx;
   apr_pool_t *pool;
@@ -55,8 +55,8 @@ struct lock_baton
  * BATON is a 'struct lock_baton *', PATH is the path being locked,
  * and LOCK is the lock itself.
  *
- * If BATON->base_path is not null, then this function either stores
- * the LOCK on REL_URL or removes any lock tokens from REL_URL
+ * If BATON->base_dir_abspath is not null, then this function either
+ * stores the LOCK on REL_URL or removes any lock tokens from REL_URL
  * (depending on whether DO_LOCK is true or false respectively), but
  * only if RA_ERR is null, or (in the unlock case) is something other
  * than SVN_ERR_FS_LOCK_OWNER_MISMATCH.
@@ -86,20 +86,17 @@ store_locks_callback(void *baton,
   notify->lock = lock;
   notify->err = ra_err;
 
-  if (lb->base_path)
+  if (lb->base_dir_abspath)
     {
       char *path = apr_hash_get(lb->urls_to_paths, rel_url,
                                 APR_HASH_KEY_STRING);
       const char *local_abspath;
 
-      SVN_ERR(svn_dirent_get_absolute(&local_abspath,
-                                      svn_dirent_join(lb->base_path,
-                                                      path, pool),
-                                      pool));
+      local_abspath = svn_dirent_join(lb->base_dir_abspath, path, pool);
 
       /* Notify a valid working copy path */
       notify->path = local_abspath;
-      notify->path_prefix = lb->base_path;
+      notify->path_prefix = lb->base_dir_abspath;
 
       if (do_lock)
         {
@@ -457,7 +454,7 @@ svn_client_lock(const apr_array_header_t
                                                NULL, FALSE, FALSE,
                                                ctx, pool));
 
-  cb.base_path = base_dir;
+  cb.base_dir_abspath = base_dir_abspath;
   cb.urls_to_paths = urls_to_paths;
   cb.ctx = ctx;
   cb.pool = pool;
@@ -504,7 +501,7 @@ svn_client_unlock(const apr_array_header
   if (! base_dir && !break_lock)
     SVN_ERR(fetch_tokens(ra_session, path_tokens, pool));
 
-  cb.base_path = base_dir;
+  cb.base_dir_abspath = base_dir_abspath;
   cb.urls_to_paths = urls_to_paths;
   cb.ctx = ctx;
   cb.pool = pool;