comparison tests/test-alias.t @ 37139:aa55c5354b8f

alias: reject non-ascii characters in user help/doc strings Since command doc/help texts are passed to i18n.gettext(), they must be ASCII. Otherwise, UnicodeError would be raised.
author Yuya Nishihara <yuya@tcha.org>
date Wed, 28 Mar 2018 22:04:45 +0900
parents 6890b7e991a4
children 004ecdbe96ec
comparison
equal deleted inserted replaced
37138:4d63f3bc1e1a 37139:aa55c5354b8f
614 */* (glob) (?) 614 */* (glob) (?)
615 */* (glob) (?) 615 */* (glob) (?)
616 616
617 (some details hidden, use --verbose to show complete help) 617 (some details hidden, use --verbose to show complete help)
618 618
619 invalid character in user-specified help
620
621 >>> with open('.hg/hgrc', 'ab') as f:
622 ... f.write(b'[alias]\n'
623 ... b'invaliddoc = log\n'
624 ... b'invaliddoc:doc = \xc0\n'
625 ... b'invalidhelp = log\n'
626 ... b'invalidhelp:help = \xc0\n') and None
627 $ hg help invaliddoc
628 non-ASCII character in alias definition 'invaliddoc:doc'
629 $ hg help invalidhelp
630 non-ASCII character in alias definition 'invalidhelp:help'
631 $ hg invaliddoc
632 abort: non-ASCII character in alias definition 'invaliddoc:doc'
633 [255]
634 $ hg invalidhelp
635 abort: non-ASCII character in alias definition 'invalidhelp:help'
636 [255]
637
619 invalid arguments 638 invalid arguments
620 639
621 $ hg rt foo 640 $ hg rt foo
622 hg rt: invalid arguments 641 hg rt: invalid arguments
623 hg rt 642 hg rt