Mercurial > public > mercurial-scm > hg
comparison mercurial/dispatch.py @ 9875:d6a95c5f6ff9
dispatch: minor refactoring
Renamed local variable i to entry in _dispatch.
author | Henri Wiechers <hwiechers@gmail.com> |
---|---|
date | Fri, 13 Nov 2009 16:38:27 +0200 |
parents | 0d850f8beea6 |
children | 6e8a16dd3e30 |
comparison
equal
deleted
inserted
replaced
9871:57949bfec718 | 9875:d6a95c5f6ff9 |
---|---|
238 except fancyopts.getopt.GetoptError, inst: | 238 except fancyopts.getopt.GetoptError, inst: |
239 raise error.ParseError(None, inst) | 239 raise error.ParseError(None, inst) |
240 | 240 |
241 if args: | 241 if args: |
242 cmd, args = args[0], args[1:] | 242 cmd, args = args[0], args[1:] |
243 aliases, i = cmdutil.findcmd(cmd, commands.table, | 243 aliases, entry = cmdutil.findcmd(cmd, commands.table, |
244 ui.config("ui", "strict")) | 244 ui.config("ui", "strict")) |
245 cmd = aliases[0] | 245 cmd = aliases[0] |
246 args = aliasargs(i[0]) + args | 246 args = aliasargs(entry[0]) + args |
247 defaults = ui.config("defaults", cmd) | 247 defaults = ui.config("defaults", cmd) |
248 if defaults: | 248 if defaults: |
249 args = map(util.expandpath, shlex.split(defaults)) + args | 249 args = map(util.expandpath, shlex.split(defaults)) + args |
250 c = list(i[1]) | 250 c = list(entry[1]) |
251 else: | 251 else: |
252 cmd = None | 252 cmd = None |
253 c = [] | 253 c = [] |
254 | 254 |
255 # combine global options into local | 255 # combine global options into local |
265 for o in commands.globalopts: | 265 for o in commands.globalopts: |
266 n = o[1] | 266 n = o[1] |
267 options[n] = cmdoptions[n] | 267 options[n] = cmdoptions[n] |
268 del cmdoptions[n] | 268 del cmdoptions[n] |
269 | 269 |
270 return (cmd, cmd and i[0] or None, args, options, cmdoptions) | 270 return (cmd, cmd and entry[0] or None, args, options, cmdoptions) |
271 | 271 |
272 def _parseconfig(ui, config): | 272 def _parseconfig(ui, config): |
273 """parse the --config options from the command line""" | 273 """parse the --config options from the command line""" |
274 for cfg in config: | 274 for cfg in config: |
275 try: | 275 try: |