Skip to content
Snippets Groups Projects
Commit 4b6498c3 authored by Brian Moe's avatar Brian Moe
Browse files

2nd attempt to fix "Invalid cross-device link" bug.

parent 5379f211
No related branches found
No related tags found
No related merge requests found
......@@ -122,6 +122,12 @@ class VersionedFile(file):
def _repoint_symlink(self):
# re-point symlink to latest version
last_version = max(self.known_versions())
# XXX Another race condition. File will not exist for a very brief time.
os.unlink(self.fullname)
os.symlink(self._name_for_version(last_version), self.fullname)
return
# XXX This fails when renaming/mv-ing across devices.
# XXX assumption: tempfile name will remain unique after closing
tmp = tempfile.NamedTemporaryFile(delete=True)
tmpname = tmp.name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment