##// END OF EJS Templates
templater: fix cbor() filter to accept smartset...
Yuya Nishihara -
r45466:e3e44e6e default
parent child Browse files
Show More
@@ -18,6 +18,7 b' from . import ('
18 18 node,
19 19 pycompat,
20 20 registrar,
21 smartset,
21 22 templateutil,
22 23 url,
23 24 util,
@@ -108,6 +109,9 b' def basename(path):'
108 109 @templatefilter(b'cbor')
109 110 def cbor(obj):
110 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 115 return b''.join(cborutil.streamencode(obj))
112 116
113 117
@@ -474,7 +474,7 b' class revslist(wrapped):'
474 474 return bool(self._revs)
475 475
476 476 def tovalue(self, context, mapping):
477 return list(self._revs)
477 return self._revs
478 478
479 479
480 480 class _mappingsequence(wrapped):
General Comments 0
You need to be logged in to leave comments. Login now