Mercurial > hg
comparison mercurial/patch.py @ 31822:fde4822b0102
diff: add --binary option for git mode diffs
This patch adds --binary option to `hg diff` and `hg export` to allow more
control about when binary diffs are displayed in Git mode as well as some
tests to verify it behaves correctly (issue5510).
author | Alexander Fomin <afomin@fb.com> |
---|---|
date | Wed, 05 Apr 2017 15:31:08 -0700 |
parents | 66a9faadbc83 |
children | 51fdedd29b0a |
comparison
equal
deleted
inserted
replaced
31821:66a9faadbc83 | 31822:fde4822b0102 |
---|---|
2208 'ignorewsamount') | 2208 'ignorewsamount') |
2209 buildopts['ignoreblanklines'] = get('ignore_blank_lines', | 2209 buildopts['ignoreblanklines'] = get('ignore_blank_lines', |
2210 'ignoreblanklines') | 2210 'ignoreblanklines') |
2211 if formatchanging: | 2211 if formatchanging: |
2212 buildopts['text'] = opts and opts.get('text') | 2212 buildopts['text'] = opts and opts.get('text') |
2213 buildopts['nobinary'] = get('nobinary', forceplain=False) | 2213 binary = None if opts is None else opts.get('binary') |
2214 buildopts['nobinary'] = (not binary if binary is not None | |
2215 else get('nobinary', forceplain=False)) | |
2214 buildopts['noprefix'] = get('noprefix', forceplain=False) | 2216 buildopts['noprefix'] = get('noprefix', forceplain=False) |
2215 | 2217 |
2216 return mdiff.diffopts(**pycompat.strkwargs(buildopts)) | 2218 return mdiff.diffopts(**pycompat.strkwargs(buildopts)) |
2217 | 2219 |
2218 def diff(repo, node1=None, node2=None, match=None, changes=None, | 2220 def diff(repo, node1=None, node2=None, match=None, changes=None, |