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
=== modified file 'bzrlib/config.py'
--- bzrlib/config.py 2011-09-07 15:21:39 +0000
+++ bzrlib/config.py 2011-09-09 12:30:53 +0000
@@ -622,7 +622,7 @@
622 for (oname, value, section, conf_id, parser) in self._get_options():622 for (oname, value, section, conf_id, parser) in self._get_options():
623 if oname.startswith('bzr.mergetool.'):623 if oname.startswith('bzr.mergetool.'):
624 tool_name = oname[len('bzr.mergetool.'):]624 tool_name = oname[len('bzr.mergetool.'):]
625 tools[tool_name] = value625 tools[tool_name] = self.get_user_option(oname)
626 trace.mutter('loaded merge tools: %r' % tools)626 trace.mutter('loaded merge tools: %r' % tools)
627 return tools627 return tools
628628
629629
=== modified file 'bzrlib/tests/test_config.py'
--- bzrlib/tests/test_config.py 2011-09-07 15:21:39 +0000
+++ bzrlib/tests/test_config.py 2011-09-09 12:30:53 +0000
@@ -183,6 +183,7 @@
183user_global_option=something183user_global_option=something
184bzr.mergetool.sometool=sometool {base} {this} {other} -o {result}184bzr.mergetool.sometool=sometool {base} {this} {other} -o {result}
185bzr.mergetool.funkytool=funkytool "arg with spaces" {this_temp}185bzr.mergetool.funkytool=funkytool "arg with spaces" {this_temp}
186bzr.mergetool.newtool='"newtool with spaces" {this_temp}'
186bzr.default_mergetool=sometool187bzr.default_mergetool=sometool
187[ALIASES]188[ALIASES]
188h=help189h=help
@@ -1339,7 +1340,8 @@
1339 self.log(repr(tools))1340 self.log(repr(tools))
1340 self.assertEqual(1341 self.assertEqual(
1341 {u'funkytool' : u'funkytool "arg with spaces" {this_temp}',1342 {u'funkytool' : u'funkytool "arg with spaces" {this_temp}',
1342 u'sometool' : u'sometool {base} {this} {other} -o {result}'},1343 u'sometool' : u'sometool {base} {this} {other} -o {result}',
1344 u'newtool' : u'"newtool with spaces" {this_temp}'},
1343 tools)1345 tools)
13441346
1345 def test_get_merge_tools_empty(self):1347 def test_get_merge_tools_empty(self):
13461348
=== modified file 'doc/en/release-notes/bzr-2.5.txt'
--- doc/en/release-notes/bzr-2.5.txt 2011-09-09 07:52:11 +0000
+++ doc/en/release-notes/bzr-2.5.txt 2011-09-09 12:30:53 +0000
@@ -172,6 +172,9 @@
172 operations that use it, like merge, can now create trees without a root.172 operations that use it, like merge, can now create trees without a root.
173 (Aaron Bentley)173 (Aaron Bentley)
174174
175* Fixed loading of external merge tools from config to properly decode
176 command-lines which contain embedded quotes. (Gordon Tyler, #828803)
177
175Documentation178Documentation
176*************179*************
177180