comparison mercurial/commands.py @ 35352:920cca6c8462

py3: handle keyword arguments correctly in commands.py Differential Revision: https://phab.mercurial-scm.org/D1628
author Pulkit Goyal <7895pulkit@gmail.com>
date Sun, 10 Dec 2017 04:45:41 +0530
parents 98f97eb20597
children b378a3d840ab
comparison
equal deleted inserted replaced
35351:a4478f74ad56 35352:920cca6c8462
1276 :``%r``: zero-padded changeset revision number 1276 :``%r``: zero-padded changeset revision number
1277 :``%b``: basename of the exporting repository 1277 :``%b``: basename of the exporting repository
1278 1278
1279 Returns 0 on success. 1279 Returns 0 on success.
1280 """ 1280 """
1281 opts = pycompat.byteskwargs(opts)
1281 ctx = scmutil.revsingle(repo, opts.get('rev')) 1282 ctx = scmutil.revsingle(repo, opts.get('rev'))
1282 m = scmutil.match(ctx, (file1,) + pats, opts) 1283 m = scmutil.match(ctx, (file1,) + pats, opts)
1283 fntemplate = opts.pop('output', '') 1284 fntemplate = opts.pop('output', '')
1284 if cmdutil.isstdiofilename(fntemplate): 1285 if cmdutil.isstdiofilename(fntemplate):
1285 fntemplate = '' 1286 fntemplate = ''
1288 fm = formatter.nullformatter(ui, 'cat') 1289 fm = formatter.nullformatter(ui, 'cat')
1289 else: 1290 else:
1290 ui.pager('cat') 1291 ui.pager('cat')
1291 fm = ui.formatter('cat', opts) 1292 fm = ui.formatter('cat', opts)
1292 with fm: 1293 with fm:
1293 return cmdutil.cat(ui, repo, ctx, m, fm, fntemplate, '', **opts) 1294 return cmdutil.cat(ui, repo, ctx, m, fm, fntemplate, '',
1295 **pycompat.strkwargs(opts))
1294 1296
1295 @command('^clone', 1297 @command('^clone',
1296 [('U', 'noupdate', None, _('the clone will include an empty working ' 1298 [('U', 'noupdate', None, _('the clone will include an empty working '
1297 'directory (only a repository)')), 1299 'directory (only a repository)')),
1298 ('u', 'updaterev', '', _('revision, tag, or branch to check out'), 1300 ('u', 'updaterev', '', _('revision, tag, or branch to check out'),
1741 _('[-o] CMD'), 1743 _('[-o] CMD'),
1742 norepo=True) 1744 norepo=True)
1743 def debugcomplete(ui, cmd='', **opts): 1745 def debugcomplete(ui, cmd='', **opts):
1744 """returns the completion list associated with the given command""" 1746 """returns the completion list associated with the given command"""
1745 1747
1746 if opts.get('options'): 1748 if opts.get(r'options'):
1747 options = [] 1749 options = []
1748 otables = [globalopts] 1750 otables = [globalopts]
1749 if cmd: 1751 if cmd:
1750 aliases, entry = cmdutil.findcmd(cmd, table, False) 1752 aliases, entry = cmdutil.findcmd(cmd, table, False)
1751 otables.append(entry[1]) 1753 otables.append(entry[1])