diff options
author | Lars Wirzenius <liw@gytha> | 2008-04-20 21:21:03 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@gytha> | 2008-04-20 21:21:03 +0300 |
commit | 67170467426779de6cd925b544fe2140e65a27bb (patch) | |
tree | 409088fea82ade8f8cff13eb5aaca3c0c0ac6eae /obnam | |
parent | 210102d0598480b5eef0c18afeaa767be079235a (diff) | |
download | obnam-67170467426779de6cd925b544fe2140e65a27bb.tar.gz |
Re-use DirObjects from the previous generation, when possible.
Diffstat (limited to 'obnam')
-rw-r--r-- | obnam/app.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/obnam/app.py b/obnam/app.py index 838e1b9e..19e2cc54 100644 --- a/obnam/app.py +++ b/obnam/app.py @@ -347,8 +347,15 @@ class Application: dirrefs=dirrefs, filegrouprefs=filegrouprefs) - self.get_store().queue_object(dir) - return dir + unsolved = obnam.io.unsolve(self.get_context(), dirname) + old_dir = self.get_dir_in_previous_generation(unsolved) + if old_dir and self.dir_is_unchanged(old_dir, dir): + logging.debug("Dir is unchanged: %s" % dirname) + return old_dir + else: + logging.debug("Dir has changed: %s" % dirname) + self.get_store().queue_object(dir) + return dir def backup_one_root(self, root): """Backup one root for the next generation.""" |