587
587
def get_bzr_remote_path(self):
589
return os.environ['BRZ_REMOTE_PATH']
589
return os.environ['BZR_REMOTE_PATH']
591
path = self.get_user_option("brz_remote_path")
591
path = self.get_user_option("bzr_remote_path")
609
609
def get_merge_tools(self):
611
611
for (oname, value, section, conf_id, parser) in self._get_options():
612
if oname.startswith('brz.mergetool.'):
613
tool_name = oname[len('brz.mergetool.'):]
612
if oname.startswith('bzr.mergetool.'):
613
tool_name = oname[len('bzr.mergetool.'):]
614
614
tools[tool_name] = self.get_user_option(oname, False)
615
615
trace.mutter('loaded merge tools: %r' % tools)
620
620
# be found in the known_merge_tools if it's not found in the config.
621
621
# This should be done through the proposed config defaults mechanism
622
622
# when it becomes available in the future.
623
command_line = (self.get_user_option('brz.mergetool.%s' % name,
623
command_line = (self.get_user_option('bzr.mergetool.%s' % name,
625
625
or mergetools.known_merge_tools.get(name, None))
626
626
return command_line
1494
1494
TODO: Global option --config-dir to override this.
1496
base = osutils.path_from_environ('BRZ_HOME')
1496
base = osutils.path_from_environ('BZR_HOME')
1497
1497
if sys.platform == 'win32':
1498
1498
if base is None:
1499
1499
base = win32utils.get_appdata_location()
1515
1515
return osutils.pathjoin(base, ".bazaar")
1519
"""Return per-user configuration directory as unicode string
1521
By default this is %APPDATA%/breezy on Windows, $XDG_CONFIG_HOME/breezy on
1522
Mac OS X and Linux. If the breezy config directory doesn't exist but
1523
the bazaar one (see bazaar_config_dir()) does, use that instead.
1525
TODO: Global option --config-dir to override this.
1527
base = osutils.path_from_environ('BRZ_HOME')
1528
if sys.platform == 'win32':
1530
base = win32utils.get_appdata_location()
1532
base = win32utils.get_home_location()
1533
# GZ 2012-02-01: Really the two level subdirs only make sense inside
1534
# APPDATA, but hard to move. See bug 348640 for more.
1536
base = osutils.path_from_environ('XDG_CONFIG_HOME')
1538
base = osutils.pathjoin(osutils._get_home_dir(), ".config")
1539
breezy_dir = osutils.pathjoin(base, 'breezy')
1540
if osutils.isdir(breezy_dir):
1542
# If the breezy directory doesn't exist, but the bazaar one does, use that:
1543
bazaar_dir = bazaar_config_dir()
1544
if osutils.isdir(bazaar_dir):
1546
"Using Bazaar configuration directory (%s)", bazaar_dir)
1518
1551
def config_filename():
1519
1552
"""Return per-user configuration ini file filename."""
1520
1553
return osutils.pathjoin(config_dir(), 'bazaar.conf')