# HG changeset patch # User Yuya Nishihara # Date 2018-01-21 04:47:06 # Node ID 64f4a680870469c9c6978c8e8f4b96b5c272a4d4 # Parent 9e641c4525a2e884eb14123e63b4535f642b6af1 logcmdutil: make default parameters of changesetprinters consistent diff --git a/mercurial/logcmdutil.py b/mercurial/logcmdutil.py --- a/mercurial/logcmdutil.py +++ b/mercurial/logcmdutil.py @@ -122,12 +122,12 @@ def changesetlabels(ctx): class changesetprinter(object): '''show changeset information when templating not requested.''' - def __init__(self, ui, repo, matchfn, diffopts, buffered): + def __init__(self, ui, repo, matchfn=None, diffopts=None, buffered=False): self.ui = ui self.repo = repo self.buffered = buffered self.matchfn = matchfn - self.diffopts = diffopts + self.diffopts = diffopts or {} self.header = {} self.hunk = {} self.lastheader = None @@ -290,7 +290,7 @@ class changesetprinter(object): class jsonchangeset(changesetprinter): '''format changeset information.''' - def __init__(self, ui, repo, matchfn, diffopts, buffered): + def __init__(self, ui, repo, matchfn=None, diffopts=None, buffered=False): changesetprinter.__init__(self, ui, repo, matchfn, diffopts, buffered) self.cache = {} self._first = True @@ -399,8 +399,6 @@ class changesettemplater(changesetprinte # adding/removing arguments before "buffered" to not break callers. def __init__(self, ui, repo, tmplspec, matchfn=None, diffopts=None, buffered=False): - diffopts = diffopts or {} - changesetprinter.__init__(self, ui, repo, matchfn, diffopts, buffered) tres = formatter.templateresources(ui, repo) self.t = formatter.loadtemplater(ui, tmplspec,