diff options
author | ben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2002-06-25 18:04:08 +0000 |
---|---|---|
committer | ben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2002-06-25 18:04:08 +0000 |
commit | aa36fa26a216b2faf89b0bbd4d90fb16fd082f38 (patch) | |
tree | 4368b953be31798122ce1583cdcf5712c7cb073b /rdiff-backup/rdiff_backup/rpath.py | |
parent | a8e880f1ad9cf62dc8b02fa60543b8925c10a846 (diff) | |
download | rdiff-backup-aa36fa26a216b2faf89b0bbd4d90fb16fd082f38.tar.gz |
More optimization: rewrote selection iteration to not recur, and added
"fast processing" to IterTreeReducer, so objects don't need to be
created in the typical case.
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@145 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/rpath.py')
-rw-r--r-- | rdiff-backup/rdiff_backup/rpath.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py index b005011..22e901e 100644 --- a/rdiff-backup/rdiff_backup/rpath.py +++ b/rdiff-backup/rdiff_backup/rpath.py @@ -433,7 +433,9 @@ class RPath(RORPath): self.conn = connection self.index = index self.base = base - if base is not None: self.path = "/".join((base,) + index) + if base is not None: + if base == "/": self.path = "/" + "/".join(index) + else: self.path = "/".join((base,) + index) self.file = None if data or base is None: self.data = data else: self.data = self.conn.C.make_file_dict(self.path) @@ -623,7 +625,7 @@ class RPath(RORPath): self.setdata() if not self.lstat(): return # must have been deleted in meantime elif self.isdir(): - itm = RpathDeleter() + itm = IterTreeReducer(RpathDeleter, []) for dsrp in Select(DSRPath(None, self)).set_iter(): itm(dsrp.index, dsrp) itm.Finish() @@ -795,7 +797,8 @@ from lazy import * from selection import * from destructive_stepping import * -class RpathDeleter(IterTreeReducer): + +class RpathDeleter(ITRBranch): """Delete a directory. Called by RPath.delete()""" def start_process(self, index, dsrp): self.dsrp = dsrp |