def __init__(self, ui, repo, patch, diffopts, mapfile, buffered): changeset_printer.__init__(self, ui, repo, patch, diffopts, buffered) formatnode = ui.debugflag and (lambda x: x) or (lambda x: x[:12]) self.t = templater.templater(mapfile, {'formatnode': formatnode}, cache={ 'parent': '{rev}:{node|formatnode} ', 'manifest': '{rev}:{node|formatnode}', 'filecopy': '{name} ({source})'})
def __init__(self, ui, repo, patch, diffopts, mapfile, buffered): changeset_printer.__init__(self, ui, repo, patch, diffopts, buffered) formatnode = ui.debugflag and (lambda x: x) or (lambda x: x[:12]) self.t = templater.templater(mapfile, {'formatnode': formatnode}, cache={ 'parent': '{rev}:{node|formatnode} ', 'manifest': '{rev}:{node|formatnode}', 'filecopy': '{name} ({source})' })
def __init__(self, ui, repo, patch, mapfile, buffered): changeset_printer.__init__(self, ui, repo, patch, buffered) filters = templatefilters.filters.copy() filters['formatnode'] = (ui.debugflag and (lambda x: x) or (lambda x: x[:12])) self.t = templater.templater(mapfile, filters, cache={ 'parent': '{rev}:{node|formatnode} ', 'manifest': '{rev}:{node|formatnode}', 'filecopy': '{name} ({source})'})
def __init__(self, ui, repo, patch, mapfile, buffered): changeset_printer.__init__(self, ui, repo, patch, buffered) filters = templatefilters.filters.copy() filters['formatnode'] = (ui.debugflag and (lambda x: x) or (lambda x: x[:12])) self.t = templater.templater(mapfile, filters, cache={ 'parent': '{rev}:{node|formatnode} ', 'manifest': '{rev}:{node|formatnode}', 'filecopy': '{name} ({source})' })
def __init__(self, ui, repo, patch, diffopts, mapfile, buffered): changeset_printer.__init__(self, ui, repo, patch, diffopts, buffered) formatnode = ui.debugflag and (lambda x: x) or (lambda x: x[:12]) defaulttempl = { 'parent': '{rev}:{node|formatnode} ', 'manifest': '{rev}:{node|formatnode}', 'file_copy': '{name} ({source})', 'extra': '{key}={value|stringescape}' } # filecopy is preserved for compatibility reasons defaulttempl['filecopy'] = defaulttempl['file_copy'] self.t = templater.templater(mapfile, {'formatnode': formatnode}, cache=defaulttempl) self.cache = {}
def _formatlabels(repo, fcd, fco, labels): """Formats the given labels using the conflict marker template. Returns a list of formatted labels. """ cd = fcd.changectx() co = fco.changectx() ui = repo.ui template = ui.config('ui', 'mergemarkertemplate', _defaultconflictmarker) template = templater.parsestring(template, quoted=False) tmpl = templater.templater(None, cache={ 'conflictmarker' : template }) pad = max(len(labels[0]), len(labels[1])) return [_formatconflictmarker(repo, cd, tmpl, labels[0], pad), _formatconflictmarker(repo, co, tmpl, labels[1], pad)]
def _formatlabels(repo, fcd, fco, labels): """Formats the given labels using the conflict marker template. Returns a list of formatted labels. """ cd = fcd.changectx() co = fco.changectx() ui = repo.ui template = ui.config('ui', 'mergemarkertemplate', _defaultconflictmarker) template = templater.parsestring(template, quoted=False) tmpl = templater.templater(None, cache={'conflictmarker': template}) pad = max(len(labels[0]), len(labels[1])) return [ _formatconflictmarker(repo, cd, tmpl, labels[0], pad), _formatconflictmarker(repo, co, tmpl, labels[1], pad) ]
def _formatlabels(repo, fcd, fco, fca, labels): """Formats the given labels using the conflict marker template. Returns a list of formatted labels. """ cd = fcd.changectx() co = fco.changectx() ca = fca.changectx() ui = repo.ui template = ui.config('ui', 'mergemarkertemplate', _defaultconflictmarker) tmpl = templater.templater(None, cache={'conflictmarker': template}) pad = max(len(l) for l in labels) newlabels = [ _formatconflictmarker(repo, cd, tmpl, labels[0], pad), _formatconflictmarker(repo, co, tmpl, labels[1], pad) ] if len(labels) > 2: newlabels.append(_formatconflictmarker(repo, ca, tmpl, labels[2], pad)) return newlabels
def _formatlabels(repo, fcd, fco, fca, labels): """Formats the given labels using the conflict marker template. Returns a list of formatted labels. """ cd = fcd.changectx() co = fco.changectx() ca = fca.changectx() ui = repo.ui template = ui.config("ui", "mergemarkertemplate", _defaultconflictmarker) tmpl = templater.templater(None, cache={"conflictmarker": template}) pad = max(len(l) for l in labels) newlabels = [ _formatconflictmarker(repo, cd, tmpl, labels[0], pad), _formatconflictmarker(repo, co, tmpl, labels[1], pad), ] if len(labels) > 2: newlabels.append(_formatconflictmarker(repo, ca, tmpl, labels[2], pad)) return newlabels
def gettemplater(ui, topic, spec): tmpl, mapfile = lookuptemplate(ui, topic, spec) t = templater.templater(mapfile, {}) if tmpl: t.cache[topic] = tmpl return t