comparison mercurial/cmdutil.py @ 44194:d4c1501225c4

cmdutil: change check_incompatible_arguments() *arg to single iterable This makes it clearer on the call-sites that the first argument is special. Thanks to Yuya for the suggestion. Differential Revision: https://phab.mercurial-scm.org/D8018
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 27 Jan 2020 09:14:19 -0800
parents 19533e4c3450
children c791ed6a2154
comparison
equal deleted inserted replaced
44193:3c265cef6edc 44194:d4c1501225c4
279 ) 279 )
280 previous = x 280 previous = x
281 return previous 281 return previous
282 282
283 283
284 def check_incompatible_arguments(opts, first, *others): 284 def check_incompatible_arguments(opts, first, others):
285 """abort if the first argument is given along with any of the others 285 """abort if the first argument is given along with any of the others
286 286
287 Unlike check_at_most_one_arg(), `others` are not mutually exclusive 287 Unlike check_at_most_one_arg(), `others` are not mutually exclusive
288 among themselves. 288 among themselves, and they're passed as a single collection.
289 """ 289 """
290 for other in others: 290 for other in others:
291 check_at_most_one_arg(opts, first, other) 291 check_at_most_one_arg(opts, first, other)
292 292
293 293