Mercurial > hg
annotate tests/lockdelay.py @ 49779:7d6c8943353a stable
hg: show the correct message when cloning an LFS repo with extension disabled
The `extensions._disabledpaths()` doesn't handle fetching help from `__index__`,
so it returns an empty dictionary of paths. That means None is always returned
from `extensions.disabled_help()` when embedding resources inside the pyoxidizer
or py2exe binary, regardless of the arg or if is an external extension stored in
the filesystem. And that means wrongly telling the user with an explicitly
disabled LFS extension that it will be enabled locally upon cloning from an LFS
remote. That causes test-lfs-serve.t:295 to fail.
This effectively reverts most of the rest of 843418dc0b1b, while keeping the
help text change in place (which was specifically identified as a problem).
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 05 Dec 2022 15:14:33 -0500 |
parents | 6000f5b25c9b |
children |
rev | line source |
---|---|
28289
d493d64757eb
hg: obtain lock when creating share from pooled repo (issue5104)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
1 # Dummy extension that adds a delay after acquiring a lock. |
d493d64757eb
hg: obtain lock when creating share from pooled repo (issue5104)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
2 # |
d493d64757eb
hg: obtain lock when creating share from pooled repo (issue5104)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
3 # This extension can be used to test race conditions between lock acquisition. |
d493d64757eb
hg: obtain lock when creating share from pooled repo (issue5104)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
4 |
d493d64757eb
hg: obtain lock when creating share from pooled repo (issue5104)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
5 |
d493d64757eb
hg: obtain lock when creating share from pooled repo (issue5104)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
6 import os |
d493d64757eb
hg: obtain lock when creating share from pooled repo (issue5104)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
7 import time |
d493d64757eb
hg: obtain lock when creating share from pooled repo (issue5104)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
8 |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
30068
diff
changeset
|
9 |
30068
a76d5ba7ac43
pull: grab wlock during pull
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
28289
diff
changeset
|
10 def reposetup(ui, repo): |
a76d5ba7ac43
pull: grab wlock during pull
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
28289
diff
changeset
|
11 class delayedlockrepo(repo.__class__): |
45444
f6c67bb4ca03
tests: update lockdelay.py to handle the `wait` argument
Pulkit Goyal <7895pulkit@gmail.com>
parents:
43076
diff
changeset
|
12 def lock(self, wait=True): |
30068
a76d5ba7ac43
pull: grab wlock during pull
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
28289
diff
changeset
|
13 delay = float(os.environ.get('HGPRELOCKDELAY', '0.0')) |
a76d5ba7ac43
pull: grab wlock during pull
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
28289
diff
changeset
|
14 if delay: |
a76d5ba7ac43
pull: grab wlock during pull
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
28289
diff
changeset
|
15 time.sleep(delay) |
45444
f6c67bb4ca03
tests: update lockdelay.py to handle the `wait` argument
Pulkit Goyal <7895pulkit@gmail.com>
parents:
43076
diff
changeset
|
16 res = super(delayedlockrepo, self).lock(wait=wait) |
30068
a76d5ba7ac43
pull: grab wlock during pull
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
28289
diff
changeset
|
17 delay = float(os.environ.get('HGPOSTLOCKDELAY', '0.0')) |
a76d5ba7ac43
pull: grab wlock during pull
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
28289
diff
changeset
|
18 if delay: |
a76d5ba7ac43
pull: grab wlock during pull
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
28289
diff
changeset
|
19 time.sleep(delay) |
a76d5ba7ac43
pull: grab wlock during pull
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
28289
diff
changeset
|
20 return res |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
30068
diff
changeset
|
21 |
30068
a76d5ba7ac43
pull: grab wlock during pull
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
28289
diff
changeset
|
22 repo.__class__ = delayedlockrepo |