360 yield item |
361 yield item |
361 |
362 |
362 # teach templater succsandmarkers is switched to (context, mapping) API |
363 # teach templater succsandmarkers is switched to (context, mapping) API |
363 succsandmarkers._requires = {'repo', 'ctx', 'templ'} |
364 succsandmarkers._requires = {'repo', 'ctx', 'templ'} |
364 |
365 |
|
366 def whyunstable(context, mapping): |
|
367 repo = context.resource(mapping, 'repo') |
|
368 ctx = context.resource(mapping, 'ctx') |
|
369 |
|
370 entries = obsutil.whyunstable(repo, ctx) |
|
371 for entry in entries: |
|
372 if entry.get('divergentnodes'): |
|
373 entry['divergentnodes'] = _siblings(entry['divergentnodes']) |
|
374 yield entry |
|
375 |
|
376 whyunstable._requires = {'repo', 'ctx', 'templ'} |
|
377 |
365 def commonentry(repo, ctx): |
378 def commonentry(repo, ctx): |
366 node = ctx.node() |
379 node = ctx.node() |
367 return { |
380 return { |
368 # TODO: perhaps ctx.changectx() should be assigned if ctx is a |
381 # TODO: perhaps ctx.changectx() should be assigned if ctx is a |
369 # filectx, but I'm not pretty sure if that would always work because |
382 # filectx, but I'm not pretty sure if that would always work because |
378 'extra': ctx.extra(), |
391 'extra': ctx.extra(), |
379 'phase': ctx.phasestr(), |
392 'phase': ctx.phasestr(), |
380 'obsolete': ctx.obsolete(), |
393 'obsolete': ctx.obsolete(), |
381 'succsandmarkers': succsandmarkers, |
394 'succsandmarkers': succsandmarkers, |
382 'instabilities': [{"instability": i} for i in ctx.instabilities()], |
395 'instabilities': [{"instability": i} for i in ctx.instabilities()], |
|
396 'whyunstable': whyunstable, |
383 'branch': nodebranchnodefault(ctx), |
397 'branch': nodebranchnodefault(ctx), |
384 'inbranch': nodeinbranch(repo, ctx), |
398 'inbranch': nodeinbranch(repo, ctx), |
385 'branches': nodebranchdict(repo, ctx), |
399 'branches': nodebranchdict(repo, ctx), |
386 'tags': nodetagsdict(repo, node), |
400 'tags': nodetagsdict(repo, node), |
387 'bookmarks': nodebookmarksdict(repo, node), |
401 'bookmarks': nodebookmarksdict(repo, node), |