mirror of
https://github.com/borgbackup/borg.git
synced 2026-05-28 04:03:21 -04:00
upgrader: fix / reformat comments
This commit is contained in:
parent
3c52f41132
commit
03975016c5
1 changed files with 4 additions and 6 deletions
|
|
@ -87,17 +87,15 @@ class AtticRepositoryUpgrader(Repository):
|
|||
segment.seek(0)
|
||||
segment.write(new_magic)
|
||||
else:
|
||||
# remove the hardlink and rewrite the file. this
|
||||
# works because our old file handle is still open
|
||||
# so even though the file is removed, we can still
|
||||
# read it until the file is closed.
|
||||
# rename the hardlink and rewrite the file. this works
|
||||
# because the file is still open. so even though the file
|
||||
# is renamed, we can still read it until it is closed.
|
||||
os.rename(filename, filename + '.tmp')
|
||||
with open(filename, 'wb') as new_segment:
|
||||
new_segment.write(new_magic)
|
||||
new_segment.write(segment.read())
|
||||
# the little dance with the .tmp file is necessary
|
||||
# because Windows won't allow overwriting an open
|
||||
# file.
|
||||
# because Windows won't allow overwriting an open file.
|
||||
os.unlink(filename + '.tmp')
|
||||
|
||||
def find_attic_keyfile(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue