summaryrefslogtreecommitdiff
path: root/rdiff-backup/src/restore.py
diff options
context:
space:
mode:
Diffstat (limited to 'rdiff-backup/src/restore.py')
-rw-r--r--rdiff-backup/src/restore.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/rdiff-backup/src/restore.py b/rdiff-backup/src/restore.py
index 9c7a42a..0e0d62e 100644
--- a/rdiff-backup/src/restore.py
+++ b/rdiff-backup/src/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)