This is an archive of the discontinued Mercurial Phabricator instance.

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

Authored by jcristau on Dec 2 2019, 8:51 AM.

Details

Summary

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.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jcristau created this revision.Dec 2 2019, 8:51 AM
yuja added a subscriber: yuja.Dec 3 2019, 7:55 AM

+ command = procutil.shellsplit(method)
+ if not (command and procutil.findexe(command[0])):

This condition is correct, but command[0] would raise IndexError if
not command.

Maybe we'll need a helper function that does shellsplit() and returns
command[0] or b''.

  • _(b'%r specified as email transport, but not in PATH') % method

+ _(b'%r specified as email transport, but not in PATH') % command[0]

jcristau planned changes to this revision.Dec 3 2019, 9:51 AM

doh. Right you are.

jcristau updated this revision to Diff 33000.Mon, Apr 11, 8:56 AM
Alphare accepted this revision.Tue, Apr 12, 9:54 AM
Alphare added a subscriber: Alphare.

That's an oldie

This revision is now accepted and ready to land.Tue, Apr 12, 9:54 AM
This revision was automatically updated to reflect the committed changes.