Skip to content
Snippets Groups Projects
Commit 1c518d69 authored by Pierre-Yves David's avatar Pierre-Yves David
Browse files

eol: make sure we always release the wlock when writing cache

If any exception were to happen after we acquired the wlock, we could leave it
unreleased. We move the wlock release in a 'finally:' close as it should be.
parent f5607b62
No related branches found
No related tags found
No related merge requests found
......@@ -360,7 +360,6 @@
# Write the cache to update mtime and cache .hgeol
with self.vfs("eol.cache", "w") as f:
f.write(hgeoldata)
wlock.release()
except error.LockUnavailable:
# If we cannot lock the repository and clear the
# dirstate, then a commit might not see all files
......@@ -368,6 +367,9 @@
# repository, then we can also not make a commit,
# so ignore the error.
pass
finally:
if wlock is not None:
wlock.release()
def commitctx(self, ctx, haserror=False):
for f in sorted(ctx.added() + ctx.modified()):
......
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