Ejemplo n.º 1
0
 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})'})
Ejemplo n.º 2
0
 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})'
                                  })
Ejemplo n.º 3
0
 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})'})
Ejemplo n.º 4
0
 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})'
                                  })
Ejemplo n.º 5
0
 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 = {}
Ejemplo n.º 6
0
 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 = {}
Ejemplo n.º 7
0
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)]
Ejemplo n.º 8
0
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)
    ]
Ejemplo n.º 9
0
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
Ejemplo n.º 10
0
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
Ejemplo n.º 11
0
def gettemplater(ui, topic, spec):
    tmpl, mapfile = lookuptemplate(ui, topic, spec)
    t = templater.templater(mapfile, {})
    if tmpl:
        t.cache[topic] = tmpl
    return t
Ejemplo n.º 12
0
def gettemplater(ui, topic, spec):
    tmpl, mapfile = lookuptemplate(ui, topic, spec)
    t = templater.templater(mapfile, {})
    if tmpl:
        t.cache[topic] = tmpl
    return t