changeset 912:adf4a0890cc5

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
author Brad Hall <bhall@fb.com>
date Mon, 04 Jun 2012 11:27:24 -0700
parents 772280aed751
children 9fff2b8217b6
files hgsubversion/wrappers.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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: