Commit fb2e575f authored by bescoto's avatar bescoto

Added more restore times to compensate for old timezone bug


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@571 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent 81065bd1
......@@ -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)
---------------------------
......
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment