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.
Mon, 15 Jun 2015 16:08:22 -0700 phase: also overwrite phase's sets when replacing a phasecache
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 15 Jun 2015 16:08:22 -0700] rev 25594
phase: also overwrite phase's sets when replacing a phasecache We need to copy this new attributes around too. This fix an issue where phases data used by 'not public()' were not invalidated properly.
Mon, 15 Jun 2015 15:57:47 -0700 phase: invalidate the phase's set cache alongside the revs
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 15 Jun 2015 15:57:47 -0700] rev 25593
phase: invalidate the phase's set cache alongside the revs Invalidate was leaving set data around leading to possible bugs in revset.
Mon, 15 Jun 2015 15:52:52 -0700 phase: also copy phase's sets when copying phase cache
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 15 Jun 2015 15:52:52 -0700] rev 25592
phase: also copy phase's sets when copying phase cache We forgot to add such copy when we added the attributes.
Tue, 16 Jun 2015 16:15:15 -0400 verify: check the subrepository references in .hgsubstate
Matt Harbison <matt_harbison@yahoo.com> [Tue, 16 Jun 2015 16:15:15 -0400] rev 25591
verify: check the subrepository references in .hgsubstate While hopefully atypical, there are reasons that a subrepository revision can be lost that aren't covered by corruption of the .hgsubstate revlog. Such things can happen when a subrepo is amended, stripped or simply isn't pulled from upstream because the parent repo revision wasn't updated yet. There's no way to know if it is an error, but this will find potential problems sooner than when some random revision is updated. Until recently, convert made no attempt at rewriting the .hgsubstate file. The impetuous for this is to verify the conversion of some repositories, and this is orders of magnitude faster than a bash script from 0..tip that does an 'hg update -C $rev'. But it is equally useful to determine if everything has been pulled down before taking a thumb drive on the go. It feels somewhat wrong to leave this out of verifymod (mostly because the file is already read in there, and the final summary is printed before the subrepos are checked). But verifymod looks very low level, so importing subrepo stuff there seems more wrong.
Sun, 14 Jun 2015 22:04:17 -0400 context: override workingctx.hex() to avoid a crash
Matt Harbison <matt_harbison@yahoo.com> [Sun, 14 Jun 2015 22:04:17 -0400] rev 25590
context: override workingctx.hex() to avoid a crash Since node is None for workingctx, it can't use the base class implementation of 'hex(self.node())'. It doesn't appear that there are any current callers of this, but there will be when archive supports 'wdir()'. My first thought was to use "{p1node}+", but that would cause headaches elsewhere [1]. We should probably fix up localrepository.__getitem__ to accept this hash for consistency, as a followup. This works, if the full hash is specified: @@ -480,7 +480,7 @@ return dirstate.dirstate(self.vfs, self.ui, self.root, validate) def __getitem__(self, changeid): - if changeid is None: + if changeid is None or changeid == 'ff' * 20: return context.workingctx(self) if isinstance(changeid, slice): return [context.changectx(self, i) That differs from null, where it will accept any number of 0s, as long as it isn't ambiguous. [1] https://www.selenic.com/pipermail/mercurial-devel/2015-June/071166.html
Mon, 15 Jun 2015 16:50:31 -0400 convert: update 'intermediate-source' in the destination's extras dictionary
Matt Harbison <matt_harbison@yahoo.com> [Mon, 15 Jun 2015 16:50:31 -0400] rev 25589
convert: update 'intermediate-source' in the destination's extras dictionary
Tue, 16 Jun 2015 23:06:30 +0900 check-code: ban use of '[[ ]]' in tests
Yuya Nishihara <yuya@tcha.org> [Tue, 16 Jun 2015 23:06:30 +0900] rev 25588
check-code: ban use of '[[ ]]' in tests
Tue, 16 Jun 2015 22:47:05 +0900 test-fileset: remove bashism, use test instead of '[[ ]]'
Yuya Nishihara <yuya@tcha.org> [Tue, 16 Jun 2015 22:47:05 +0900] rev 25587
test-fileset: remove bashism, use test instead of '[[ ]]' Debian dash complains about it. $TESTTMP.sh: 213: $TESTTMP.sh: [[: not found
(0) -10000 -3000 -1000 -300 -100 -10 +10 +100 +300 +1000 +3000 +10000 tip