[PATCH 5 of 7] children: use absolute_import

Martin von Zweigbergk martinvonz at google.com
Wed Feb 10 17:39:08 EST 2016


On Tue, Feb 9, 2016 at 5:52 PM, Gregory Szorc <gregory.szorc at gmail.com> wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1455068072 28800
> #      Tue Feb 09 17:34:32 2016 -0800
> # Node ID 265d8d09b0be997064ea4b5ec4e0ff5e50eadf88
> # Parent  3f54d7079a3f6704c103633290aaca137411f4a2
> children: use absolute_import
>
> diff --git a/hgext/children.py b/hgext/children.py
> --- a/hgext/children.py
> +++ b/hgext/children.py
> @@ -13,11 +13,17 @@
>  This extension is deprecated. You should use :hg:`log -r
>  "children(REV)"` instead.
>  '''
>
> -from mercurial import cmdutil
> -from mercurial.commands import templateopts
> +from __future__ import absolute_import
> +
>  from mercurial.i18n import _
> +from mercurial import (
> +    cmdutil,
> +    commands,
> +)
> +
> +templateopts = commands.templateopts

Does "from mercurial.commands import templateopts" not work ("from
mercurial.i18n import _" apparently works)? Maybe something gets
initialized by "from mercurial import commands" that we need? I don't
know much about how imports work.


More information about the Mercurial-devel mailing list