Show More
@@ -2277,6 +2277,10 b' def _temprevlog(ui, orig, truncaterev):' | |||
|
2277 | 2277 | |
|
2278 | 2278 | if orig._inline: |
|
2279 | 2279 | raise error.Abort('not supporting inline revlog (yet)') |
|
2280 | revlogkwargs = {} | |
|
2281 | k = 'upperboundcomp' | |
|
2282 | if util.safehasattr(orig, k): | |
|
2283 | revlogkwargs[k] = getattr(orig, k) | |
|
2280 | 2284 | |
|
2281 | 2285 | origindexpath = orig.opener.join(orig.indexfile) |
|
2282 | 2286 | origdatapath = orig.opener.join(orig.datafile) |
@@ -2308,7 +2312,7 b' def _temprevlog(ui, orig, truncaterev):' | |||
|
2308 | 2312 | |
|
2309 | 2313 | dest = revlog.revlog(vfs, |
|
2310 | 2314 | indexfile=indexname, |
|
2311 | datafile=dataname) | |
|
2315 | datafile=dataname, **revlogkwargs) | |
|
2312 | 2316 | if dest._inline: |
|
2313 | 2317 | raise error.Abort('not supporting inline revlog (yet)') |
|
2314 | 2318 | # make sure internals are initialized |
@@ -1417,6 +1417,10 b' class manifestfulltextcache(util.lrucach' | |||
|
1417 | 1417 | self.write() |
|
1418 | 1418 | self._read = False |
|
1419 | 1419 | |
|
1420 | # and upper bound of what we expect from compression | |
|
1421 | # (real live value seems to be "3") | |
|
1422 | MAXCOMPRESSION = 10 | |
|
1423 | ||
|
1420 | 1424 | @interfaceutil.implementer(repository.imanifeststorage) |
|
1421 | 1425 | class manifestrevlog(object): |
|
1422 | 1426 | '''A revlog that stores manifest texts. This is responsible for caching the |
@@ -1467,7 +1471,8 b' class manifestrevlog(object):' | |||
|
1467 | 1471 | self._revlog = revlog.revlog(opener, indexfile, |
|
1468 | 1472 | # only root indexfile is cached |
|
1469 | 1473 | checkambig=not bool(tree), |
|
1470 |
mmaplargeindex=True |
|
|
1474 | mmaplargeindex=True, | |
|
1475 | upperboundcomp=MAXCOMPRESSION) | |
|
1471 | 1476 | |
|
1472 | 1477 | self.index = self._revlog.index |
|
1473 | 1478 | self.version = self._revlog.version |
@@ -334,15 +334,21 b' class revlog(object):' | |||
|
334 | 334 | configured threshold. |
|
335 | 335 | |
|
336 | 336 | If censorable is True, the revlog can have censored revisions. |
|
337 | ||
|
338 | If `upperboundcomp` is not None, this is the expected maximal gain from | |
|
339 | compression for the data content. | |
|
337 | 340 | """ |
|
338 | 341 | def __init__(self, opener, indexfile, datafile=None, checkambig=False, |
|
339 |
mmaplargeindex=False, censorable=False |
|
|
342 | mmaplargeindex=False, censorable=False, | |
|
343 | upperboundcomp=None): | |
|
340 | 344 | """ |
|
341 | 345 | create a revlog object |
|
342 | 346 | |
|
343 | 347 | opener is a function that abstracts the file opening operation |
|
344 | 348 | and can be used to implement COW semantics or the like. |
|
349 | ||
|
345 | 350 | """ |
|
351 | self.upperboundcomp = upperboundcomp | |
|
346 | 352 | self.indexfile = indexfile |
|
347 | 353 | self.datafile = datafile or (indexfile[:-2] + ".d") |
|
348 | 354 | self.opener = opener |
General Comments 0
You need to be logged in to leave comments.
Login now