##// END OF EJS Templates
templater: fix cbor() filter to accept smartset...
Yuya Nishihara -
r45081:e3e44e6e default
parent child Browse files
Show More
@@ -18,6 +18,7 b' from . import ('
18 node,
18 node,
19 pycompat,
19 pycompat,
20 registrar,
20 registrar,
21 smartset,
21 templateutil,
22 templateutil,
22 url,
23 url,
23 util,
24 util,
@@ -108,6 +109,9 b' def basename(path):'
108 @templatefilter(b'cbor')
109 @templatefilter(b'cbor')
109 def cbor(obj):
110 def cbor(obj):
110 """Any object. Serializes the object to CBOR bytes."""
111 """Any object. Serializes the object to CBOR bytes."""
112 if isinstance(obj, smartset.abstractsmartset):
113 # cborutil is stricter about type than json() filter
114 obj = list(obj)
111 return b''.join(cborutil.streamencode(obj))
115 return b''.join(cborutil.streamencode(obj))
112
116
113
117
@@ -474,7 +474,7 b' class revslist(wrapped):'
474 return bool(self._revs)
474 return bool(self._revs)
475
475
476 def tovalue(self, context, mapping):
476 def tovalue(self, context, mapping):
477 return list(self._revs)
477 return self._revs
478
478
479
479
480 class _mappingsequence(wrapped):
480 class _mappingsequence(wrapped):
General Comments 0
You need to be logged in to leave comments. Login now