summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup/increment.py
diff options
context:
space:
mode:
authorbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-12-21 06:35:08 +0000
committerbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-12-21 06:35:08 +0000
commite95a61773adb2f98499cf13ff543f4249ee38226 (patch)
tree835e2cc34386eb6c798026ebf5acd1ea30a9c537 /rdiff-backup/rdiff_backup/increment.py
parent5d3974dcd81e009293afe2372364983ad3810568 (diff)
downloadrdiff-backup-e95a61773adb2f98499cf13ff543f4249ee38226.tar.gz
Removed most destructive stepping operations
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@251 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/increment.py')
-rw-r--r--rdiff-backup/rdiff_backup/increment.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/rdiff-backup/rdiff_backup/increment.py b/rdiff-backup/rdiff_backup/increment.py
index baba9e1..5040c40 100644
--- a/rdiff-backup/rdiff_backup/increment.py
+++ b/rdiff-backup/rdiff_backup/increment.py
@@ -145,8 +145,6 @@ class IncrementITRB(StatsITRB):
4. Directory -> Normal file: Wait until the end, so we can
process all the files in the directory.
- Remember this object needs to be pickable.
-
"""
# Iff true, mirror file was a directory
mirror_isdirectory = None
@@ -299,7 +297,14 @@ class MirrorITRB(StatsITRB):
def start_process(self, index, diff_rorp, mirror_dsrp):
"""Initialize statistics and do actual writing to mirror"""
self.start_stats(mirror_dsrp)
- if diff_rorp and not diff_rorp.isplaceholder():
+ if (diff_rorp and diff_rorp.isdir() or
+ not diff_rorp and mirror_dsrp.isdir()):
+ # mirror_dsrp will end up as directory, update attribs later
+ if not diff_rorp: diff_rorp = mirror_dsrp.get_rorpath()
+ if not mirror_dsrp.isdir():
+ mirror_dsrp.delete()
+ mirror_dsrp.mkdir()
+ elif diff_rorp and not diff_rorp.isplaceholder():
RORPIter.patchonce_action(None, mirror_dsrp, diff_rorp).execute()
self.incpref = self.inc_rpath.new_index(index)
@@ -309,6 +314,7 @@ class MirrorITRB(StatsITRB):
"""Update statistics when leaving"""
self.end_stats(self.diff_rorp, self.mirror_dsrp)
if self.mirror_dsrp.isdir():
+ RPathStatic.copy_attribs(self.diff_rorp, self.mirror_dsrp)
MiscStats.write_dir_stats_line(self, self.mirror_dsrp.index)
def can_fast_process(self, index, diff_rorp, mirror_dsrp):