42 [1] |
42 [1] |
43 $ hg paths -q unknown |
43 $ hg paths -q unknown |
44 [1] |
44 [1] |
45 $ cd .. |
45 $ cd .. |
46 |
46 |
|
47 sub-options for an undeclared path are ignored |
|
48 |
|
49 $ hg init suboptions |
|
50 $ cd suboptions |
|
51 |
|
52 $ cat > .hg/hgrc << EOF |
|
53 > [paths] |
|
54 > path0 = https://example.com/path0 |
|
55 > path1:pushurl = https://example.com/path1 |
|
56 > EOF |
|
57 $ hg paths |
|
58 path0 = https://example.com/path0 |
|
59 |
|
60 unknown sub-options aren't displayed |
|
61 |
|
62 $ cat > .hg/hgrc << EOF |
|
63 > [paths] |
|
64 > path0 = https://example.com/path0 |
|
65 > path0:foo = https://example.com/path1 |
|
66 > EOF |
|
67 |
|
68 $ hg paths |
|
69 path0 = https://example.com/path0 |
|
70 |
|
71 :pushurl must be a URL |
|
72 |
|
73 $ cat > .hg/hgrc << EOF |
|
74 > [paths] |
|
75 > default = /path/to/nothing |
|
76 > default:pushurl = /not/a/url |
|
77 > EOF |
|
78 |
|
79 $ hg paths |
|
80 (paths.default:pushurl not a URL; ignoring) |
|
81 default = /path/to/nothing |
|
82 |
|
83 #fragment is not allowed in :pushurl |
|
84 |
|
85 $ cat > .hg/hgrc << EOF |
|
86 > [paths] |
|
87 > default = https://example.com/repo |
|
88 > invalid = https://example.com/repo |
|
89 > invalid:pushurl = https://example.com/repo#branch |
|
90 > EOF |
|
91 |
|
92 $ hg paths |
|
93 ("#fragment" in paths.invalid:pushurl not supported; ignoring) |
|
94 default = https://example.com/repo |
|
95 invalid = https://example.com/repo |
|
96 invalid:pushurl = https://example.com/repo |
|
97 |
|
98 $ cd .. |
|
99 |
47 'file:' disables [paths] entries for clone destination |
100 'file:' disables [paths] entries for clone destination |
48 |
101 |
49 $ cat >> $HGRCPATH <<EOF |
102 $ cat >> $HGRCPATH <<EOF |
50 > [paths] |
103 > [paths] |
51 > gpath1 = http://hg.example.com |
104 > gpath1 = http://hg.example.com |