GNU bug report logs -
#48232
[PATCH 0/2] Add mercurial-commitsigs and some changes to Mercurial.
Previous Next
Reported by: Xinglu Chen <public <at> yoctocell.xyz>
Date: Tue, 4 May 2021 20:59:01 UTC
Severity: normal
Tags: patch
Done: Xinglu Chen <public <at> yoctocell.xyz>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hi,
Xinglu Chen <public <at> yoctocell.xyz> skribis:
[...]
> However, two of the tests are failing, they are related to multiple
> people trying to push to the same repo at the same time. I don’t know
> why they would fail, and I don’t know if my patch will break things in
> the “real world”.
>
> This is needed to make Mercurial read the HGEXTENSIONPATH to detect
> third-party extensions. It is called HGEXTENSIONPATH and not
> HG_EXTENSION_PATH to keep it consistent with other environment variables for
> Mercurial, e.g. HGENCODINGAMBIGUOUS, HGEDITOR ... Hopefully I or someone else
> will get this into Mercurial proper.
>
> diff --git a/mercurial/extensions.py b/mercurial/extensions.py
> --- a/mercurial/extensions.py
> +++ b/mercurial/extensions.py
> @@ -13,6 +13,7 @@
> import imp
> import inspect
> import os
> +import sys
>
> from .i18n import (
> _,
> @@ -108,6 +109,8 @@
>
> def _importh(name):
> """import and return the <name> module"""
> + # Read HGEXTENSIONPATH environment variable when import extensions.
> + sys.path.append(os.getenv("HGEXTENSIONPATH"))
Perhaps you need to handle the case where HGEXTENSIONPATH is undefined?
(This could explain the test failures that you see, no?)
Also, I’m no Pythonista, but if ‘sys.path’ is a list, then you have to
split the value of HGEXTENSIONPATH on colons.
Thanks,
Ludo’.
This bug report was last modified 4 years and 63 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.