~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lockdir.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-10-05 00:14:36 UTC
  • mfrom: (2055.2.2 lockdir-no-email)
  • Revision ID: pqm@pqm.ubuntu.com-20061005001436-917ac78b08565d62
(John Meinel) don't require a valid email for LockDir

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.NoEmailInUsername:
 
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