comparison mercurial/revlog.py @ 5910:b9a830fa10f6

simplify revlog.strip interface and callers; add docstring Also, strip files only after the changelog and the manifest.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sat, 19 Jan 2008 18:01:16 -0200
parents f45f7390c1c5
children 08e0825b8106
comparison
equal deleted inserted replaced
5909:f45f7390c1c5 5910:b9a830fa10f6
1235 start = self.start(base) 1235 start = self.start(base)
1236 end = self.end(t) 1236 end = self.end(t)
1237 1237
1238 return node 1238 return node
1239 1239
1240 def strip(self, rev, minlink): 1240 def strip(self, minlink):
1241 """truncate the revlog on the first revision with a linkrev >= minlink
1242
1243 This function is called when we're stripping revision minlink and
1244 its descendants from the repository.
1245
1246 We have to remove all revisions with linkrev >= minlink, because
1247 the equivalent changelog revisions will be renumbered after the
1248 strip.
1249
1250 So we truncate the revlog on the first of these revisions, and
1251 trust that the caller has saved the revisions that shouldn't be
1252 removed and that it'll readd them after this truncation.
1253 """
1241 if self.count() == 0: 1254 if self.count() == 0:
1242 return 1255 return
1243 1256
1244 if isinstance(self.index, lazyindex): 1257 if isinstance(self.index, lazyindex):
1245 self._loadindexmap() 1258 self._loadindexmap()