Mercurial > hg
comparison mercurial/patch.py @ 31821:66a9faadbc83
patch: make diff in git mode respect --text option (issue5510)
This changeset makes patch respect -a/--text option in --git mode by aligning
its behaviour with git itself.
author | Alexander Fomin <afomin@fb.com> |
---|---|
date | Wed, 05 Apr 2017 15:15:06 -0700 |
parents | 6c80f985a13c |
children | fde4822b0102 |
comparison
equal
deleted
inserted
replaced
31820:45761ef1bc93 | 31821:66a9faadbc83 |
---|---|
2550 header.append('%s from %s' % (copyop, path1)) | 2550 header.append('%s from %s' % (copyop, path1)) |
2551 header.append('%s to %s' % (copyop, path2)) | 2551 header.append('%s to %s' % (copyop, path2)) |
2552 elif revs and not repo.ui.quiet: | 2552 elif revs and not repo.ui.quiet: |
2553 header.append(diffline(path1, revs)) | 2553 header.append(diffline(path1, revs)) |
2554 | 2554 |
2555 if binary and opts.git and not opts.nobinary: | 2555 if binary and opts.git and not opts.nobinary and not opts.text: |
2556 text = mdiff.b85diff(content1, content2) | 2556 text = mdiff.b85diff(content1, content2) |
2557 if text: | 2557 if text: |
2558 header.append('index %s..%s' % | 2558 header.append('index %s..%s' % |
2559 (gitindex(content1), gitindex(content2))) | 2559 (gitindex(content1), gitindex(content2))) |
2560 hunks = (None, [text]), | 2560 hunks = (None, [text]), |