.hgsub crash on windows if UTF-8 file.
Created originally on Bitbucket by Joel Lamotte (A. Joël Lamotte)
I'm failing to make the following .hgsub file work:
{{{
navi=[git]https://github.com/khrona/Navi.git
}}}
If the encoding is "ANSI" (as Windows define it) it does nothing (no subrepo cloned), same behaviour with UTF-8 without BOM. But if I convert it to UTF-8 (with BOM) then I got :a crash in the workbench
{{{
#!python ** Mercurial version (2.1.1). TortoiseHg version (2.3.1) ** Command: --nofork workbench ** CWD: E:\Projects\Games\NetRush\dependencies ** Encoding: cp1252 ** Extensions loaded: convert, largefiles ** Python version: 2.6.6 (r266:84297, Aug 24 2010, 18:13:38) [MSC v.1500 64 bit (AMD64)] ** Windows version: (6, 1, 7601, 2, 'Service Pack 1') ** Processor architecture: x64 ** Qt-4.7.4 PyQt-4.8.6 Traceback (most recent call last): File "tortoisehg\hgqt\repowidget.pyo", line 806, in onRevisionSelected File "tortoisehg\hgqt\revdetails.pyo", line 287, in onRevisionSelected File "tortoisehg\hgqt\filelistview.pyo", line 61, in setContext File "tortoisehg\hgqt\filelistmodel.pyo", line 87, in setContext File "tortoisehg\hgqt\filelistmodel.pyo", line 155, in loadFiles File "tortoisehg\hgqt\filelistmodel.pyo", line 110, in _buildDesc File "mercurial\context.pyo", line 801, in files File "mercurial\util.pyo", line 237, in get File "mercurial\context.pyo", line 758, in _status File "hgext\largefiles\reposetup.pyo", line 96, in status File "mercurial\localrepo.pyo", line 1371, in status File "mercurial\util.pyo", line 237, in get File "mercurial\context.pyo", line 79, in substate File "mercurial\subrepo.pyo", line 38, in state File "mercurial\subrepo.pyo", line 33, in read File "mercurial\config.pyo", line 171, in parse ParseError: ('\xef\xbb\xbf', '.hgsub:1')
}}}
After some investigations I found that in UTF-8 with BOM only, I got this error because the first line in my .hgsub file is empty. If it is not empty, then it will work.
(But the subrepo doesn't clone so I don't know why but it's another problem I guess).