changeset 35111:a9454beb9dd8

context: add obsolete() method to basefilectx This method is now used in webutils.commonentry(), which adds common data items (commit hash, author, date, etc) for rendering changesets in hgweb. Usually, commonentry() is given a changectx as ctx; but in views related to files (e.g. file view, diff, annotate) it's replaced by a filectx, so the latter also needs to have obsolete() method.
author Anton Shestakov <av6@dwimlabs.net>
date Sat, 18 Nov 2017 11:58:57 +0800
parents dd000a958364
children 69ea10d5b00c
files mercurial/context.py mercurial/hgweb/webutil.py
diffstat 2 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Sat Nov 18 13:00:47 2017 +0800
+++ b/mercurial/context.py	Sat Nov 18 11:58:57 2017 +0800
@@ -819,6 +819,8 @@
         return self._changectx.phase()
     def phasestr(self):
         return self._changectx.phasestr()
+    def obsolete(self):
+        return self._changectx.obsolete()
     def manifest(self):
         return self._changectx.manifest()
     def changectx(self):
--- a/mercurial/hgweb/webutil.py	Sat Nov 18 13:00:47 2017 +0800
+++ b/mercurial/hgweb/webutil.py	Sat Nov 18 11:58:57 2017 +0800
@@ -361,6 +361,7 @@
         'date': ctx.date(),
         'extra': ctx.extra(),
         'phase': ctx.phasestr(),
+        'obsolete': ctx.obsolete(),
         'branch': nodebranchnodefault(ctx),
         'inbranch': nodeinbranch(repo, ctx),
         'branches': nodebranchdict(repo, ctx),