diff --git a/tests/test_zfsautobackup.py b/tests/test_zfsautobackup.py index 142224b..0a60477 100644 --- a/tests/test_zfsautobackup.py +++ b/tests/test_zfsautobackup.py @@ -549,7 +549,7 @@ test_target1/test_source2/fs2/sub@test-20101111000000 canmount - - with mocktime("20101111000003"): #--test should succeed by destroying incompatibles - self.assertFalse(ZfsAutobackup("test test_target1 --no-progress --verbose --allow-empty --destroy-incompatible --test".split(" ")).run()) + self.assertFalse(ZfsAutobackup("test test_target1 --no-progress --verbose --allow-empty --destroy-incompatible --test --debug".split(" ")).run()) with mocktime("20101111000003"): #should succeed by destroying incompatibles diff --git a/zfs_autobackup/ZfsDataset.py b/zfs_autobackup/ZfsDataset.py index fdb9358..872c0f3 100644 --- a/zfs_autobackup/ZfsDataset.py +++ b/zfs_autobackup/ZfsDataset.py @@ -1140,7 +1140,10 @@ class ZfsDataset: if source_common_snapshot: source_snapshot=self.find_next_snapshot(source_common_snapshot ) else: - source_snapshot=self.snapshots[0] + if self.snapshots: + source_snapshot=self.snapshots[0] + else: + source_snapshot=None while source_snapshot: # we want it? @@ -1243,7 +1246,7 @@ class ZfsDataset: target_dataset.handle_incompatible_snapshots(incompatible_target_snapshots, destroy_incompatible) # now actually transfer the snapshots, if we want - if no_send: + if no_send or len(target_transfers)==0: return # check if we can resume @@ -1270,7 +1273,6 @@ class ZfsDataset: source_snapshot=self.find_snapshot(target_snapshot) - # do the rollback, one time at first transfer if do_rollback: target_dataset.rollback()