From: Xinglu Chen <public@yoctocell.xyz>
To: guix-devel@gnu.org
Subject: [PATCH 0/2] Add mercurial-commitsigs and some changes to Mercurial.
Date: Tue, 04 May 2021 22:46:14 +0200 [thread overview]
Message-ID: <cover.1620159508.git.public@yoctocell.xyz> (raw)
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
--
2.31.1
next reply other threads:[~2021-05-04 20:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-04 20:46 Xinglu Chen [this message]
2021-05-04 20:56 ` [PATCH 0/2] Add mercurial-commitsigs and some changes to Mercurial 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=cover.1620159508.git.public@yoctocell.xyz \
--to=public@yoctocell.xyz \
--cc=guix-devel@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).