templater: avoid recursive evaluation of string literals completely
Changeset
3d8bfe2ecf6d (released with 2.8.1) fixed "recursively
evaluate string literals as templates" problem (
issue4103) by
introducing "_evalifliteral()".
But some parts in template expressions below are still processed by
the combination of "compiletemplate()" and "runtemplate()", and may
cause same problem unexpectedly.
- 'init' and 'hang' of 'fill(text, width, init, hang)'
- 'expr' of 'sub(pat, repl, expr)'
- 'label' of 'label(label, expr)'
This patch processes them by "_evalifliteral()" instead of the
combination of "compiletemplate()" and "runtemplate()" to avoid
recursive evaluation of string literals completely.
status: improve explanation of ' ' status
a) it shows for states other than 'A'
b) it only shows with --copies
revset: changed methods in spanset to return ordered sets
Now __sub__ and __and__ can smartly return ordered lazysets.
revset: added order methods to lazyset classes
This will allow revsets to ask for an ordered set when possible to be able to
work lazily with it.
setdiscovery: document algorithms used
This is taken from:
http://programmers.stackexchange.com/questions/208998
And modified slightly.