Mercurial > public > mercurial-scm > hg
comparison tests/lockdelay.py @ 45444:f6c67bb4ca03
tests: update lockdelay.py to handle the `wait` argument
Spotted by a future change.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Thu, 10 Sep 2020 16:51:40 +0530 |
parents | 2372284d9457 |
children | 6000f5b25c9b |
comparison
equal
deleted
inserted
replaced
45443:037e88d453fa | 45444:f6c67bb4ca03 |
---|---|
8 import time | 8 import time |
9 | 9 |
10 | 10 |
11 def reposetup(ui, repo): | 11 def reposetup(ui, repo): |
12 class delayedlockrepo(repo.__class__): | 12 class delayedlockrepo(repo.__class__): |
13 def lock(self): | 13 def lock(self, wait=True): |
14 delay = float(os.environ.get('HGPRELOCKDELAY', '0.0')) | 14 delay = float(os.environ.get('HGPRELOCKDELAY', '0.0')) |
15 if delay: | 15 if delay: |
16 time.sleep(delay) | 16 time.sleep(delay) |
17 res = super(delayedlockrepo, self).lock() | 17 res = super(delayedlockrepo, self).lock(wait=wait) |
18 delay = float(os.environ.get('HGPOSTLOCKDELAY', '0.0')) | 18 delay = float(os.environ.get('HGPOSTLOCKDELAY', '0.0')) |
19 if delay: | 19 if delay: |
20 time.sleep(delay) | 20 time.sleep(delay) |
21 return res | 21 return res |
22 | 22 |