~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-08-09 17:04:46 UTC
  • mfrom: (6055.1.3 822571-bzr-home-unicode)
  • Revision ID: pqm@pqm.ubuntu.com-20110809170446-f1wc1a8fhgnxi4cn
(vila) Decode BZR_HOME with fs encoding to allow unicode homes. (Vincent
 Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1513
1513
            raise errors.BzrError('You must have one of BZR_HOME, APPDATA,'
1514
1514
                                  ' or HOME set')
1515
1515
        return osutils.pathjoin(base, 'bazaar', '2.0')
1516
 
    elif sys.platform == 'darwin':
 
1516
    else:
 
1517
        if base is not None:
 
1518
            base = base.decode(osutils._fs_enc)
 
1519
    if sys.platform == 'darwin':
1517
1520
        if base is None:
1518
1521
            # this takes into account $HOME
1519
1522
            base = os.path.expanduser("~")
1520
1523
        return osutils.pathjoin(base, '.bazaar')
1521
1524
    else:
1522
1525
        if base is None:
1523
 
 
1524
1526
            xdg_dir = os.environ.get('XDG_CONFIG_HOME', None)
1525
1527
            if xdg_dir is None:
1526
1528
                xdg_dir = osutils.pathjoin(os.path.expanduser("~"), ".config")
1529
1531
                trace.mutter(
1530
1532
                    "Using configuration in XDG directory %s." % xdg_dir)
1531
1533
                return xdg_dir
1532
 
 
1533
1534
            base = os.path.expanduser("~")
1534
1535
        return osutils.pathjoin(base, ".bazaar")
1535
1536
 
2630
2631
class GlobalStore(LockableIniFileStore):
2631
2632
 
2632
2633
    def __init__(self, possible_transports=None):
2633
 
        t = transport.get_transport_from_path(config_dir(),
2634
 
                                    possible_transports=possible_transports)
 
2634
        t = transport.get_transport_from_path(
 
2635
            config_dir(), possible_transports=possible_transports)
2635
2636
        super(GlobalStore, self).__init__(t, 'bazaar.conf')
2636
2637
 
2637
2638
 
2638
2639
class LocationStore(LockableIniFileStore):
2639
2640
 
2640
2641
    def __init__(self, possible_transports=None):
2641
 
        t = transport.get_transport_from_path(config_dir(),
2642
 
                                    possible_transports=possible_transports)
 
2642
        t = transport.get_transport_from_path(
 
2643
            config_dir(), possible_transports=possible_transports)
2643
2644
        super(LocationStore, self).__init__(t, 'locations.conf')
2644
2645
 
2645
2646