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 2013/07/09 18:09:33 UTC

svn commit: r1501360 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Author: rhuijben
Date: Tue Jul  9 16:09:32 2013
New Revision: 1501360

URL: http://svn.apache.org/r1501360
Log:
Following up on r1501338, avoid using a separate db query for the wq items
exists check.

* subversion/libsvn_wc/wc_db.c
  (wclock_obtain_cb): Enforce empty workqueue in the existing transaction for
    this operation, here.
  (svn_wc__db_wclock_obtain): Instead of here.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1501360&r1=1501359&r2=1501360&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Tue Jul  9 16:09:32 2013
@@ -13503,6 +13503,7 @@ wclock_obtain_cb(svn_wc__db_wcroot_t *wc
                  const char *local_relpath,
                  int levels_to_lock,
                  svn_boolean_t steal_lock,
+                 svn_boolean_t enforce_empty_wq,
                  apr_pool_t *scratch_pool)
 {
   svn_sqlite__stmt_t *stmt;
@@ -13532,6 +13533,9 @@ wclock_obtain_cb(svn_wc__db_wcroot_t *wc
                                                         scratch_pool));
     }
 
+  if (enforce_empty_wq)
+    svn_wc__db_verify_no_work(wcroot->sdb);
+
   /* Check if there are nodes locked below the new lock root */
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, STMT_FIND_WC_LOCK));
   SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
@@ -13679,9 +13683,6 @@ svn_wc__db_wclock_obtain(svn_wc__db_t *d
                                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
-  if (db->enforce_empty_wq)
-    SVN_ERR(svn_wc__db_verify_no_work(wcroot->sdb));
-
   if (!steal_lock)
     {
       int i;
@@ -13709,7 +13710,7 @@ svn_wc__db_wclock_obtain(svn_wc__db_t *d
 
   SVN_WC__DB_WITH_TXN(
     wclock_obtain_cb(wcroot, local_relpath, levels_to_lock, steal_lock,
-                     scratch_pool),
+                     db->enforce_empty_wq, scratch_pool),
     wcroot);
   return SVN_NO_ERROR;
 }



RE: svn commit: r1501360 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: Daniel Shahaf [mailto:d.s@daniel.shahaf.name]
> Sent: dinsdag 9 juli 2013 22:06
> To: dev@subversion.apache.org
> Cc: commits@subversion.apache.org
> Subject: Re: svn commit: r1501360 -
> /subversion/trunk/subversion/libsvn_wc/wc_db.c
> 
> rhuijben@apache.org wrote on Tue, Jul 09, 2013 at 16:09:33 -0000:
> > @@ -13532,6 +13533,9 @@ wclock_obtain_cb(svn_wc__db_wcroot_t *wc
> > +  if (enforce_empty_wq)
> > +    svn_wc__db_verify_no_work(wcroot->sdb);
> 
> Missing SVN_ERR wrapper.
> 
> > @@ -13679,9 +13683,6 @@ svn_wc__db_wclock_obtain(svn_wc__db_t *d
> > -  if (db->enforce_empty_wq)
> > -    SVN_ERR(svn_wc__db_verify_no_work(wcroot->sdb));

Good catch.
(writing patch now)

	Bert


Re: svn commit: r1501360 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
rhuijben@apache.org wrote on Tue, Jul 09, 2013 at 16:09:33 -0000:
> @@ -13532,6 +13533,9 @@ wclock_obtain_cb(svn_wc__db_wcroot_t *wc
> +  if (enforce_empty_wq)
> +    svn_wc__db_verify_no_work(wcroot->sdb);

Missing SVN_ERR wrapper.

> @@ -13679,9 +13683,6 @@ svn_wc__db_wclock_obtain(svn_wc__db_t *d
> -  if (db->enforce_empty_wq)
> -    SVN_ERR(svn_wc__db_verify_no_work(wcroot->sdb));

Re: svn commit: r1501360 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
rhuijben@apache.org wrote on Tue, Jul 09, 2013 at 16:09:33 -0000:
> @@ -13532,6 +13533,9 @@ wclock_obtain_cb(svn_wc__db_wcroot_t *wc
> +  if (enforce_empty_wq)
> +    svn_wc__db_verify_no_work(wcroot->sdb);

Missing SVN_ERR wrapper.

> @@ -13679,9 +13683,6 @@ svn_wc__db_wclock_obtain(svn_wc__db_t *d
> -  if (db->enforce_empty_wq)
> -    SVN_ERR(svn_wc__db_verify_no_work(wcroot->sdb));