comparison mercurial/templatefilters.py @ 46113:59fa3890d40a

node: import symbols explicitly There is no point in lazy importing mercurial.node, it is used all over the place anyway. So consistently import the used symbols directly. Fix one file using symbols indirectly via mercurial.revlog. Differential Revision: https://phab.mercurial-scm.org/D9480
author Joerg Sonnenberger <joerg@bec.de>
date Tue, 01 Dec 2020 21:54:46 +0100
parents 89a2afe31e82
children d4ba4d51f85f
comparison
equal deleted inserted replaced
46112:d6afa9c149c3 46113:59fa3890d40a
10 import os 10 import os
11 import re 11 import re
12 import time 12 import time
13 13
14 from .i18n import _ 14 from .i18n import _
15 from .node import hex
15 from . import ( 16 from . import (
16 encoding, 17 encoding,
17 error, 18 error,
18 node,
19 pycompat, 19 pycompat,
20 registrar, 20 registrar,
21 smartset, 21 smartset,
22 templateutil, 22 templateutil,
23 url, 23 url,
278 @templatefilter(b'hex', intype=bytes) 278 @templatefilter(b'hex', intype=bytes)
279 def hexfilter(text): 279 def hexfilter(text):
280 """Any text. Convert a binary Mercurial node identifier into 280 """Any text. Convert a binary Mercurial node identifier into
281 its long hexadecimal representation. 281 its long hexadecimal representation.
282 """ 282 """
283 return node.hex(text) 283 return hex(text)
284 284
285 285
286 @templatefilter(b'hgdate', intype=templateutil.date) 286 @templatefilter(b'hgdate', intype=templateutil.date)
287 def hgdate(text): 287 def hgdate(text):
288 """Date. Returns the date as a pair of numbers: "1157407993 288 """Date. Returns the date as a pair of numbers: "1157407993