Mercurial > hg
view tests/failfilemerge.py @ 28547:73d01cba5810
templater: expand list of parsed templates to template node
This patch eliminates a nested data structure other than the parsed tree.
('template', [(op, data), ..]) -> ('template', (op, data), ..)
New expanded tree can be processed by common parser functions. This change
will help implementing template aliases.
Because a (template ..) node should have at least one child node, an empty
template (template []) is mapped to (string ''). Also a trivial string
(template [(string ..)]) node is unwrapped to (string ..) at parsing phase,
instead of compiling phase.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 13 Feb 2016 23:20:47 +0900 |
parents | 61f4d59e9a0b |
children | 424c1632fffb |
line wrap: on
line source
# extension to emulate interupting filemerge._filemerge from __future__ import absolute_import from mercurial import ( filemerge, extensions, error, ) def failfilemerge(filemergefn, premerge, repo, mynode, orig, fcd, fco, fca, labels=None): raise error.Abort("^C") return filemergefn(premerge, repo, mynode, orig, fcd, fco, fca, labels) def extsetup(ui): extensions.wrapfunction(filemerge, '_filemerge', failfilemerge)