changeset 35093:bd2743936b56

context: add instabilities() 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 instabilities() method.
author Anton Shestakov <av6@dwimlabs.net>
date Sun, 19 Nov 2017 13:18:54 +0800
parents 1ac4c0887de4
children 38fe3fe4bbb6
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	Sun Nov 19 04:11:21 2017 +0100
+++ b/mercurial/context.py	Sun Nov 19 13:18:54 2017 +0800
@@ -821,6 +821,8 @@
         return self._changectx.phasestr()
     def obsolete(self):
         return self._changectx.obsolete()
+    def instabilities(self):
+        return self._changectx.instabilities()
     def manifest(self):
         return self._changectx.manifest()
     def changectx(self):
--- a/mercurial/hgweb/webutil.py	Sun Nov 19 04:11:21 2017 +0100
+++ b/mercurial/hgweb/webutil.py	Sun Nov 19 13:18:54 2017 +0800
@@ -362,6 +362,7 @@
         'extra': ctx.extra(),
         'phase': ctx.phasestr(),
         'obsolete': ctx.obsolete(),
+        'instabilities': [{"name": i} for i in ctx.instabilities()],
         'branch': nodebranchnodefault(ctx),
         'inbranch': nodeinbranch(repo, ctx),
         'branches': nodebranchdict(repo, ctx),