# HG changeset patch # User Anton Shestakov # Date 1696874786 10800 # Node ID bdc8978232dea5c651fecddff1177ec36ad099f8 # Parent 703911d39f7a213aa02a694dbcdea84ea2e20291 topic: copy experimental.tns-default-pull-namespaces to remote peer ui This is required to be able to reach this config option when it's set in a hgrc as opposed to be given with the --config CLI flag. diff -r 703911d39f7a -r bdc8978232de hgext3rd/topic/discovery.py --- a/hgext3rd/topic/discovery.py Sat Sep 30 13:59:18 2023 -0300 +++ b/hgext3rd/topic/discovery.py Mon Oct 09 15:06:26 2023 -0300 @@ -354,6 +354,17 @@ # to do the conversion return orig(self, rev, **kwargs) +def wraphgremoteui(orig, src, opts): + """hg.remoteui() that copies tns-related config options to peer ui""" + dst = orig(src, opts) + if util.safehasattr(src, 'baseui'): # looks like a repository + src = src.ui + # we need to copy topic namespaces from local config to peer ui, since it + # needs to be accessible for peer command executors + namespaces = src.configlist(b'experimental', b'tns-default-pull-namespaces', [b'*']) + dst.setconfig(b'experimental', b'tns-default-pull-namespaces', namespaces, b'copied') + return dst + def modsetup(ui): """run at uisetup time to install all destinations wrapping""" extensions.wrapfunction(discovery, '_headssummary', _headssummary) @@ -378,3 +389,4 @@ bundle2.parthandlermapping[b'check:updated-heads'] = bundle2.handlecheckupdatedheads extensions.wrapfunction(exchange, '_pushb2phases', _pushb2phases) exchange.b2partsgenmapping[b'phase'] = exchange._pushb2phases + extensions.wrapfunction(hg, 'remoteui', wraphgremoteui)