summaryrefslogtreecommitdiff
path: root/obnam
diff options
context:
space:
mode:
authorLars Wirzenius <liw@gytha>2008-04-26 20:32:30 +0300
committerLars Wirzenius <liw@gytha>2008-04-26 20:32:30 +0300
commitdf5098c1eca94a081b0cd46cf47b81288e035911 (patch)
treead61bbbfcb5e4e60c6878f43567ba124c418b255 /obnam
parent0f95063acf9f23ae70e89e209828922af9820365 (diff)
downloadobnam-df5098c1eca94a081b0cd46cf47b81288e035911.tar.gz
Use FILELIST from previous generation, if available.
Diffstat (limited to 'obnam')
-rw-r--r--obnam/app.py3
-rw-r--r--obnam/oper_backup.py6
2 files changed, 9 insertions, 0 deletions
diff --git a/obnam/app.py b/obnam/app.py
index 60838202..284b6528 100644
--- a/obnam/app.py
+++ b/obnam/app.py
@@ -238,6 +238,9 @@ class Application:
def get_file_in_previous_generation(self, pathname):
"""Return non-directory file in previous generation, or None."""
+ file = self.find_file_by_name(pathname)
+ if file:
+ return file
gen = self.get_previous_generation()
if gen:
return self.get_store().lookup_file(gen, pathname)
diff --git a/obnam/oper_backup.py b/obnam/oper_backup.py
index a9a5240d..ec59a6b2 100644
--- a/obnam/oper_backup.py
+++ b/obnam/oper_backup.py
@@ -42,6 +42,12 @@ class Backup(obnam.Operation):
if old_gen_ids:
prev_gen = app.get_store().get_object(old_gen_ids[-1])
app.set_previous_generation(prev_gen)
+ filelist_id = prev_gen.get_filelistref()
+ if filelist_id:
+ filelist = obnam.filelist.Filelist()
+ o = app.get_store().get_object(filelist_id)
+ filelist.from_object(o)
+ app.set_prevgen_filelist(filelist)
gen = app.backup(roots)