Bug 4247 - hg config should return a non-zero exit code when looking for a non-existent option
Summary: hg config should return a non-zero exit code when looking for a non-existent ...
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 3.0
Hardware: PC All
: normal feature
Assignee: Bugzilla
URL:
Keywords: easy
Depends on:
Blocks:
 
Reported: 2014-05-13 17:20 UTC by Aaron Kushner
Modified: 2014-09-27 20:19 UTC (History)
4 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Kushner 2014-05-13 17:20 UTC
$ hg config extension.i_dont_exist

$ echo $?
0

Should really exit other than 0 when the config option does not exist. What it currently does is return a newline for extensions that exist (and the option doesn't have anything on the right hand side of the =).
Comment 1 Matt Mackall 2014-05-13 18:17 UTC
Sounds good.
Comment 2 HG Bot 2014-09-01 21:45 UTC
Fixed by http://selenic.com/repo/hg/rev/816be4ca4ae2
Aaron Kushner <akushner@fb.com>
config: exit non zero on non-existent config option (issue4247)

When running 'hg config no_such_option', hg exited with a
zero exit code. This change now exits with a 1 if the
config option does not exist.

(please test the fix)