changeset 51053:59c6f99723b1

revlog: remove legacy usage of `_checkambig` All core code is now getting the setting from the DataConfig object.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 10 Oct 2023 11:02:00 +0200
parents 861fe9273d57
children 3977068c638c
files mercurial/revlog.py mercurial/revlogutils/rewrite.py
diffstat 2 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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: