comparison mercurial/bookmarks.py @ 48244:b56858d85a7b

bookmarks: add a `ignore` variant of the bookmark mode This new mode allow to disable bookmark exchange with some path (or all path). Differential Revision: https://phab.mercurial-scm.org/D11677
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 15 Oct 2021 04:41:24 +0200
parents 76c071bba40d
children dfbfa802876b
comparison
equal deleted inserted replaced
48243:76c071bba40d 48244:b56858d85a7b
773 773
774 774
775 def updatefromremote( 775 def updatefromremote(
776 ui, repo, remotemarks, path, trfunc, explicit=(), mode=None 776 ui, repo, remotemarks, path, trfunc, explicit=(), mode=None
777 ): 777 ):
778 if mode == b'ignore':
779 # This should move to an higher level to avoid fetching bookmark at all
780 return
778 ui.debug(b"checking for updated bookmarks\n") 781 ui.debug(b"checking for updated bookmarks\n")
779 if mode == b'mirror': 782 if mode == b'mirror':
780 changed = mirroring_remote(ui, repo, remotemarks) 783 changed = mirroring_remote(ui, repo, remotemarks)
781 else: 784 else:
782 changed = merging_from_remote(ui, repo, remotemarks, path, explicit) 785 changed = merging_from_remote(ui, repo, remotemarks, path, explicit)
791 repo._bookmarks.applychanges(repo, tr, changes) 794 repo._bookmarks.applychanges(repo, tr, changes)
792 795
793 796
794 def incoming(ui, repo, peer, mode=None): 797 def incoming(ui, repo, peer, mode=None):
795 """Show bookmarks incoming from other to repo""" 798 """Show bookmarks incoming from other to repo"""
799 if mode == b'ignore':
800 ui.status(_(b"bookmarks exchange disabled with this path\n"))
801 return 0
796 ui.status(_(b"searching for changed bookmarks\n")) 802 ui.status(_(b"searching for changed bookmarks\n"))
797 803
798 with peer.commandexecutor() as e: 804 with peer.commandexecutor() as e:
799 remotemarks = unhexlifybookmarks( 805 remotemarks = unhexlifybookmarks(
800 e.callcommand( 806 e.callcommand(