/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/config.py

  • Committer: Jelmer Vernooij
  • Date: 2017-06-10 12:50:32 UTC
  • mfrom: (6679 work)
  • mto: This revision was merged to the branch mainline in revision 6690.
  • Revision ID: jelmer@jelmer.uk-20170610125032-xb5rd5fjskjallos
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
from .sixish import (
115
115
    binary_type,
116
116
    BytesIO,
 
117
    PY3,
117
118
    text_type,
118
119
    string_types,
119
120
    )
476
477
        If no username can be found, errors.NoWhoami exception is raised.
477
478
        """
478
479
        v = os.environ.get('BRZ_EMAIL')
479
 
        if v:
 
480
        if v and not PY3:
480
481
            return v.decode(osutils.get_user_encoding())
481
482
        v = self._get_user_id()
482
 
        if v:
 
483
        if v and not PY3:
483
484
            return v
484
485
        return default_email()
485
486
 
1496
1497
 
1497
1498
def default_email():
1498
1499
    v = os.environ.get('BRZ_EMAIL')
1499
 
    if v:
 
1500
    if v and not PY3:
1500
1501
        return v.decode(osutils.get_user_encoding())
1501
1502
    v = os.environ.get('EMAIL')
1502
 
    if v:
 
1503
    if v and not PY3:
1503
1504
        return v.decode(osutils.get_user_encoding())
1504
1505
    name, email = _auto_user_id()
1505
1506
    if name and email:
3264
3265
        # The following will do in the interim but maybe we don't want to
3265
3266
        # expose a path here but rather a config ID and its associated
3266
3267
        # object </hand wawe>.
3267
 
        return urlutils.join(self.transport.external_url(), self.file_name.encode("ascii"))
 
3268
        return urlutils.join(
 
3269
            self.transport.external_url(), urlutils.escape(self.file_name))
3268
3270
 
3269
3271
 
3270
3272
# Note that LockableConfigObjStore inherits from ConfigObjStore because we need
3780
3782
            global _shared_stores_at_exit_installed
3781
3783
            stores = _shared_stores
3782
3784
            def save_config_changes():
3783
 
                for k, store in stores.iteritems():
 
3785
                for k, store in stores.items():
3784
3786
                    store.save_changes()
3785
3787
            if not _shared_stores_at_exit_installed:
3786
3788
                # FIXME: Ugly hack waiting for library_state to always be