mercurial/templatefuncs.py
changeset 47081 a407fe56d6e8
parent 47055 d55b71393907
child 48966 6000f5b25c9b
equal deleted inserted replaced
47080:54589bb9604d 47081:a407fe56d6e8
   762             # i18n: "shortest" is a keyword
   762             # i18n: "shortest" is a keyword
   763             _(b"shortest() expects an integer minlength"),
   763             _(b"shortest() expects an integer minlength"),
   764         )
   764         )
   765 
   765 
   766     repo = context.resource(mapping, b'repo')
   766     repo = context.resource(mapping, b'repo')
   767     if len(hexnode) > 40:
   767     hexnodelen = 2 * repo.nodeconstants.nodelen
       
   768     if len(hexnode) > hexnodelen:
   768         return hexnode
   769         return hexnode
   769     elif len(hexnode) == 40:
   770     elif len(hexnode) == hexnodelen:
   770         try:
   771         try:
   771             node = bin(hexnode)
   772             node = bin(hexnode)
   772         except TypeError:
   773         except TypeError:
   773             return hexnode
   774             return hexnode
   774     else:
   775     else: