# HG changeset patch # User Laurent Charignon # Date 1451500044 28800 # Node ID 8140bbc2fdc2062c6d957b0e288a3ab45030a95e # Parent e7316a108780dfc2cb469ac03b96bae38d537e5e bookmarks: use bookmarks.recordchange instead of bookmarks.write if available bookmarks.write is deprecated and it was showing warning messages in test-hg-branch.t with the latest test runner from core mercurial. Tested with both hg 2.8 and hg tip. diff -r e7316a108780 -r 8140bbc2fdc2 hggit/git_handler.py --- a/hggit/git_handler.py Mon Dec 14 14:38:42 2015 -0800 +++ b/hggit/git_handler.py Wed Dec 30 10:27:24 2015 -0800 @@ -21,6 +21,7 @@ from mercurial import commands from mercurial import context, util as hgutil from mercurial import url +from mercurial import lock as lockmod import _ssh import git2hg @@ -1308,11 +1309,19 @@ bms[head + suffix] = hgsha if heads: - wlock = self.repo.wlock() + tr = lock = wlock = None try: - bms.write() + wlock = self.repo.wlock() + lock = self.repo.lock() + tr = self.repo.transaction('git_handler') + if hgutil.safehasattr(bms, 'recordchange'): + # recordchange was added in mercurial 3.2 + bms.recordchange(tr) + else: + bms.write() + tr.close() finally: - wlock.release() + lockmod.release(tr, lock, wlock) except AttributeError: self.ui.warn(_('creating bookmarks failed, do you have'