Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/webutil.py @ 30081:dd0ff715a82c
hgweb: make fctx.annotate a separated function so it could be wrapped
This patch moves "fctx.annotate" used by the "annotate" webcommand, along
with the diffopts to a separated function which takes a ui and a fctx.
So it could be replaced by other implementations which don't want to replace
the core "fctx.annotate" directly.
author | Jun Wu <quark@fb.com> |
---|---|
date | Sat, 08 Oct 2016 16:10:34 +0100 |
parents | ead25aa27a43 |
children | 11b8b740d54a |
comparison
equal
deleted
inserted
replaced
30080:33e8a5a00007 | 30081:dd0ff715a82c |
---|---|
161 d['file'] = s.path() | 161 d['file'] = s.path() |
162 yield d | 162 yield d |
163 | 163 |
164 def __len__(self): | 164 def __len__(self): |
165 return len(self.siblings) | 165 return len(self.siblings) |
166 | |
167 def annotate(fctx, ui): | |
168 diffopts = patch.difffeatureopts(ui, untrusted=True, | |
169 section='annotate', whitespace=True) | |
170 return fctx.annotate(follow=True, linenumber=True, diffopts=diffopts) | |
166 | 171 |
167 def parents(ctx, hide=None): | 172 def parents(ctx, hide=None): |
168 if isinstance(ctx, context.basefilectx): | 173 if isinstance(ctx, context.basefilectx): |
169 introrev = ctx.introrev() | 174 introrev = ctx.introrev() |
170 if ctx.changectx().rev() != introrev: | 175 if ctx.changectx().rev() != introrev: |