summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2005-03-28 17:56:20 +0000
committerbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2005-03-28 17:56:20 +0000
commite4bfbea2a2ce14e6bff8ecef9914236bc4e2cf69 (patch)
treea71303b277b82d61d231b3fa5f1927135e7e18b1
parentee1b62fc2a2d42ad7f0ce42735be049c60e4f7fd (diff)
downloadrdiff-backup-e4bfbea2a2ce14e6bff8ecef9914236bc4e2cf69.tar.gz
Added more restore times to compensate for old timezone bug
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/branches/r0-12@571 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r--rdiff-backup/CHANGELOG3
-rw-r--r--rdiff-backup/rdiff_backup/restore.py29
2 files changed, 24 insertions, 8 deletions
diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG
index bc62e0a..3edaddc 100644
--- a/rdiff-backup/CHANGELOG
+++ b/rdiff-backup/CHANGELOG
@@ -5,6 +5,9 @@ Dean Gaudet's patch fixes "--restrict /" option.
Added Maximilian Mehnert's fix for too many open files bug.
+Added fix for listing/restoring certain bad archives made when there
+was a timezone bug. (Thanks to Stephen Isard)
+
New in v0.12.7 (2004/05/31)
---------------------------
diff --git a/rdiff-backup/rdiff_backup/restore.py b/rdiff-backup/rdiff_backup/restore.py
index 580d0d8..f82ede9 100644
--- a/rdiff-backup/rdiff_backup/restore.py
+++ b/rdiff-backup/rdiff_backup/restore.py
@@ -123,21 +123,34 @@ class MirrorStruct:
and what was actually on the mirror side will correspond to the
older one.
- So here we assume all rdiff-backup events were recorded in
- "increments" increments, and if it's in-between we pick the
- older one here.
+ So if restore_to_time is inbetween two increments, return the
+ older one.
"""
- global _rest_time
- base_incs = get_inclist(Globals.rbdir.append("increments"))
- if not base_incs: return _mirror_time
- inctimes = [inc.getinctime() for inc in base_incs]
- inctimes.append(_mirror_time)
+ inctimes = cls.get_increment_times()
older_times = filter(lambda time: time <= restore_to_time, inctimes)
if older_times: return max(older_times)
else: # restore time older than oldest increment, just return that
return min(inctimes)
+ def get_increment_times(cls, rp = None):
+ """Return list of times of backups, including current mirror
+
+ Take the total list of times from the increments.<time>.dir
+ file and the mirror_metadata file. Sorted ascending.
+
+ """
+ # use dictionary to remove dups
+ if not _mirror_time: d = {cls.get_mirror_time(): None}
+ else: d = {_mirror_time: None}
+ if not rp or not rp.index: rp = Globals.rbdir.append("increments")
+ for inc in get_inclist(rp): d[inc.getinctime()] = None
+ for inc in get_inclist(Globals.rbdir.append("mirror_metadata")):
+ d[inc.getinctime()] = None
+ return_list = d.keys()
+ return_list.sort()
+ return return_list
+
def initialize_rf_cache(cls, mirror_base, inc_base):
"""Set cls.rf_cache to CachedRF object"""
inc_list = get_inclist(inc_base)