##// END OF EJS Templates
transaction: handle missing file in backupentries (instead of using entries)...
Pierre-Yves David -
r23278:aa194327 default
parent child Browse files
Show More
@@ -44,6 +44,7 def _playback(journal, report, opener, e
44 44
45 45 backupfiles = []
46 46 for f, b in backupentries:
47 if b:
47 48 filepath = opener.join(f)
48 49 backuppath = opener.join(b)
49 50 try:
@@ -52,6 +53,12 def _playback(journal, report, opener, e
52 53 except IOError:
53 54 report(_("failed to recover %s\n") % f)
54 55 raise
56 else:
57 try:
58 opener.unlink(f)
59 except (IOError, OSError), inst:
60 if inst.errno != errno.ENOENT:
61 raise
55 62
56 63 opener.unlink(journal)
57 64 backuppath = "%s.backupfiles" % journal
@@ -85,6 +92,7 class transaction(object):
85 92 self.entries = []
86 93 self.map = {}
87 94 # a list of ('path', 'backuppath') entries.
95 # if 'backuppath' is empty, no file existed at backup time
88 96 self._backupentries = []
89 97 self._backupmap = {}
90 98 self.journal = journal
@@ -179,8 +187,7 class transaction(object):
179 187 backuppath = self.opener.join(backupfile)
180 188 util.copyfiles(filepath, backuppath, hardlink=hardlink)
181 189 else:
182 self.add(file, 0)
183 return
190 backupfile = ''
184 191
185 192 self._backupentries.append((file, backupfile))
186 193 self._backupmap[file] = len(self._backupentries) - 1
@@ -331,6 +338,7 class transaction(object):
331 338 if self.opener.isfile(self._backupjournal):
332 339 self.opener.unlink(self._backupjournal)
333 340 for _f, b in self._backupentries:
341 if b:
334 342 self.opener.unlink(b)
335 343 self._backupentries = []
336 344 self.journal = None
General Comments 0
You need to be logged in to leave comments. Login now