[Commented On] D8524: phabricator: load .arcconfig during reposetup (issue6331)
sfink (Steve Fink)
phabricator at mercurial-scm.org
Fri Aug 28 18:16:05 UTC 2020
sfink added a comment.
I finally got around to looking at why I needed this. It turned out to be pretty complicated, and although this patch would work for me, I'm sure there are other ways to work around this so it may not make sense to land.
At first, I thought it was simple: the wrapped `loadhgrc` is defined in an extension, and knowing what extensions exist requires loading the `.hgrc` config file, so of course it can't possibly work and everybody who is using it successfully must be, uh, liars or something!
But it appears that this `loadhgrc` is only used for loading a repository's `.hg/hgrc`, so the above logic is wrong.
Ok, here's where it gets weird. What I'm doing is making a "wrapper" extension `mozphabricator.py` that works by importing selected stuff from mercurial's in-tree `hgext/phabricator.py`, and then overriding and monkeypatching what I want to change. The problem is that `phabricator.py` hooks into the repo-specific `.hgrc` loading via `@exthelper.exthelper().wrapfunction(localrepo, "loadhgrc")`. When I thought using `loadhgrc` was just completely wrong, the implementation was trivial: just do `from hgext.phabricator import reposetup` and it just works.
Aha! Ok, the problem I was running into with the `exthelper` stuff is that it wasn't getting invoked, and it wasn't getting invoked because my extension did not set its `uisetup` at all. So the fix is very similar to the above: `from hgext.phabricator import uisetup`.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D8524/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D8524
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/acd00f68/attachment-0001.html>
More information about the Mercurial-patches
mailing list