artemis.py
changeset 48 7897c850150f
parent 40 d013e9b9aba7
child 49 248ec36cef5f
equal deleted inserted replaced
47:1f5ed31cc92a 48:7897c850150f
   110     default_issue_text +=         "Detailed description."
   110     default_issue_text +=         "Detailed description."
   111 
   111 
   112     # Get properties, and figure out if we need an explicit comment
   112     # Get properties, and figure out if we need an explicit comment
   113     properties = _get_properties(opts['property'])
   113     properties = _get_properties(opts['property'])
   114     no_comment = id and properties and opts['no_property_comment']
   114     no_comment = id and properties and opts['no_property_comment']
       
   115     message = opts['message']
   115 
   116 
   116     # Create the text
   117     # Create the text
   117     if not no_comment:
   118     if message:
       
   119         if not id:
       
   120             state_str = 'State: %s\n' % state['default']
       
   121         else:
       
   122             state_str = ''
       
   123         issue = "From: %s\nDate: %s\nSubject: %s\n%s" % \
       
   124                 (user, util.datestr(format=date_format), message, state_str)
       
   125     elif not no_comment:
   118         issue = ui.edit(default_issue_text, user)
   126         issue = ui.edit(default_issue_text, user)
   119 
   127 
   120         if issue.strip() == '':
   128         if issue.strip() == '':
   121             ui.warn('Empty issue, ignoring\n')
   129             ui.warn('Empty issue, ignoring\n')
   122             return
   130             return
   399                  [('a', 'attach', [],
   407                  [('a', 'attach', [],
   400                    'attach file(s) (e.g., -a filename1 -a filename2)'),
   408                    'attach file(s) (e.g., -a filename1 -a filename2)'),
   401                   ('p', 'property', [],
   409                   ('p', 'property', [],
   402                    'update properties (e.g., -p state=fixed)'),
   410                    'update properties (e.g., -p state=fixed)'),
   403                   ('n', 'no-property-comment', None,
   411                   ('n', 'no-property-comment', None,
   404                    'do not add a comment about changed properties')],
   412                    'do not add a comment about changed properties'),
       
   413                   ('m', 'message', '',
       
   414                    'use <text> as an issue subject')],
   405                  _('hg iadd [OPTIONS] [ID] [COMMENT]')),
   415                  _('hg iadd [OPTIONS] [ID] [COMMENT]')),
   406     'ishow':      (ishow,
   416     'ishow':      (ishow,
   407                  [('a', 'all', None, 'list all comments'),
   417                  [('a', 'all', None, 'list all comments'),
   408                   ('s', 'skip', '>', 'skip lines starting with a substring'),
   418                   ('s', 'skip', '>', 'skip lines starting with a substring'),
   409                   ('x', 'extract', [], 'extract attachments (provide attachment number as argument)'),
   419                   ('x', 'extract', [], 'extract attachments (provide attachment number as argument)'),