From patchwork Tue May 4 20:58:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Xinglu Chen X-Patchwork-Id: 97 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id C9FBC27BC81; Tue, 4 May 2021 21:59:10 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7297127BC82 for ; Tue, 4 May 2021 21:59:10 +0100 (BST) Received: from localhost ([::1]:42584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1le28L-0004M5-LT for patchwork@mira.cbaines.net; Tue, 04 May 2021 16:59:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1le28E-0004LZ-Ef for guix-patches@gnu.org; Tue, 04 May 2021 16:59:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43862) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1le28E-0002S8-6w for guix-patches@gnu.org; Tue, 04 May 2021 16:59:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1le28E-0008TF-52 for guix-patches@gnu.org; Tue, 04 May 2021 16:59:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48232] [PATCH 0/2] Add mercurial-commitsigs and some changes to Mercurial. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 04 May 2021 20:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48232 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48232@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.162016188932515 (code B ref -1); Tue, 04 May 2021 20:59:01 +0000 Received: (at submit) by debbugs.gnu.org; 4 May 2021 20:58:09 +0000 Received: from localhost ([127.0.0.1]:55398 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1le27N-0008SN-Dn for submit@debbugs.gnu.org; Tue, 04 May 2021 16:58:09 -0400 Received: from lists.gnu.org ([209.51.188.17]:44184) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1le27K-0008SH-IT for submit@debbugs.gnu.org; Tue, 04 May 2021 16:58:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1le27K-0004Iu-9n for guix-patches@gnu.org; Tue, 04 May 2021 16:58:06 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:51194 helo=mail.yoctocell.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1le27I-0001rN-KD for guix-patches@gnu.org; Tue, 04 May 2021 16:58:06 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1620161882; bh=40JRkgm+CEEIy8jmLZGTt1lKekEue6QMC1JHSz5b/gU=; h=From:To:Subject:References:Date; b=cXtwu1QBRyv43vEgTr1tK5wmv4rX5fCrsIB9O6VfFYaoH3YrW4eoS3TZwrWbS6OmW 5Ad4TzxAetEC5XeMKG9FIJnAZSRC+DSadpQxo3t366bgarwq8k9CcQ9L1Vzv7k8vJ3 ONWd2n0hdSE56jlHPQE7oMknYWCoie+ZZmBnVk7c= References: Date: Tue, 04 May 2021 22:58:01 +0200 Message-ID: <87k0oecj3a.fsf@yoctocell.xyz> MIME-Version: 1.0 Received-SPF: pass client-ip=87.96.130.155; envelope-from=public@yoctocell.xyz; helo=mail.yoctocell.xyz X-Spam_score_int: 34 X-Spam_score: 3.4 X-Spam_bar: +++ X-Spam_report: (3.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_SUSPICIOUS_NTLD=0.498, FROM_SUSPICIOUS_NTLD_FP=1.997, PDS_OTHER_BAD_TLD=1.997, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches The first patch adds the commitsigs extension for Mercurial, it allows users to sign Mercurial changesets (equivalent to Git commits) with GnuPG or OpenSSL. The second patch adds PYTHONPATH to the ‘native-search-paths’ field of Mercurial, this allows Mercurial to automatically find third-party extensions (like commitsigs) installed in /gnu/store/...-profile/lib/python3.8/site-packages/hgext3rd. By default, it only looks at /gnu/store/...-mercurial/lib/python3.8/site-packages/hgext3rd. However, I am not sure this is the best approach since it messes with PYTHONPATH, AFAIK there is no such things as a HGEXTENSIONS variable I could set. Another problem is that I have to hardcode “python3.8”, this would obviously have to be updated if the default Python version gets updated. I did try to do something like this: #+begin_src scheme (string-append "lib/python" (string-join (drop-right (string-split (package-version python) #\.) 1) ".") "/site-packages/hgext3rd") #+end_src but it just gave me a confusing error message when trying to build it; it worked fine if I hit {C-x C-e} in Emacs, though. What we could do instead is to delegate the work of installing Mercurial extensions to Guix Home[1] (I am currently working on adding a service for Mercurial[2]) and add a ‘mercurial-extension-file-path’ key to the ‘properties’ field of Mercurial extensions so Guix Home can tell Mercurial where to find the extension by the relevant lines in hgrc. We could have a package definition like this: #+begin_src scheme (package (name "mercurial-commitsigs") ... (properties '((mercurial-extension-file-path . "commitsigs.py")))) #+end_src hgrc: #+begin_src [extensions] commitsigs = /gnu/store/...-mercurial-commitsigs/commitsigs.py #+end_src [1]: https://yhetil.org/guix-devel/878s6u2pco.fsf@trop.in/ [2]: https://lists.sr.ht/~abcdw/rde-devel/patches/22421 Xinglu Chen (2): gnu: Add mercurial-commitsigs. gnu: mercurial: Add PYTHONPATH to ‘native-search-paths’. gnu/packages/version-control.scm | 68 ++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) base-commit: aa7eeabe9a782afc2535581298990050d16b1895