##// END OF EJS Templates
templater: consistently join() string-like object per character (BC)...
Yuya Nishihara -
r38230:8bded7ea default
parent child Browse files
Show More
@@ -189,12 +189,8 b' class mappable(wrapped):'
189 yield self.tomap()
189 yield self.tomap()
190
190
191 def join(self, context, mapping, sep):
191 def join(self, context, mapping, sep):
192 # TODO: just copies the old behavior where a value was a generator
192 w = makewrapped(context, mapping, self._value)
193 # yielding one item, but reconsider about it. join() over a string
193 return w.join(context, mapping, sep)
194 # has no consistent result because a string may be a bytes, or a
195 # generator yielding an item, or a generator yielding multiple items.
196 # Preserving all of the current behaviors wouldn't make any sense.
197 return self.show(context, mapping)
198
194
199 def show(self, context, mapping):
195 def show(self, context, mapping):
200 # TODO: switch gen to (context, mapping) API?
196 # TODO: switch gen to (context, mapping) API?
@@ -3242,12 +3242,12 b' Test new-style inline templating of non-'
3242 $ hg log -R latesttag -l1 -T '{max(revset("0:9")) % "{rev}:{node|short}\n"}'
3242 $ hg log -R latesttag -l1 -T '{max(revset("0:9")) % "{rev}:{node|short}\n"}'
3243 9:fbc7cd862e9c
3243 9:fbc7cd862e9c
3244
3244
3245 Test manifest/get() can be join()-ed as before, though it's silly:
3245 Test manifest/get() can be join()-ed as string, though it's silly:
3246
3246
3247 $ hg log -R latesttag -r tip -T '{join(manifest, "")}\n'
3247 $ hg log -R latesttag -r tip -T '{join(manifest, ".")}\n'
3248 11:2bc6e9006ce2
3248 1.1.:.2.b.c.6.e.9.0.0.6.c.e.2
3249 $ hg log -R latesttag -r tip -T '{join(get(extras, "branch"), "")}\n'
3249 $ hg log -R latesttag -r tip -T '{join(get(extras, "branch"), ".")}\n'
3250 default
3250 d.e.f.a.u.l.t
3251
3251
3252 Test join() over string
3252 Test join() over string
3253
3253
General Comments 0
You need to be logged in to leave comments. Login now