mirror of
https://github.com/facebook/sapling.git
synced 2024-12-29 08:02:24 +03:00
hooks: add predefined hook to run fsync
Reviewed By: DurhamG Differential Revision: D22993217 fbshipit-source-id: 2cfb6b26479cd7dad02419fb76fa5d3ca5dd66db
This commit is contained in:
parent
a01693df0e
commit
6e2a90ddb5
21
eden/scm/edenscm/hooks.py
Normal file
21
eden/scm/edenscm/hooks.py
Normal file
@ -0,0 +1,21 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
#
|
||||
# This software may be used and distributed according to the terms of the
|
||||
# GNU General Public License version 2.
|
||||
|
||||
"""predefined hooks"""
|
||||
|
||||
from .mercurial import util
|
||||
|
||||
|
||||
def backgroundfsync(ui, repo, hooktype, **kwargs):
|
||||
"""run fsync in background
|
||||
|
||||
Example config::
|
||||
|
||||
[hooks]
|
||||
postwritecommand.fsync = python:edenscm.hooks.backgroundfsync
|
||||
"""
|
||||
if not repo:
|
||||
return
|
||||
util.spawndeetached(util.gethgcmd() + ["debugfsync"], cwd=repo.svfs.join(""))
|
Loading…
Reference in New Issue
Block a user