diff -r 4367c46a89ee -r c96ed4029fda mercurial/templatefilters.py --- a/mercurial/templatefilters.py Wed Sep 07 14:56:45 2022 -0400 +++ b/mercurial/templatefilters.py Thu Sep 15 01:48:38 2022 +0200 @@ -390,6 +390,14 @@ return stringutil.person(author) +@templatefilter(b'reverse') +def reverse(list_): + """List. Reverses the order of list items.""" + if isinstance(list_, list): + return templateutil.hybridlist(list_[::-1], name=b'item') + raise error.ParseError(_(b'not reversible')) + + @templatefilter(b'revescape', intype=bytes) def revescape(text): """Any text. Escapes all "special" characters, except @.