[Updated] D8524: Bug None - Bug None - Bug None - Bug None - phabricator: add .arcconfig to help messages and comments (issue6331)
sfink (Steve Fink)
phabricator at mercurial-scm.org
Fri Aug 28 20:09:59 UTC 2020
sfink added a comment.
sfink retitled this revision from "phabricator: load .arcconfig during reposetup (issue6331)" to "Bug None - Bug None - Bug None - Bug None - phabricator: add .arcconfig to help messages and comments (issue6331)".
sfink updated this revision to Diff 22484.
I thought I would at least keep the help message updates instead of scrapping the whole thing.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D8524?vs=21386&id=22484
BRANCH
default
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D8524/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D8524
AFFECTED FILES
hgext/phabricator.py
CHANGE DETAILS
diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -41,6 +41,9 @@
# API token. Get it from https://$HOST/conduit/login/
example.phabtoken = cli-xxxxxxxxxxxxxxxxxxxxxxxxxxxx
+
+phabricator.url and callsign will fallback to values from repo's .arcconfig if
+available.
"""
from __future__ import absolute_import
@@ -182,8 +185,6 @@
else x,
pycompat.json_loads(rawparams),
)
-
- result = True
except ValueError:
ui.warn(_(b"invalid JSON in %s\n") % wdirvfs.join(b".arcconfig"))
except IOError:
@@ -200,7 +201,7 @@
if cfg:
ui.applyconfig(cfg, source=wdirvfs.join(b".arcconfig"))
- return orig(ui, wdirvfs, hgvfs, requirements) or result # Load .hg/hgrc
+ return orig(ui, wdirvfs, hgvfs, requirements) or bool(cfg) # Load .hg/hgrc
def vcrcommand(name, flags, spec, helpcategory=None, optionalrepo=False):
@@ -328,13 +329,18 @@
def readurltoken(ui):
"""return conduit url, token and make sure they exist
- Currently read from [auth] config section. In the future, it might
- make sense to read from .arcconfig and .arcrc as well.
+ Read token from [auth] config section. Read url from [phabricator] config
+ section or repo's .arcconfig. In the future, it might make sense to read
+ tokens from ~/.arcrc as well.
"""
url = ui.config(b'phabricator', b'url')
if not url:
raise error.Abort(
- _(b'config %s.%s is required') % (b'phabricator', b'url')
+ _(
+ b'unable to read phabricator uri from from config %s.%s or %s '
+ b'file in repo'
+ )
+ % (b'phabricator', b'url', b'.arcconfig')
)
res = httpconnectionmod.readauthforuri(ui, url, util.url(url).user)
To: sfink, mharbison72, marmoute
Cc: marmoute, Kwan, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20200828/a616c906/attachment.html>
More information about the Mercurial-patches
mailing list