diff options
author | Lars Wirzenius <liw@liw.fi> | 2012-04-23 07:27:06 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2012-04-23 07:27:06 +0100 |
commit | 89d7cd82ca37938be5b60c6bdb042b7cd370395b (patch) | |
tree | 98fe548a1aa73e60abc36cbfc0a41e34e612ad1a /larch | |
parent | 004ea287a08e67f8a8768e7374cd0f15e26f1e85 (diff) | |
download | larch-89d7cd82ca37938be5b60c6bdb042b7cd370395b.tar.gz |
Fix exists for new way of deleting files
Diffstat (limited to 'larch')
-rw-r--r-- | larch/journal.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/larch/journal.py b/larch/journal.py index 9636c24..886b2ed 100644 --- a/larch/journal.py +++ b/larch/journal.py @@ -107,8 +107,14 @@ class Journal(object): return os.path.join(self.deletedir, self._relative(filename)) def exists(self, filename): - return (self.fs.exists(filename) or - (self.allow_writes and self.fs.exists(self._new(filename)))) + if self.allow_writes: + new = self._new(filename) + deleted = self._deleted(filename) + if self.fs.exists(new): + return True + elif self.fs.exists(deleted): + return False + return self.fs.exists(filename) def makedirs(self, dirname): tracing.trace(dirname) |