templater: provide loop counter as "index" keyword
This was originally written for JSON templating where we would have to be careful to not add extra comma, but seems generally useful. Inner loop started by % operator has its own counter.
Showing
- mercurial/cmdutil.py 3 additions, 0 deletionsmercurial/cmdutil.py
- mercurial/formatter.py 3 additions, 0 deletionsmercurial/formatter.py
- mercurial/templatekw.py 7 additions, 0 deletionsmercurial/templatekw.py
- mercurial/templater.py 2 additions, 1 deletionmercurial/templater.py
- tests/test-command-template.t 10 additions, 0 deletionstests/test-command-template.t
Loading
Please register or sign in to comment