From patchwork Fri May 19 15:25:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1, of, 8, V2] gendoc: make sure locale path is set before loading any modules From: Yuya Nishihara X-Patchwork-Id: 20720 Message-Id: <329d4934ca617e7044d1.1495207511@mimosa> To: mercurial-devel@mercurial-scm.org Date: Sat, 20 May 2017 00:25:11 +0900 # HG changeset patch # User Yuya Nishihara # Date 1494665635 -32400 # Sat May 13 17:53:55 2017 +0900 # Node ID 329d4934ca617e7044d1e5be2daa664043a97078 # Parent 763d7292569138886c3fdf179f7e688351bfb212 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. 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,