~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

  • Committer: Aaron Bentley
  • Date: 2007-02-07 03:09:58 UTC
  • mfrom: (2268 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2269.
  • Revision ID: aaron.bentley@utoronto.ca-20070207030958-fx6ykp7rg7zma6xu
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
    osutils,
78
78
    symbol_versioning,
79
79
    urlutils,
 
80
    win32utils,
80
81
    )
81
82
import bzrlib.util.configobj.configobj as configobj
82
83
""")
709
710
    base = os.environ.get('BZR_HOME', None)
710
711
    if sys.platform == 'win32':
711
712
        if base is None:
712
 
            base = os.environ.get('APPDATA', None)
 
713
            base = win32utils.get_appdata_location_unicode()
713
714
        if base is None:
714
715
            base = os.environ.get('HOME', None)
715
716
        if base is None:
755
756
    """
756
757
    import socket
757
758
 
758
 
    # XXX: Any good way to get real user name on win32?
 
759
    if sys.platform == 'win32':
 
760
        name = win32utils.get_user_name_unicode()
 
761
        if name is None:
 
762
            raise errors.BzrError("Cannot autodetect user name.\n"
 
763
                                  "Please, set your name with command like:\n"
 
764
                                  'bzr whoami "Your Name <name@domain.com>"')
 
765
        host = win32utils.get_host_name_unicode()
 
766
        if host is None:
 
767
            host = socket.gethostname()
 
768
        return name, (name + '@' + host)
759
769
 
760
770
    try:
761
771
        import pwd