Merge lp:~jelmer/brz/diff-binary-weird into lp:brz

Proposed by Jelmer Vernooij on 2019-06-29
Status: Merged
Approved by: Jelmer Vernooij on 2019-07-07
Approved revision: 7363
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/diff-binary-weird
Merge into: lp:brz
Diff against target: 49 lines (+16/-2)
3 files modified
breezy/diff.py (+2/-2)
breezy/tests/blackbox/test_diff.py (+11/-0)
doc/en/release-notes/brz-3.1.txt (+3/-0)
To merge this branch: bzr merge lp:~jelmer/brz/diff-binary-weird
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve on 2019-06-30
Review via email: mp+369474@code.launchpad.net

Commit message

Don't include datestamps in filenames when reporting on binary files.

Description of the change

Don't include datestamps in filenames when reporting on binary files.

To post a comment you must log in.
Jelmer Vernooij (jelmer) :
review: Approve
lp:~jelmer/brz/diff-binary-weird updated on 2019-07-07
7363. By Jelmer Vernooij on 2019-07-07

Fix tests.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/diff.py'
2--- breezy/diff.py 2019-06-26 20:41:57 +0000
3+++ breezy/diff.py 2019-07-07 19:00:04 +0000
4@@ -768,8 +768,8 @@
5 context_lines=self.context_lines)
6 except errors.BinaryFile:
7 self.to_file.write(
8- ("Binary files %s and %s differ\n" %
9- (from_label, to_label)).encode(self.path_encoding, 'replace'))
10+ ("Binary files %s%s and %s%s differ\n" %
11+ (self.old_label, from_path, self.new_label, to_path)).encode(self.path_encoding, 'replace'))
12 return self.CHANGED
13
14
15
16=== modified file 'breezy/tests/blackbox/test_diff.py'
17--- breezy/tests/blackbox/test_diff.py 2018-11-11 04:08:32 +0000
18+++ breezy/tests/blackbox/test_diff.py 2019-07-07 19:00:04 +0000
19@@ -325,6 +325,17 @@
20 output = self.run_bzr('diff -Fboo', retcode=1)
21 self.assertTrue("BOO!" in output[0])
22
23+ def test_binary_diff_remove(self):
24+ tree = self.make_branch_and_tree('.')
25+ self.build_tree_contents([('a', b'\x00' * 20)])
26+ tree.add(['a'])
27+ tree.commit('add binary file')
28+ os.unlink('a')
29+ output = self.run_bzr('diff', retcode=1)
30+ self.assertEqual(
31+ "=== removed file 'a'\nBinary files old/a and new/a differ\n",
32+ output[0])
33+
34
35 class TestCheckoutDiff(TestDiff):
36
37
38=== modified file 'doc/en/release-notes/brz-3.1.txt'
39--- doc/en/release-notes/brz-3.1.txt 2019-07-07 18:18:20 +0000
40+++ doc/en/release-notes/brz-3.1.txt 2019-07-07 19:00:04 +0000
41@@ -76,6 +76,9 @@
42 (i.e. when a non-int is specified as the value for an integer
43 parameter) (#237844, Jelmer Vernooij)
44
45+* Don't include timestamps in filenames when reporting on binary
46+ files in diff. (Jelmer Vernooij, #71307)
47+
48 * Ignore UnknownFormatErrors when scanning for control directories.
49 (Jelmer Vernooij, #468332)
50

Subscribers

People subscribed via source and target branches