You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/06/21 21:15:09 UTC

svn commit: r1495545 - in /subversion/trunk/subversion: include/ libsvn_fs/ libsvn_fs_base/ libsvn_fs_fs/ libsvn_repos/ svnadmin/

Author: stefan2
Date: Fri Jun 21 19:15:08 2013
New Revision: 1495545

URL: http://svn.apache.org/r1495545
Log:
Add progress and cancellation support to 'svnadmin verify' down the
whole chain of APIs.  Not very complicated - just a bit of code churn.

* subversion/include/svn_fs.h
  (svn_fs_upgrade_notify_action_t,
   svn_fs_upgrade_notify_t): new FS layer notification types
  (svn_fs_upgrade2): rev'ed API, now with notification & cancellation
  (svn_fs_upgrade): deprecate
  
* subversion/libsvn_fs_fs/fs_fs.h
  (svn_fs_fs__upgrade): add notification & cancellation parameters

* subversion/libsvn_fs_fs/fs_fs.c
  (upgrade_pack_revprops,
   upgrade_cleanup_pack_revprops): add notification & cancellation support
  (upgrade_baton_t): new aux. data structure
  (upgrade_body,
   svn_fs_fs__upgrade): pass notification & cancellation params through

* subversion/libsvn_fs/fs-loader.h
  (fs_library_vtable_t.upgrade_fs): add notification & cancellation parameters

* subversion/libsvn_fs_fs/fs.c
  (fs_upgrade): update; pass new params through

* subversion/libsvn_fs_base/fs.c
  (base_upgrade): update; notifiy about format bump

* subversion/libsvn_fs/fs-loader.c
  (svn_fs_upgrade2): renamed from svn_fs_upgrade; pass new params through
  (svn_fs_upgrade): implement deprecated API in terms of the latest one

* subversion/include/svn_repos.h
  (svn_repos_notify_action_t): add corresponding actions from FS layer
  (svn_repos_notify_t): update comments

* subversion/libsvn_repos/repos.c
  (fs_upgrade_notify_baton_t,
   fs_upgrade_notify): new notification utils translating FS layer
                       notifications to REPOS layer notifications
  (svn_repos_upgrade2): configure notification pass-through

* subversion/svnadmin/svnadmin.c
  (repos_notify_handler): handle the new actions

Modified:
    subversion/trunk/subversion/include/svn_fs.h
    subversion/trunk/subversion/include/svn_repos.h
    subversion/trunk/subversion/libsvn_fs/fs-loader.c
    subversion/trunk/subversion/libsvn_fs/fs-loader.h
    subversion/trunk/subversion/libsvn_fs_base/fs.c
    subversion/trunk/subversion/libsvn_fs_fs/fs.c
    subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
    subversion/trunk/subversion/libsvn_fs_fs/fs_fs.h
    subversion/trunk/subversion/libsvn_repos/repos.c
    subversion/trunk/subversion/svnadmin/svnadmin.c

Modified: subversion/trunk/subversion/include/svn_fs.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_fs.h?rev=1495545&r1=1495544&r2=1495545&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_fs.h (original)
+++ subversion/trunk/subversion/include/svn_fs.h Fri Jun 21 19:15:08 2013
@@ -264,6 +264,38 @@ svn_fs_open(svn_fs_t **fs_p,
             apr_hash_t *fs_config,
             apr_pool_t *pool);
 
