revlog: remove legacy usage of `_checkambig`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 10 Oct 2023 11:02:00 +0200
changeset 51053 59c6f99723b1
parent 51052 861fe9273d57
child 51054 3977068c638c
revlog: remove legacy usage of `_checkambig` All core code is now getting the setting from the DataConfig object.
mercurial/revlog.py
mercurial/revlogutils/rewrite.py
--- a/mercurial/revlog.py	Tue Oct 10 10:58:28 2023 +0200
+++ b/mercurial/revlog.py	Tue Oct 10 11:02:00 2023 +0200
@@ -996,7 +996,9 @@
         # You should not use this directly and use `_writing` instead
         try:
             f = self.opener(
-                self._indexfile, mode=b"r+", checkambig=self._checkambig
+                self._indexfile,
+                mode=b"r+",
+                checkambig=self.data_config.check_ambig,
             )
             if self._docket is None:
                 f.seek(0, os.SEEK_END)
@@ -1005,7 +1007,9 @@
             return f
         except FileNotFoundError:
             return self.opener(
-                self._indexfile, mode=b"w+", checkambig=self._checkambig
+                self._indexfile,
+                mode=b"w+",
+                checkambig=self.data_config.check_ambig,
             )
 
     def __index_new_fp(self):
@@ -1013,7 +1017,7 @@
         return self.opener(
             self._indexfile,
             mode=b"w",
-            checkambig=self._checkambig,
+            checkambig=self.data_config.check_ambig,
             atomictemp=True,
         )
 
--- a/mercurial/revlogutils/rewrite.py	Tue Oct 10 10:58:28 2023 +0200
+++ b/mercurial/revlogutils/rewrite.py	Tue Oct 10 11:02:00 2023 +0200
@@ -539,7 +539,7 @@
             util.copyfile(
                 rl.opener.join(index_file),
                 rl.opener.join(new_file_path),
-                checkambig=rl._checkambig,
+                checkambig=rl.data_config.check_ambig,
             )
 
             with rl.opener(new_file_path, mode=b"r+") as fp: