# HG changeset patch # User Laurent Charignon # Date 2015-11-20 21:23:47 # Node ID 1168499e52661e0e147b302ae84c1e4e27200160 # Parent df9b73d2d444ae82fe8d3fe6cf682a93b2c4a7ef histedit: make use of bookmarks.recordchange instead of bookmarks.write Before this patch we were using the old api bookmarks.write, this patches replaces its usage by bookmarks.recordchange, the new api to record bookmark changes. diff --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -1180,13 +1180,20 @@ def movebookmarks(ui, repo, mapping, old # nothing to move moves.append((bk, new[-1])) if moves: - marks = repo._bookmarks - for mark, new in moves: - old = marks[mark] - ui.note(_('histedit: moving bookmarks %s from %s to %s\n') - % (mark, node.short(old), node.short(new))) - marks[mark] = new - marks.write() + lock = tr = None + try: + lock = repo.lock() + tr = repo.transaction('histedit') + marks = repo._bookmarks + for mark, new in moves: + old = marks[mark] + ui.note(_('histedit: moving bookmarks %s from %s to %s\n') + % (mark, node.short(old), node.short(new))) + marks[mark] = new + marks.recordchange(tr) + tr.close() + finally: + release(tr, lock) def cleanupnode(ui, repo, name, nodes): """strip a group of nodes from the repository