Commit e6658f1a authored by ben's avatar ben

Minor cleanups in Hardlink.py and robust.py, killtest update to lazy.py


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@197 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent ceea9002
......@@ -91,7 +91,7 @@ def rorp_eq(src_rorp, dest_rorp):
indicies.
"""
assert src_rorp.index == dest_rorp.index
if not src_rorp.index == dest_rorp.index: return None
if (not src_rorp.isreg() or not dest_rorp.isreg() or
src_rorp.getnumlinks() == dest_rorp.getnumlinks() == 1):
return 1 # Hard links don't apply
......
......@@ -234,18 +234,18 @@ class IterTreeReducer:
branches[-1].branch_process(to_be_finished)
else: return 1
def add_branch(self):
def add_branch(self, index):
"""Return branch of type self.branch_class, add to branch list"""
branch = self.branch_class(*self.branch_args)
branch.base_index = index
self.branches.append(branch)
return branch
def process_w_branch(self, index, branch, args):
def process_w_branch(self, branch, args):
"""Run start_process on latest branch"""
Robust.check_common_error(branch.on_error,
branch.start_process, args)
if not branch.caught_exception: branch.start_successful = 1
branch.base_index = index
def Finish(self):
"""Call at end of sequence to tie everything up"""
......@@ -268,7 +268,8 @@ class IterTreeReducer:
"""
index = args[0]
if self.index is None:
self.process_w_branch(index, self.root_branch, args)
self.root_branch.base_index = index
self.process_w_branch(self.root_branch, args)
self.index = index
return 1
......@@ -283,8 +284,8 @@ class IterTreeReducer:
if last_branch.can_fast_process(*args):
last_branch.fast_process(*args)
else:
branch = self.add_branch()
self.process_w_branch(index, branch, args)
branch = self.add_branch(index)
self.process_w_branch(branch, args)
else: last_branch.log_prev_error(index)
self.index = index
......
......@@ -575,10 +575,7 @@ class Resume:
mirror = None
last_index = cls.sym_to_index(increment_sym)
if checkpoint_rp:
result = cls.unpickle_checkpoint(checkpoint_rp)
sys.stderr.write("#############" + str(result) + "\n")
#ITR, finalizer = cls.unpickle_checkpoint(checkpoint_rp)
ITR, finalizer = result
ITR, finalizer = cls.unpickle_checkpoint(checkpoint_rp)
elif mirror_sym:
mirror = 1
last_index = cls.sym_to_index(mirror_sym)
......
......@@ -91,7 +91,7 @@ def rorp_eq(src_rorp, dest_rorp):
indicies.
"""
assert src_rorp.index == dest_rorp.index
if not src_rorp.index == dest_rorp.index: return None
if (not src_rorp.isreg() or not dest_rorp.isreg() or
src_rorp.getnumlinks() == dest_rorp.getnumlinks() == 1):
return 1 # Hard links don't apply
......
......@@ -234,18 +234,18 @@ class IterTreeReducer:
branches[-1].branch_process(to_be_finished)
else: return 1
def add_branch(self):
def add_branch(self, index):
"""Return branch of type self.branch_class, add to branch list"""
branch = self.branch_class(*self.branch_args)
branch.base_index = index
self.branches.append(branch)
return branch
def process_w_branch(self, index, branch, args):
def process_w_branch(self, branch, args):
"""Run start_process on latest branch"""
Robust.check_common_error(branch.on_error,
branch.start_process, args)
if not branch.caught_exception: branch.start_successful = 1
branch.base_index = index
def Finish(self):
"""Call at end of sequence to tie everything up"""
......@@ -268,7 +268,8 @@ class IterTreeReducer:
"""
index = args[0]
if self.index is None:
self.process_w_branch(index, self.root_branch, args)
self.root_branch.base_index = index
self.process_w_branch(self.root_branch, args)
self.index = index
return 1
......@@ -283,8 +284,8 @@ class IterTreeReducer:
if last_branch.can_fast_process(*args):
last_branch.fast_process(*args)
else:
branch = self.add_branch()
self.process_w_branch(index, branch, args)
branch = self.add_branch(index)
self.process_w_branch(branch, args)
else: last_branch.log_prev_error(index)
self.index = index
......
......@@ -575,10 +575,7 @@ class Resume:
mirror = None
last_index = cls.sym_to_index(increment_sym)
if checkpoint_rp:
result = cls.unpickle_checkpoint(checkpoint_rp)
sys.stderr.write("#############" + str(result) + "\n")
#ITR, finalizer = cls.unpickle_checkpoint(checkpoint_rp)
ITR, finalizer = result
ITR, finalizer = cls.unpickle_checkpoint(checkpoint_rp)
elif mirror_sym:
mirror = 1
last_index = cls.sym_to_index(mirror_sym)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment