equal
deleted
inserted
replaced
412 backupfilename = b"%s.backup.%s" % (self._journal, filename) |
412 backupfilename = b"%s.backup.%s" % (self._journal, filename) |
413 backupfile = vfs.reljoin(dirname, backupfilename) |
413 backupfile = vfs.reljoin(dirname, backupfilename) |
414 if vfs.exists(file): |
414 if vfs.exists(file): |
415 filepath = vfs.join(file) |
415 filepath = vfs.join(file) |
416 backuppath = vfs.join(backupfile) |
416 backuppath = vfs.join(backupfile) |
|
417 # store encoding may result in different directory here. |
|
418 # so we have to ensure the destination directory exist |
|
419 final_dir_name = os.path.dirname(backuppath) |
|
420 util.makedirs(final_dir_name, mode=vfs.createmode, notindexed=True) |
|
421 # then we can copy the backup |
417 util.copyfile(filepath, backuppath, hardlink=hardlink) |
422 util.copyfile(filepath, backuppath, hardlink=hardlink) |
418 else: |
423 else: |
419 backupfile = b'' |
424 backupfile = b'' |
420 |
425 |
421 self._addbackupentry((location, file, backupfile, False)) |
426 self._addbackupentry((location, file, backupfile, False)) |