Adding a subrepo causes an error

Issue #1905 duplicate
Former user created an issue

When trying to add a subrepo by selecting a folder that doesn't contain hg info, an error occurs.

Steps:

  1. right-click an existing repo in thg tree

  2. select "add a subrepo"

  3. in the browse dialog select a folder which is not a hg repo

  4. an error occurs:

{{{

!python

Mercurial version (2.1.2). TortoiseHg version (2.3.1)
Command:
CWD: /home/baklanov/Documents
Encoding: UTF-8
Extensions loaded: convert, hgk, extdiff, graphlog
Python version: 2.7.2 (default, Aug 19 2011, 20:41:43) [GCC]
** Qt-4.7.4 PyQt-4.8.5
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/tortoisehg/hgqt/reporegistry.py", line 540, in addSubrepo
if not os.path.isdir(sroot):
File "/usr/lib64/python2.7/genericpath.py", line 41, in isdir
st = os.stat(s)
TypeError: coercing to Unicode: need string or buffer, NoneType found

}}}