mercurial/patch.py
changeset 17940 c84ef0047a94
parent 17939 d587925680d9
child 17941 9a6e4d5d7ea8
equal deleted inserted replaced
17939:d587925680d9 17940:c84ef0047a94
  1744                     _addmodehdr(header, gitmode[oflag], gitmode[nflag])
  1744                     _addmodehdr(header, gitmode[oflag], gitmode[nflag])
  1745                     if binary:
  1745                     if binary:
  1746                         dodiff = 'binary'
  1746                         dodiff = 'binary'
  1747                 elif binary or nflag != oflag:
  1747                 elif binary or nflag != oflag:
  1748                     losedatafn(f)
  1748                     losedatafn(f)
  1749             if opts.git:
  1749 
       
  1750         if dodiff:
       
  1751             if opts.git or revs:
  1750                 header.insert(0, mdiff.diffline(revs, join(a), join(b), opts))
  1752                 header.insert(0, mdiff.diffline(revs, join(a), join(b), opts))
  1751 
       
  1752         if dodiff:
       
  1753             if dodiff == 'binary':
  1753             if dodiff == 'binary':
  1754                 text = mdiff.b85diff(to, tn)
  1754                 text = mdiff.b85diff(to, tn)
  1755             else:
  1755             else:
  1756                 text = mdiff.unidiff(to, date1,
  1756                 text = mdiff.unidiff(to, date1,
  1757                                     # ctx2 date may be dynamic
  1757                                     # ctx2 date may be dynamic
  1758                                     tn, util.datestr(ctx2.date()),
  1758                                     tn, util.datestr(ctx2.date()),
  1759                                     join(a), join(b), revs, opts=opts)
  1759                                     join(a), join(b), opts=opts)
  1760             if header and (text or len(header) > 1):
  1760             if header and (text or len(header) > 1):
  1761                 yield ''.join(header)
  1761                 yield ''.join(header)
  1762             if text:
  1762             if text:
  1763                 yield text
  1763                 yield text
  1764 
  1764