Patchwork D7542: mail: don't complain about a multi-word email.method

login
register
mail settings
Submitter phabricator
Date April 11, 2022, 12:56 p.m.
Message ID <f7db4bae917a012115f9a66a14d82d9e@localhost.localdomain>
Download mbox | patch
Permalink /patch/50840/
State New
Headers show

Comments

phabricator - April 11, 2022, 12:56 p.m.
Herald added a subscriber: mercurial-patches.
jcristau updated this revision to Diff 33000.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7542?vs=18420&id=33000

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7542/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7542

AFFECTED FILES
  mercurial/mail.py

CHANGE DETAILS




To: jcristau, #hg-reviewers
Cc: mercurial-patches, yuja, mercurial-devel

Patch

diff --git a/mercurial/mail.py b/mercurial/mail.py
--- a/mercurial/mail.py
+++ b/mercurial/mail.py
@@ -260,9 +260,11 @@ 
                 )
             )
     else:
-        if not procutil.findexe(method):
+        command = procutil.shellsplit(method)
+        command = command[0] if command else b''
+        if not (command and procutil.findexe(command)):
             raise error.Abort(
-                _(b'%r specified as email transport, but not in PATH') % method
+                _(b'%r specified as email transport, but not in PATH') % command
             )