Show More
@@ -2552,7 +2552,7 b' def trydiff(repo, revs, ctx1, ctx2, modi' | |||||
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' % |
@@ -73,5 +73,39 b'' | |||||
73 | literal 5 |
|
73 | literal 5 | |
74 | Mc$_OqttjCF00uV!&;S4c |
|
74 | Mc$_OqttjCF00uV!&;S4c | |
75 |
|
75 | |||
|
76 | $ cd .. | |||
|
77 | ||||
|
78 | Test text mode with extended git-style diff format | |||
|
79 | $ hg init b | |||
|
80 | $ cd b | |||
|
81 | $ cat > writebin.py <<EOF | |||
|
82 | > import sys | |||
|
83 | > path = sys.argv[1] | |||
|
84 | > open(path, 'wb').write('\x00\x01\x02\x03') | |||
|
85 | > EOF | |||
|
86 | $ python writebin.py binfile.bin | |||
|
87 | $ hg add binfile.bin | |||
|
88 | $ hg ci -m 'add binfile.bin' | |||
|
89 | ||||
|
90 | $ echo >> binfile.bin | |||
|
91 | $ hg ci -m 'change binfile.bin' | |||
|
92 | ||||
|
93 | $ hg diff --git -a -r 0 -r 1 | |||
|
94 | diff --git a/binfile.bin b/binfile.bin | |||
|
95 | --- a/binfile.bin | |||
|
96 | +++ b/binfile.bin | |||
|
97 | @@ -1,1 +1,1 @@ | |||
|
98 | -\x00\x01\x02\x03 (esc) | |||
|
99 | \ No newline at end of file | |||
|
100 | +\x00\x01\x02\x03 (esc) | |||
|
101 | ||||
|
102 | $ HGPLAIN=1 hg diff --git -a -r 0 -r 1 | |||
|
103 | diff --git a/binfile.bin b/binfile.bin | |||
|
104 | --- a/binfile.bin | |||
|
105 | +++ b/binfile.bin | |||
|
106 | @@ -1,1 +1,1 @@ | |||
|
107 | -\x00\x01\x02\x03 (esc) | |||
|
108 | \ No newline at end of file | |||
|
109 | +\x00\x01\x02\x03 (esc) | |||
76 |
|
110 | |||
77 | $ cd .. |
|
111 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now