423
424
base = os.environ.get('HOME', None)
425
426
raise BzrError('You must have one of BZR_HOME, APPDATA, or HOME set')
426
return os.path.join(base, 'bazaar', '2.0')
427
return pathjoin(base, 'bazaar', '2.0')
428
429
# cygwin, linux, and darwin all have a $HOME directory
430
431
base = os.path.expanduser("~")
431
return os.path.join(base, ".bazaar")
432
return pathjoin(base, ".bazaar")
435
def ensure_config_dir_exists():
436
"""Make sure the configuration directory exists.
437
On Windows, there is more than one level, so both must be created.
440
if os.path.exists(cd):
442
if sys.platform == 'win32':
443
base = os.dirname(cd)
444
if not os.path.exists(base):
434
449
def config_filename():
435
450
"""Return per-user configuration ini file filename."""
436
return os.path.join(config_dir(), 'bazaar.conf')
451
return pathjoin(config_dir(), 'bazaar.conf')
439
454
def branches_config_filename():
440
455
"""Return per-user configuration ini file filename."""
441
return os.path.join(config_dir(), 'branches.conf')
456
return pathjoin(config_dir(), 'branches.conf')
444
459
def _auto_user_id():