changeset 9470:ba75830d17a9

dispatch: catch ConfigError while constructing ui
author Martin Geisler <mg@lazybytes.net>
date Sat, 19 Sep 2009 13:52:54 +0200
parents 7f0f882af23d
children bccf780f78ed 6ea653272c09
files mercurial/dispatch.py tests/test-hgrc tests/test-hgrc.out
diffstat 3 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dispatch.py	Sat Sep 12 11:17:07 2009 +0200
+++ b/mercurial/dispatch.py	Sat Sep 19 13:52:54 2009 +0200
@@ -24,6 +24,9 @@
     except util.Abort, inst:
         sys.stderr.write(_("abort: %s\n") % inst)
         return -1
+    except error.ConfigError, inst:
+        sys.stderr.write(_("hg: %s\n") % inst)
+        return -1
     return _runcatch(u, args)
 
 def _runcatch(ui, args):
--- a/tests/test-hgrc	Sat Sep 12 11:17:07 2009 +0200
+++ b/tests/test-hgrc	Sat Sep 19 13:52:54 2009 +0200
@@ -16,3 +16,9 @@
 cat .hg/hgrc |sed -e "s:$p:...:"
 hg paths |sed -e "s:$p:...:"
 hg showconfig |sed -e "s:$p:...:"
+
+# issue1829: wrong indentation
+cd ..
+echo '[foo]' >> $HGRCPATH
+echo '  x = y' >> $HGRCPATH
+hg version 2>&1 | sed -e "s|$HGRCPATH|\$HGRCPATH|"
--- a/tests/test-hgrc.out	Sat Sep 12 11:17:07 2009 +0200
+++ b/tests/test-hgrc.out	Sat Sep 19 13:52:54 2009 +0200
@@ -10,3 +10,4 @@
 defaults.tag=-d "0 0"
 paths.default=.../foo%bar
 ui.slash=True
+hg: config error at $HGRCPATH:8: '  x = y'