Arfrever Frehtes Taifersar Arahesis wrote:
> I think that hot-backup.py could check an environmental variable and if it's
> available, then the value retrieved from this variable could be used instead
> of hard coded value.
>
> [[[
> Allow to set in environment the numer of backups kept around by hot-backup.py.
>
> * tools/backup/hot-backup.py.in: Set num_backups to value obtained from
> SVN_HOTBACKUP_BACKUPS_NUMBER environmental variable.
>
> Patch by: arfrever
> ]]]
>
>
>
> ------------------------------------------------------------------------
>
> Index: tools/backup/hot-backup.py.in
> ===================================================================
> --- tools/backup/hot-backup.py.in (revision 27145)
> +++ tools/backup/hot-backup.py.in (working copy)
> @@ -53,7 +53,10 @@
> svnadmin = r"@SVN_BINDIR@/svnadmin"
>
> # Number of backups to keep around (0 for "keep them all")
> -num_backups = 64
> +if os.environ.has_key("SVN_HOTBACKUP_BACKUPS_NUMBER"):
> + num_backups = int(os.environ["SVN_HOTBACKUP_BACKUPS_NUMBER"])
> +else:
> + num_backups = 64
>
> # Archive types/extensions
> archive_map = {
The more-typical way of doing this is:
num_backups = int(os.environ.get("SVN_HOTBACKUP_BACKUPS_NUMBER", 64))
--
C. Michael Pilato <cmpilato@collab.net>
CollabNet <> www.collab.net <> Distributed Development On Demand
Received on Fri Oct 12 15:32:35 2007