mercurial/templatekw.py
changeset 37074 2891079fb0c0
parent 37071 d3f7930a9563
child 37084 f0b6fbea00cf
equal deleted inserted replaced
37073:44757e6dad93 37074:2891079fb0c0
   447     return getlatesttags(context, mapping)[1]
   447     return getlatesttags(context, mapping)[1]
   448 
   448 
   449 @templatekeyword('changessincelatesttag', requires={'repo', 'ctx', 'cache'})
   449 @templatekeyword('changessincelatesttag', requires={'repo', 'ctx', 'cache'})
   450 def showchangessincelatesttag(context, mapping):
   450 def showchangessincelatesttag(context, mapping):
   451     """Integer. All ancestors not in the latest tag."""
   451     """Integer. All ancestors not in the latest tag."""
   452     mapping = mapping.copy()
   452     tag = getlatesttags(context, mapping)[2][0]
   453     mapping['tag'] = getlatesttags(context, mapping)[2][0]
   453     mapping = context.overlaymap(mapping, {'tag': tag})
   454     return _showchangessincetag(context, mapping)
   454     return _showchangessincetag(context, mapping)
   455 
   455 
   456 def _showchangessincetag(context, mapping):
   456 def _showchangessincetag(context, mapping):
   457     repo = context.resource(mapping, 'repo')
   457     repo = context.resource(mapping, 'repo')
   458     ctx = context.resource(mapping, 'ctx')
   458     ctx = context.resource(mapping, 'ctx')
   478     if mnode is None:
   478     if mnode is None:
   479         # just avoid crash, we might want to use the 'ff...' hash in future
   479         # just avoid crash, we might want to use the 'ff...' hash in future
   480         return
   480         return
   481     mrev = repo.manifestlog._revlog.rev(mnode)
   481     mrev = repo.manifestlog._revlog.rev(mnode)
   482     mhex = hex(mnode)
   482     mhex = hex(mnode)
   483     mapping = mapping.copy()
   483     mapping = context.overlaymap(mapping, {'rev': mrev, 'node': mhex})
   484     mapping.update({'rev': mrev, 'node': mhex})
       
   485     f = context.process('manifest', mapping)
   484     f = context.process('manifest', mapping)
   486     # TODO: perhaps 'ctx' should be dropped from mapping because manifest
   485     # TODO: perhaps 'ctx' should be dropped from mapping because manifest
   487     # rev and node are completely different from changeset's.
   486     # rev and node are completely different from changeset's.
   488     return _mappable(f, None, f, lambda x: {'rev': mrev, 'node': mhex})
   487     return _mappable(f, None, f, lambda x: {'rev': mrev, 'node': mhex})
   489 
   488