67
from bzrlib.lazy_import import lazy_import
68
lazy_import(globals(), """
66
70
from fnmatch import fnmatch
70
72
from StringIO import StringIO
73
from bzrlib import errors, urlutils
74
from bzrlib.osutils import pathjoin
80
import bzrlib.util.configobj.configobj as configobj
75
83
from bzrlib.trace import mutter, warning
76
import bzrlib.util.configobj.configobj as configobj
79
86
CHECK_IF_POSSIBLE=0
599
606
base = os.environ.get('HOME', None)
601
608
raise errors.BzrError('You must have one of BZR_HOME, APPDATA, or HOME set')
602
return pathjoin(base, 'bazaar', '2.0')
609
return osutils.pathjoin(base, 'bazaar', '2.0')
604
611
# cygwin, linux, and darwin all have a $HOME directory
606
613
base = os.path.expanduser("~")
607
return pathjoin(base, ".bazaar")
614
return osutils.pathjoin(base, ".bazaar")
610
617
def config_filename():
611
618
"""Return per-user configuration ini file filename."""
612
return pathjoin(config_dir(), 'bazaar.conf')
619
return osutils.pathjoin(config_dir(), 'bazaar.conf')
615
622
def branches_config_filename():
616
623
"""Return per-user configuration ini file filename."""
617
return pathjoin(config_dir(), 'branches.conf')
624
return osutils.pathjoin(config_dir(), 'branches.conf')
620
627
def locations_config_filename():
621
628
"""Return per-user configuration ini file filename."""
622
return pathjoin(config_dir(), 'locations.conf')
629
return osutils.pathjoin(config_dir(), 'locations.conf')
625
632
def user_ignore_config_filename():
626
633
"""Return the user default ignore filename"""
627
return pathjoin(config_dir(), 'ignore')
634
return osutils.pathjoin(config_dir(), 'ignore')
630
637
def _auto_user_id():
699
706
m = re.search(r'[\w+.-]+@[\w+.-]+', e)
701
raise errors.BzrError("%r doesn't seem to contain "
702
"a reasonable email address" % e)
708
raise errors.NoEmailInUsername(e)
703
709
return m.group(0)