comparison mercurial/commands.py @ 45745:94f681b84c70

tag: leverage cmdutil.check_incompatible_arguments() Differential Revision: https://phab.mercurial-scm.org/D9223
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 15 Oct 2020 22:57:30 -0700
parents 4df5d3965a3e
children e0ad11ab8052 ed84a4d48910
comparison
equal deleted inserted replaced
45744:4df5d3965a3e 45745:94f681b84c70
7086 Since tag names have priority over branch names during revision 7086 Since tag names have priority over branch names during revision
7087 lookup, using an existing branch name as a tag name is discouraged. 7087 lookup, using an existing branch name as a tag name is discouraged.
7088 7088
7089 Returns 0 on success. 7089 Returns 0 on success.
7090 """ 7090 """
7091 cmdutil.check_incompatible_arguments(opts, 'remove', ['rev'])
7091 opts = pycompat.byteskwargs(opts) 7092 opts = pycompat.byteskwargs(opts)
7092 with repo.wlock(), repo.lock(): 7093 with repo.wlock(), repo.lock():
7093 rev_ = b"." 7094 rev_ = b"."
7094 names = [t.strip() for t in (name1,) + names] 7095 names = [t.strip() for t in (name1,) + names]
7095 if len(names) != len(set(names)): 7096 if len(names) != len(set(names)):
7098 scmutil.checknewlabel(repo, n, b'tag') 7099 scmutil.checknewlabel(repo, n, b'tag')
7099 if not n: 7100 if not n:
7100 raise error.Abort( 7101 raise error.Abort(
7101 _(b'tag names cannot consist entirely of whitespace') 7102 _(b'tag names cannot consist entirely of whitespace')
7102 ) 7103 )
7103 if opts.get(b'rev') and opts.get(b'remove'):
7104 raise error.Abort(_(b"--rev and --remove are incompatible"))
7105 if opts.get(b'rev'): 7104 if opts.get(b'rev'):
7106 rev_ = opts[b'rev'] 7105 rev_ = opts[b'rev']
7107 message = opts.get(b'message') 7106 message = opts.get(b'message')
7108 if opts.get(b'remove'): 7107 if opts.get(b'remove'):
7109 if opts.get(b'local'): 7108 if opts.get(b'local'):