# HG changeset patch # User Yuya Nishihara # Date 1518919095 -32400 # Node ID d7a23d6184a277669d0303f1c43c99929c5c7896 # Parent 165cf86365ffa39fcfe4c83e1f6cdb690f9e179e cmdutil: reorder optional arguments passed to makefileobj() **props will be passed directly to templater. diff -r 165cf86365ff -r d7a23d6184a2 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Sun Feb 18 10:54:24 2018 +0900 +++ b/mercurial/cmdutil.py Sun Feb 18 10:58:15 2018 +0900 @@ -954,10 +954,7 @@ def __exit__(self, exc_type, exc_value, exc_tb): pass -def makefileobj(ctx, pat, total=None, - seqno=None, revwidth=None, mode='wb', modemap=None, - pathname=None): - +def makefileobj(ctx, pat, mode='wb', modemap=None, **props): writable = mode not in ('r', 'rb') if isstdiofilename(pat): @@ -967,7 +964,7 @@ else: fp = repo.ui.fin return _unclosablefile(fp) - fn = makefilename(ctx, pat, total, seqno, revwidth, pathname) + fn = makefilename(ctx, pat, **props) if modemap is not None: mode = modemap.get(fn, mode) if mode == 'wb': @@ -1542,9 +1539,8 @@ ctx = repo[rev] fo = None if not fp and fntemplate: - fo = makefileobj(ctx, fntemplate, - total=total, seqno=seqno, revwidth=revwidth, - mode='wb', modemap=filemode) + fo = makefileobj(ctx, fntemplate, mode='wb', modemap=filemode, + total=total, seqno=seqno, revwidth=revwidth) dest = fo.name def write(s, **kw): fo.write(s)