Unhandled exceptions when running command on invalid mercurial working copy

Issue #226 resolved
Leo Gertsenshteyn created an issue

This is an edge case, yes, but should fail gracefully.

Repro steps:

Navigate to a working directory that was not created as an hgsubversion clone

Get confused as to where this particular working copy came from

Run hg svn genignore (or any other hg svn foo for a different error stack)

See following error:

{{{

unknown exception encountered, please report by visiting http://mercurial.selenic.com/wiki/BugTracker Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] Mercurial Distributed SCM (version 1.7) Extensions loaded: fixfrozenexts, color, wincolor, extdiff, mq, record, convert, rebase, bfiles, parentrevspec, hgsubversion, bookmarks, hggit Traceback (most recent call last): File "hg", line 36, in <module> File "mercurial\dispatch.pyo", line 16, in run File "mercurial\dispatch.pyo", line 36, in dispatch File "mercurial\dispatch.pyo", line 58, in _runcatch File "mercurial\dispatch.pyo", line 590, in _dispatch File "mercurial\dispatch.pyo", line 401, in runcommand File "mercurial\extensions.pyo", line 175, in wrap File "hgext\color.pyo", line 223, in colorcmd File "mercurial\dispatch.pyo", line 641, in _runcommand File "mercurial\dispatch.pyo", line 595, in checkargs File "mercurial\dispatch.pyo", line 588, in <lambda> File "mercurial\util.pyo", line 427, in check File "mercurial\extensions.pyo", line 130, in wrap File "mercurial\util.pyo", line 427, in check File "hgext\mq.pyo", line 2979, in mqcommand File "mercurial\util.pyo", line 427, in check File "C:\Dev\tools\hg\hgsubversion\hgsubversion\svncommands.py", line 465, in svn return commandfunc(ui, args=args, repo=repo, opts) File "C:\Dev\tools\hg\hgsubversion\hgsubversion\svncommands.py", line 334, in genignore svn = svnrepo.svnremoterepo(repo.ui).svn File "mercurial\util.pyo", line 169, in get File "C:\Dev\tools\hg\hgsubversion\hgsubversion\svnrepo.py", line 103, in svn return svnwrap.SubversionRepo(*self.svnauth) File "mercurial\util.pyo", line 169, in get File "C:\Dev\tools\hg\hgsubversion\hgsubversion\svnrepo.py", line 92, in svnauth url = util.normalize_url(self.path) File "C:\Dev\tools\hg\hgsubversion\hgsubversion\util.py", line 85, in normalize_url if url.startswith('svn+http://') or url.startswith('svn+https://'): AttributeError: 'NoneType' object has no attribute 'startswith' }}}