changeset 50202:fef5bca96513

record: drop a now useless overlay that grab the lock Since 28dfb2df4ab9, commit grab the wlock and the extra layer grabing the lock in record is no longer needed. We clean up the code to make this simpler (and add a small assert for extra security against future change).
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 07 Feb 2023 10:16:25 +0100
parents 149f09ffef46
children ee7a7155de10
files mercurial/cmdutil.py
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Fri Feb 24 03:03:54 2023 +0100
+++ b/mercurial/cmdutil.py	Tue Feb 07 10:16:25 2023 +0100
@@ -469,6 +469,7 @@
         In the end we'll record interesting changes, and everything else
         will be left in place, so the user can continue working.
         """
+        assert repo.currentwlock() is not None
         if not opts.get(b'interactive-unshelve'):
             checkunfinished(repo, commit=True)
         wctx = repo[None]
@@ -669,11 +670,7 @@
             except OSError:
                 pass
 
-    def recordinwlock(ui, repo, message, match, opts):
-        with repo.wlock():
-            return recordfunc(ui, repo, message, match, opts)
-
-    return commit(ui, repo, recordinwlock, pats, opts)
+    return commit(ui, repo, recordfunc, pats, opts)
 
 
 class dirnode: