/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: John Arbash Meinel
  • Date: 2006-09-20 17:01:14 UTC
  • mto: This revision was merged to the branch mainline in revision 2050.
  • Revision ID: john@arbash-meinel.com-20060920170114-20251f6bb2e7b7f7
Change default timeouts, and report differently the first failure

Show diffs side-by-side

added added

removed removed

Lines of Context:
130
130
# TODO: Make sure to pass the right file and directory mode bits to all
131
131
# files/dirs created.
132
132
 
133
 
_DEFAULT_TIMEOUT_SECONDS = 60
134
 
_DEFAULT_POLL_SECONDS = 0.5
 
133
_DEFAULT_TIMEOUT_SECONDS = 3600
 
134
_DEFAULT_POLL_SECONDS = 1.0
135
135
 
136
136
class LockDir(object):
137
137
    """Write-lock guarding access to data."""
373
373
            new_info = self.peek()
374
374
            mutter('last_info: %s, new info: %s', last_info, new_info)
375
375
            if new_info is not None and new_info != last_info:
 
376
                if last_info is None:
 
377
                    start = 'Unable to obtain'
 
378
                else:
 
379
                    start = 'Lock owner changed for'
376
380
                last_info = new_info
377
381
                formatted_info = self._format_lock_info(new_info)
378
 
                self._report_function('Unable to obtain %s\n'
 
382
                self._report_function('%s %s\n'
379
383
                                      '%s\n' # held by
380
384
                                      '%s\n' # locked ... ago
381
385
                                      'Will continue to try for %s seconds\n',
 
386
                                      start,
382
387
                                      formatted_info[0],
383
388
                                      formatted_info[1],
384
389
                                      formatted_info[2],
385
 
                                      deadline - time.time())
 
390
                                      int(deadline - time.time()))
386
391
 
387
392
            if time.time() + poll < deadline:
388
393
                time.sleep(poll)