unable to build docs on default

Steve Borho steve at borho.org
Thu Jun 9 11:00:07 CDT 2011


On Thu, Jun 9, 2011 at 5:29 AM, Adrian Buehlmann <adrian at cadifra.com> wrote:
> On 2011-06-09 11:36, Adrian Buehlmann wrote:
>> On 2011-06-09 09:29, Adrian Buehlmann wrote:
>>> (adding Yuya to cc)
>>>
>>> On 2011-06-09 06:35, Steve Borho wrote:
>>>>>  C:\Python26x64\python.exe gendoc.py > build-hg/doc/hg.1.gendoc.txt
>>>> Traceback (most recent call last):
>>>>   File "gendoc.py", line 167, in <module>
>>>>     show_doc(sys.stdout)
>>>>   File "gendoc.py", line 114, in show_doc
>>>>     mod = extensions.load(None, extensionname, None)
>>>>   File "..\mercurial\extensions.py", line 73, in load
>>>>     mod = importh(name)
>>>>   File "..\mercurial\extensions.py", line 65, in importh
>>>>     mod = __import__(name)
>>>>   File "..\mercurial\demandimport.py", line 85, in _demandimport
>>>>     return _origimport(name, globals, locals, fromlist)
>>>> ImportError: Import by filename is not supported.
>>>>
>>>> build-hg/doc> C:\Python26x64\python.exe runrst html --link-stylesheet
>>>> --stylesheet-path style.css hg.1.txt hg.1.html
>>>> hg.1.gendoc.txt:2088: (SEVERE/4) Title level inconsistent:
>>>>
>>>> Branch-based Access Control
>>>> ...........................
>>>> Exiting due to level-4 (SEVERE) system message.
>>>>
>>>>
>>>> It looks like gendoc.py assumes Mercurial default (pre 1.9) is
>>>> installed?  That's a nice chicken-egg loop.
>>>>
>>>
>>> I ran into this as well when trying to build TortoiseHg with
>>>
>>>   https://bitbucket.org/tortoisehg/thg-winbuild
>>
>> Another quick and dirty/temporary "fix" for thg-winbuild which makes the
>> build run to completion is:
>>
>> (patch for https://bitbucket.org/tortoisehg/thg-winbuild/src/tip/setup.py )
>>
>> diff --git a/setup.py b/setup.py
>> --- a/setup.py
>> +++ b/setup.py
>> @@ -301,7 +301,7 @@
>>      run_python(r'setup.py build_py -c -d . build_mo', 'build-hg')
>>      run_python(r'setup.py build_ext -i', 'build-hg', env=get_sdkenv(arch))
>>
>> -    generate_hgext_index()
>> +    #generate_hgext_index()
>>
>>      # Build man pages
>>      pipetofile((sys.executable, 'gendoc.py'),
>> @@ -400,7 +400,7 @@
>>          if ext == 'hgcr-gui':
>>              shutil.copy('hgcr-gui/hgcr.ui', 'build-thg/tortoisehg/hgqt')
>>
>> -    generate_hgext_index()
>> +    #generate_hgext_index()
>>
>>      # Build docs
>>      run(r'build chm', 'build-thg/doc')
>>
>>
>> Looks like thg-winbuild needs to be adapted to Yuya's change in mercurial
>> default branch anyway. The index in hgext is now supposed to be generated
>> by mercurial's setup.py (see mercurial's 3818c67a501e).
>
> Maybe something like (still quite hackish, but seems to work here):
>
> diff --git a/setup.py b/setup.py
> --- a/setup.py
> +++ b/setup.py
> @@ -300,8 +300,7 @@
>     run_python(r'setup.py --version', 'build-hg')
>     run_python(r'setup.py build_py -c -d . build_mo', 'build-hg')
>     run_python(r'setup.py build_ext -i', 'build-hg', env=get_sdkenv(arch))
> -
> -    generate_hgext_index()
> +    run_python(r'setup.py build_hgextindex', 'build-hg', env=get_sdkenv(arch))
>
>     # Build man pages
>     pipetofile((sys.executable, 'gendoc.py'),
> @@ -400,7 +399,8 @@
>         if ext == 'hgcr-gui':
>             shutil.copy('hgcr-gui/hgcr.ui', 'build-thg/tortoisehg/hgqt')
>
> -    generate_hgext_index()
> +    run(r'del build-hg\hgext\__index__.*')
> +    run_python(r'setup.py build_hgextindex', 'build-hg', env=get_sdkenv(arch))
>
>     # Build docs
>     run(r'build chm', 'build-thg/doc')
>

Yeah, that looks promising.  Thanks for investigating.  Until the code
freeze we'll need to support both paths.

-- 
Steve Borho


More information about the Mercurial-devel mailing list