~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-27 22:12:53 UTC
  • mto: This revision was merged to the branch mainline in revision 2050.
  • Revision ID: john@arbash-meinel.com-20060927221253-db89ca8e8a8c102e
Change tests that expect locking to fail to timeout sooner.
This includes changing LockDir to not have a compiled-in default timeout.

Show diffs side-by-side

added added

removed removed

Lines of Context:
353
353
    def _parse_info(self, info_file):
354
354
        return read_stanza(info_file.readlines()).as_dict()
355
355
 
356
 
    def wait_lock(self, timeout=_DEFAULT_TIMEOUT_SECONDS,
357
 
                  poll=_DEFAULT_POLL_SECONDS):
 
356
    def wait_lock(self, timeout=None, poll=None):
358
357
        """Wait a certain period for a lock.
359
358
 
360
359
        If the lock can be acquired within the bounded time, it
363
362
        approximately `timeout` seconds.  (It may be a bit more if
364
363
        a transport operation takes a long time to complete.)
365
364
        """
 
365
        if timeout is None:
 
366
            timeout = _DEFAULT_TIMEOUT_SECONDS
 
367
        if poll is None:
 
368
            poll = _DEFAULT_POLL_SECONDS
 
369
 
366
370
        # XXX: the transport interface doesn't let us guard 
367
371
        # against operations there taking a long time.
368
372
        deadline = time.time() + timeout