Mercurial > hg-stable
diff tests/test-config.t @ 22276:b13b99d39a46
config: highlight parse error caused by leading spaces (issue3214)
Added "unexpected leading whitespace" message to parse error
when .hgrc has a line that starts with whitespace.
Helps new users unfamiliar with syntax of rc file.
author | Razvan Cojocaru <razvan.cojocaru93@gmail.com> |
---|---|
date | Sun, 16 Mar 2014 17:31:31 +0200 |
parents | d9a8017dce10 |
children | c5df4af17110 |
line wrap: on
line diff
--- a/tests/test-config.t Wed Aug 20 22:52:56 2014 -0700 +++ b/tests/test-config.t Sun Mar 16 17:31:31 2014 +0200 @@ -19,6 +19,25 @@ hg: parse error at $TESTTMP/.hg/hgrc:1: =nokeyvalue [255] +Test hint about invalid syntax from leading white space + + $ cat > .hg/hgrc << EOF + > key=value + > EOF + $ hg showconfig + hg: parse error at $TESTTMP/.hg/hgrc:1: key=value + unexpected leading whitespace + [255] + + $ cat > .hg/hgrc << EOF + > [section] + > key=value + > EOF + $ hg showconfig + hg: parse error at $TESTTMP/.hg/hgrc:1: [section] + unexpected leading whitespace + [255] + Reset hgrc $ echo > .hg/hgrc