349 raise ErrorResponse(HTTP_BAD_REQUEST, str(exc)) |
350 raise ErrorResponse(HTTP_BAD_REQUEST, str(exc)) |
350 |
351 |
351 def formatlinerange(fromline, toline): |
352 def formatlinerange(fromline, toline): |
352 return '%d:%d' % (fromline + 1, toline) |
353 return '%d:%d' % (fromline + 1, toline) |
353 |
354 |
|
355 def succsandmarkers(repo, ctx): |
|
356 return templatekw.showsuccsandmarkers(repo, ctx) |
|
357 |
354 def commonentry(repo, ctx): |
358 def commonentry(repo, ctx): |
355 node = ctx.node() |
359 node = ctx.node() |
356 return { |
360 return { |
357 'rev': ctx.rev(), |
361 'rev': ctx.rev(), |
358 'node': hex(node), |
362 'node': hex(node), |
360 'desc': ctx.description(), |
364 'desc': ctx.description(), |
361 'date': ctx.date(), |
365 'date': ctx.date(), |
362 'extra': ctx.extra(), |
366 'extra': ctx.extra(), |
363 'phase': ctx.phasestr(), |
367 'phase': ctx.phasestr(), |
364 'obsolete': ctx.obsolete(), |
368 'obsolete': ctx.obsolete(), |
|
369 'succsandmarkers': lambda **x: succsandmarkers(repo, ctx), |
365 'instabilities': [{"instability": i} for i in ctx.instabilities()], |
370 'instabilities': [{"instability": i} for i in ctx.instabilities()], |
366 'branch': nodebranchnodefault(ctx), |
371 'branch': nodebranchnodefault(ctx), |
367 'inbranch': nodeinbranch(repo, ctx), |
372 'inbranch': nodeinbranch(repo, ctx), |
368 'branches': nodebranchdict(repo, ctx), |
373 'branches': nodebranchdict(repo, ctx), |
369 'tags': nodetagsdict(repo, node), |
374 'tags': nodetagsdict(repo, node), |