2022-01-06 01:42:23 +03:00
|
|
|
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
2020-09-01 03:32:44 +03:00
|
|
|
#
|
|
|
|
# This software may be used and distributed according to the terms of the
|
|
|
|
# GNU General Public License version 2.
|
|
|
|
|
|
|
|
"""predefined hooks"""
|
|
|
|
|
2022-08-24 23:45:53 +03:00
|
|
|
from . import util
|
2020-09-01 03:32:44 +03:00
|
|
|
|
|
|
|
|
|
|
|
def backgroundfsync(ui, repo, hooktype, **kwargs):
|
|
|
|
"""run fsync in background
|
|
|
|
|
|
|
|
Example config::
|
|
|
|
|
|
|
|
[hooks]
|
|
|
|
postwritecommand.fsync = python:edenscm.hooks.backgroundfsync
|
|
|
|
"""
|
|
|
|
if not repo:
|
|
|
|
return
|
2022-05-27 04:13:23 +03:00
|
|
|
util.spawndetached(util.hgcmd() + ["debugfsync"], cwd=repo.svfs.join(""))
|