summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup/destructive_stepping.py
diff options
context:
space:
mode:
Diffstat (limited to 'rdiff-backup/rdiff_backup/destructive_stepping.py')
-rw-r--r--rdiff-backup/rdiff_backup/destructive_stepping.py68
1 files changed, 0 insertions, 68 deletions
diff --git a/rdiff-backup/rdiff_backup/destructive_stepping.py b/rdiff-backup/rdiff_backup/destructive_stepping.py
index c4b1191..c2cd011 100644
--- a/rdiff-backup/rdiff_backup/destructive_stepping.py
+++ b/rdiff-backup/rdiff_backup/destructive_stepping.py
@@ -180,72 +180,4 @@ class DestructiveStepping:
lambda dsrpath, x, y: dsrpath.write_changes(),
initial_state)
- def isexcluded(dsrp, source):
- """Return true if given DSRPath is excluded/ignored
-
- If source = 1, treat as source file, otherwise treat as
- destination file.
-
- """
- return None # this code is for the test suites only, use Select instead
- if Globals.exclude_device_files and dsrp.isdev(): return 1
-
- if source: exclude_regexps = Globals.exclude_regexps
- else: exclude_regexps = Globals.exclude_mirror_regexps
-
- for regexp in exclude_regexps:
- if regexp.match(dsrp.path):
- Log("Excluding %s" % dsrp.path, 6)
- return 1
- return None
-
- def Iterate_from(baserp, source, starting_index = None):
- """Iterate dsrps from baserp, skipping any matching exclude_regexps
-
- includes only dsrps with indicies greater than starting_index
- if starting_index is not None.
-
- """
- def helper_starting_from(dsrpath):
- """Like helper, but only start iterating after starting_index"""
- if dsrpath.index > starting_index:
- # Past starting_index, revert to normal helper
- for dsrp in helper(dsrpath): yield dsrp
- elif dsrpath.index == starting_index[:len(dsrpath.index)]:
- # May encounter starting index on this branch
- if (not DestructiveStepping.isexcluded(dsrpath, source) and
- not DestructiveStepping.initialize(dsrpath, source)):
- if dsrpath.isdir():
- dir_listing = dsrpath.listdir()
- dir_listing.sort()
- for filename in dir_listing:
- for dsrp in helper_starting_from(
- dsrpath.append(filename)):
- yield dsrp
-
- def helper(dsrpath):
- if (not DestructiveStepping.isexcluded(dsrpath, source) and
- not DestructiveStepping.initialize(dsrpath, source)):
- yield dsrpath
- if dsrpath.isdir():
- dir_listing = dsrpath.listdir()
- dir_listing.sort()
- for filename in dir_listing:
- for dsrp in helper(dsrpath.append(filename)):
- yield dsrp
-
- base_dsrpath = DSRPath(baserp.conn, baserp.base,
- baserp.index, baserp.data)
- if starting_index is None: return helper(base_dsrpath)
- else: return helper_starting_from(base_dsrpath)
-
- def Iterate_with_Finalizer(baserp, source):
- """Like Iterate_from, but finalize each dsrp afterwards"""
- finalize = DestructiveStepping.Finalizer()
- for dsrp in DestructiveStepping.Iterate_from(baserp, source):
- yield dsrp
- finalize(dsrp)
- finalize.getresult()
-
-
MakeStatic(DestructiveStepping)