Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/patch.py @ 21790:3fbef7ac26f0
diff: add nobinary config to suppress git-style binary diffs
author | Stephen Lee <sphen.lee@gmail.com> |
---|---|
date | Sat, 21 Jun 2014 15:56:49 +1000 |
parents | 2a095d3442e0 |
children | c1ceec0c8cb4 |
comparison
equal
deleted
inserted
replaced
21789:15baed3f24ee | 21790:3fbef7ac26f0 |
---|---|
1559 getter(section, name or key, None, untrusted=untrusted)) | 1559 getter(section, name or key, None, untrusted=untrusted)) |
1560 return mdiff.diffopts( | 1560 return mdiff.diffopts( |
1561 text=opts and opts.get('text'), | 1561 text=opts and opts.get('text'), |
1562 git=get('git'), | 1562 git=get('git'), |
1563 nodates=get('nodates'), | 1563 nodates=get('nodates'), |
1564 nobinary=get('nobinary'), | |
1564 showfunc=get('show_function', 'showfunc'), | 1565 showfunc=get('show_function', 'showfunc'), |
1565 ignorews=get('ignore_all_space', 'ignorews'), | 1566 ignorews=get('ignore_all_space', 'ignorews'), |
1566 ignorewsamount=get('ignore_space_change', 'ignorewsamount'), | 1567 ignorewsamount=get('ignore_space_change', 'ignorewsamount'), |
1567 ignoreblanklines=get('ignore_blank_lines', 'ignoreblanklines'), | 1568 ignoreblanklines=get('ignore_blank_lines', 'ignoreblanklines'), |
1568 context=get('unified', getter=ui.config)) | 1569 context=get('unified', getter=ui.config)) |
1813 losedatafn(f) | 1814 losedatafn(f) |
1814 | 1815 |
1815 if dodiff: | 1816 if dodiff: |
1816 if opts.git or revs: | 1817 if opts.git or revs: |
1817 header.insert(0, diffline(join(a), join(b), revs)) | 1818 header.insert(0, diffline(join(a), join(b), revs)) |
1818 if dodiff == 'binary': | 1819 if dodiff == 'binary' and not opts.nobinary: |
1819 text = mdiff.b85diff(to, tn) | 1820 text = mdiff.b85diff(to, tn) |
1820 if text: | 1821 if text: |
1821 addindexmeta(header, [gitindex(to), gitindex(tn)]) | 1822 addindexmeta(header, [gitindex(to), gitindex(tn)]) |
1822 else: | 1823 else: |
1823 text = mdiff.unidiff(to, date1, | 1824 text = mdiff.unidiff(to, date1, |