##// END OF EJS Templates
hgweb: make fctx.annotate a separated function so it could be wrapped...
Jun Wu -
r30081:dd0ff715 default
parent child Browse files
Show More
@@ -31,7 +31,6 b' from .. import ('
31 31 encoding,
32 32 error,
33 33 graphmod,
34 patch,
35 34 revset,
36 35 scmutil,
37 36 templatefilters,
@@ -861,8 +860,6 b' def annotate(web, req, tmpl):'
861 860 fctx = webutil.filectx(web.repo, req)
862 861 f = fctx.path()
863 862 parity = paritygen(web.stripecount)
864 diffopts = patch.difffeatureopts(web.repo.ui, untrusted=True,
865 section='annotate', whitespace=True)
866 863
867 864 def parents(f):
868 865 for p in f.parents():
@@ -877,8 +874,8 b' def annotate(web, req, tmpl):'
877 874 or 'application/octet-stream')
878 875 lines = [((fctx.filectx(fctx.filerev()), 1), '(binary:%s)' % mt)]
879 876 else:
880 lines = fctx.annotate(follow=True, linenumber=True,
881 diffopts=diffopts)
877 lines = webutil.annotate(fctx, web.repo.ui)
878
882 879 previousrev = None
883 880 blockparitygen = paritygen(1)
884 881 for lineno, ((f, targetline), l) in enumerate(lines):
@@ -164,6 +164,11 b' class _siblings(object):'
164 164 def __len__(self):
165 165 return len(self.siblings)
166 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)
171
167 172 def parents(ctx, hide=None):
168 173 if isinstance(ctx, context.basefilectx):
169 174 introrev = ctx.introrev()
General Comments 0
You need to be logged in to leave comments. Login now