comparison mercurial/cmdutil.py @ 42921:4690902850df

uncommit: make -D/--date and -U/--user mutually exclusive This is how amend and graft work (but not MQ). I'm not sure why this didn't work for me when I first tried it. Differential Revision: https://phab.mercurial-scm.org/D6842
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 10 Sep 2019 22:52:04 -0400
parents a50661567f83
children e4803231f538
comparison
equal deleted inserted replaced
42920:a50661567f83 42921:4690902850df
183 _linebelow = "^HG: ------------------------ >8 ------------------------$" 183 _linebelow = "^HG: ------------------------ >8 ------------------------$"
184 184
185 def resolvecommitoptions(ui, opts): 185 def resolvecommitoptions(ui, opts):
186 """modify commit options dict to handle related options 186 """modify commit options dict to handle related options
187 """ 187 """
188 if opts.get('date') and opts.get('currentdate'):
189 raise error.Abort(_('--date and --currentdate are mutually '
190 'exclusive'))
191 if opts.get(b'user') and opts.get(b'currentuser'):
192 raise error.Abort(_('--user and --currentuser are mutually '
193 'exclusive'))
194
188 # N.B. this is extremely similar to setupheaderopts() in mq.py 195 # N.B. this is extremely similar to setupheaderopts() in mq.py
189 if not opts.get(b'date') and opts.get(b'currentdate'): 196 if opts.get(b'currentdate'):
190 opts[b'date'] = b'%d %d' % dateutil.makedate() 197 opts[b'date'] = b'%d %d' % dateutil.makedate()
191 if not opts.get(b'user') and opts.get(b'currentuser'): 198 if opts.get(b'currentuser'):
192 opts[b'user'] = ui.username() 199 opts[b'user'] = ui.username()
193 200
194 def ishunk(x): 201 def ishunk(x):
195 hunkclasses = (crecordmod.uihunk, patch.recordhunk) 202 hunkclasses = (crecordmod.uihunk, patch.recordhunk)
196 return isinstance(x, hunkclasses) 203 return isinstance(x, hunkclasses)