[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Convert hot-backup.py.in to use new svnadmin list-dblogs and list-unused-dblogs commands

From: <cmpilato_at_collab.net>
Date: 2003-08-27 19:04:24 CEST

Vladimir Berezniker <vmpn@tigris.org> writes:

> Teaching the hot-backup.py to use svnadmin commands instead of
> Berkeley DB utilities, in the hope for less chance of BDB version
> mismatches.
>
>
> Log Message:
> * tools/backup/hot-backup.py.in:
> Use svnadmin list-dblogs, list-unused-dblogs and recover
> subcommands instead of Berkeley DB db_archive and db_recover utilities.
>
>
> Patch:
>
>
> Index: hot-backup.py.in
> ===================================================================
> --- hot-backup.py.in (revision 6892)
> +++ hot-backup.py.in (working copy)
...
> @@ -143,27 +139,33 @@
> print "Re-copying logfiles:"
>
> for item in stdout_lines:
> - logfile = string.strip(item)
> - src = os.path.join(repo_dir, "db", logfile)
> - dst = os.path.join(backup_subdir, "db", logfile)
> - print " Re-copying logfile '" + logfile + "'..."
> - shutil.copy(src, dst)
> + log_file = string.strip(item)
>
> + repo_dir_abs = os.path.abspath(repo_dir)
> +
> + log_file_abs = os.path.abspath(log_file)
> +
> + common_path = os.path.commonprefix([repo_dir_abs, log_file_abs])
> +
> + log_file_rel = log_file_abs[len(common_path) + 1:]
> +
> + dst = os.path.join(backup_subdir, log_file_rel)
> + print " Re-copying logfile '" + log_file + "'..."
> + shutil.copy(log_file, dst)
> +
> print "Backup completed."

If we know that logfiles always live in the db/ directory, you could
just do:

- logfile = string.strip(item)
+ logfile = os.path.basename(string.strip(item))

Right?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Aug 27 19:08:28 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.