# HG changeset patch # User Dan Villiom Podlaski Christiansen <danchr@gmail.com> # Date 1622498685 -7200 # Tue Jun 01 00:04:45 2021 +0200 # Node ID 264471993b24d6da11ad8e4533f8a48356f4940c # Parent bf5d4487560b7c2e088b0cec289104a8bb4420a6 util: remove unnecessary updatebookmarks() wrapper This used to be for compatibility with old versions of Mercurial, but in practice it just hides the transaction. diff --git a/hggit/git_handler.py b/hggit/git_handler.py --- a/hggit/git_handler.py +++ b/hggit/git_handler.py @@ -1675,7 +1675,9 @@ changes.append((head + suffix, hgsha)) if changes: - util.updatebookmarks(self.repo, changes) + with self.repo.wlock(), self.repo.lock(): + with self.repo.transaction(b"hg-git") as tr: + bms.applychanges(self.repo, tr, changes) except AttributeError: self.ui.warn(_(b'creating bookmarks failed, do you have' diff --git a/hggit/util.py b/hggit/util.py --- a/hggit/util.py +++ b/hggit/util.py @@ -10,7 +10,6 @@ from mercurial.i18n import _ from mercurial import ( error, - lock as lockmod, util as hgutil, ) @@ -102,20 +101,6 @@ return False -def updatebookmarks(repo, changes, name=b'git_handler'): - """abstract writing bookmarks for backwards compatibility""" - bms = repo._bookmarks - tr = lock = wlock = None - try: - wlock = repo.wlock() - lock = repo.lock() - tr = repo.transaction(name) - bms.applychanges(repo, tr, changes) - tr.close() - finally: - lockmod.release(tr, lock, wlock) - - def checksafessh(host): """check if a hostname is a potentially unsafe ssh exploit (SEC)