~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: 2010-05-21 13:36:51 UTC
  • mfrom: (5243.2.1 readdir_cleanup)
  • Revision ID: pqm@pqm.ubuntu.com-20100521133651-p62dndo2giy5ls21
(lifeless) Some cleanups to the readdir pyrex code for a little efficiency
 and to avoid compile warnings. (John A Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
243
243
        # have a similar bug allowing someone to think they got the lock
244
244
        # when it's already held.
245
245
        #
246
 
        # See <https://bugs.edge.launchpad.net/bzr/+bug/498378> for one case.
 
246
        # See <https://bugs.launchpad.net/bzr/+bug/498378> for one case.
247
247
        #
248
248
        # Strictly the check is unnecessary and a waste of time for most
249
249
        # people, but probably worth trapping if something is wrong.
447
447
        # XXX: is creating this here inefficient?
448
448
        config = bzrlib.config.GlobalConfig()
449
449
        try:
450
 
            user = config.user_email()
451
 
        except errors.NoEmailInUsername:
452
450
            user = config.username()
 
451
        except errors.NoWhoami:
 
452
            user = osutils.getuser_unicode()
453
453
        s = rio.Stanza(hostname=get_host_name(),
454
454
                   pid=str(os.getpid()),
455
455
                   start_time=str(int(time.time())),
540
540
                    deadline_str = time.strftime('%H:%M:%S',
541
541
                                                 time.localtime(deadline))
542
542
                lock_url = self.transport.abspath(self.path)
543
 
                # See <https://bugs.edge.launchpad.net/bzr/+bug/250451>
 
543
                # See <https://bugs.launchpad.net/bzr/+bug/250451>
544
544
                # the URL here is sometimes not one that is useful to the
545
545
                # user, perhaps being wrapped in a lp-%d or chroot decorator,
546
546
                # especially if this error is issued from the server.