mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 01:07:15 +03:00
fix a deadlock in "hg unhide"
Summary: The `hg unhide` command acquired the repo lock without acquiring the wlock. This causes locking order problems, as it calls other parts of the code that will acquire the `wlock` (such as autopull during revset resolution) while it is already holding the `lock`. This can cause `hg unhide` to deadlock with other `hg` commands that acquire `wlock` before `lock`. Reviewed By: kulshrax Differential Revision: D24129559 fbshipit-source-id: cf31ec661123df329f1773d2b67deb474d6476f8
This commit is contained in:
parent
e9a5b7e379
commit
b2d9183c92
@ -187,7 +187,7 @@ def unhide(ui, repo, *revs, **opts):
|
||||
commits will also become visible.
|
||||
"""
|
||||
revs = list(revs) + opts.pop("rev", [])
|
||||
with repo.lock():
|
||||
with repo.wlock(), repo.lock():
|
||||
revs = set(scmutil.revrange(repo, revs))
|
||||
_dounhide(repo, revs)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user