subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1440220 - in /subversion/trunk/subversion: libsvn_client/resolved.c libsvn_wc/conflicts.c
Date Tue, 29 Jan 2013 23:43:53 GMT
Author: rhuijben
Date: Tue Jan 29 23:43:52 2013
New Revision: 1440220

URL: http://svn.apache.org/viewvc?rev=1440220&view=rev
Log:
Make libsvn_client obtain a write lock before calling the resolver code.
The working copy code shouldn't obtain write locks as that makes it impossible
for the client code to combine operations within a write lock.
(Obtaining a lock when a lock already exists raises an error)

* subversion/libsvn_client/resolved.c
  (svn_client_resolve): Use SVN_WC__CALL_WITH_WRITE_LOCK().

* subversion/libsvn_wc/conflicts.c
  (conflict_status_walker_baton): Remove wc_ctx from baton. Shouldn't be
     necessary.
  (conflict_status_walker): Don't obtain lock here.
  (svn_wc__resolve_conflicts): Update baton initialization.

Modified:
    subversion/trunk/subversion/libsvn_client/resolved.c
    subversion/trunk/subversion/libsvn_wc/conflicts.c

Modified: subversion/trunk/subversion/libsvn_client/resolved.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/resolved.c?rev=1440220&r1=1440219&r2=1440220&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/resolved.c (original)
+++ subversion/trunk/subversion/libsvn_client/resolved.c Tue Jan 29 23:43:52 2013
@@ -55,17 +55,19 @@ svn_client_resolve(const char *path,
 
   SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
 
-  SVN_ERR(svn_wc__resolve_conflicts(ctx->wc_ctx, local_abspath,
-                                    depth,
-                                    TRUE /* resolve_text */,
-                                    "" /* resolve_prop (ALL props) */,
-                                    TRUE /* resolve_tree */,
-                                    conflict_choice,
-                                    ctx->conflict_func2,
-                                    ctx->conflict_baton2,
-                                    ctx->cancel_func, ctx->cancel_baton,
-                                    ctx->notify_func2, ctx->notify_baton2,
-                                    pool));
+  SVN_WC__CALL_WITH_WRITE_LOCK(
+      svn_wc__resolve_conflicts(ctx->wc_ctx, local_abspath,
+                                depth,
+                                TRUE /* resolve_text */,
+                                "" /* resolve_prop (ALL props) */,
+                                TRUE /* resolve_tree */,
+                                conflict_choice,
+                                ctx->conflict_func2,
+                                ctx->conflict_baton2,
+                                ctx->cancel_func, ctx->cancel_baton,
+                                ctx->notify_func2, ctx->notify_baton2,
+                                pool),
+      ctx->wc_ctx, local_abspath, TRUE, pool);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/conflicts.c?rev=1440220&r1=1440219&r2=1440220&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_wc/conflicts.c Tue Jan 29 23:43:52 2013
@@ -2620,7 +2620,6 @@ svn_wc__mark_resolved_prop_conflicts(svn
 /* Baton for conflict_status_walker */
 struct conflict_status_walker_baton
 {
-  svn_wc_context_t *wc_ctx;
   svn_wc__db_t *db;
   svn_boolean_t resolve_text;
   const char *resolve_prop;
@@ -2716,18 +2715,14 @@ conflict_status_walker(void *baton,
                           /* Break the move by reverting the deleted half of
                            * the move, keeping the copied-half as a copy.
                            * Reverting a node requires write lock on parent. */
-                          SVN_WC__CALL_WITH_WRITE_LOCK(
-                            svn_wc__revert_internal(cswb->db, local_abspath,
-                                                    svn_depth_infinity,
-                                                    FALSE, 
-                                                    cswb->cancel_func,
-                                                    cswb->cancel_baton,
-                                                    cswb->notify_func,
-                                                    cswb->notify_baton,
-                                                    scratch_pool),
-                            cswb->wc_ctx,
-                            svn_dirent_dirname(local_abspath, scratch_pool),
-                            FALSE, scratch_pool);
+                          SVN_ERR(svn_wc__revert_internal(cswb->db, local_abspath,
+                                                          svn_depth_infinity,
+                                                          FALSE, 
+                                                          cswb->cancel_func,
+                                                          cswb->cancel_baton,
+                                                          cswb->notify_func,
+                                                          cswb->notify_baton,
+                                                          scratch_pool));
                           break;
                         default:
                           /* ### TODO other node_status cases */
@@ -2876,7 +2871,6 @@ svn_wc__resolve_conflicts(svn_wc_context
   else if (depth == svn_depth_unknown)
     depth = svn_depth_infinity;
 
-  cswb.wc_ctx = wc_ctx;
   cswb.db = wc_ctx->db;
   cswb.resolve_text = resolve_text;
   cswb.resolve_prop = resolve_prop;



Mime
View raw message