Mercurial > public > mercurial-scm > hg
comparison mercurial/revlog.py @ 51045: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 | f636103c4d67 |
children | 3977068c638c |
comparison
equal
deleted
inserted
replaced
51044:861fe9273d57 | 51045:59c6f99723b1 |
---|---|
994 | 994 |
995 def __index_write_fp(self): | 995 def __index_write_fp(self): |
996 # You should not use this directly and use `_writing` instead | 996 # You should not use this directly and use `_writing` instead |
997 try: | 997 try: |
998 f = self.opener( | 998 f = self.opener( |
999 self._indexfile, mode=b"r+", checkambig=self._checkambig | 999 self._indexfile, |
1000 mode=b"r+", | |
1001 checkambig=self.data_config.check_ambig, | |
1000 ) | 1002 ) |
1001 if self._docket is None: | 1003 if self._docket is None: |
1002 f.seek(0, os.SEEK_END) | 1004 f.seek(0, os.SEEK_END) |
1003 else: | 1005 else: |
1004 f.seek(self._docket.index_end, os.SEEK_SET) | 1006 f.seek(self._docket.index_end, os.SEEK_SET) |
1005 return f | 1007 return f |
1006 except FileNotFoundError: | 1008 except FileNotFoundError: |
1007 return self.opener( | 1009 return self.opener( |
1008 self._indexfile, mode=b"w+", checkambig=self._checkambig | 1010 self._indexfile, |
1011 mode=b"w+", | |
1012 checkambig=self.data_config.check_ambig, | |
1009 ) | 1013 ) |
1010 | 1014 |
1011 def __index_new_fp(self): | 1015 def __index_new_fp(self): |
1012 # You should not use this unless you are upgrading from inline revlog | 1016 # You should not use this unless you are upgrading from inline revlog |
1013 return self.opener( | 1017 return self.opener( |
1014 self._indexfile, | 1018 self._indexfile, |
1015 mode=b"w", | 1019 mode=b"w", |
1016 checkambig=self._checkambig, | 1020 checkambig=self.data_config.check_ambig, |
1017 atomictemp=True, | 1021 atomictemp=True, |
1018 ) | 1022 ) |
1019 | 1023 |
1020 def _datafp(self, mode=b'r'): | 1024 def _datafp(self, mode=b'r'): |
1021 """file object for the revlog's data file""" | 1025 """file object for the revlog's data file""" |