Merge lp:~jelmer/brz/diff-using-fix into lp:brz/3.0

Proposed by Jelmer Vernooij
Status: Superseded
Proposed branch: lp:~jelmer/brz/diff-using-fix
Merge into: lp:brz/3.0
Diff against target: 45 lines (+14/-0)
3 files modified
breezy/diff.py (+2/-0)
breezy/tests/test_diff.py (+9/-0)
doc/en/release-notes/brz-3.0.txt (+3/-0)
To merge this branch: bzr merge lp:~jelmer/brz/diff-using-fix
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+377084@code.launchpad.net

This proposal supersedes a proposal from 2019-10-26.

Commit message

Fix 'bzr diff --using' when no variables are specified in the template.

Description of the change

Fix 'bzr diff --using' when no variables are specified in the template.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :

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 2018-11-25 21:48:55 +0000
3+++ breezy/diff.py 2019-12-22 11:33:00 +0000
4@@ -729,6 +729,8 @@
5 my_map = {'old_path': old_path, 'new_path': new_path}
6 command = [AtTemplate(t).substitute(my_map) for t in
7 self.command_template]
8+ if command == self.command_template:
9+ command += [old_path, new_path]
10 if sys.platform == 'win32': # Popen doesn't accept unicode on win32
11 command_encoded = []
12 for c in command:
13
14=== modified file 'breezy/tests/test_diff.py'
15--- breezy/tests/test_diff.py 2018-11-25 21:48:55 +0000
16+++ breezy/tests/test_diff.py 2019-12-22 11:33:00 +0000
17@@ -1400,6 +1400,15 @@
18 self.assertEqual(['diff', '@old_path', '@new_path'],
19 diff_obj.command_template)
20
21+ def test_from_string_no_paths(self):
22+ diff_obj = diff.DiffFromTool.from_string(
23+ ['diff', "-u5"], None, None, None)
24+ self.addCleanup(diff_obj.finish)
25+ self.assertEqual(['diff', '-u5'],
26+ diff_obj.command_template)
27+ self.assertEqual(['diff', '-u5', 'old-path', 'new-path'],
28+ diff_obj._get_command('old-path', 'new-path'))
29+
30 def test_from_string_u5(self):
31 diff_obj = diff.DiffFromTool.from_string('diff "-u 5"',
32 None, None, None)
33
34=== modified file 'doc/en/release-notes/brz-3.0.txt'
35--- doc/en/release-notes/brz-3.0.txt 2019-11-19 17:16:42 +0000
36+++ doc/en/release-notes/brz-3.0.txt 2019-12-22 11:33:00 +0000
37@@ -32,6 +32,9 @@
38 .. Fixes for situations where brz would previously crash or give incorrect
39 or undesirable results.
40
41+* Fix ``brz diff --using`` when {old_path} and {new_path} are not
42+ specified in the template. (#1847915, Jelmer Vernooij)
43+
44 Documentation
45 *************
46

Subscribers

People subscribed via source and target branches