Mercurial > public > mercurial-scm > hg
comparison mercurial/filemerge.py @ 28955:78759f78a44e
templater: factor out function that creates templater from string template
This function will host loading of template aliases. It is not defined at
templater, but at formatter, since formatter is the module handling ui stuff
in front of templater.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 10 Apr 2016 17:23:09 +0900 |
parents | f97a0bcfd7a1 |
children | 99b50346b750 |
comparison
equal
deleted
inserted
replaced
28954:f97a0bcfd7a1 | 28955:78759f78a44e |
---|---|
15 from .i18n import _ | 15 from .i18n import _ |
16 from .node import nullid, short | 16 from .node import nullid, short |
17 | 17 |
18 from . import ( | 18 from . import ( |
19 error, | 19 error, |
20 formatter, | |
20 match, | 21 match, |
21 scmutil, | 22 scmutil, |
22 simplemerge, | 23 simplemerge, |
23 tagmerge, | 24 tagmerge, |
24 templatekw, | 25 templatekw, |
524 co = fco.changectx() | 525 co = fco.changectx() |
525 ca = fca.changectx() | 526 ca = fca.changectx() |
526 | 527 |
527 ui = repo.ui | 528 ui = repo.ui |
528 template = ui.config('ui', 'mergemarkertemplate', _defaultconflictmarker) | 529 template = ui.config('ui', 'mergemarkertemplate', _defaultconflictmarker) |
529 tmpl = templater.templater(cache={'conflictmarker': template}) | 530 tmpl = formatter.maketemplater(ui, 'conflictmarker', template) |
530 | 531 |
531 pad = max(len(l) for l in labels) | 532 pad = max(len(l) for l in labels) |
532 | 533 |
533 newlabels = [_formatconflictmarker(repo, cd, tmpl, labels[0], pad), | 534 newlabels = [_formatconflictmarker(repo, cd, tmpl, labels[0], pad), |
534 _formatconflictmarker(repo, co, tmpl, labels[1], pad)] | 535 _formatconflictmarker(repo, co, tmpl, labels[1], pad)] |