diff hgext3rd/topic/server.py @ 6564:2d3771d61068

topic: use a config option to signal explicit target arguments (for tns)
author Anton Shestakov <av6@dwimlabs.net>
date Mon, 09 Oct 2023 15:07:38 -0300
parents 445240ccb701
children ef04d887c9a0
line wrap: on
line diff
--- a/hgext3rd/topic/server.py	Mon Oct 09 15:06:26 2023 -0300
+++ b/hgext3rd/topic/server.py	Mon Oct 09 15:07:38 2023 -0300
@@ -122,7 +122,10 @@
             if command == b'heads':
                 if self._peer.capable(b'ext-topics-tns-heads'):
                     command = b'tns_heads'
-                    args[b'namespaces'] = self._peer.ui.configlist(b'experimental', b'tns-default-pull-namespaces', [b'*'])
+                    if self._peer.ui.configbool(b'_internal', b'tns-explicit-target', False):
+                        args[b'namespaces'] = [b'*']
+                    else:
+                        args[b'namespaces'] = self._peer.ui.configlist(b'experimental', b'tns-default-pull-namespaces', [b'*'])
                 elif self._peer.capable(b'_exttopics_heads'):
                     command = b'_exttopics_heads'
                     if getattr(self._peer, '_exttopics_heads', None) is None:
@@ -137,7 +140,10 @@
             if command == b'heads':
                 if self._peer.capable(b'ext-topics-tns-heads'):
                     command = b'tns_heads'
-                    args[b'namespaces'] = self._peer.ui.configlist(b'experimental', b'tns-default-pull-namespaces', [b'*'])
+                    if self._peer.ui.configbool(b'_internal', b'tns-explicit-target', False):
+                        args[b'namespaces'] = [b'*']
+                    else:
+                        args[b'namespaces'] = self._peer.ui.configlist(b'experimental', b'tns-default-pull-namespaces', [b'*'])
             s = super(topiccommandexecutor, self)
             return s.callcommand(command, args)