# HG changeset patch # User Marcin Kuzminski # Date 2017-05-17 14:20:55 # Node ID 7133c82f23af7b1f6f8c3b53635cd6100f3e8bd0 # Parent 427ed58b3a3a33f38ba79ff87619acea62fa1424 hooks: expose post-key-push hook for Mercurial. diff --git a/vcsserver/hooks.py b/vcsserver/hooks.py --- a/vcsserver/hooks.py +++ b/vcsserver/hooks.py @@ -194,6 +194,12 @@ def post_push(ui, repo, node, **kwargs): return _call_hook('post_push', extras, HgMessageWriter(ui)) +def key_push(ui, repo, **kwargs): + if kwargs['new'] != '0' and kwargs['namespace'] == 'bookmarks': + # store new bookmarks in our UI object propagated later to post_push + ui._rc_pushkey_branches = repo[kwargs['key']].bookmarks() + return + # backward compat log_pull_action = post_pull