Esempio n. 1
0
File: fs.c Progetto: Alkzndr/freebsd
/* This implements the fs_library_vtable_t.hotcopy() API.  Copy a
   possibly live Subversion filesystem SRC_FS from SRC_PATH to a
   DST_FS at DEST_PATH. If INCREMENTAL is TRUE, make an effort not to
   re-copy data which already exists in DST_FS.
   The CLEAN_LOGS argument is ignored and included for Subversion
   1.0.x compatibility.  Perform all temporary allocations in POOL. */
static svn_error_t *
fs_hotcopy(svn_fs_t *src_fs,
           svn_fs_t *dst_fs,
           const char *src_path,
           const char *dst_path,
           svn_boolean_t clean_logs,
           svn_boolean_t incremental,
           svn_cancel_func_t cancel_func,
           void *cancel_baton,
           apr_pool_t *pool)
{
  SVN_ERR(svn_fs__check_fs(src_fs, FALSE));
  SVN_ERR(initialize_fs_struct(src_fs));
  SVN_ERR(svn_fs_fs__open(src_fs, src_path, pool));
  SVN_ERR(svn_fs_fs__initialize_caches(src_fs, pool));
  SVN_ERR(fs_serialized_init(src_fs, pool, pool));

  SVN_ERR(svn_fs__check_fs(dst_fs, FALSE));
  SVN_ERR(initialize_fs_struct(dst_fs));
  /* In INCREMENTAL mode, svn_fs_fs__hotcopy() will open DST_FS.
     Otherwise, it's not an FS yet --- possibly just an empty dir --- so
     can't be opened.
   */
  return svn_fs_fs__hotcopy(src_fs, dst_fs, src_path, dst_path,
                            incremental, cancel_func, cancel_baton, pool);
}
Esempio n. 2
0
File: fs.c Progetto: vocho/openqnx
/* This implements the fs_library_vtable_t.hotcopy() API.  Copy a
   possibly live Subversion filesystem from SRC_PATH to DEST_PATH.
   The CLEAN_LOGS argument is ignored and included for Subversion
   1.0.x compatibility.  Perform all temporary allocations in POOL. */
static svn_error_t *
fs_hotcopy(const char *src_path,
           const char *dest_path,
           svn_boolean_t clean_logs,
           apr_pool_t *pool)
{
  return svn_fs_fs__hotcopy(src_path, dest_path, pool);
}
Esempio n. 3
0
/* This implements the fs_library_vtable_t.hotcopy() API.  Copy a
   possibly live Subversion filesystem SRC_FS from SRC_PATH to a
   DST_FS at DEST_PATH. If INCREMENTAL is TRUE, make an effort not to
   re-copy data which already exists in DST_FS.
   The CLEAN_LOGS argument is ignored and included for Subversion
   1.0.x compatibility.  Indicate progress via the optional NOTIFY_FUNC
   callback using NOTIFY_BATON.  Perform all temporary allocations in POOL. */
static svn_error_t *
fs_hotcopy(svn_fs_t *src_fs,
           svn_fs_t *dst_fs,
           const char *src_path,
           const char *dst_path,
           svn_boolean_t clean_logs,
           svn_boolean_t incremental,
           svn_fs_hotcopy_notify_t notify_func,
           void *notify_baton,
           svn_cancel_func_t cancel_func,
           void *cancel_baton,
           svn_mutex__t *common_pool_lock,
           apr_pool_t *pool,
           apr_pool_t *common_pool)
{
  /* Open the source repo as usual. */
  SVN_ERR(fs_open(src_fs, src_path, common_pool_lock, pool, common_pool));
  if (cancel_func)
    SVN_ERR(cancel_func(cancel_baton));

  /* Test target repo when in INCREMENTAL mode, initialize it when not.
   * For this, we need our FS internal data structures to be temporarily
   * available. */
  SVN_ERR(initialize_fs_struct(dst_fs));
  SVN_ERR(svn_fs_fs__hotcopy_prepare_target(src_fs, dst_fs, dst_path,
                                            incremental, pool));
  uninitialize_fs_struct(dst_fs);

  /* Now, the destination repo should open just fine. */
  SVN_ERR(fs_open(dst_fs, dst_path, common_pool_lock, pool, common_pool));
  if (cancel_func)
    SVN_ERR(cancel_func(cancel_baton));

  /* Now, we may copy data as needed ... */
  return svn_fs_fs__hotcopy(src_fs, dst_fs, incremental,
                            notify_func, notify_baton,
                            cancel_func, cancel_baton, pool);
}