~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/atomicfile.py

  • Committer: Vincent Ladeuil
  • Date: 2007-11-04 15:24:27 UTC
  • mto: (2961.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 2962.
  • Revision ID: v.ladeuil+lp@free.fr-20071104152427-p9k7e4toywa87wfc
Review feedback.

* doc/en/user-guide/authentication_conf.txt: 
New file. Authentication configuration file documentation.

* doc/en/user-guide/configuration.txt: 
Slight modifications, add authentication.conf reference.

* doc/en/mini-tutorial/index.txt: 
Fix make docs warning.

* doc/developers/authentication-ring.txt: 
Small cleanups noticed during
doc/en/user-guide/authentication_conf.txt redaction.

* bzrlib/transport/http/_urllib.py:
(HttpTransport_urllib._perform): Use a dict() instead of {} syntax.

* bzrlib/tests/blackbox/test_whoami.py:
(TestWhoami.test_whoami_branch): Delete BZREMAIL related tests.

* bzrlib/config.py:
(Config.username): BZREMAIL deleted, has been obsolete for more
than a year.
(AuthenticationConfig.__init__): Review feedback, since keeping a
callback as an attribute is useless, call it now and keep the
filename itself as an attribute.
(AuthenticationConfig.get_credentials): Use a dict() instead of {}
syntax.

* NEWS: 
Updated as per Martin's suggestion.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
        global _hostname
52
52
 
53
53
        self._fd = None
 
54
        assert mode in ('wb', 'wt'), \
 
55
            "invalid AtomicFile mode %r" % mode
54
56
 
55
57
        if _hostname is None:
56
 
            _hostname = osutils.get_host_name()
 
58
            _hostname = socket.gethostname()
57
59
 
58
60
        self.tmpfilename = '%s.%d.%s.tmp' % (filename, _pid, _hostname)
59
61
 
62
64
        flags = os.O_EXCL | os.O_CREAT | os.O_WRONLY
63
65
        if mode == 'wb':
64
66
            flags |= osutils.O_BINARY
65
 
        elif mode != 'wt':
66
 
            raise ValueError("invalid AtomicFile mode %r" % mode)
67
67
 
68
68
        if new_mode is not None:
69
69
            local_mode = new_mode