Mercurial > public > mercurial-scm > hg
comparison mercurial/hgweb/webutil.py @ 36594:59ee648870a7
templatekw: switch obsfate-related template keywords to new API
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 25 Feb 2018 19:05:57 +0900 |
parents | 7937850a523d |
children | a2fa51415ddc |
comparison
equal
deleted
inserted
replaced
36593:900e5ee44307 | 36594:59ee648870a7 |
---|---|
350 raise ErrorResponse(HTTP_BAD_REQUEST, pycompat.bytestr(exc)) | 350 raise ErrorResponse(HTTP_BAD_REQUEST, pycompat.bytestr(exc)) |
351 | 351 |
352 def formatlinerange(fromline, toline): | 352 def formatlinerange(fromline, toline): |
353 return '%d:%d' % (fromline + 1, toline) | 353 return '%d:%d' % (fromline + 1, toline) |
354 | 354 |
355 def succsandmarkers(repo, ctx, **args): | 355 def succsandmarkers(context, mapping): |
356 for item in templatekw.showsuccsandmarkers(repo, ctx, **args): | 356 repo = context.resource(mapping, 'repo') |
357 for item in templatekw.showsuccsandmarkers(context, mapping): | |
357 item['successors'] = _siblings(repo[successor] | 358 item['successors'] = _siblings(repo[successor] |
358 for successor in item['successors']) | 359 for successor in item['successors']) |
359 yield item | 360 yield item |
361 | |
362 # teach templater succsandmarkers is switched to (context, mapping) API | |
363 succsandmarkers._requires = {'repo', 'ctx', 'templ'} | |
360 | 364 |
361 def commonentry(repo, ctx): | 365 def commonentry(repo, ctx): |
362 node = ctx.node() | 366 node = ctx.node() |
363 return { | 367 return { |
364 # TODO: perhaps ctx.changectx() should be assigned if ctx is a | 368 # TODO: perhaps ctx.changectx() should be assigned if ctx is a |