diff options
author | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2003-02-12 07:28:33 +0000 |
---|---|---|
committer | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2003-02-12 07:28:33 +0000 |
commit | adc9d7a9a9cd90c8d078b1276cfdad98d0303d07 (patch) | |
tree | afa49da6e1ebc85a0d16aad52591e55bda0c70f2 /rdiff-backup/rdiff_backup/backup.py | |
parent | 9613406fbab1949f66fe7858590cab990c7b4b25 (diff) | |
download | rdiff-backup-adc9d7a9a9cd90c8d078b1276cfdad98d0303d07.tar.gz |
Fixed selection bug, renamed metadata files to ".snapshot"
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@278 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/backup.py')
-rw-r--r-- | rdiff-backup/rdiff_backup/backup.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/rdiff-backup/rdiff_backup/backup.py b/rdiff-backup/rdiff_backup/backup.py index a4b9bff..2f3d362 100644 --- a/rdiff-backup/rdiff_backup/backup.py +++ b/rdiff-backup/rdiff_backup/backup.py @@ -31,7 +31,7 @@ def Mirror(src_rpath, dest_rpath): DestS.init_statistics() source_rpiter = SourceS.get_source_select() dest_sigiter = DestS.process_source_get_sigs(dest_rpath, source_rpiter, 0) - source_diffiter = SourceS.get_diffs(src_rpath, dest_sigiter) + source_diffiter = SourceS.get_diffs(dest_sigiter) DestS.patch(dest_rpath, source_diffiter) DestS.write_statistics() @@ -43,7 +43,7 @@ def Mirror_and_increment(src_rpath, dest_rpath, inc_rpath): DestS.init_statistics() source_rpiter = SourceS.get_source_select() dest_sigiter = DestS.process_source_get_sigs(dest_rpath, source_rpiter, 1) - source_diffiter = SourceS.get_diffs(src_rpath, dest_sigiter) + source_diffiter = SourceS.get_diffs(dest_sigiter) DestS.patch_and_increment(dest_rpath, source_diffiter, inc_rpath) DestS.write_statistics() @@ -59,19 +59,26 @@ class SourceStruct: connection. Otherwise we will get an error because a list containing files can't be pickled. + Also, cls.source_select needs to be cached so get_diffs below + can retrieve the necessary rps. + """ sel = selection.Select(rpath) sel.ParseArgs(tuplelist, filelists) - cls.source_select = sel.set_iter() + sel.set_iter() + cache_size = Globals.pipeline_max_length * 2 # 2 because to and from + cls.source_select = rorpiter.CacheIndexable(sel, cache_size) def get_source_select(cls): """Return source select iterator, set by set_source_select""" return cls.source_select - def get_diffs(cls, baserp, dest_sigiter): + def get_diffs(cls, dest_sigiter): """Return diffs of any files with signature in dest_sigiter""" + source_rps = cls.source_select def get_one_diff(dest_sig): - src_rp = baserp.new_index(dest_sig.index) + src_rp = (source_rps.get(dest_sig.index) or + rpath.RORPath(dest_sig.index)) diff_rorp = src_rp.getRORPath() if dest_sig.isflaglinked(): diff_rorp.flaglinked(dest_sig.get_link_flag()) |