dispatch: load shared source repository config in share-safe mode
It seems to me now that there are two steps when config is loaded:
1) on dispatch
2) repository object creation
Recent patches added functionality that there can be shares in share-safe mode
where config of the source repository is shared with the the shares. However we
missed adding logic to read the source config on dispatch. This leads to
extensions not being loaded on dispatch and hence extensions command not being
recognized.
This patch fixes it by reading the shared source config on dispatch.
Differential Revision: https://phab.mercurial-scm.org/D9047
# Dummy extension that adds a delay after acquiring a lock.
#
# This extension can be used to test race conditions between lock acquisition.
from __future__ import absolute_import
import os
import time
def reposetup(ui, repo):
class delayedlockrepo(repo.__class__):
def lock(self, wait=True):
delay = float(os.environ.get('HGPRELOCKDELAY', '0.0'))
if delay:
time.sleep(delay)
res = super(delayedlockrepo, self).lock(wait=wait)
delay = float(os.environ.get('HGPOSTLOCKDELAY', '0.0'))
if delay:
time.sleep(delay)
return res
repo.__class__ = delayedlockrepo