Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/logcmdutil.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 | ec37df9042f9 |
children | 2523c0200df4 |
comparison
equal
deleted
inserted
replaced
38555:f83600efa1ca | 38556:f2f9bacf0587 |
---|---|
226 self.ui.write(columns['parent'] % scmutil.formatchangeid(pctx), | 226 self.ui.write(columns['parent'] % scmutil.formatchangeid(pctx), |
227 label=label) | 227 label=label) |
228 | 228 |
229 if self.ui.debugflag and rev is not None: | 229 if self.ui.debugflag and rev is not None: |
230 mnode = ctx.manifestnode() | 230 mnode = ctx.manifestnode() |
231 mrev = self.repo.manifestlog._revlog.rev(mnode) | 231 mrev = self.repo.manifestlog.rev(mnode) |
232 self.ui.write(columns['manifest'] | 232 self.ui.write(columns['manifest'] |
233 % scmutil.formatrevnode(self.ui, mrev, mnode), | 233 % scmutil.formatrevnode(self.ui, mrev, mnode), |
234 label='ui.debug log.manifest') | 234 label='ui.debug log.manifest') |
235 self.ui.write(columns['user'] % ctx.user(), label='log.user') | 235 self.ui.write(columns['user'] % ctx.user(), label='log.user') |
236 self.ui.write(columns['date'] % dateutil.datestr(ctx.date()), | 236 self.ui.write(columns['date'] % dateutil.datestr(ctx.date()), |