revlog: use the method to check if the revlog is being written to
authorRaphaël Gomès <rgomes@octobus.net>
Wed, 19 Jun 2024 18:06:50 +0200
changeset 51858 2fd44b3dcc33
parent 51857 b04011ca6eff
child 51859 b60f25f00e94
revlog: use the method to check if the revlog is being written to This was probably fine, but it could become not fine at some point.
mercurial/revlog.py
--- a/mercurial/revlog.py	Wed Jun 19 17:26:06 2024 +0200
+++ b/mercurial/revlog.py	Wed Jun 19 18:06:50 2024 +0200
@@ -3160,7 +3160,7 @@
             raise error.RevlogError(
                 _(b"%s: attempt to add wdir revision") % self.display_id
             )
-        if self._inner._writinghandles is None:
+        if not self._inner.is_writing:
             msg = b'adding revision outside `revlog._writing` context'
             raise error.ProgrammingError(msg)