hgext/patchbomb.py
changeset 7547 4949729ee9ee
parent 7413 0b6428da1f22
child 7600 f7739cf3833c
equal deleted inserted replaced
7546:c7f48414f3ad 7547:4949729ee9ee
     7 the first line of the changeset description as the subject text.
     7 the first line of the changeset description as the subject text.
     8 The message contains two or three body parts:
     8 The message contains two or three body parts:
     9 
     9 
    10   The remainder of the changeset description.
    10   The remainder of the changeset description.
    11 
    11 
    12   [Optional] If the diffstat program is installed, the result of
    12   [Optional] The result of running diffstat on the patch.
    13   running diffstat on the patch.
       
    14 
    13 
    15   The patch itself, as generated by "hg export".
    14   The patch itself, as generated by "hg export".
    16 
    15 
    17 Each message refers to all of its predecessors using the In-Reply-To
    16 Each message refers to all of its predecessors using the In-Reply-To
    18 and References headers, so they will show up as a sequence in
    17 and References headers, so they will show up as a sequence in
    97             return r
    96             return r
    98         ui.warn(_('Please enter a valid value.\n'))
    97         ui.warn(_('Please enter a valid value.\n'))
    99 
    98 
   100 def cdiffstat(ui, summary, patchlines):
    99 def cdiffstat(ui, summary, patchlines):
   101     s = patch.diffstat(patchlines)
   100     s = patch.diffstat(patchlines)
   102     if s:
   101     if summary:
   103         if summary:
   102         ui.write(summary, '\n')
   104             ui.write(summary, '\n')
   103         ui.write(s, '\n')
   105             ui.write(s, '\n')
   104     ans = prompt(ui, _('Does the diffstat above look okay? '), 'y')
   106         ans = prompt(ui, _('Does the diffstat above look okay? '), 'y')
   105     if not ans.lower().startswith('y'):
   107         if not ans.lower().startswith('y'):
   106         raise util.Abort(_('diffstat rejected'))
   108             raise util.Abort(_('diffstat rejected'))
       
   109     elif s is None:
       
   110         ui.warn(_('no diffstat information available\n'))
       
   111         s = ''
       
   112     return s
   107     return s
   113 
   108 
   114 def makepatch(ui, repo, patch, opts, _charsets, idx, total, patchname=None):
   109 def makepatch(ui, repo, patch, opts, _charsets, idx, total, patchname=None):
   115 
   110 
   116     desc = []
   111     desc = []