Show More
@@ -1040,8 +1040,9 b' class bugzilla(object):' | |||||
1040 | if not mapfile and not tmpl: |
|
1040 | if not mapfile and not tmpl: | |
1041 | tmpl = _('changeset {node|short} in repo {root} refers ' |
|
1041 | tmpl = _('changeset {node|short} in repo {root} refers ' | |
1042 | 'to bug {bug}.\ndetails:\n\t{desc|tabindent}') |
|
1042 | 'to bug {bug}.\ndetails:\n\t{desc|tabindent}') | |
1043 | t = cmdutil.changeset_templater(self.ui, self.repo, |
|
1043 | spec = cmdutil.logtemplatespec(tmpl, mapfile) | |
1044 | False, None, tmpl, mapfile, False) |
|
1044 | t = cmdutil.changeset_templater(self.ui, self.repo, spec, | |
|
1045 | False, None, False) | |||
1045 | self.ui.pushbuffer() |
|
1046 | self.ui.pushbuffer() | |
1046 | t.show(ctx, changes=ctx.changeset(), |
|
1047 | t.show(ctx, changes=ctx.changeset(), | |
1047 | bug=str(bugid), |
|
1048 | bug=str(bugid), |
@@ -203,8 +203,9 b' class notifier(object):' | |||||
203 | mapfile = self.ui.config('notify', 'style') |
|
203 | mapfile = self.ui.config('notify', 'style') | |
204 | if not mapfile and not template: |
|
204 | if not mapfile and not template: | |
205 | template = deftemplates.get(hooktype) or single_template |
|
205 | template = deftemplates.get(hooktype) or single_template | |
206 | self.t = cmdutil.changeset_templater(self.ui, self.repo, False, None, |
|
206 | spec = cmdutil.logtemplatespec(template, mapfile) | |
207 | template, mapfile, False) |
|
207 | self.t = cmdutil.changeset_templater(self.ui, self.repo, spec, | |
|
208 | False, None, False) | |||
208 |
|
209 | |||
209 | def strip(self, path): |
|
210 | def strip(self, path): | |
210 | '''strip leading slashes from local path, turn into web-safe path.''' |
|
211 | '''strip leading slashes from local path, turn into web-safe path.''' |
@@ -1578,9 +1578,8 b' class jsonchangeset(changeset_printer):' | |||||
1578 | class changeset_templater(changeset_printer): |
|
1578 | class changeset_templater(changeset_printer): | |
1579 | '''format changeset information.''' |
|
1579 | '''format changeset information.''' | |
1580 |
|
1580 | |||
1581 |
def __init__(self, ui, repo, matchfn, diffopts, |
|
1581 | def __init__(self, ui, repo, tmplspec, matchfn, diffopts, buffered): | |
1582 | changeset_printer.__init__(self, ui, repo, matchfn, diffopts, buffered) |
|
1582 | changeset_printer.__init__(self, ui, repo, matchfn, diffopts, buffered) | |
1583 | tmplspec = logtemplatespec(tmpl, mapfile) |
|
|||
1584 | self.t = formatter.loadtemplater(ui, 'changeset', tmplspec, |
|
1583 | self.t = formatter.loadtemplater(ui, 'changeset', tmplspec, | |
1585 | cache=templatekw.defaulttempl) |
|
1584 | cache=templatekw.defaulttempl) | |
1586 | self._counter = itertools.count() |
|
1585 | self._counter = itertools.count() | |
@@ -1679,8 +1678,9 b' def _lookuplogtemplate(ui, tmpl, style):' | |||||
1679 |
|
1678 | |||
1680 | def makelogtemplater(ui, repo, tmpl, buffered=False): |
|
1679 | def makelogtemplater(ui, repo, tmpl, buffered=False): | |
1681 | """Create a changeset_templater from a literal template 'tmpl'""" |
|
1680 | """Create a changeset_templater from a literal template 'tmpl'""" | |
1682 | return changeset_templater(ui, repo, matchfn=None, diffopts={}, |
|
1681 | spec = logtemplatespec(tmpl, None) | |
1683 | tmpl=tmpl, mapfile=None, buffered=buffered) |
|
1682 | return changeset_templater(ui, repo, spec, matchfn=None, diffopts={}, | |
|
1683 | buffered=buffered) | |||
1684 |
|
1684 | |||
1685 | def show_changeset(ui, repo, opts, buffered=False): |
|
1685 | def show_changeset(ui, repo, opts, buffered=False): | |
1686 | """show one changeset using template or regular display. |
|
1686 | """show one changeset using template or regular display. | |
@@ -1702,12 +1702,11 b' def show_changeset(ui, repo, opts, buffe' | |||||
1702 | return jsonchangeset(ui, repo, matchfn, opts, buffered) |
|
1702 | return jsonchangeset(ui, repo, matchfn, opts, buffered) | |
1703 |
|
1703 | |||
1704 | spec = _lookuplogtemplate(ui, opts.get('template'), opts.get('style')) |
|
1704 | spec = _lookuplogtemplate(ui, opts.get('template'), opts.get('style')) | |
1705 | tmpl, mapfile = spec |
|
1705 | ||
1706 |
|
1706 | if not spec.tmpl and not spec.mapfile: | ||
1707 | if not tmpl and not mapfile: |
|
|||
1708 | return changeset_printer(ui, repo, matchfn, opts, buffered) |
|
1707 | return changeset_printer(ui, repo, matchfn, opts, buffered) | |
1709 |
|
1708 | |||
1710 |
return changeset_templater(ui, repo, matchfn, opts, |
|
1709 | return changeset_templater(ui, repo, spec, matchfn, opts, buffered) | |
1711 |
|
1710 | |||
1712 | def showmarker(fm, marker, index=None): |
|
1711 | def showmarker(fm, marker, index=None): | |
1713 | """utility function to display obsolescence marker in a readable way |
|
1712 | """utility function to display obsolescence marker in a readable way | |
@@ -2954,9 +2953,8 b' def commitforceeditor(repo, ctx, subs, f' | |||||
2954 |
|
2953 | |||
2955 | def buildcommittemplate(repo, ctx, subs, extramsg, tmpl): |
|
2954 | def buildcommittemplate(repo, ctx, subs, extramsg, tmpl): | |
2956 | ui = repo.ui |
|
2955 | ui = repo.ui | |
2957 |
|
|
2956 | spec = _lookuplogtemplate(ui, tmpl, None) | |
2958 |
|
2957 | t = changeset_templater(ui, repo, spec, None, {}, False) | ||
2959 | t = changeset_templater(ui, repo, None, {}, tmpl, mapfile, False) |
|
|||
2960 |
|
2958 | |||
2961 | for k, v in repo.ui.configitems('committemplate'): |
|
2959 | for k, v in repo.ui.configitems('committemplate'): | |
2962 | if k != 'changeset': |
|
2960 | if k != 'changeset': |
General Comments 0
You need to be logged in to leave comments.
Login now