+/** The kind of action being taken by 'upgrade'.
+ *
+ * @since New in 1.9.
+ */
+typedef enum svn_fs_upgrade_notify_action_t
+{
+  /** Packing of the revprop shard has completed.
+   *  The number parameter is the shard being processed. */
+  svn_fs_upgrade_pack_revprops = 0,
+
+  /** Removal of the non-packed revprop shard is completed.
+   *  The number parameter is the shard being processed */
+  svn_fs_upgrade_cleanup_revprops,
+
+  /** DB format has been set to the new value.
+   *  The number parameter is the new format number. */
+  svn_fs_upgrade_format_bumped
+} svn_fs_upgrade_notify_action_t;
+
+/** The type of a upgrade notification function.  @a number is specifc 
+ * to @a action (see #svn_fs_upgrade_notify_action_t); @a action is the
+ * type of action being performed.  @a baton is the corresponding baton
+ * for the notification function, and @a pool can be used for temporary
+ * allocations, but will be cleared between invocations.
+ * 
+ * @since New in 1.9.
+ */
+typedef svn_error_t *(*svn_fs_upgrade_notify_t)(void *baton,
+                                      apr_uint64_t number,
+                                      svn_fs_upgrade_notify_action_t action,
+                                      apr_pool_t *pool);
+
 /**
  * Upgrade the Subversion filesystem located in the directory @a path
  * to the latest version supported by this library.  Return
@@ -271,11 +303,37 @@ svn_fs_open(svn_fs_t **fs_p,
  * filesystem if the requested upgrade is not supported.  Use @a pool
  * for necessary allocations.
  *
+ * The optional @a notify_func callback is only a general feedback that
+ * the operation is still in process but may be called in e.g. random shard
+ * order and more than once for the same shard.
+ *
+ * The optional @a cancel_func callback will be invoked as usual to allow
+ * the user to preempt this potentially lengthy operation.
+ *
  * @note You probably don't want to use this directly.  Take a look at
  * svn_repos_upgrade() instead.
  *
+ * @note Canceling an upgrade is legal but may leave remnants of previous
+ * format data that may not be cleaned up automatically by later calls.
+ *
+ * @since New in 1.9.
+ */
+svn_error_t *
+svn_fs_upgrade2(const char *path,
+                svn_fs_upgrade_notify_t notify_func,
+                void *notify_baton,
+                svn_cancel_func_t cancel_func,
+                void *cancel_baton,
+                apr_pool_t *pool);
+
+/**
+ * Like svn_fs_upgrade2 but with notify_func, notify_baton, cancel_func
+ * and cancel_baton being set to NULL.
+ *
+ * @deprecated Provided for backward compatibility with the 1.8 API. 
  * @since New in 1.5.
  */
+SVN_DEPRECATED
 svn_error_t *
 svn_fs_upgrade(const char *path,
                apr_pool_t *pool);

Modified: subversion/trunk/subversion/include/svn_repos.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_repos.h?rev=1495545&r1=1495544&r2=1495545&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_repos.h (original)
+++ subversion/trunk/subversion/include/svn_repos.h Fri Jun 21 19:15:08 2013
@@ -254,8 +254,16 @@ typedef enum svn_repos_notify_action_t
   svn_repos_notify_verify_rev_structure,
 
   /** A revision is found with corruption/errors. @since New in 1.9. */
-  svn_repos_notify_failure
+  svn_repos_notify_failure,
 
+  /** A revprop shard got packed. @since New in 1.9. */
+  svn_repos_notify_pack_revprops,
+
+  /** A non-packed revprop shard got removed. @since New in 1.9. */
+  svn_repos_notify_cleanup_revprops,
+
+  /** The repository format got bumped. @since New in 1.9. */
+  svn_repos_notify_format_bumped
 } svn_repos_notify_action_t;
 
 /** The type of error occurring.
@@ -298,7 +306,8 @@ typedef struct svn_repos_notify_t
   svn_repos_notify_action_t action;
 
   /** For #svn_repos_notify_dump_rev_end and #svn_repos_notify_verify_rev_end,
-   * the revision which just completed. */
+   * the revision which just completed.
+   * For #svn_fs_upgrade_format_bumped, the new format version. */
   svn_revnum_t revision;
 
   /** For #svn_repos_notify_warning, the warning object. */
@@ -307,6 +316,8 @@ typedef struct svn_repos_notify_t
 
   /** For #svn_repos_notify_pack_shard_start,
       #svn_repos_notify_pack_shard_end,
+      #svn_repos_notify_pack_revprops,
+      #svn_repos_notify_cleanup_revprops
       #svn_repos_notify_pack_shard_start_revprop, and
       #svn_repos_notify_pack_shard_end_revprop, the shard processed. */
   apr_int64_t shard;

Modified: subversion/trunk/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs/fs-loader.c?rev=1495545&r1=1495544&r2=1495545&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/trunk/subversion/libsvn_fs/fs-loader.c Fri Jun 21 19:15:08 2013
@@ -481,7 +481,12 @@ svn_fs_open(svn_fs_t **fs_p, const char 
 }
 
 svn_error_t *
