# HG changeset patch # User Brad Hall # Date 1338834444 25200 # Node ID adf4a0890cc57380a1a3bdc8d57c62b354d3b37a # Parent 772280aed7513b672aa8ba060750f52518e1b20e Catch/abort on subversion exceptions in list_dir Give the user an error message if they attempt to pull a non-existent SVN rev instead of a backtrace diff --git a/hgsubversion/wrappers.py b/hgsubversion/wrappers.py --- a/hgsubversion/wrappers.py +++ b/hgsubversion/wrappers.py @@ -275,7 +275,11 @@ def pull(repo, source, heads=[], force=F layout = repo.ui.config('hgsubversion', 'layout', 'auto') if layout == 'auto': - rootlist = svn.list_dir('', revision=(stopat_rev or None)) + try: + rootlist = svn.list_dir('', revision=(stopat_rev or None)) + except svnwrap.SubversionException, e: + err = "%s (subversion error: %d)" % (e.args[0], e.args[1]) + raise hgutil.Abort(err) if sum(map(lambda x: x in rootlist, ('branches', 'tags', 'trunk'))): layout = 'standard' else: