From df5098c1eca94a081b0cd46cf47b81288e035911 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 26 Apr 2008 20:32:30 +0300 Subject: Use FILELIST from previous generation, if available. --- obnam/app.py | 3 +++ obnam/oper_backup.py | 6 ++++++ 2 files changed, 9 insertions(+) (limited to 'obnam') 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) -- cgit v1.2.1