comparison hgext3rd/topic/discovery.py @ 6566:cb009f13126a

branching: merge with stable
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 11 Oct 2023 13:45:08 -0300
parents 2d3771d61068 30d0d3d92c8d
children d511eba4cdb0
comparison
equal deleted inserted replaced
6565:835f0adf8e39 6566:cb009f13126a
353 else: 353 else:
354 # _branchinfo() gets called through branchinfo(), the latter will need 354 # _branchinfo() gets called through branchinfo(), the latter will need
355 # to do the conversion 355 # to do the conversion
356 return orig(self, rev, **kwargs) 356 return orig(self, rev, **kwargs)
357 357
358 def wrapaddpartrevbranchcache(orig, repo, bundler, outgoing):
359 """making sure we send rev-branch-cache that only has bare branches"""
360 overrides = {(b'_internal', b'tns-disable-fqbn'): True}
361 with repo.ui.configoverride(overrides, b'topic-namespaces'):
362 orig(repo, bundler, outgoing)
363
358 def wraphgpeer(orig, uiorrepo, opts, *args, **kwargs): 364 def wraphgpeer(orig, uiorrepo, opts, *args, **kwargs):
359 """hg.peer() that checks if there are explicit arguments for e.g. pull""" 365 """hg.peer() that checks if there are explicit arguments for e.g. pull"""
360 peer = orig(uiorrepo, opts, *args, **kwargs) 366 peer = orig(uiorrepo, opts, *args, **kwargs)
361 if any(opts.get(k) for k in (b'rev', b'bookmark', b'branch')): 367 if any(opts.get(k) for k in (b'rev', b'bookmark', b'branch')):
362 peer.ui.setconfig(b'_internal', b'tns-explicit-target', True, b'topic-namespaces') 368 peer.ui.setconfig(b'_internal', b'tns-explicit-target', True, b'topic-namespaces')
393 if util.safehasattr(bundle2, 'handlecheckupdatedheads'): 399 if util.safehasattr(bundle2, 'handlecheckupdatedheads'):
394 # we still need a proper wrap b2 part stuff 400 # we still need a proper wrap b2 part stuff
395 extensions.wrapfunction(bundle2, 'handlecheckupdatedheads', handlecheckheads) 401 extensions.wrapfunction(bundle2, 'handlecheckupdatedheads', handlecheckheads)
396 bundle2.handlecheckupdatedheads.params = frozenset() 402 bundle2.handlecheckupdatedheads.params = frozenset()
397 bundle2.parthandlermapping[b'check:updated-heads'] = bundle2.handlecheckupdatedheads 403 bundle2.parthandlermapping[b'check:updated-heads'] = bundle2.handlecheckupdatedheads
404 extensions.wrapfunction(bundle2, 'addpartrevbranchcache', wrapaddpartrevbranchcache)
398 extensions.wrapfunction(exchange, '_pushb2phases', _pushb2phases) 405 extensions.wrapfunction(exchange, '_pushb2phases', _pushb2phases)
399 exchange.b2partsgenmapping[b'phase'] = exchange._pushb2phases 406 exchange.b2partsgenmapping[b'phase'] = exchange._pushb2phases
400 extensions.wrapfunction(hg, 'peer', wraphgpeer) 407 extensions.wrapfunction(hg, 'peer', wraphgpeer)
401 extensions.wrapfunction(hg, 'remoteui', wraphgremoteui) 408 extensions.wrapfunction(hg, 'remoteui', wraphgremoteui)