Patchwork [1,of,6] gendoc: make sure locale path is set before loading any modules

login
register
mail settings
Submitter Yuya Nishihara
Date May 13, 2017, 9:57 a.m.
Message ID <e2ec0287484da7ab5fe2.1494669452@mimosa>
Download mbox | patch
Permalink /patch/20592/
State Accepted
Headers show

Comments

Yuya Nishihara - May 13, 2017, 9:57 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1494665635 -32400
#      Sat May 13 17:53:55 2017 +0900
# Node ID e2ec0287484da7ab5fe232d750e6e6e0c903448b
# Parent  d0d9a4fca59bcb0c0d5a53e7b3d2db2068844d1f
gendoc: make sure locale path is set before loading any modules

Otherwise some messages wouldn't be translated depending on when the util
was loaded.
Gregory Szorc - May 13, 2017, 5:53 p.m.
On Sat, May 13, 2017 at 2:57 AM, Yuya Nishihara <yuya@tcha.org> wrote:

> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1494665635 -32400
> #      Sat May 13 17:53:55 2017 +0900
> # Node ID e2ec0287484da7ab5fe232d750e6e6e0c903448b
> # Parent  d0d9a4fca59bcb0c0d5a53e7b3d2db2068844d1f
> gendoc: make sure locale path is set before loading any modules
>
> Otherwise some messages wouldn't be translated depending on when the util
> was loaded.
>

I've got patches 1-4 ready to be queued. But I'm not sure what magic
incantation I need to type to invoke my new reviewer powers. Once someone
tells me, they will be queued.


> diff --git a/doc/gendoc.py b/doc/gendoc.py
> --- a/doc/gendoc.py
> +++ b/doc/gendoc.py
> @@ -16,6 +16,10 @@ os.environ['HGMODULEPOLICY'] = 'allow'
>  # import from the live mercurial repo
>  sys.path.insert(0, "..")
>  from mercurial import demandimport; demandimport.enable()
> +# Load util so that the locale path is set by i18n.setdatapath() before
> +# calling _().
> +from mercurial import util
> +util.datapath
>  from mercurial import (
>      commands,
>      extensions,
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
via Mercurial-devel - May 19, 2017, 4:16 a.m.
On Sat, May 13, 2017 at 10:53 AM, Gregory Szorc <gregory.szorc@gmail.com> wrote:
> On Sat, May 13, 2017 at 2:57 AM, Yuya Nishihara <yuya@tcha.org> wrote:
>>
>> # HG changeset patch
>> # User Yuya Nishihara <yuya@tcha.org>
>> # Date 1494665635 -32400
>> #      Sat May 13 17:53:55 2017 +0900
>> # Node ID e2ec0287484da7ab5fe232d750e6e6e0c903448b
>> # Parent  d0d9a4fca59bcb0c0d5a53e7b3d2db2068844d1f
>> gendoc: make sure locale path is set before loading any modules
>>
>> Otherwise some messages wouldn't be translated depending on when the util
>> was loaded.
>
>
> I've got patches 1-4 ready to be queued. But I'm not sure what magic
> incantation I need to type to invoke my new reviewer powers. Once someone
> tells me, they will be queued.

I think you figured how to push since you wrote that. Want to push the
first 4 or are you waiting for a v2 of all 6?

>
>>
>> diff --git a/doc/gendoc.py b/doc/gendoc.py
>> --- a/doc/gendoc.py
>> +++ b/doc/gendoc.py
>> @@ -16,6 +16,10 @@ os.environ['HGMODULEPOLICY'] = 'allow'
>>  # import from the live mercurial repo
>>  sys.path.insert(0, "..")
>>  from mercurial import demandimport; demandimport.enable()
>> +# Load util so that the locale path is set by i18n.setdatapath() before
>> +# calling _().
>> +from mercurial import util
>> +util.datapath
>>  from mercurial import (
>>      commands,
>>      extensions,
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel@mercurial-scm.org
>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
>
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
Yuya Nishihara - May 19, 2017, 3:26 p.m.
On Thu, 18 May 2017 21:16:13 -0700, Martin von Zweigbergk wrote:
> On Sat, May 13, 2017 at 10:53 AM, Gregory Szorc <gregory.szorc@gmail.com> wrote:
> > On Sat, May 13, 2017 at 2:57 AM, Yuya Nishihara <yuya@tcha.org> wrote:
> >>
> >> # HG changeset patch
> >> # User Yuya Nishihara <yuya@tcha.org>
> >> # Date 1494665635 -32400
> >> #      Sat May 13 17:53:55 2017 +0900
> >> # Node ID e2ec0287484da7ab5fe232d750e6e6e0c903448b
> >> # Parent  d0d9a4fca59bcb0c0d5a53e7b3d2db2068844d1f
> >> gendoc: make sure locale path is set before loading any modules
> >>
> >> Otherwise some messages wouldn't be translated depending on when the util
> >> was loaded.
> >
> >
> > I've got patches 1-4 ready to be queued. But I'm not sure what magic
> > incantation I need to type to invoke my new reviewer powers. Once someone
> > tells me, they will be queued.
> 
> I think you figured how to push since you wrote that. Want to push the
> first 4 or are you waiting for a v2 of all 6?

I've sent V2. The first half is unchanged.

Patch

diff --git a/doc/gendoc.py b/doc/gendoc.py
--- a/doc/gendoc.py
+++ b/doc/gendoc.py
@@ -16,6 +16,10 @@  os.environ['HGMODULEPOLICY'] = 'allow'
 # import from the live mercurial repo
 sys.path.insert(0, "..")
 from mercurial import demandimport; demandimport.enable()
+# Load util so that the locale path is set by i18n.setdatapath() before
+# calling _().
+from mercurial import util
+util.datapath
 from mercurial import (
     commands,
     extensions,