~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lockdir.py

  • Committer: John Arbash Meinel
  • Date: 2006-09-29 20:12:58 UTC
  • mto: This revision was merged to the branch mainline in revision 2062.
  • Revision ID: john@arbash-meinel.com-20060929201258-c491e7ca6daefbb4
Make LockDir less sensitive to invalid configuration of email

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
import time
99
99
from cStringIO import StringIO
100
100
 
 
101
from bzrlib import (
 
102
    errors,
 
103
    )
101
104
import bzrlib.config
102
105
from bzrlib.errors import (
103
106
        DirectoryNotEmpty,
342
345
        import socket
343
346
        # XXX: is creating this here inefficient?
344
347
        config = bzrlib.config.GlobalConfig()
 
348
        try:
 
349
            user = config.user_email()
 
350
        except errors.BzrError:
 
351
            user = config.username()
345
352
        s = Stanza(hostname=socket.gethostname(),
346
353
                   pid=str(os.getpid()),
347
354
                   start_time=str(int(time.time())),
348
355
                   nonce=self.nonce,
349
 
                   user=config.user_email(),
 
356
                   user=user,
350
357
                   )
351
358
        return s.to_string()
352
359