--- a/mercurial/templateutil.py Sat Mar 17 21:42:27 2018 +0900 +++ b/mercurial/templateutil.py Tue Mar 20 23:16:28 2018 +0900 @@ -558,6 +558,6 @@ for x in itemiter: if first: first = False - else: + elif sep: yield sep yield x