##// END OF EJS Templates
phabricator: use .arcconfig for `phabricator.url` if not set locally...
Matt Harbison -
r44587:ff396501 default
parent child Browse files
Show More
@@ -1,5 +1,6 b''
1 {
1 {
2 "conduit_uri": "https://phab.mercurial-scm.org/api",
2 "conduit_uri": "https://phab.mercurial-scm.org/api",
3 "phabricator.uri": "https://phab.mercurial-scm.org/",
3 "repository.callsign": "HG",
4 "repository.callsign": "HG",
4 "arc.land.onto.default": "@",
5 "arc.land.onto.default": "@",
5 "base": "hg:.^"
6 "base": "hg:.^"
@@ -178,11 +178,16 b' def _loadhgrc(orig, ui, wdirvfs, hgvfs, '
178 except IOError:
178 except IOError:
179 pass
179 pass
180
180
181 cfg = util.sortdict()
182
181 if b"repository.callsign" in arcconfig:
183 if b"repository.callsign" in arcconfig:
182 ui.applyconfig(
184 cfg[(b"phabricator", b"callsign")] = arcconfig[b"repository.callsign"]
183 {(b"phabricator", b"callsign"): arcconfig[b"repository.callsign"]},
185
184 source=wdirvfs.join(b".arcconfig"),
186 if b"phabricator.uri" in arcconfig:
185 )
187 cfg[(b"phabricator", b"url")] = arcconfig[b"phabricator.uri"]
188
189 if cfg:
190 ui.applyconfig(cfg, source=wdirvfs.join(b".arcconfig"))
186
191
187 return orig(ui, wdirvfs, hgvfs, requirements) or result # Load .hg/hgrc
192 return orig(ui, wdirvfs, hgvfs, requirements) or result # Load .hg/hgrc
188
193
@@ -228,8 +228,8 b' The .arcconfig content overrides global '
228 $ mv .hg/hgrc .hg/hgrc.bak
228 $ mv .hg/hgrc .hg/hgrc.bak
229 $ hg config phabricator --debug
229 $ hg config phabricator --debug
230 read config from: */.hgrc (glob)
230 read config from: */.hgrc (glob)
231 */.hgrc:*: phabricator.url=global (glob)
232 $TESTTMP/repo/.arcconfig: phabricator.callsign=HG
231 $TESTTMP/repo/.arcconfig: phabricator.callsign=HG
232 $TESTTMP/repo/.arcconfig: phabricator.url=https://phab.mercurial-scm.org/
233
233
234 But it doesn't override local config
234 But it doesn't override local config
235 $ cat >> .hg/hgrc << EOF
235 $ cat >> .hg/hgrc << EOF
General Comments 0
You need to be logged in to leave comments. Login now