Show More
@@ -58,6 +58,8 b' def dispatch(req):' | |||||
58 | if len(inst.args) > 1: |
|
58 | if len(inst.args) > 1: | |
59 | ferr.write(_("hg: parse error at %s: %s\n") % |
|
59 | ferr.write(_("hg: parse error at %s: %s\n") % | |
60 | (inst.args[1], inst.args[0])) |
|
60 | (inst.args[1], inst.args[0])) | |
|
61 | if (inst.args[0][0] == ' '): | |||
|
62 | ferr.write(_("unexpected leading whitespace\n")) | |||
61 | else: |
|
63 | else: | |
62 | ferr.write(_("hg: parse error: %s\n") % inst.args[0]) |
|
64 | ferr.write(_("hg: parse error: %s\n") % inst.args[0]) | |
63 | return -1 |
|
65 | return -1 | |
@@ -155,6 +157,8 b' def _runcatch(req):' | |||||
155 | if len(inst.args) > 1: |
|
157 | if len(inst.args) > 1: | |
156 | ui.warn(_("hg: parse error at %s: %s\n") % |
|
158 | ui.warn(_("hg: parse error at %s: %s\n") % | |
157 | (inst.args[1], inst.args[0])) |
|
159 | (inst.args[1], inst.args[0])) | |
|
160 | if (inst.args[0][0] == ' '): | |||
|
161 | ui.warn(_("unexpected leading whitespace\n")) | |||
158 | else: |
|
162 | else: | |
159 | ui.warn(_("hg: parse error: %s\n") % inst.args[0]) |
|
163 | ui.warn(_("hg: parse error: %s\n") % inst.args[0]) | |
160 | return -1 |
|
164 | return -1 |
@@ -19,6 +19,25 b' Invalid syntax: no key' | |||||
19 | hg: parse error at $TESTTMP/.hg/hgrc:1: =nokeyvalue |
|
19 | hg: parse error at $TESTTMP/.hg/hgrc:1: =nokeyvalue | |
20 | [255] |
|
20 | [255] | |
21 |
|
21 | |||
|
22 | Test hint about invalid syntax from leading white space | |||
|
23 | ||||
|
24 | $ cat > .hg/hgrc << EOF | |||
|
25 | > key=value | |||
|
26 | > EOF | |||
|
27 | $ hg showconfig | |||
|
28 | hg: parse error at $TESTTMP/.hg/hgrc:1: key=value | |||
|
29 | unexpected leading whitespace | |||
|
30 | [255] | |||
|
31 | ||||
|
32 | $ cat > .hg/hgrc << EOF | |||
|
33 | > [section] | |||
|
34 | > key=value | |||
|
35 | > EOF | |||
|
36 | $ hg showconfig | |||
|
37 | hg: parse error at $TESTTMP/.hg/hgrc:1: [section] | |||
|
38 | unexpected leading whitespace | |||
|
39 | [255] | |||
|
40 | ||||
22 | Reset hgrc |
|
41 | Reset hgrc | |
23 |
|
42 | |||
24 | $ echo > .hg/hgrc |
|
43 | $ echo > .hg/hgrc |
@@ -43,6 +43,7 b' issue1829: wrong indentation' | |||||
43 | $ echo ' x = y' >> $HGRC |
|
43 | $ echo ' x = y' >> $HGRC | |
44 | $ hg version |
|
44 | $ hg version | |
45 | hg: parse error at $TESTTMP/hgrc:2: x = y |
|
45 | hg: parse error at $TESTTMP/hgrc:2: x = y | |
|
46 | unexpected leading whitespace | |||
46 | [255] |
|
47 | [255] | |
47 |
|
48 | |||
48 | $ python -c "print '[foo]\nbar = a\n b\n c \n de\n fg \nbaz = bif cb \n'" \ |
|
49 | $ python -c "print '[foo]\nbar = a\n b\n c \n de\n fg \nbaz = bif cb \n'" \ |
General Comments 0
You need to be logged in to leave comments.
Login now