[PATCH 3 of 6] scripts: docs-headings: set HGRCPATH to empty

Thomas De Schampheleire patrickdepinguin at gmail.com
Sat Dec 29 21:50:17 UTC 2018


# HG changeset patch
# User Thomas De Schampheleire <thomas.de_schampheleire at nokia.com>
# Date 1546111044 -3600
#      Sat Dec 29 20:17:24 2018 +0100
# Node ID 60672272cef36dd45594b607036fb5d7eda5b15c
# Parent  a7df630cfe21e5e66c555b9fa88ef2c3930870b1
scripts: docs-headings: set HGRCPATH to empty

User settings could pollute output, for example in my case, within a
virtualenv I get the following on every 'hg' invocation:

*** failed to import extension absorb from
/home/tdescham/repo/contrib/hg-experimental/installed/lib64/python2.7/site-packages/hgext3rd/absorb:
'module' object has no attribute 'command'

diff --git a/scripts/docs-headings.py b/scripts/docs-headings.py
--- a/scripts/docs-headings.py
+++ b/scripts/docs-headings.py
@@ -5,6 +5,7 @@ Consistent formatting of rst section tit
 """
 
 import multiprocessing
+import os
 import re
 import subprocess
 
@@ -73,6 +74,8 @@ def process_one(fn):
     open(fn, 'w').write(s)
 
 def main():
+    # ignore user settings that may pollute output (e.g. missing extensions)
+    os.environ["HGRCPATH"] = ""
 
     filenames = subprocess.check_output(['hg', 'loc', 'set:**.rst+kallithea/i18n/how_to']).splitlines()
 


More information about the kallithea-general mailing list