cmdutil: reorder optional arguments passed to makefileobj()
**props will be passed directly to templater.
--- 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)