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

3rd attempt to fix "Invalid cross-device link" bug.

parent 4b6498c3
No related branches found
No related tags found
No related merge requests found
...@@ -122,8 +122,13 @@ class VersionedFile(file): ...@@ -122,8 +122,13 @@ class VersionedFile(file):
def _repoint_symlink(self): def _repoint_symlink(self):
# re-point symlink to latest version # re-point symlink to latest version
last_version = max(self.known_versions()) last_version = max(self.known_versions())
# XXX Another race condition. File will not exist for a very brief time. # XXX Maybe ought to check that we are removing a symlink.
os.unlink(self.fullname) try:
# XXX Another race condition. File will not exist for a very brief time.
os.unlink(self.fullname)
except:
# Do not care if file does not exist.
pass
os.symlink(self._name_for_version(last_version), self.fullname) os.symlink(self._name_for_version(last_version), self.fullname)
return return
......
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