summaryrefslogtreecommitdiff
path: root/rdiff-backup
diff options
context:
space:
mode:
authorben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-08-20 22:14:52 +0000
committerben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-08-20 22:14:52 +0000
commitc1d0c6ef751eb813f6fa0e71c7fa6f317efaeaa5 (patch)
tree7d553cbdf0fbb84bdca1d5dd51f4c67acc2d9f64 /rdiff-backup
parenta24c08b18d5e630b44bc4f4d6585fbb90936dd2e (diff)
downloadrdiff-backup-c1d0c6ef751eb813f6fa0e71c7fa6f317efaeaa5.tar.gz
Fixed get_rest_time to return the oldest time if rest_time is older
than all increments. git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@187 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup')
-rw-r--r--rdiff-backup/rdiff_backup/restore.py7
-rw-r--r--rdiff-backup/src/restore.py7
2 files changed, 10 insertions, 4 deletions
diff --git a/rdiff-backup/rdiff_backup/restore.py b/rdiff-backup/rdiff_backup/restore.py
index 432f9cc..438beb2 100644
--- a/rdiff-backup/rdiff_backup/restore.py
+++ b/rdiff-backup/rdiff_backup/restore.py
@@ -72,8 +72,11 @@ class Restore:
base_incs = Restore.get_inclist(Globals.rbdir.append("increments"))
if not base_incs: return old_rest_time
inctimes = [Time.stringtotime(inc.getinctime()) for inc in base_incs]
- return max(filter(lambda time: time <= old_rest_time,
- inctimes + [mirror_time]))
+ inctimes.append(mirror_time)
+ older_times = filter(lambda time: time <= old_rest_time, inctimes)
+ if older_times: return max(older_times)
+ else: # restore time older than oldest increment, just return that
+ return min(inctimes)
def get_inclist(inc_rpath):
"""Returns increments with given base"""
diff --git a/rdiff-backup/src/restore.py b/rdiff-backup/src/restore.py
index 432f9cc..438beb2 100644
--- a/rdiff-backup/src/restore.py
+++ b/rdiff-backup/src/restore.py
@@ -72,8 +72,11 @@ class Restore:
base_incs = Restore.get_inclist(Globals.rbdir.append("increments"))
if not base_incs: return old_rest_time
inctimes = [Time.stringtotime(inc.getinctime()) for inc in base_incs]
- return max(filter(lambda time: time <= old_rest_time,
- inctimes + [mirror_time]))
+ inctimes.append(mirror_time)
+ older_times = filter(lambda time: time <= old_rest_time, inctimes)
+ if older_times: return max(older_times)
+ else: # restore time older than oldest increment, just return that
+ return min(inctimes)
def get_inclist(inc_rpath):
"""Returns increments with given base"""