mercurial/commit.py
changeset 45265 bd7515273fd6
parent 45264 39f4ec4039a8
child 45266 13814622b3b1
--- a/mercurial/commit.py	Thu Jul 23 23:40:59 2020 +0200
+++ b/mercurial/commit.py	Thu Jul 23 23:58:23 2020 +0200
@@ -63,14 +63,14 @@
     p1, p2 = ctx.p1(), ctx.p2()
     user = ctx.user()
 
-    writechangesetcopy, writefilecopymeta = _write_copy_meta(repo)
+    with repo.lock(), repo.transaction(b"commit") as tr:
+        writechangesetcopy, writefilecopymeta = _write_copy_meta(repo)
 
-    p1copies, p2copies = None, None
-    if writechangesetcopy:
-        p1copies = ctx.p1copies()
-        p2copies = ctx.p2copies()
-    filesadded, filesremoved = None, None
-    with repo.lock(), repo.transaction(b"commit") as tr:
+        p1copies, p2copies = None, None
+        if writechangesetcopy:
+            p1copies = ctx.p1copies()
+            p2copies = ctx.p2copies()
+        filesadded, filesremoved = None, None
         if ctx.manifestnode():
             # reuse an existing manifest revision
             repo.ui.debug(b'reusing known manifest\n')