Commit c79d2ad5 authored by bescoto's avatar bescoto

Fix for remote --list-changed-since and --list-at-time


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@447 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent 4600e590
......@@ -4,6 +4,9 @@ New in v0.13.3 (??????????)
Fixed some of the --restrict options which would cause spurious
violation errors.
--list-changed-since and --list-at-time now work remotely.
Thanks to Morten Werner Olsen for bug report.
New in v0.13.2 (2003/09/16)
---------------------------
......
......@@ -662,7 +662,9 @@ def ListChangedSince(rp):
restore_check_backup_dir(restore_root)
mirror_rp = restore_root.new_index(restore_index)
inc_rp = mirror_rp.append_path("increments", restore_index)
restore.ListChangedSince(mirror_rp, inc_rp, rest_time)
for rorp in rp.conn.restore.ListChangedSince(mirror_rp, inc_rp, rest_time):
# This is a hack, see restore.ListChangedSince for rational
print rorp.index[0]
def ListAtTime(rp):
......@@ -673,7 +675,9 @@ def ListAtTime(rp):
restore_check_backup_dir(restore_root)
mirror_rp = restore_root.new_index(restore_index)
inc_rp = mirror_rp.append_path("increments", restore_index)
restore.ListAtTime(mirror_rp, inc_rp, rest_time)
for rorp in rp.conn.restore.ListAtTime(mirror_rp, inc_rp, rest_time):
# Hack for remote operation, see restore.ListChangedSince for rational
print rorp.index[0]
def CheckDest(dest_rp):
......
......@@ -64,13 +64,20 @@ def get_inclist(inc_rpath):
return inc_list
def ListChangedSince(mirror_rp, inc_rp, restore_to_time):
"""List the changed files under mirror_rp since rest time"""
MirrorS = mirror_rp.conn.restore.MirrorStruct
MirrorS.set_mirror_and_rest_times(restore_to_time)
MirrorS.initialize_rf_cache(mirror_rp, inc_rp)
"""List the changed files under mirror_rp since rest time
Notice the output is an iterator of RORPs. We do this because we
want to give the remote connection the data in buffered
increments, and this is done automatically for rorp iterators.
Encode the lines in the first element of the rorp's index.
"""
assert mirror_rp.conn is Globals.local_connection, "Run locally only"
MirrorStruct.set_mirror_and_rest_times(restore_to_time)
MirrorStruct.initialize_rf_cache(mirror_rp, inc_rp)
cur_iter = MirrorS.get_mirror_rorp_iter(_mirror_time, 1)
old_iter = MirrorS.get_mirror_rorp_iter(_rest_time, 1)
old_iter = MirrorStruct.get_mirror_rorp_iter(_rest_time, 1)
cur_iter = MirrorStruct.get_mirror_rorp_iter(_mirror_time, 1)
collated = rorpiter.Collate2Iters(old_iter, cur_iter)
for old_rorp, cur_rorp in collated:
if not old_rorp: change = "new"
......@@ -79,17 +86,22 @@ def ListChangedSince(mirror_rp, inc_rp, restore_to_time):
else: change = "changed"
path_desc = (old_rorp and old_rorp.get_indexpath() or
cur_rorp.get_indexpath())
print "%-7s %s" % (change, path_desc)
yield rpath.RORPath(("%-7s %s" % (change, path_desc),))
def ListAtTime(mirror_rp, inc_rp, time):
"""List the files in archive at the given time"""
MirrorS = mirror_rp.conn.restore.MirrorStruct
MirrorS.set_mirror_and_rest_times(time)
MirrorS.initialize_rf_cache(mirror_rp, inc_rp)
"""List the files in archive at the given time
Output is a RORP Iterator with info in index. See ListChangedSince.
"""
assert mirror_rp.conn is Globals.local_connection, "Run locally only"
MirrorStruct.set_mirror_and_rest_times(time)
MirrorStruct.initialize_rf_cache(mirror_rp, inc_rp)
old_iter = MirrorS.get_mirror_rorp_iter(_rest_time, 1)
for rorp in old_iter: print rorp.get_indexpath()
old_iter = MirrorStruct.get_mirror_rorp_iter(_rest_time, 1)
for rorp in old_iter:
yield rpath.RORPath((rorp.get_indexpath(),))
class MirrorStruct:
......
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