mercurial/templatefuncs.py
changeset 37865 da083d9fafab
parent 37859 66dc9db6ed2c
child 37931 faa41fd282d1
equal deleted inserted replaced
37864:890bdf0e33c8 37865:da083d9fafab
   606             node = wdirid
   606             node = wdirid
   607         except error.LookupError:
   607         except error.LookupError:
   608             return hexnode
   608             return hexnode
   609         if not node:
   609         if not node:
   610             return hexnode
   610             return hexnode
   611     return scmutil.shortesthexnodeidprefix(repo, node, minlength)
   611     try:
       
   612         return scmutil.shortesthexnodeidprefix(repo, node, minlength)
       
   613     except error.RepoLookupError:
       
   614         return hexnode
   612 
   615 
   613 @templatefunc('strip(text[, chars])')
   616 @templatefunc('strip(text[, chars])')
   614 def strip(context, mapping, args):
   617 def strip(context, mapping, args):
   615     """Strip characters from a string. By default,
   618     """Strip characters from a string. By default,
   616     strips all leading and trailing whitespace."""
   619     strips all leading and trailing whitespace."""