comparison mercurial/filemerge.py @ 28954:f97a0bcfd7a1

templater: separate function to create templater from map file (API) New frommapfile() function will make it clear when template aliases will be loaded. They should be applied to command arguments and templates in hgrc, but not to map files. Otherwise, our stock styles and web templates (i.e map-file templates) could be modified unintentionally. Future patches will add "aliases" argument to __init__(), but not to frommapfile().
author Yuya Nishihara <yuya@tcha.org>
date Sun, 03 Apr 2016 23:26:48 +0900
parents 4fc640fd0026
children 78759f78a44e
comparison
equal deleted inserted replaced
28953:7f6b8ec691e3 28954:f97a0bcfd7a1
524 co = fco.changectx() 524 co = fco.changectx()
525 ca = fca.changectx() 525 ca = fca.changectx()
526 526
527 ui = repo.ui 527 ui = repo.ui
528 template = ui.config('ui', 'mergemarkertemplate', _defaultconflictmarker) 528 template = ui.config('ui', 'mergemarkertemplate', _defaultconflictmarker)
529 tmpl = templater.templater(None, cache={'conflictmarker': template}) 529 tmpl = templater.templater(cache={'conflictmarker': template})
530 530
531 pad = max(len(l) for l in labels) 531 pad = max(len(l) for l in labels)
532 532
533 newlabels = [_formatconflictmarker(repo, cd, tmpl, labels[0], pad), 533 newlabels = [_formatconflictmarker(repo, cd, tmpl, labels[0], pad),
534 _formatconflictmarker(repo, co, tmpl, labels[1], pad)] 534 _formatconflictmarker(repo, co, tmpl, labels[1], pad)]