mercurial/cmdutil.py
changeset 42921 4690902850df
parent 42920 a50661567f83
child 42932 e4803231f538
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)