Mercurial > evolve
diff hgext/evolve.py @ 1558:4706475e0c5d
commitwrapper: use bookmarks.recordchange instead of bookmarks.write
Before this patch we were using the deprecated API bookmarks.write, this patch
replace its usage by the new API call bookmarks.recordchange.
author | Laurent Charignon <lcharignon@fb.com> |
---|---|
date | Thu, 10 Dec 2015 15:09:25 -0800 |
parents | e72f83f09bdc |
children | dbf1532ee868 |
line wrap: on
line diff
--- a/hgext/evolve.py Thu Dec 10 14:43:31 2015 -0800 +++ b/hgext/evolve.py Thu Dec 10 15:09:25 2015 -0800 @@ -2665,6 +2665,7 @@ @eh.wrapcommand('commit') def commitwrapper(orig, ui, repo, *arg, **kwargs): + tr = None if kwargs.get('amend', False): wlock = lock = None else: @@ -2687,10 +2688,16 @@ for book in oldbookmarks: repo._bookmarks[book] = new.node() if oldbookmarks: - repo._bookmarks.write() + if not wlock: + wlock = repo.wlock() + if not lock: + lock = repo.lock() + tr = repo.transaction('commit') + repo._bookmarks.recordchange(tr) + tr.close() return result finally: - lockmod.release(lock, wlock) + lockmod.release(tr, lock, wlock) @command('^split', [('r', 'rev', [], _("revision to fold")),