From b17688b2c85a77e4f4eb45a928e915f8004b81a2 Mon Sep 17 00:00:00 2001 From: bescoto Date: Mon, 24 Nov 2003 00:01:54 +0000 Subject: Restore excludes now leave existing files on target alone git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@497 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/rdiff_backup/restore.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'rdiff-backup/rdiff_backup/restore.py') diff --git a/rdiff-backup/rdiff_backup/restore.py b/rdiff-backup/rdiff_backup/restore.py index 4a528ff..86795b1 100644 --- a/rdiff-backup/rdiff_backup/restore.py +++ b/rdiff-backup/rdiff_backup/restore.py @@ -25,11 +25,6 @@ import Globals, Time, Rdiff, Hardlink, rorpiter, selection, rpath, \ log, static, robust, metadata, statistics, TempFile, eas_acls -# This should be set to selection.Select objects over the source and -# mirror directories respectively. -_select_source = None -_select_mirror = None - # This will be set to the time of the current mirror _mirror_time = None # This will be set to the exact time to restore to (not restore_to_time) @@ -263,9 +258,16 @@ static.MakeClass(MirrorStruct) class TargetStruct: """Hold functions to be run on the target side when restoring""" - def get_initial_iter(cls, target): + _select = None + def set_target_select(cls, target, select_opts, *filelists): """Return a selection object iterating the rorpaths in target""" - return selection.Select(target).set_iter() + cls._select = selection.Select(target) + cls._select.ParseArgs(select_opts, filelists) + cls._select.set_iter() + + def get_initial_iter(cls, target): + """Return selector previously set with set_initial_iter""" + return cls._select or selection.Select(target).set_iter() def patch(cls, target, diff_iter): """Patch target with the diffs from the mirror side -- cgit v1.2.1