Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.py @ 43894:774cee0e95c6
amend: use cmdutil.check_at_most_one_arg()
Differential Revision: https://phab.mercurial-scm.org/D7635
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 12 Dec 2019 15:10:44 -0800 |
parents | 2e672ccc2220 |
children | 023ad45e2fd2 |
comparison
equal
deleted
inserted
replaced
43893:2e672ccc2220 | 43894:774cee0e95c6 |
---|---|
1054 ctx.sub(s).bailifchanged(hint=hint) | 1054 ctx.sub(s).bailifchanged(hint=hint) |
1055 | 1055 |
1056 | 1056 |
1057 def logmessage(ui, opts): | 1057 def logmessage(ui, opts): |
1058 """ get the log message according to -m and -l option """ | 1058 """ get the log message according to -m and -l option """ |
1059 | |
1060 check_at_most_one_arg(opts, b'message', b'logfile') | |
1061 | |
1059 message = opts.get(b'message') | 1062 message = opts.get(b'message') |
1060 logfile = opts.get(b'logfile') | 1063 logfile = opts.get(b'logfile') |
1061 | 1064 |
1062 if message and logfile: | |
1063 raise error.Abort( | |
1064 _(b'options --message and --logfile are mutually exclusive') | |
1065 ) | |
1066 if not message and logfile: | 1065 if not message and logfile: |
1067 try: | 1066 try: |
1068 if isstdiofilename(logfile): | 1067 if isstdiofilename(logfile): |
1069 message = ui.fin.read() | 1068 message = ui.fin.read() |
1070 else: | 1069 else: |