Show More
@@ -188,7 +188,7 b' class transaction(object):' | |||||
188 | self.file.flush() |
|
188 | self.file.flush() | |
189 |
|
189 | |||
190 | @active |
|
190 | @active | |
191 |
def addbackup(self, file, hardlink=True, |
|
191 | def addbackup(self, file, hardlink=True, location=''): | |
192 | """Adds a backup of the file to the transaction |
|
192 | """Adds a backup of the file to the transaction | |
193 |
|
193 | |||
194 | Calling addbackup() creates a hardlink backup of the specified file |
|
194 | Calling addbackup() creates a hardlink backup of the specified file | |
@@ -205,11 +205,9 b' class transaction(object):' | |||||
205 | if file in self.map or file in self._backupmap: |
|
205 | if file in self.map or file in self._backupmap: | |
206 | return |
|
206 | return | |
207 | dirname, filename = os.path.split(file) |
|
207 | dirname, filename = os.path.split(file) | |
208 |
|
||||
209 | backupfilename = "%s.backup.%s" % (self.journal, filename) |
|
208 | backupfilename = "%s.backup.%s" % (self.journal, filename) | |
210 | backupfile = os.path.join(dirname, backupfilename) |
|
209 | backupfile = os.path.join(dirname, backupfilename) | |
211 | if vfs is None: |
|
210 | vfs = self._vfsmap[location] | |
212 | vfs = self.opener |
|
|||
213 | if vfs.exists(file): |
|
211 | if vfs.exists(file): | |
214 | filepath = vfs.join(file) |
|
212 | filepath = vfs.join(file) | |
215 | backuppath = vfs.join(backupfile) |
|
213 | backuppath = vfs.join(backupfile) | |
@@ -217,7 +215,7 b' class transaction(object):' | |||||
217 | else: |
|
215 | else: | |
218 | backupfile = '' |
|
216 | backupfile = '' | |
219 |
|
217 | |||
220 |
self._addbackupentry(( |
|
218 | self._addbackupentry((location, file, backupfile, False)) | |
221 |
|
219 | |||
222 | def _addbackupentry(self, entry): |
|
220 | def _addbackupentry(self, entry): | |
223 | """register a new backup entry and write it to disk""" |
|
221 | """register a new backup entry and write it to disk""" |
General Comments 0
You need to be logged in to leave comments.
Login now