comparison mercurial/repository.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
920 """ 920 """
921 921
922 def clearcaches(): 922 def clearcaches():
923 """Clear caches associated with this collection.""" 923 """Clear caches associated with this collection."""
924 924
925 def rev(node):
926 """Obtain the revision number for a binary node.
927
928 Raises ``error.LookupError`` if the node is not known.
929 """
930
925 class completelocalrepository(interfaceutil.Interface): 931 class completelocalrepository(interfaceutil.Interface):
926 """Monolithic interface for local repositories. 932 """Monolithic interface for local repositories.
927 933
928 This currently captures the reality of things - not how things should be. 934 This currently captures the reality of things - not how things should be.
929 """ 935 """