Mercurial > hg
comparison mercurial/bookmarks.py @ 48242:4d2ab365699e
bookmarks: move the `mirror` option to the `paths` section
A new `bookmarks` section with a `mirror` option have been added. That option
has never been released yet.
This new options is limited since it affect all paths without distinction. In
case where a repository is interacting with multiple peers, being able to
control behavior on a path basis can be quite valuable.
In addition, having more variant of behavior would be interesting, especially a
mode where no bookmark exchanged is tried at all. Such new mode (implemented
later) make a lot of sense for configuration on a path-basis.
Configuration of the default behavior is still possible through the usage of
generic path configuration. The "old" config, becomes:
[bookmarks]
mirror=True
becomes:
[path]
*:bookmarks.mode=mirror
Differential Revision: https://phab.mercurial-scm.org/D11675
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 15 Oct 2021 03:49:05 +0200 |
parents | 62f325f9b347 |
children | 76c071bba40d |
comparison
equal
deleted
inserted
replaced
48241:7d1e60244561 | 48242:4d2ab365699e |
---|---|
770 % (b, hex(scid)[:12]) | 770 % (b, hex(scid)[:12]) |
771 ) | 771 ) |
772 return changed | 772 return changed |
773 | 773 |
774 | 774 |
775 def updatefromremote(ui, repo, remotemarks, path, trfunc, explicit=()): | 775 def updatefromremote( |
776 ui, repo, remotemarks, path, trfunc, explicit=(), mode=None | |
777 ): | |
776 ui.debug(b"checking for updated bookmarks\n") | 778 ui.debug(b"checking for updated bookmarks\n") |
777 if ui.configbool(b'bookmarks', b'mirror'): | 779 if mode == b'mirror': |
778 changed = mirroring_remote(ui, repo, remotemarks) | 780 changed = mirroring_remote(ui, repo, remotemarks) |
779 else: | 781 else: |
780 changed = merging_from_remote(ui, repo, remotemarks, path, explicit) | 782 changed = merging_from_remote(ui, repo, remotemarks, path, explicit) |
781 | 783 |
782 if changed: | 784 if changed: |