mercurial/revlog.py
changeset 8073 e8a28556a0a8
parent 8017 685ce2f7ee35
child 8150 bbc24c0753a0
equal deleted inserted replaced
8072:ecf7795479d5 8073:e8a28556a0a8
  1283                 dfh.close()
  1283                 dfh.close()
  1284             ifh.close()
  1284             ifh.close()
  1285 
  1285 
  1286         return node
  1286         return node
  1287 
  1287 
  1288     def strip(self, minlink):
  1288     def strip(self, minlink, transaction):
  1289         """truncate the revlog on the first revision with a linkrev >= minlink
  1289         """truncate the revlog on the first revision with a linkrev >= minlink
  1290 
  1290 
  1291         This function is called when we're stripping revision minlink and
  1291         This function is called when we're stripping revision minlink and
  1292         its descendants from the repository.
  1292         its descendants from the repository.
  1293 
  1293 
  1312             return
  1312             return
  1313 
  1313 
  1314         # first truncate the files on disk
  1314         # first truncate the files on disk
  1315         end = self.start(rev)
  1315         end = self.start(rev)
  1316         if not self._inline:
  1316         if not self._inline:
  1317             df = self.opener(self.datafile, "a")
  1317             transaction.add(self.datafile, end)
  1318             df.truncate(end)
       
  1319             end = rev * self._io.size
  1318             end = rev * self._io.size
  1320         else:
  1319         else:
  1321             end += rev * self._io.size
  1320             end += rev * self._io.size
  1322 
  1321 
  1323         indexf = self.opener(self.indexfile, "a")
  1322         transaction.add(self.indexfile, end)
  1324         indexf.truncate(end)
       
  1325 
  1323 
  1326         # then reset internal state in memory to forget those revisions
  1324         # then reset internal state in memory to forget those revisions
  1327         self._cache = None
  1325         self._cache = None
  1328         self._chunkcache = None
  1326         self._chunkcache = None
  1329         for x in xrange(rev, len(self)):
  1327         for x in xrange(rev, len(self)):