/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/lockdir.py

  • Committer: Parth Malwankar
  • Date: 2010-06-11 07:56:46 UTC
  • mto: This revision was merged to the branch mainline in revision 5303.
  • Revision ID: parth.malwankar@gmail.com-20100611075646-9yyeih46ken6yagd
fixed tests. closed review comments by mgz.

Show diffs side-by-side

added added

removed removed

Lines of Context:
539
539
                if deadline_str is None:
540
540
                    deadline_str = time.strftime('%H:%M:%S',
541
541
                                                 time.localtime(deadline))
542
 
                # See <https://bugs.launchpad.net/bzr/+bug/250451>
543
 
                # the URL here is sometimes not one that is useful to the
544
 
                # user, perhaps being wrapped in a lp-%d or chroot decorator,
545
 
                # especially if this error is issued from the server.
546
 
                lock_url, user, hostname, pid, time_ago = formatted_info
547
 
                self._report_function(
548
 
                    '%s lock held by '  # start
549
 
                    '%s '               # user
550
 
                    'at %s '            # hostname
551
 
                    '[process #%s], '   # pid
552
 
                    'acquired %s.\n'    # time ago
553
 
                    'Will continue to try until %s, unless '
554
 
                    'you press Ctrl-C.\n'
555
 
                    'See "bzr help break-lock" for more.',
556
 
                    start,
557
 
                    user,
558
 
                    hostname,
559
 
                    pid,
560
 
                    time_ago,
561
 
                    deadline_str,
562
 
                    )
563
 
 
 
542
                user, hostname, pid, time_ago = formatted_info
 
543
                msg = ('%s lock held by '   # start
 
544
                    '%s\n'                  # user
 
545
                    'at %s '                # hostname
 
546
                    '[process #%s], '       # pid
 
547
                    'acquired %s.')         # time ago
 
548
                msg_args = [start, user, hostname, pid, time_ago]
 
549
                if timeout > 0:
 
550
                    msg += ('\nWill continue to try until %s, unless '
 
551
                        'you press Ctrl-C.')
 
552
                    msg_args.append(deadline_str)
 
553
                msg += '\nSee "bzr help break-lock" for more.'
 
554
                self._report_function(msg, *msg_args)
564
555
            if (max_attempts is not None) and (attempt_count >= max_attempts):
565
556
                self._trace("exceeded %d attempts")
566
557
                raise LockContention(self)
620
611
 
621
612
    def _format_lock_info(self, info):
622
613
        """Turn the contents of peek() into something for the user"""
623
 
        lock_url = self.transport.abspath(self.path)
624
614
        start_time = info.get('start_time')
625
615
        if start_time is None:
626
616
            time_ago = '(unknown)'
630
620
        hostname = info.get('hostname', '<unknown>')
631
621
        pid = info.get('pid', '<unknown>')
632
622
        return [
633
 
            lock_url,
634
623
            user,
635
624
            hostname,
636
625
            pid,