~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: 2007-02-03 16:20:12 UTC
  • mfrom: (2245.4.11 win98.support)
  • Revision ID: pqm@pqm.ubuntu.com-20070203162012-b09dab5423fa3c50
(bialix) Support for Windows 98

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