all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH 0/2] Add mercurial-commitsigs and some changes to Mercurial.
@ 2021-05-04 20:46 Xinglu Chen
  2021-05-04 20:56 ` Xinglu Chen
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Xinglu Chen @ 2021-05-04 20:46 UTC (permalink / raw)
  To: guix-devel

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




^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2021-05-17 20:09 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-04 20:46 [PATCH 0/2] Add mercurial-commitsigs and some changes to Mercurial Xinglu Chen
2021-05-04 20:56 ` Xinglu Chen
2021-05-04 20:58 ` [bug#48232] " 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
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

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.