Sat, 13 Jun 2015 20:23:52 +0900 templater: drop strtoken argument from compiletemplate()
Yuya Nishihara <yuya@tcha.org> [Sat, 13 Jun 2015 20:23:52 +0900] rev 25598
templater: drop strtoken argument from compiletemplate() There's no "rawstring" template now.
Wed, 10 Jun 2015 21:44:43 +0900 templater: do not reevaluate rawstring as template (BC)
Yuya Nishihara <yuya@tcha.org> [Wed, 10 Jun 2015 21:44:43 +0900] rev 25597
templater: do not reevaluate rawstring as template (BC) The previous patch made 'string' is always interpreted as a template. So this patch removes the special handling of r'rawstring' instead. Now r'' disables template processing at all.
Sat, 13 Jun 2015 19:49:54 +0900 templater: take any string literals as template, but not for rawstring (BC)
Yuya Nishihara <yuya@tcha.org> [Sat, 13 Jun 2015 19:49:54 +0900] rev 25596
templater: take any string literals as template, but not for rawstring (BC) This patch series is intended to unify the interpretation of string literals. It is breaking change that boldly assumes a. string literal "..." never contains template-like fragment or it is intended to be a template b. we tend to use raw string literal r"..." for regexp pattern in which "{" should have different meaning Currently, we don't have a comprehensible rule how string literals are evaluated in template functions. For example, fill() takes "initialindent" and "hangindent" as templates, but not for "text", whereas "text" is a template in pad() function. date(date, fmt) diff(includepattern, excludepattern) fill(text, width, initialident: T, hangindent: T) get(dict, key) if(expr, then: T, else: T) ifcontains(search, thing, then: T, else: T) ifeq(expr1, expr2, then: T, else: T) indent(text, indentchars, firstline) join(list, sep) label(label: T, expr: T) pad(text: T, width, fillchar, right) revset(query, formatargs...]) rstdoc(text, style) shortest(node, minlength) startswith(pattern, text) strip(text, chars) sub(pattern, replacement, expression: T) word(number, text, separator) expr % template: T T: interpret "string" or r"rawstring" as template This patch series adjusts the rule as follows: a. string literal, '' or "", starts template processing (BC) b. raw string literal, r'' or r"", disables both \-escape and template processing (BC, done by subsequent patches) c. fragment not surrounded by {} is non-templated string "ccc{'aaa'}{r'bbb'}" ------------------ *: template --- c: string --- a: template --- b: rawstring Because this can eliminate the compilation of template arguments from the evaluation phase, "hg log -Tdefault" gets faster. % cd mozilla-central % LANG=C HGRCPATH=/dev/null hg log -Tdefault -r0:10000 --time > /dev/null before: real 4.870 secs (user 4.860+0.000 sys 0.010+0.000) after: real 3.480 secs (user 3.440+0.000 sys 0.030+0.000) Also, this will allow us to parse nested templates at once for better error indication.
Sat, 13 Jun 2015 00:15:22 +0900 templater: move runtemplate function out of buildmap/runmap pair
Yuya Nishihara <yuya@tcha.org> [Sat, 13 Jun 2015 00:15:22 +0900] rev 25595
templater: move runtemplate function out of buildmap/runmap pair The next patch will introduce buildtemplate function that should be defined near runtemplate. But I don't want to insert it between buildmap and runmap.
(0) -10000 -3000 -1000 -300 -100 -30 -10 -4 +4 +10 +30 +100 +300 +1000 +3000 +10000 tip