Skip to content

Commit

Permalink
hgmo: deal with API change in mercurial 6.0 r=sheehan
Browse files Browse the repository at this point in the history
mercurial.bookmarks.bmupdatefromremote got a new keyword argument
"mode" in https://www.mercurial-scm.org/repo/hg/rev/4d2ab365699e.

It looks like with 6.0 we might actually be able to drop the
hgmo.replacebookmarks option and replace it with the new
"path.*:bookmarks.mode=mirror", but for now let's just not crash.

Differential Revision: https://phabricator.services.mozilla.com/D136327

--HG--
extra : moz-landing-system : lando
  • Loading branch information
jcristau committed Jan 19, 2022
1 parent ac4d918 commit b15db40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hgext/hgmo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ def revset_automationrelevant(repo, subset, x):
return subset & revset.baseset(revs)


def bmupdatefromremote(orig, ui, repo, remotemarks, path, trfunc, explicit=()):
def bmupdatefromremote(orig, ui, repo, remotemarks, path, trfunc, **kwargs):
"""Custom bookmarks applicator that overwrites with remote state.
The default bookmarks merging code adds divergence. When replicating from
Expand All @@ -561,7 +561,7 @@ def bmupdatefromremote(orig, ui, repo, remotemarks, path, trfunc, explicit=()):
the complicated merging algorithm with a simple "remote wins" version.
"""
if not ui.configbool(b'hgmo', b'replacebookmarks', False):
return orig(ui, repo, remotemarks, path, trfunc, explicit=explicit)
return orig(ui, repo, remotemarks, path, trfunc, **kwargs)

localmarks = repo._bookmarks

Expand Down

0 comments on commit b15db40

Please sign in to comment.