mercurial/cmdutil.py
changeset 42903 66048f6b5d0d
parent 42892 a65c4715fb5d
child 42920 a50661567f83
equal deleted inserted replaced
42902:ff1ff2aae132 42903:66048f6b5d0d
    98      _('record the specified date as commit date'), _('DATE')),
    98      _('record the specified date as commit date'), _('DATE')),
    99     ('u', 'user', '',
    99     ('u', 'user', '',
   100      _('record the specified user as committer'), _('USER')),
   100      _('record the specified user as committer'), _('USER')),
   101 ]
   101 ]
   102 
   102 
       
   103 commitopts3 = [
       
   104     (b'D', b'current-date', None,
       
   105      _(b'record the current date as commit date')),
       
   106     (b'U', b'current-user', None,
       
   107      _(b'record the current user as committer')),
       
   108 ]
       
   109 
   103 formatteropts = [
   110 formatteropts = [
   104     ('T', 'template', '',
   111     ('T', 'template', '',
   105      _('display with template'), _('TEMPLATE')),
   112      _('display with template'), _('TEMPLATE')),
   106 ]
   113 ]
   107 
   114 
   172 ]
   179 ]
   173 
   180 
   174 # special string such that everything below this line will be ingored in the
   181 # special string such that everything below this line will be ingored in the
   175 # editor text
   182 # editor text
   176 _linebelow = "^HG: ------------------------ >8 ------------------------$"
   183 _linebelow = "^HG: ------------------------ >8 ------------------------$"
       
   184 
       
   185 def resolvecommitoptions(ui, opts):
       
   186     """modify commit options dict to handle related options
       
   187     """
       
   188     # N.B. this is extremely similar to setupheaderopts() in mq.py
       
   189     if not opts.get(b'date') and opts.get(b'current_date'):
       
   190         opts[b'date'] = b'%d %d' % dateutil.makedate()
       
   191     if not opts.get(b'user') and opts.get(b'current_user'):
       
   192         opts[b'user'] = ui.username()
   177 
   193 
   178 def ishunk(x):
   194 def ishunk(x):
   179     hunkclasses = (crecordmod.uihunk, patch.recordhunk)
   195     hunkclasses = (crecordmod.uihunk, patch.recordhunk)
   180     return isinstance(x, hunkclasses)
   196     return isinstance(x, hunkclasses)
   181 
   197