[Commented On] D11992: largefiles: take lock before writing requirements
baymax (Baymax, Your Personal Patch-care Companion)
phabricator at mercurial-scm.org
Mon Jan 24 15:02:49 UTC 2022
baymax added a comment.
baymax updated this revision to Diff 31801.
✅ refresh by Heptapod after a successful CI run (🐙 💚)
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D11992?vs=31647&id=31801
BRANCH
default
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D11992/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D11992
AFFECTED FILES
hgext/largefiles/reposetup.py
CHANGE DETAILS
diff --git a/hgext/largefiles/reposetup.py b/hgext/largefiles/reposetup.py
--- a/hgext/largefiles/reposetup.py
+++ b/hgext/largefiles/reposetup.py
@@ -455,11 +455,12 @@
repo.prepushoutgoinghooks.add(b"largefiles", prepushoutgoinghook)
def checkrequireslfiles(ui, repo, **kwargs):
- if b'largefiles' not in repo.requirements and any(
- lfutil.shortname + b'/' in f[1] for f in repo.store.datafiles()
- ):
- repo.requirements.add(b'largefiles')
- scmutil.writereporequirements(repo)
+ with repo.lock():
+ if b'largefiles' not in repo.requirements and any(
+ lfutil.shortname + b'/' in f[1] for f in repo.store.datafiles()
+ ):
+ repo.requirements.add(b'largefiles')
+ scmutil.writereporequirements(repo)
ui.setconfig(
b'hooks', b'changegroup.lfiles', checkrequireslfiles, b'largefiles'
To: marmoute, #hg-reviewers, Alphare
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20220124/6e2b7828/attachment-0002.html>
More information about the Mercurial-patches
mailing list