r847643 | striker | 2003-10-30 13:23:08 -0600 (Thu, 30 Oct 2003) Issue #1571: svnadmin hotcopy Patch by: Vladimir Berezniker <vmpn@hitechman.com> * subversion/include/svn_io.h * subversion/libsvn_subr/io.c (svn_io_file_create): Factored out function for file creation. (svn_io__file_clear_and_close): Moved from subversion/libsvn_repos/repos.c (clear_and_close). (svn_io_file_lock): Factored out function for file locking. (svn_io_dir_file_copy): Implemented function for copying a file between two directories. * subversion/include/svn_fs.h (svn_fs_hotcopy_berkeley): Added prototype for Berkeley hot copy function. * subversion/include/svn_repos.h (svn_repos_hotcopy): Added prototype for subversion repository hot copy function. (svn_repos_db_logs_lockfile): Added prototype. * subversion/libsvn_fs/fs.c: (svn_fs__clean_logs): Implemented function that deletes only copied unused Berkeley DB logs. (svn_fs_hotcopy_berkeley): Implemented hot copy functionality in accordance with Berkeley DB documentation. * subversion/libsvn_repos/repos.h (SVN_REPOS__DB_LOGS_LOCKFILE): Added new definition for BDB logs files lock file. * subversion/libsvn_repos/repos.c (create_db_lock): Factored out function for creation of db lock file. (create_locks): Cleanup. Deleted redundant path parameter. (create_hooks): Cleanup. Deleted redundant path parameter. Updated code to use (svn_io_file_create). (hotcopy_ctx_t): New structure for use by (hotcopy_structure). (hotcopy_structure): Adapted, deleted, (copy_structure) for copying repository structure with exception of /db and /locks directories. (svn_repos_db_logs_lockfile): Implemented function to return path to db logs lock file. (create_db_logs_lock): Implemented function for creation of db logs lock file. (lock_db_logs_file): Function for locking db logs lock file. (svn_repos_hotcopy): Implemented function to make a hot copy of a repository. (get_repos): Cleanup. Updated code to use (svn_io_file_lock). (clear_and_close): Moved to subversion/libsvn_subr/io.c (svn_io__file_clear_and_close). (create_repos_structure): Cleanup. Updated code to use (svn_io_file_create). * subversion/svnadmin/main.c Added new flag "--clean-logs" to specify that unused copied logs are to be deleted after the hot copy is complete. (parse_local_repos_path): Factored out function for parsing and validating local repository path. (subcommand_hotcopy): Implemented new hotcopy subcommand. * tools/backup/hot-backup.py.in Updated hot backup script to utilize the new hot copy functionality.
r846735 | cmpilato | 2003-08-07 10:53:51 -0500 (Thu, 07 Aug 2003) Rename 'svnadmin archive' to 'svnadmin lsdblogs', and support display of all or only the unused logs. After this commit, we should be able to revert my reversion of Ben Collins-Sussman's tweaks to hot-backup.py.in which replaced usages of db_archive and db_recover with their svnadmin counterparts. Patch by: Vladimir Berezniker <vberezniker@siuh.edu> (Tweaked by me.) * subversion/include/svn_fs.h (svn_fs_berkeley_logfiles): Renamed from svn_fs_berkeley_archive to be more in line with actual purpose of the function. Change return pointer to apr_array_header_t type from pointer to NULL-terminated array of const char *. Add parameter specifying whether to return all or only unused log file names. * subversion/libsvn_fs/fs.c (svn_fs_berkeley_logfiles): Implement the function as specified in include/svn_fs.h. * subversion/include/svn_repos.h (svn_repos_db_logfiles): Created wrapper function around svn_fs_berkeley_logfiles to return log paths relative to the repository root. * subversion/libsvn_repos/repos.c (svn_repos_db_logfiles): Implement the function as specified in include/svn_repos.h. * subversion/svnadmin/main.c Rename "archive" sub command to "lsdblogs" and change default behavior from listing only unused logs to listing all log files, to be consistent with the name of sub command. Added --only-unused option to mimic the behavior of replaced "archive" sub command.