summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup/restore.py
diff options
context:
space:
mode:
authorbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2003-11-24 00:01:54 +0000
committerbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2003-11-24 00:01:54 +0000
commitb17688b2c85a77e4f4eb45a928e915f8004b81a2 (patch)
tree267bf09d16a31d3557426d012d14454f676b0e0e /rdiff-backup/rdiff_backup/restore.py
parenta326e28f5c73d5334abc4759dad12249cbcb7cf0 (diff)
downloadrdiff-backup-b17688b2c85a77e4f4eb45a928e915f8004b81a2.tar.gz
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
Diffstat (limited to 'rdiff-backup/rdiff_backup/restore.py')
-rw-r--r--rdiff-backup/rdiff_backup/restore.py16
1 files changed, 9 insertions, 7 deletions
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