comparison mercurial/manifest.py @ 38555:f2f9bacf0587

manifest: define and implement rev() on manifestlog Various code is accessing repo.manifestlog._revlog - a private attribute. This bypasses our interface and makes it difficult to implement non-revlog manifest storage. This commit adds a rev() method to the manifestlog interface and class and teaches callers to use it. Ideally this method wouldn't exist, as very few consumers should need to resolve the revision number of a manifest. Again, the primary goal of interface work is to establish and use interfaces first and to improve them later. Differential Revision: https://phab.mercurial-scm.org/D3882
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 04 Jul 2018 12:12:49 -0700
parents c82ea938efbb
children 0db41eb0a3ac
comparison
equal deleted inserted replaced
38554:f83600efa1ca 38555:f2f9bacf0587
1346 1346
1347 def clearcaches(self): 1347 def clearcaches(self):
1348 self._dirmancache.clear() 1348 self._dirmancache.clear()
1349 self._revlog.clearcaches() 1349 self._revlog.clearcaches()
1350 1350
1351 def rev(self, node):
1352 return self._revlog.rev(node)
1353
1351 @interfaceutil.implementer(repository.imanifestrevisionwritable) 1354 @interfaceutil.implementer(repository.imanifestrevisionwritable)
1352 class memmanifestctx(object): 1355 class memmanifestctx(object):
1353 def __init__(self, manifestlog): 1356 def __init__(self, manifestlog):
1354 self._manifestlog = manifestlog 1357 self._manifestlog = manifestlog
1355 self._manifestdict = manifestdict() 1358 self._manifestdict = manifestdict()