Commits

Yuya Nishihara committed 6cdc99f

rename: receive command-line paths as explicit parameters

This fixes Python 2.5 incompatibility, reported by Michał Kandulski
<michal.kandulski@gmail.com>, thanks.

Comments (0)

Files changed (1)

tortoisehg/hgqt/run.py

     return quickop.run(ui, repoagent, *pats, **opts)
 
 @command('rename|mv|copy', [], _('thg rename [SOURCE] [DEST]'))
-def rename(ui, repoagent, *pats, **opts):
+def rename(ui, repoagent, source=None, dest=None, **opts):
     """rename dialog"""
     from tortoisehg.hgqt import rename as renamemod
-    if len(pats) > 2:
-        raise util.Abort(_('too many files specified'))
-    pats = map(hglib.tounicode, hglib.canonpaths(pats))
+    source, dest = map(hglib.tounicode,
+                       hglib.canonpaths([source or '', dest or '']))
     iscopy = (opts.get('alias') == 'copy')
-    return renamemod.RenameDialog(repoagent, None, *pats, iscopy=iscopy)
+    return renamemod.RenameDialog(repoagent, None, source, dest, iscopy)
 
 @command('^repoconfig',
     [('', 'focus', '', _('field to give initial focus'))],