changeset 36508:d7a23d6184a2

cmdutil: reorder optional arguments passed to makefileobj() **props will be passed directly to templater.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 18 Feb 2018 10:58:15 +0900
parents 165cf86365ff
children 638c012a87ef
files mercurial/cmdutil.py
diffstat 1 files changed, 4 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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)