-svn_fs_upgrade(const char *path, apr_pool_t *pool)
+svn_fs_upgrade2(const char *path,
+                svn_fs_upgrade_notify_t notify_func,
+                void *notify_baton,
+                svn_cancel_func_t cancel_func,
+                void *cancel_baton,
+                apr_pool_t *pool)
 {
   fs_library_vtable_t *vtable;
   svn_fs_t *fs;
@@ -490,11 +495,20 @@ svn_fs_upgrade(const char *path, apr_poo
   fs = fs_new(NULL, pool);
 
   SVN_MUTEX__WITH_LOCK(common_pool_lock,
-                       vtable->upgrade_fs(fs, path, pool, common_pool));
+                       vtable->upgrade_fs(fs, path,
+                                          notify_func, notify_baton,
+                                          cancel_func, cancel_baton,
+                                          pool, common_pool));
   return SVN_NO_ERROR;
 }
 
 svn_error_t *
+svn_fs_upgrade(const char *path, apr_pool_t *pool)
+{
+  return svn_error_trace(svn_fs_upgrade2(path, NULL, NULL, NULL, NULL, pool));
+}
+
+svn_error_t *
 svn_fs_verify(const char *path,
               apr_hash_t *fs_config,
               svn_revnum_t start,

Modified: subversion/trunk/subversion/libsvn_fs/fs-loader.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs/fs-loader.h?rev=1495545&r1=1495544&r2=1495545&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs/fs-loader.h (original)
+++ subversion/trunk/subversion/libsvn_fs/fs-loader.h Fri Jun 21 19:15:08 2013
@@ -85,7 +85,13 @@ typedef struct fs_library_vtable_t
   svn_error_t *(*open_fs_for_recovery)(svn_fs_t *fs, const char *path,
                                        apr_pool_t *pool,
                                        apr_pool_t *common_pool);
-  svn_error_t *(*upgrade_fs)(svn_fs_t *fs, const char *path, apr_pool_t *pool,
+  svn_error_t *(*upgrade_fs)(svn_fs_t *fs,
+                             const char *path,
+                             svn_fs_upgrade_notify_t notify_func,
+                             void *notify_baton,
+                             svn_cancel_func_t cancel_func,
+                             void *cancel_baton,
+                             apr_pool_t *pool,
                              apr_pool_t *common_pool);
   svn_error_t *(*verify_fs)(svn_fs_t *fs, const char *path,
                             svn_revnum_t start,

Modified: subversion/trunk/subversion/libsvn_fs_base/fs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_base/fs.c?rev=1495545&r1=1495544&r2=1495545&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_base/fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_base/fs.c Fri Jun 21 19:15:08 2013
@@ -898,7 +898,13 @@ base_open_for_recovery(svn_fs_t *fs, con
 }
 
 static svn_error_t *
-base_upgrade(svn_fs_t *fs, const char *path, apr_pool_t *pool,
+base_upgrade(svn_fs_t *fs,
+             const char *path,
+             svn_fs_upgrade_notify_t notify_func,
+             void *notify_baton,
+             svn_cancel_func_t cancel_func,
+             void *cancel_baton,
+             apr_pool_t *pool,
              apr_pool_t *common_pool)
 {
   const char *version_file_path;
@@ -921,6 +927,9 @@ base_upgrade(svn_fs_t *fs, const char *p
   /* Bump the format file's stored version number. */
   SVN_ERR(svn_io_write_version_file(version_file_path,
                                     SVN_FS_BASE__FORMAT_NUMBER, pool));
+  if (notify_func)
+    SVN_ERR(notify_func(notify_baton, SVN_FS_BASE__FORMAT_NUMBER,
+                        svn_fs_upgrade_format_bumped, pool));
 
   /* Check and see if we need to record the "bump" revision. */
   if (old_format_number < SVN_FS_BASE__MIN_FORWARD_DELTAS_FORMAT)

Modified: subversion/trunk/subversion/libsvn_fs_fs/fs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs.c?rev=1495545&r1=1495544&r2=1495545&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs.c Fri Jun 21 19:15:08 2013
@@ -289,7 +289,13 @@ fs_open_for_recovery(svn_fs_t *fs,
 
 /* This implements the fs_library_vtable_t.upgrade_fs() API. */
 static svn_error_t *
-fs_upgrade(svn_fs_t *fs, const char *path, apr_pool_t *pool,
+fs_upgrade(svn_fs_t *fs,
+           const char *path,
+           svn_fs_upgrade_notify_t notify_func,
+           void *notify_baton,
+           svn_cancel_func_t cancel_func,
+           void *cancel_baton,
+           apr_pool_t *pool,
            apr_pool_t *common_pool)
 {
   SVN_ERR(svn_fs__check_fs(fs, FALSE));
@@ -297,7 +303,8 @@ fs_upgrade(svn_fs_t *fs, const char *pat
   SVN_ERR(svn_fs_fs__open(fs, path, pool));
   SVN_ERR(svn_fs_fs__initialize_caches(fs, pool));
   SVN_ERR(fs_serialized_init(fs, common_pool, pool));
-  return svn_fs_fs__upgrade(fs, pool);
+  return svn_fs_fs__upgrade(fs, notify_func, notify_baton,
+                            cancel_func, cancel_baton, pool);
 }
 
 static svn_error_t *

Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?rev=1495545&r1=1495544&r2=1495545&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Fri Jun 21 19:15:08 2013
@@ -1467,10 +1467,15 @@ delete_revprops_shard(const char *shard_
  * have no unpacked data anymore.  Call upgrade_cleanup_pack_revprops after
  * the bump.
  * 
- * Use SCRATCH_POOL for temporary allocations.
+ * NOTIFY_FUNC and NOTIFY_BATON as well as CANCEL_FUNC and CANCEL_BATON are
+ * used in the usual way.  Temporary allocations are done in SCRATCH_POOL.
  */
 static svn_error_t *
 upgrade_pack_revprops(svn_fs_t *fs,
+                      svn_fs_upgrade_notify_t notify_func,
+                      void *notify_baton,
+                      svn_cancel_func_t cancel_func,
+                      void *cancel_baton,
                       apr_pool_t *scratch_pool)
 {
   fs_fs_data_t *ffd = fs->fsap_data;
@@ -1503,7 +1508,11 @@ upgrade_pack_revprops(svn_fs_t *fs,
                                   shard, ffd->max_files_per_dir,
                                   (int)(0.9 * ffd->revprop_pack_size),
                                   compression_level,
-                                  NULL, NULL, iterpool));
+                                  cancel_func, cancel_baton, iterpool));
+      if (notify_func)
+        SVN_ERR(notify_func(notify_baton, shard,
+                            svn_fs_upgrade_pack_revprops, iterpool));
+
       svn_pool_clear(iterpool);
     }
 
@@ -1513,11 +1522,21 @@ upgrade_pack_revprops(svn_fs_t *fs,
 }
 
 /* In the filesystem FS, remove all non-packed revprop shards up to
- * min_unpacked_rev.  Use SCRATCH_POOL for temporary allocations.
+ * min_unpacked_rev.  Temporary allocations are done in SCRATCH_POOL.
+ * 
+ * NOTIFY_FUNC and NOTIFY_BATON as well as CANCEL_FUNC and CANCEL_BATON are
+ * used in the usual way.  Cancellation is supported in the sense that we
+ * will cleanly abort the operation.  However, there will be remnant shards
+ * that must be removed manually.
+ *
  * See upgrade_pack_revprops for more info.
  */
 static svn_error_t *
 upgrade_cleanup_pack_revprops(svn_fs_t *fs,
+                              svn_fs_upgrade_notify_t notify_func,
+                              void *notify_baton,
+                              svn_cancel_func_t cancel_func,
+                              void *cancel_baton,
                               apr_pool_t *scratch_pool)
 {
   fs_fs_data_t *ffd = fs->fsap_data;
@@ -1538,7 +1557,11 @@ upgrade_cleanup_pack_revprops(svn_fs_t *
                        iterpool);
       SVN_ERR(delete_revprops_shard(revprops_shard_path,
                                     shard, ffd->max_files_per_dir,
-                                    NULL, NULL, iterpool));
+                                    cancel_func, cancel_baton, iterpool));
+      if (notify_func)
+        SVN_ERR(notify_func(notify_baton, shard,
+                            svn_fs_upgrade_cleanup_revprops, iterpool));
+
       svn_pool_clear(iterpool);
     }
 
@@ -1547,10 +1570,22 @@ upgrade_cleanup_pack_revprops(svn_fs_t *
   return SVN_NO_ERROR;
 }
 
+/* Baton type bridging svn_fs_fs__upgrade and upgrade_body carrying 
+ * parameters over between them. */
+struct upgrade_baton_t
+{
+  svn_fs_t *fs;
+  svn_fs_upgrade_notify_t notify_func;
+  void *notify_baton;
+  svn_cancel_func_t cancel_func;
+  void *cancel_baton;
+};
+
 static svn_error_t *
 upgrade_body(void *baton, apr_pool_t *pool)
 {
-  svn_fs_t *fs = baton;
+  struct upgrade_baton_t *upgrade_baton = baton;
+  svn_fs_t *fs = upgrade_baton->fs;
   int format, max_files_per_dir;
   const char *format_path = path_format(fs, pool);
   svn_node_kind_t kind;
@@ -1615,16 +1650,31 @@ upgrade_body(void *baton, apr_pool_t *po
       && max_files_per_dir > 0)
     {
       needs_revprop_shard_cleanup = TRUE;
-      SVN_ERR(upgrade_pack_revprops(fs, pool));
+      SVN_ERR(upgrade_pack_revprops(fs,
+                                    upgrade_baton->notify_func,
+                                    upgrade_baton->notify_baton,
+                                    upgrade_baton->cancel_func,
+                                    upgrade_baton->cancel_baton,
+                                    pool));
     }
 
   /* Bump the format file. */
   SVN_ERR(write_format(format_path, SVN_FS_FS__FORMAT_NUMBER,
                        max_files_per_dir, TRUE, pool));
+  if (upgrade_baton->notify_func)
+    SVN_ERR(upgrade_baton->notify_func(upgrade_baton->notify_baton,
+                                       SVN_FS_FS__FORMAT_NUMBER,
+                                       svn_fs_upgrade_format_bumped,
+                                       pool));
 
   /* Now, it is safe to remove the redundant revprop files. */
   if (needs_revprop_shard_cleanup)
-    SVN_ERR(upgrade_cleanup_pack_revprops(fs, pool));
+    SVN_ERR(upgrade_cleanup_pack_revprops(fs,
+                                          upgrade_baton->notify_func,
+                                          upgrade_baton->notify_baton,
+                                          upgrade_baton->cancel_func,
+                                          upgrade_baton->cancel_baton,
+                                          pool));
 
   /* Done */
   return SVN_NO_ERROR;
@@ -1632,9 +1682,21 @@ upgrade_body(void *baton, apr_pool_t *po
 
 
 svn_error_t *
-svn_fs_fs__upgrade(svn_fs_t *fs, apr_pool_t *pool)
+svn_fs_fs__upgrade(svn_fs_t *fs,
+                   svn_fs_upgrade_notify_t notify_func,
+                   void *notify_baton,
+                   svn_cancel_func_t cancel_func,
+                   void *cancel_baton,
+                   apr_pool_t *pool)
 {
-  return svn_fs_fs__with_write_lock(fs, upgrade_body, (void *)fs, pool);
+  struct upgrade_baton_t baton;
+  baton.fs = fs;
+  baton.notify_func = notify_func;
+  baton.notify_baton = notify_baton;
+  baton.cancel_func = cancel_func;
+  baton.cancel_baton = cancel_baton;
+  
+  return svn_fs_fs__with_write_lock(fs, upgrade_body, (void *)&baton, pool);
 }
 
 

Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.h?rev=1495545&r1=1495544&r2=1495545&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.h (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.h Fri Jun 21 19:15:08 2013
@@ -34,8 +34,15 @@ svn_error_t *svn_fs_fs__open(svn_fs_t *f
                              const char *path,
                              apr_pool_t *pool);
 
-/* Upgrade the fsfs filesystem FS.  Use POOL for temporary allocations. */
+/* Upgrade the fsfs filesystem FS.  Indicate progress via the optional
+ * NOTIFY_FUNC callback using NOTIFY_BATON.  The optional CANCEL_FUNC
+ * will periodically be called with CANCEL_BATON to allow for preemption.
+ * Use POOL for temporary allocations. */
 svn_error_t *svn_fs_fs__upgrade(svn_fs_t *fs,
+                                svn_fs_upgrade_notify_t notify_func,
+                                void *notify_baton,
+                                svn_cancel_func_t cancel_func,
+                                void *cancel_baton,
                                 apr_pool_t *pool);
 
 /* Verify metadata in fsfs filesystem FS.  Limit the checks to revisions

Modified: subversion/trunk/subversion/libsvn_repos/repos.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/repos.c?rev=1495545&r1=1495544&r2=1495545&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/repos.c (original)
+++ subversion/trunk/subversion/libsvn_repos/repos.c Fri Jun 21 19:15:08 2013
@@ -1534,6 +1534,54 @@ svn_repos_open2(svn_repos_t **repos_p,
   return get_repos(repos_p, path, FALSE, FALSE, TRUE, fs_config, pool);
 }
 
+/* Baton used with fs_upgrade_notify, specifying the svn_repos layer
+ * notification parameters.
+ */
+struct fs_upgrade_notify_baton_t
+{
+  svn_repos_notify_func_t notify_func;
+  void *notify_baton;
+};
+
+/* Implements svn_fs_upgrade_notify_t as forwarding to a
+ * svn_repos_notify_func_t passed in a fs_upgrade_notify_baton_t* BATON.
+ */
+svn_error_t *
+fs_upgrade_notify(void *baton,
+                  apr_uint64_t number,
+                  svn_fs_upgrade_notify_action_t action,
+                  apr_pool_t *pool)
+{
+  struct fs_upgrade_notify_baton_t *fs_baton = baton;
+
+  svn_repos_notify_t *notify = svn_repos_notify_create(
+                                svn_repos_notify_mutex_acquired, pool);
+  switch(action)
+    {
+      case svn_fs_upgrade_pack_revprops:
+        notify->shard = number;
+        notify->action = svn_repos_notify_pack_revprops;
+        break;
+
+      case svn_fs_upgrade_cleanup_revprops:
+        notify->shard = number;
+        notify->action = svn_repos_notify_cleanup_revprops;
+        break;
+
+      case svn_fs_upgrade_format_bumped:
+        notify->revision = number;
+        notify->action = svn_repos_notify_format_bumped;
+        break;
+
+      default:
+        /* unknown notification */
+        SVN_ERR_MALFUNCTION();
+    }
+
+  fs_baton->notify_func(fs_baton->notify_baton, notify, pool);
+
+  return SVN_NO_ERROR;
+}
 
 svn_error_t *
 svn_repos_upgrade2(const char *path,
@@ -1547,6 +1595,10 @@ svn_repos_upgrade2(const char *path,
   int format;
   apr_pool_t *subpool = svn_pool_create(pool);
 
+  struct fs_upgrade_notify_baton_t fs_notify_baton;
+  fs_notify_baton.notify_func = notify_func;
+  fs_notify_baton.notify_baton = notify_baton;
+
   /* Fetch a repository object; for the Berkeley DB backend, it is
      initialized with an EXCLUSIVE lock on the database.  This will at
      least prevent others from trying to read or write to it while we
@@ -1575,7 +1627,9 @@ svn_repos_upgrade2(const char *path,
   SVN_ERR(svn_io_write_version_file(format_path, format, subpool));
 
   /* Try to upgrade the filesystem. */
-  SVN_ERR(svn_fs_upgrade(repos->db_path, subpool));
+  SVN_ERR(svn_fs_upgrade2(repos->db_path,
+                          notify_func ? fs_upgrade_notify : NULL,
+                          &fs_notify_baton, NULL, NULL, subpool));
 
   /* Now overwrite our format file with the latest version. */
   SVN_ERR(svn_io_write_version_file(format_path, SVN_REPOS__FORMAT_NUMBER,

Modified: subversion/trunk/subversion/svnadmin/svnadmin.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnadmin/svnadmin.c?rev=1495545&r1=1495544&r2=1495545&view=diff
==============================================================================
--- subversion/trunk/subversion/svnadmin/svnadmin.c (original)
+++ subversion/trunk/subversion/svnadmin/svnadmin.c Fri Jun 21 19:15:08 2013
@@ -994,6 +994,35 @@ repos_notify_handler(void *baton,
                               " repository may take some time...\n"));
       return;
 
+    case svn_repos_notify_pack_revprops:
+      {
+        const char *shardstr = apr_psprintf(scratch_pool,
+                                            "%" APR_INT64_T_FMT,
+                                            notify->shard);
+        cmdline_stream_printf(feedback_stream, scratch_pool,
+                              _("Packing revision properties"
+                                " in shard %s..."),
+                              shardstr);
+        return;
+      }
+
+    case svn_repos_notify_cleanup_revprops:
+      {
+        const char *shardstr = apr_psprintf(scratch_pool,
+                                            "%" APR_INT64_T_FMT,
+                                            notify->shard);
+        cmdline_stream_printf(feedback_stream, scratch_pool,
+                              _("Removing non-packed revision properties"
+                                " in shard %s..."),
+                              shardstr);
+        return;
+      }
+
+    case svn_repos_notify_format_bumped:
+      cmdline_stream_printf(feedback_stream, scratch_pool,
+                            _("Bumped repository format to %ld\n"),
+                            notify->revision);
+
     default:
       return;
   }