Comments
Patch
@@ -260,19 +260,23 @@ class transaction(object):
"""
# For now, we are unable to do proper backup and restore of custom vfs
# but for bookmarks that are handled outside this mechanism.
self._filegenerators[genid] = (order, filenames, genfunc, location)
- def _generatefiles(self):
+ def _generatefiles(self, suffix=''):
# write files registered for generation
for entry in sorted(self._filegenerators.values()):
order, filenames, genfunc, location = entry
vfs = self._vfsmap[location]
files = []
try:
for name in filenames:
- self.addbackup(name, location=location)
+ name += suffix
+ if suffix:
+ self.registertmp(name, location=location)
+ else:
+ self.addbackup(name, location=location)
files.append(vfs(name, 'w', atomictemp=True))
genfunc(*files)
finally:
for f in files:
f.close()