summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup/restore.py
diff options
context:
space:
mode:
authorben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-03-25 07:51:33 +0000
committerben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-03-25 07:51:33 +0000
commita2da3ed31d63e53e80aaf84e1e8b90a53f44713d (patch)
tree0e0b980419e2a3d317d04c55b27d395f97e4df7a /rdiff-backup/rdiff_backup/restore.py
parentc28f6258d10db6957df8e692c510edd4fb6a36e4 (diff)
downloadrdiff-backup-a2da3ed31d63e53e80aaf84e1e8b90a53f44713d.tar.gz
Added support for gzipped increments
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@23 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/restore.py')
-rw-r--r--rdiff-backup/rdiff_backup/restore.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/rdiff-backup/rdiff_backup/restore.py b/rdiff-backup/rdiff_backup/restore.py
index 9c7a42a..0e0d62e 100644
--- a/rdiff-backup/rdiff_backup/restore.py
+++ b/rdiff-backup/rdiff_backup/restore.py
@@ -69,14 +69,19 @@ class Restore:
if inctype == "diff":
if not target.lstat():
raise RestoreError("Bad increment sequence at " + inc.path)
- Rdiff.patch_action(target, inc).execute()
+ Rdiff.patch_action(target, inc,
+ delta_compressed = inc.isinccompressed()
+ ).execute()
elif inctype == "dir":
if not target.isdir():
if target.lstat():
raise RestoreError("File %s already exists" % target.path)
target.mkdir()
elif inctype == "missing": return
- elif inctype == "snapshot": RPath.copy(inc, target)
+ elif inctype == "snapshot":
+ if inc.isinccompressed():
+ target.write_from_fileobj(inc.open("rb", compress = 1))
+ else: RPath.copy(inc, target)
else: raise RestoreError("Unknown inctype %s" % inctype)
RPath.copy_attribs(inc, target)