Mercurial > hg
comparison mercurial/mail.py @ 49051:1d6c6ad645e1
mail: don't complain about a multi-word email.method
I want to be able to set email.method to "ssh relay /usr/sbin/sendmail"
without needing an extra trivial shell script.
This works fine since we pass the full command to a shell, except for
validateconfig trying to find it in $PATH.
Differential Revision: https://phab.mercurial-scm.org/D7542
author | Julien Cristau <jcristau@debian.org> |
---|---|
date | Mon, 02 Dec 2019 14:45:00 +0100 |
parents | f0c445a8e324 |
children | 1c7453f2bb57 |
comparison
equal
deleted
inserted
replaced
49045:a85c123c625a | 49051:1d6c6ad645e1 |
---|---|
258 b'smtp specified as email transport, ' | 258 b'smtp specified as email transport, ' |
259 b'but no smtp host configured' | 259 b'but no smtp host configured' |
260 ) | 260 ) |
261 ) | 261 ) |
262 else: | 262 else: |
263 if not procutil.findexe(method): | 263 command = procutil.shellsplit(method) |
264 command = command[0] if command else b'' | |
265 if not (command and procutil.findexe(command)): | |
264 raise error.Abort( | 266 raise error.Abort( |
265 _(b'%r specified as email transport, but not in PATH') % method | 267 _(b'%r specified as email transport, but not in PATH') % command |
266 ) | 268 ) |
267 | 269 |
268 | 270 |
269 def codec2iana(cs): | 271 def codec2iana(cs): |
270 # type: (str) -> str | 272 # type: (str) -> str |