70
71
gpg_signing_command=gnome-gpg
72
73
user_global_option=something
74
bzr.mergetool.sometool=sometool {base} {this} {other} -o {result}
75
bzr.mergetool.funkytool=funkytool "arg with spaces" {this_temp}
76
bzr.default_mergetool=sometool
75
79
ll=""" + sample_long_alias + "\n"
953
957
change_editor = my_config.get_change_editor('old', 'new')
954
958
self.assertIs(None, change_editor)
960
def test_get_merge_tools(self):
961
conf = self._get_sample_config()
962
tools = conf.get_merge_tools()
963
self.log(repr(tools))
965
{u'funkytool' : u'funkytool "arg with spaces" {this_temp}',
966
u'sometool' : u'sometool {base} {this} {other} -o {result}'},
969
def test_get_merge_tools_empty(self):
970
conf = self._get_empty_config()
971
tools = conf.get_merge_tools()
972
self.assertEqual({}, tools)
974
def test_find_merge_tool(self):
975
conf = self._get_sample_config()
976
cmdline = conf.find_merge_tool('sometool')
977
self.assertEqual('sometool {base} {this} {other} -o {result}', cmdline)
979
def test_find_merge_tool_not_found(self):
980
conf = self._get_sample_config()
981
cmdline = conf.find_merge_tool('DOES NOT EXIST')
982
self.assertIs(cmdline, None)
984
def test_find_merge_tool_known(self):
985
conf = self._get_empty_config()
986
cmdline = conf.find_merge_tool('kdiff3')
987
self.assertEquals('kdiff3 {base} {this} {other} -o {result}', cmdline)
989
def test_find_merge_tool_override_known(self):
990
conf = self._get_empty_config()
991
conf.set_user_option('bzr.mergetool.kdiff3', 'kdiff3 blah')
992
cmdline = conf.find_merge_tool('kdiff3')
993
self.assertEqual('kdiff3 blah', cmdline)
957
996
class TestGlobalConfigSavingOptions(tests.TestCaseInTempDir):