Show More
@@ -621,7 +621,7 b' class revlog(object):' | |||
|
621 | 621 | indexdata = '' |
|
622 | 622 | self._initempty = True |
|
623 | 623 | try: |
|
624 |
f = self. |
|
|
624 | f = self._indexfp() | |
|
625 | 625 | if (mmapindexthreshold is not None and |
|
626 | 626 | self.opener.fstat(f).st_size >= mmapindexthreshold): |
|
627 | 627 | indexdata = util.buffer(util.mmapread(f)) |
@@ -682,6 +682,15 b' class revlog(object):' | |||
|
682 | 682 | def _compressor(self): |
|
683 | 683 | return util.compengines[self._compengine].revlogcompressor() |
|
684 | 684 | |
|
685 | def _indexfp(self, mode='r'): | |
|
686 | """file object for the revlog's index file""" | |
|
687 | args = {r'mode': mode} | |
|
688 | if mode != 'r': | |
|
689 | args[r'checkambig'] = self._checkambig | |
|
690 | if mode == 'w': | |
|
691 | args[r'atomictemp'] = True | |
|
692 | return self.opener(self.indexfile, **args) | |
|
693 | ||
|
685 | 694 | def _datafp(self, mode='r'): |
|
686 | 695 | """file object for the revlog's data file""" |
|
687 | 696 | return self.opener(self.datafile, mode=mode) |
@@ -1498,7 +1507,7 b' class revlog(object):' | |||
|
1498 | 1507 | closehandle = False |
|
1499 | 1508 | else: |
|
1500 | 1509 | if self._inline: |
|
1501 |
df = self. |
|
|
1510 | df = self._indexfp() | |
|
1502 | 1511 | else: |
|
1503 | 1512 | df = self._datafp() |
|
1504 | 1513 | closehandle = True |
@@ -1858,8 +1867,7 b' class revlog(object):' | |||
|
1858 | 1867 | finally: |
|
1859 | 1868 | df.close() |
|
1860 | 1869 | |
|
1861 | fp = self.opener(self.indexfile, 'w', atomictemp=True, | |
|
1862 | checkambig=self._checkambig) | |
|
1870 | fp = self._indexfp('w') | |
|
1863 | 1871 | self.version &= ~FLAG_INLINE_DATA |
|
1864 | 1872 | self._inline = False |
|
1865 | 1873 | for i in self: |
@@ -1928,7 +1936,7 b' class revlog(object):' | |||
|
1928 | 1936 | dfh = None |
|
1929 | 1937 | if not self._inline: |
|
1930 | 1938 | dfh = self._datafp("a+") |
|
1931 | ifh = self.opener(self.indexfile, "a+", checkambig=self._checkambig) | |
|
1939 | ifh = self._indexfp("a+") | |
|
1932 | 1940 | try: |
|
1933 | 1941 | return self._addrevision(node, rawtext, transaction, link, p1, p2, |
|
1934 | 1942 | flags, cachedelta, ifh, dfh, |
@@ -2157,7 +2165,7 b' class revlog(object):' | |||
|
2157 | 2165 | end = 0 |
|
2158 | 2166 | if r: |
|
2159 | 2167 | end = self.end(r - 1) |
|
2160 | ifh = self.opener(self.indexfile, "a+", checkambig=self._checkambig) | |
|
2168 | ifh = self._indexfp("a+") | |
|
2161 | 2169 | isize = r * self._io.size |
|
2162 | 2170 | if self._inline: |
|
2163 | 2171 | transaction.add(self.indexfile, end + isize, r) |
@@ -2229,8 +2237,7 b' class revlog(object):' | |||
|
2229 | 2237 | # reopen the index |
|
2230 | 2238 | ifh.close() |
|
2231 | 2239 | dfh = self._datafp("a+") |
|
2232 |
ifh = self. |
|
|
2233 | checkambig=self._checkambig) | |
|
2240 | ifh = self._indexfp("a+") | |
|
2234 | 2241 | finally: |
|
2235 | 2242 | if dfh: |
|
2236 | 2243 | dfh.close() |
General Comments 0
You need to be logged in to leave comments.
Login now