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

[PATCH] Fix hot-backup.py issue where zip archives do not backup empty directories

From: eg <egoots_at_gmail.com>
Date: Sat, 10 May 2008 15:14:34 -0700

This issue was reported in the users group the other day. An end user
was getting errors after he restored a repository from a hot-backup
which had been created using --archive-type=zip. It turns out the zip
archives were not backing empty directories (such as \transactions),
whereas bz2 and gz archives were.

The fix is a one line change in the script.

[[[

* tools/backup/hot-backup.py: Fix an issue with using the
--archive-type=zip option whereby any empty repository
directories were not being zipped up. This could cause errors when using
the backups to restore a repository.
]]]

Index: hot-backup.py.in
===================================================================
--- hot-backup.py.in (revision 31118)
+++ hot-backup.py.in (working copy)
@@ -301,7 +301,7 @@
       def add_to_zip(baton, dirname, names):
         zp = baton[0]
         root = os.path.join(baton[1], '')
-
+ zp.writestr(zipfile.ZipInfo(dirname[len(root):]+"/"),"")
         for file in names:
           path = os.path.join(dirname, file)
           if os.path.isfile(path):

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-05-11 09:09:55 CEST

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.