Mercurial > public > mercurial-scm > hg-stable
diff mercurial/manifest.py @ 38556: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 |
line wrap: on
line diff
--- a/mercurial/manifest.py Mon Jul 02 11:14:13 2018 -0700 +++ b/mercurial/manifest.py Wed Jul 04 12:12:49 2018 -0700 @@ -1348,6 +1348,9 @@ self._dirmancache.clear() self._revlog.clearcaches() + def rev(self, node): + return self._revlog.rev(node) + @interfaceutil.implementer(repository.imanifestrevisionwritable) class memmanifestctx(object): def __init__(self, manifestlog):