subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1493703 - in /subversion/trunk/subversion/libsvn_wc: upgrade.c wc_db.c wc_db.h
Date Mon, 17 Jun 2013 10:04:38 GMT
Author: rhuijben
Date: Mon Jun 17 10:04:38 2013
New Revision: 1493703

URL: http://svn.apache.org/r1493703
Log:
Perform an upgrade notification on every successfull working copy upgrade,
instead of only from pre-1.7 working copies.

This helps GUI clients to determine if the format bump was successfull.

* subversion/libsvn_wc/upgrade.c
  (svn_wc_upgrade): Update caller. Notify on format bumps withing WC-NG range.

* subversion/libsvn_wc/wc_db.c
  (svn_wc__db_bump_format): Re-order arguments to match common form. Provide
    optional output argument to tell about an actual format bump.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_bump_format): Update prototype.

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

Modified: subversion/trunk/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/upgrade.c?rev=1493703&r1=1493702&r2=1493703&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/trunk/subversion/libsvn_wc/upgrade.c Mon Jun 17 10:04:38 2013
@@ -2196,13 +2196,15 @@ svn_wc_upgrade(svn_wc_context_t *wc_ctx,
   upgrade_working_copy_baton_t cb_baton;
   svn_error_t *err;
   int result_format;
+  svn_boolean_t bumped_format;
 
   /* Try upgrading a wc-ng-style working copy. */
   SVN_ERR(svn_wc__db_open(&db, NULL /* ### config */, TRUE, FALSE,
                           scratch_pool, scratch_pool));
 
 
-  err = svn_wc__db_bump_format(&result_format, local_abspath, db,
+  err = svn_wc__db_bump_format(&result_format, &bumped_format,
+                               db, local_abspath,
                                scratch_pool);
   if (err)
     {
@@ -2224,6 +2226,17 @@ svn_wc_upgrade(svn_wc_context_t *wc_ctx,
 
       SVN_ERR_ASSERT(result_format == SVN_WC__VERSION);
 
+      if (bumped_format && notify_func)
+        {
+          svn_wc_notify_t *notify;
+
+          notify = svn_wc_create_notify(local_abspath,
+                                        svn_wc_notify_upgraded_path,
+                                        scratch_pool);
+
+          notify_func(notify_baton, notify, scratch_pool);
+        }
+
       return SVN_NO_ERROR;
     }
 

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1493703&r1=1493702&r2=1493703&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Mon Jun 17 10:04:38 2013
@@ -14990,14 +14990,18 @@ svn_wc__db_verify(svn_wc__db_t *db,
 
 svn_error_t *
 svn_wc__db_bump_format(int *result_format,
-                       const char *wcroot_abspath,
+                       svn_boolean_t *bumped_format,
                        svn_wc__db_t *db,
+                       const char *wcroot_abspath,
                        apr_pool_t *scratch_pool)
 {
   svn_sqlite__db_t *sdb;
   svn_error_t *err;
   int format;
 
+  if (bumped_format)
+    *bumped_format = FALSE;
+
   /* Do not scan upwards for a working copy root here to prevent accidental
    * upgrades of any working copies the WCROOT might be nested in.
    * Just try to open a DB at the specified path instead. */
@@ -15032,7 +15036,10 @@ svn_wc__db_bump_format(int *result_forma
 
   SVN_ERR(svn_sqlite__read_schema_version(&format, sdb, scratch_pool));
   err = svn_wc__upgrade_sdb(result_format, wcroot_abspath,
-                                     sdb, format, scratch_pool);
+                            sdb, format, scratch_pool);
+
+  if (bumped_format)
+    *bumped_format = (*result_format > format);
 
   /* Make sure we return a different error than expected for upgrades from
      entries */

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=1493703&r1=1493702&r2=1493703&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Mon Jun 17 10:04:38 2013
@@ -2913,11 +2913,15 @@ svn_wc__db_upgrade_get_repos_id(apr_int6
  * Upgrading subdirectories of a working copy is not supported.
  * If WCROOT_ABSPATH is not a working copy root SVN_ERR_WC_INVALID_OP_ON_CWD
  * is returned.
+ *
+ * If BUMPED_FORMAT is not NULL, set *BUMPED_FORMAT to TRUE if the format
+ * was bumped or to FALSE if the wc was already at the resulting format.
  */
 svn_error_t *
 svn_wc__db_bump_format(int *result_format,
-                       const char *wcroot_abspath,
+                       svn_boolean_t *bumped_format,
                        svn_wc__db_t *db,
+                       const char *wcroot_abspath,
                        apr_pool_t *scratch_pool);
 
 /* @} */



Mime
View raw message