cmdutil: reorder optional arguments passed to makefileobj()
authorYuya Nishihara <yuya@tcha.org>
Sun, 18 Feb 2018 10:58:15 +0900
changeset 36508 d7a23d6184a2
parent 36507 165cf86365ff
child 36509 638c012a87ef
cmdutil: reorder optional arguments passed to makefileobj() **props will be passed directly to templater.
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)