1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
# Bazaar revision bundle v0.8
#
# message:
# Make the tests pass with recent versions of diffutils.
# committer: Marien Zwart <marienz@gentoo.org>
# date: Thu 2006-08-24 20:01:44.809999943 +0200
=== modified file bzrlib/diff.py // last-changed:marienz@gentoo.org-20060824174
... 709-83cf7a51d41c69f8
--- bzrlib/diff.py
+++ bzrlib/diff.py
@@ -166,8 +166,9 @@
# 'diff' gives retcode == 2 for all sorts of errors
# one of those is 'Binary files differ'.
# Bad options could also be the problem.
- # 'Binary files' is not a real error, so we suppress that error
- m = re.match('^binary files.*differ$', first_line, re.I)
+ # 'Binary files' is not a real error, so we suppress that error.
+ # Starting with diffutils 2.8.4 the word "binary" was dropped.
+ m = re.match('^(binary )?files.*differ$', first_line, re.I)
if not m:
raise BzrError('external diff failed with exit code 2;'
' command: %r' % (diffcmd,))
=== modified file bzrlib/tests/test_diff.py
--- bzrlib/tests/test_diff.py
+++ bzrlib/tests/test_diff.py
@@ -111,7 +111,11 @@
def test_external_diff_binary(self):
lines = external_udiff_lines(['\x00foobar\n'], ['foo\x00bar\n'])
- self.assertEqual(['Binary files old and new differ\n', '\n'], lines)
+ # Older versions of diffutils say "Binary files", newer
+ # versions just say "files".
+ self.assertContainsRe(lines[0],
+ '(Binary f|F)iles old and new differ\n')
+ self.assertEquals(lines[1:], ['\n'])
def test_no_external_diff(self):
"""Check that NoDiff is raised when diff is not available"""
# revision id: marienz@gentoo.org-20060824180144-b5b013e11e5709f4
# sha1: fd7d1ad679b4fde74c2d5927d4bb67b0e7dc6bac
# inventory sha1: 18333f103b8c13ac42673e56e272805790a275c5
# parent ids:
# marienz@gentoo.org-20060824174709-83cf7a51d41c69f8
# base id: pqm@pqm.ubuntu.com-20060811102108-06a24f3a1d4e7d82
# properties:
# branch-nick: bzr.0.9
# message:
# Make external diff in binary mode work with recent versions of diffutils.
# committer: Marien Zwart <marienz@gentoo.org>
# date: Thu 2006-08-24 19:47:09.569000006 +0200
=== modified file bzrlib/diff.py // encoding:base64
LS0tIGJ6cmxpYi9kaWZmLnB5CisrKyBienJsaWIvZGlmZi5weQpAQCAtMTY2LDggKzE2Niw5IEBA
CiAgICAgICAgICAgICAjICdkaWZmJyBnaXZlcyByZXRjb2RlID09IDIgZm9yIGFsbCBzb3J0cyBv
ZiBlcnJvcnMKICAgICAgICAgICAgICMgb25lIG9mIHRob3NlIGlzICdCaW5hcnkgZmlsZXMgZGlm
ZmVyJy4KICAgICAgICAgICAgICMgQmFkIG9wdGlvbnMgY291bGQgYWxzbyBiZSB0aGUgcHJvYmxl
bS4KLSAgICAgICAgICAgICMgJ0JpbmFyeSBmaWxlcycgaXMgbm90IGEgcmVhbCBlcnJvciwgc28g
d2Ugc3VwcHJlc3MgdGhhdCBlcnJvcgotICAgICAgICAgICAgbSA9IHJlLm1hdGNoKCdeYmluYXJ5
IGZpbGVzLipkaWZmZXIkJywgZmlyc3RfbGluZSwgcmUuSSkKKyAgICAgICAgICAgICMgJ0JpbmFy
eSBmaWxlcycgaXMgbm90IGEgcmVhbCBlcnJvciwgc28gd2Ugc3VwcHJlc3MgdGhhdCBlcnJvci4K
KyAgICAgICAgICAgICMgU3RhcnRpbmcgd2l0aCBkaWZmdXRpbHMgMi44LjQgdGhlIHdvcmQgImJp
bmFyeSIgd2FzIGRyb3BwZWQuCisgICAgICAgICAgICBtID0gcmUubWF0Y2goJ14oYmluYXJ5ICk/
ZmlsZXMuKmRpZmZlciQnLCBmaXJzdF9saW5lLCByZS5JKQogICAgICAgICAgICAgaWYgbm90IG06
CiAgICAgICAgICAgICAgICAgcmFpc2UgQnpyRXJyb3IoJ2V4dGVybmFsIGRpZmYgZmFpbGVkIHdp
dGggZXhpdCBjb2RlIDI7JwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcgY29tbWFu
ZDogJXInICUgKGRpZmZjbWQsKSkKCg==
# revision id: marienz@gentoo.org-20060824174709-83cf7a51d41c69f8
# sha1: a7a4000ddb2b723ba82c62a11104c4ed354abe13
# inventory sha1: 03cc983b5e08ffbcdbb02fba0f4733c973d0a554
# parent ids:
# pqm@pqm.ubuntu.com-20060811102108-06a24f3a1d4e7d82
# properties:
# branch-nick: bzr.0.9
|