mercurial/statichttprepo.py
changeset 51898 159854151f0f
parent 51884 f79f98733a5b
child 51899 e26a08563223
--- a/mercurial/statichttprepo.py	Thu Sep 26 02:58:50 2024 +0200
+++ b/mercurial/statichttprepo.py	Wed Sep 25 00:52:44 2024 -0400
@@ -192,9 +192,8 @@
 
             # check if it is a non-empty old-style repository
             try:
-                fp = self.vfs(b"00changelog.i")
-                fp.read(1)
-                fp.close()
+                with self.vfs(b"00changelog.i") as fp:
+                    fp.read(1)
             except FileNotFoundError:
                 # we do not care about empty old-style repositories here
                 msg = _(b"'%s' does not appear to be an hg repository") % path