[PATCH 1 of 2 v4] dispatch: change indentation level in _dispatch()

Yuya Nishihara yuya at tcha.org
Fri Sep 23 08:44:11 EDT 2016


On Thu, 22 Sep 2016 12:45:25 -0700, Arun Kulshreshtha wrote:
> # HG changeset patch
> # User Arun Kulshreshtha <kulshrax at fb.com>
> # Date 1474571988 25200
> #      Thu Sep 22 12:19:48 2016 -0700
> # Node ID 75b224273359ed924528491efb88c612f3caa4ca
> # Parent  5271ae66615207f39cc41d78f4541bc6f8ca6ff6
> dispatch: change indentation level in _dispatch()

Queued the series, thanks.

> --- a/mercurial/dispatch.py
> +++ b/mercurial/dispatch.py
> @@ -844,60 +844,63 @@
>      elif not cmd:
>          return commands.help_(ui, 'shortlist')
>  
> -    repo = None
> -    cmdpats = args[:]
> -    if not _cmdattr(ui, cmd, func, 'norepo'):
> -        # use the repo from the request only if we don't have -R
> -        if not rpath and not cwd:
> -            repo = req.repo
> +    if True:
> +        repo = None
> +        cmdpats = args[:]
> +        if not _cmdattr(ui, cmd, func, 'norepo'):
> +            # use the repo from the request only if we don't have -R
> +            if not rpath and not cwd:
> +                repo = req.repo

I prefer splitting inner function than indenting large code block, but in
this case, that would be impractical because there are many variables to be
passed around. So this change looks good.


More information about the Mercurial-devel mailing list