mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
Open data files with read and write mode
Upstream Mercurial now reuses file handles for reads, so we need to open the dfh handle with a+ so it can be read from.
This commit is contained in:
parent
c21db7cde6
commit
6b151bffeb
6
hgsql.py
6
hgsql.py
@ -1079,7 +1079,7 @@ def addgroup(orig, self, bundle, linkmapper, transaction, addrevisioncb=None):
|
||||
else:
|
||||
transaction.add(self.indexfile, isize, r)
|
||||
transaction.add(self.datafile, end)
|
||||
dfh = self.opener(self.datafile, "a")
|
||||
dfh = self.opener(self.datafile, "a+")
|
||||
|
||||
try:
|
||||
# loop through our set of deltas
|
||||
@ -1206,8 +1206,8 @@ def addgroup(orig, self, bundle, linkmapper, transaction, addrevisioncb=None):
|
||||
# addrevision switched from inline to conventional
|
||||
# reopen the index
|
||||
ifh.close()
|
||||
dfh = self.opener(self.datafile, "a")
|
||||
ifh = self.opener(self.indexfile, "a")
|
||||
dfh = self.opener(self.datafile, "a+")
|
||||
ifh = self.opener(self.indexfile, "a+")
|
||||
finally:
|
||||
if dfh:
|
||||
dfh.close()
|
||||
|
Loading…
Reference in New Issue
Block a user