filelog: open the writing context a bit earlier in `addgroup` stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sat, 07 Aug 2021 14:13:53 +0200
branchstable
changeset 47820 436932c2cfaa
parent 47819 c02ce6def30c
child 47821 c30ca163b45e
filelog: open the writing context a bit earlier in `addgroup` This is a small change made ahead of the next patch for clarification. Differential Revision: https://phab.mercurial-scm.org/D11269
mercurial/filelog.py
--- a/mercurial/filelog.py	Sat Aug 07 12:39:01 2021 +0200
+++ b/mercurial/filelog.py	Sat Aug 07 14:13:53 2021 +0200
@@ -157,13 +157,14 @@
                 )
             )
 
-        return self._revlog.addgroup(
-            deltas,
-            linkmapper,
-            transaction,
-            addrevisioncb=addrevisioncb,
-            duplicaterevisioncb=duplicaterevisioncb,
-        )
+        with self._revlog._writing(transaction):
+            return self._revlog.addgroup(
+                deltas,
+                linkmapper,
+                transaction,
+                addrevisioncb=addrevisioncb,
+                duplicaterevisioncb=duplicaterevisioncb,
+            )
 
     def getstrippoint(self, minlink):
         return self._revlog.getstrippoint(minlink)