Merge lp:~doxxx/bzr/828803-get_merge_tools into lp:bzr

Proposed by Gordon Tyler
Status: Merged
Approved by: Vincent Ladeuil
Approved revision: no longer in the source branch.
Merged at revision: 6128
Proposed branch: lp:~doxxx/bzr/828803-get_merge_tools
Merge into: lp:bzr
Diff against target: 47 lines (+7/-2)
3 files modified
bzrlib/config.py (+1/-1)
bzrlib/tests/test_config.py (+3/-1)
doc/en/release-notes/bzr-2.5.txt (+3/-0)
To merge this branch: bzr merge lp:~doxxx/bzr/828803-get_merge_tools
Reviewer Review Type Date Requested Status
Vincent Ladeuil Needs Fixing
Review via email: mp+72362@code.launchpad.net

Commit message

Properly decode command lines with embedded quotes for external merge tools.

Description of the change

Fixes bug 828803 by using get_user_option in get_merge_tools so that config values are correctly unquoted.

To post a comment you must log in.
Revision history for this message
Gordon Tyler (doxxx) wrote :

I'm going to add tests for this.

Revision history for this message
Gordon Tyler (doxxx) wrote :

Sorry, I haven't had time to look at this yet. Family visits, etc.

Revision history for this message
Gordon Tyler (doxxx) wrote :

I've updated the tests.

Revision history for this message
Vincent Ladeuil (vila) wrote :

Sounds good to me !

You lack a news entry though.

Also, I'm fine landing this in trunk but as soon as you get confirmation that it fixes the issue, it would be nice to backport it to 2.4 no ?

Voting 'needsfixing' but I can add the news entry and land it if you prefer.

review: Needs Fixing
Revision history for this message
Gordon Tyler (doxxx) wrote :

On Friday, September 09, 2011 3:26:23 AM, Vincent Ladeuil wrote:
> You lack a news entry though.

I always do. ;) Not enough practice.

> Also, I'm fine landing this in trunk but as soon as you get confirmation that it fixes the issue, it would be nice to backport it to 2.4 no ?

True... I'll do one for 2.4 and submit it as well.

> Voting 'needsfixing' but I can add the news entry and land it if you prefer.

No worries, I can do it now.

Revision history for this message
Gordon Tyler (doxxx) wrote :

Release notes added.

Revision history for this message
Vincent Ladeuil (vila) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/config.py'
2--- bzrlib/config.py 2011-09-07 15:21:39 +0000
3+++ bzrlib/config.py 2011-09-09 12:30:53 +0000
4@@ -622,7 +622,7 @@
5 for (oname, value, section, conf_id, parser) in self._get_options():
6 if oname.startswith('bzr.mergetool.'):
7 tool_name = oname[len('bzr.mergetool.'):]
8- tools[tool_name] = value
9+ tools[tool_name] = self.get_user_option(oname)
10 trace.mutter('loaded merge tools: %r' % tools)
11 return tools
12
13
14=== modified file 'bzrlib/tests/test_config.py'
15--- bzrlib/tests/test_config.py 2011-09-07 15:21:39 +0000
16+++ bzrlib/tests/test_config.py 2011-09-09 12:30:53 +0000
17@@ -183,6 +183,7 @@
18 user_global_option=something
19 bzr.mergetool.sometool=sometool {base} {this} {other} -o {result}
20 bzr.mergetool.funkytool=funkytool "arg with spaces" {this_temp}
21+bzr.mergetool.newtool='"newtool with spaces" {this_temp}'
22 bzr.default_mergetool=sometool
23 [ALIASES]
24 h=help
25@@ -1339,7 +1340,8 @@
26 self.log(repr(tools))
27 self.assertEqual(
28 {u'funkytool' : u'funkytool "arg with spaces" {this_temp}',
29- u'sometool' : u'sometool {base} {this} {other} -o {result}'},
30+ u'sometool' : u'sometool {base} {this} {other} -o {result}',
31+ u'newtool' : u'"newtool with spaces" {this_temp}'},
32 tools)
33
34 def test_get_merge_tools_empty(self):
35
36=== modified file 'doc/en/release-notes/bzr-2.5.txt'
37--- doc/en/release-notes/bzr-2.5.txt 2011-09-09 07:52:11 +0000
38+++ doc/en/release-notes/bzr-2.5.txt 2011-09-09 12:30:53 +0000
39@@ -172,6 +172,9 @@
40 operations that use it, like merge, can now create trees without a root.
41 (Aaron Bentley)
42
43+* Fixed loading of external merge tools from config to properly decode
44+ command-lines which contain embedded quotes. (Gordon Tyler, #828803)
45+
46 Documentation
47 *************
48