Mercurial > hg
comparison tests/test-config.t @ 19087:7d82ad4b3727 stable
config: discard "%unset" values defined in the other files read in previously
Before this patch, "%unset" can't unset values defined in the other
files read in previously, even though online help document says that
it can. It can unset only values defined in the same configuration
file.
For example, the value defined in "~/.hgrc" can't be unset by "%unset"
in ".hg/hgrc" of the repository.
This patch records "%unset"-ed values in "config.parse()", and
discards corresponding values in "config.update()".
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Fri, 26 Apr 2013 23:36:12 +0900 |
parents | 8fb8dce3f9b6 |
children | d9a8017dce10 816be4ca4ae2 |
comparison
equal
deleted
inserted
replaced
19086:8fb8dce3f9b6 | 19087:7d82ad4b3727 |
---|---|
9 | 9 |
10 $ hg showconfig Section | 10 $ hg showconfig Section |
11 Section.KeY=Case Sensitive | 11 Section.KeY=Case Sensitive |
12 Section.key=lower case | 12 Section.key=lower case |
13 | 13 |
14 Test "%unset" | |
15 | |
16 $ cat >> $HGRCPATH <<EOF | |
17 > [unsettest] | |
18 > local-hgrcpath = should be unset (HGRCPATH) | |
19 > %unset local-hgrcpath | |
20 > | |
21 > global = should be unset (HGRCPATH) | |
22 > | |
23 > both = should be unset (HGRCPATH) | |
24 > | |
25 > set-after-unset = should be unset (HGRCPATH) | |
26 > EOF | |
27 | |
28 $ cat >> .hg/hgrc <<EOF | |
29 > [unsettest] | |
30 > local-hgrc = should be unset (.hg/hgrc) | |
31 > %unset local-hgrc | |
32 > | |
33 > %unset global | |
34 > | |
35 > both = should be unset (.hg/hgrc) | |
36 > %unset both | |
37 > | |
38 > set-after-unset = should be unset (.hg/hgrc) | |
39 > %unset set-after-unset | |
40 > set-after-unset = should be set (.hg/hgrc) | |
41 > EOF | |
42 | |
43 $ hg showconfig unsettest | |
44 unsettest.set-after-unset=should be set (.hg/hgrc) |