~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-22 23:36:40 UTC
  • mto: This revision was merged to the branch mainline in revision 2050.
  • Revision ID: john@arbash-meinel.com-20060922233640-d9921804c4f151ff
Change to reporting the time when we will stop trying to grab the lock

Show diffs side-by-side

added added

removed removed

Lines of Context:
363
363
        # XXX: the transport interface doesn't let us guard 
364
364
        # against operations there taking a long time.
365
365
        deadline = time.time() + timeout
 
366
        deadline_str = None
366
367
        last_info = None
367
368
        while True:
368
369
            try:
379
380
                    start = 'Lock owner changed for'
380
381
                last_info = new_info
381
382
                formatted_info = self._format_lock_info(new_info)
 
383
                if deadline_str is None:
 
384
                    deadline_str = time.strftime('%H:%M:%S',
 
385
                                                 time.localtime(deadline))
382
386
                self._report_function('%s %s\n'
383
387
                                      '%s\n' # held by
384
388
                                      '%s\n' # locked ... ago
385
 
                                      'Will continue to try for %s seconds\n',
 
389
                                      'Will continue to try until %s\n',
386
390
                                      start,
387
391
                                      formatted_info[0],
388
392
                                      formatted_info[1],
389
393
                                      formatted_info[2],
390
 
                                      int(deadline - time.time()))
 
394
                                      deadline_str)
391
395
 
392
396
            if time.time() + poll < deadline:
393
397
                time.sleep(poll)