unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Xinglu Chen <public@yoctocell.xyz>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 48232@debbugs.gnu.org
Subject: [bug#48232] [PATCH 0/2] Add mercurial-commitsigs and some changes to Mercurial.
Date: Wed, 12 May 2021 11:21:43 +0200	[thread overview]
Message-ID: <874kf8cno8.fsf@yoctocell.xyz> (raw)
In-Reply-To: <877dk5h0kg.fsf@yoctocell.xyz>

[-- Attachment #1: Type: text/plain, Size: 637 bytes --]

On Tue, May 11 2021, Xinglu Chen wrote:

>> Let’s see if you can adjust hg to honor a new environment variable,
>> and if not, we’ll see…
>
> Hmm, I will try to see what I can do.

I am no Python expert, but Mercurial is able to load the commitsigs.py
module when I applying the attached patch and putting the following in
~/.config/hg/hgrc.

  [extensions]
  commitsigs = 

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”.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: hg-extension-path-patch --]
[-- Type: text/x-patch, Size: 874 bytes --]

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"))
     mod = __import__(pycompat.sysstr(name))
     components = name.split(b'.')
     for comp in components[1:]:

  reply	other threads:[~2021-05-12  9:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1620159508.git.public@yoctocell.xyz>
2021-05-04 20:58 ` [bug#48232] [PATCH 0/2] Add mercurial-commitsigs and some changes to Mercurial Xinglu Chen
2021-05-11 10:26   ` Ludovic Courtès
2021-05-11 11:27     ` Xinglu Chen
2021-05-11 12:29       ` Ludovic Courtès
2021-05-11 13:17         ` Xinglu Chen
2021-05-12  9:21           ` Xinglu Chen [this message]
2021-05-12 20:56             ` Ludovic Courtès
2021-05-14 11:52               ` Xinglu Chen
2021-05-15  9:17   ` [bug#48232] [PATCH v2 0/2] Add hg-commitsigs " Xinglu Chen
2021-05-15  9:17     ` [bug#48232] [PATCH v2 1/2] gnu: Add hg-commitsigs Xinglu Chen
2021-05-16 21:14       ` Ludovic Courtès
2021-05-16 21:33         ` Xinglu Chen
2021-05-15  9:17     ` [bug#48232] [PATCH v2 2/2] gnu: mercurial: Patch to make it read HGEXTENSIONPATH Xinglu Chen
2021-05-16 21:16       ` Ludovic Courtès
2021-05-17 20:07     ` bug#48232: [PATCH v2 0/2] Add hg-commitsigs and some changes to Mercurial Xinglu Chen
2021-05-04 21:00 ` [bug#48232] [PATCH 1/2] gnu: Add mercurial-commitsigs Xinglu Chen
2021-05-04 21:00 ` [bug#48232] [PATCH 2/2] gnu: mercurial: Add PYTHONPATH to Xinglu Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874kf8cno8.fsf@yoctocell.xyz \
    --to=public@yoctocell.xyz \
    --cc=48232@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).