diff 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
line wrap: on
line diff
--- a/mercurial/bookmarks.py	Fri Oct 15 04:25:58 2021 +0200
+++ b/mercurial/bookmarks.py	Fri Oct 15 04:41:24 2021 +0200
@@ -775,6 +775,9 @@
 def updatefromremote(
     ui, repo, remotemarks, path, trfunc, explicit=(), mode=None
 ):
+    if mode == b'ignore':
+        # This should move to an higher level to avoid fetching bookmark at all
+        return
     ui.debug(b"checking for updated bookmarks\n")
     if mode == b'mirror':
         changed = mirroring_remote(ui, repo, remotemarks)
@@ -793,6 +796,9 @@
 
 def incoming(ui, repo, peer, mode=None):
     """Show bookmarks incoming from other to repo"""
+    if mode == b'ignore':
+        ui.status(_(b"bookmarks exchange disabled with this path\n"))
+        return 0
     ui.status(_(b"searching for changed bookmarks\n"))
 
     with peer.commandexecutor() as e: