# HG changeset patch # User Laurent Charignon # Date 1448930309 28800 # Node ID 5f2e4eb08e41f794d6db8dafdeed1e86ce39608b # Parent 55fa7c3900ae4ac9f85423588fcb23bd5a7d2f9e repair: use bookmarks.recordchange instead of bookmarks.write Before this patch we were using the deprecated bookmarks.write api. This patch replaces the call to bookmarks.write by a call to bookmarks.recordchange. We move the bookmark code above the code removing the undo file because with bookmarks.recordchange we have to create a transaction that would create an undo file. diff -r 55fa7c3900ae -r 5f2e4eb08e41 mercurial/repair.py --- a/mercurial/repair.py Mon Nov 30 16:37:42 2015 -0800 +++ b/mercurial/repair.py Mon Nov 30 16:38:29 2015 -0800 @@ -203,6 +203,18 @@ repo.ui.popbuffer() f.close() + for m in updatebm: + bm[m] = repo[newbmtarget].node() + lock = tr = None + try: + lock = repo.lock() + tr = repo.transaction('repair') + bm.recordchange(tr) + tr.close() + finally: + tr.release() + lock.release() + # remove undo files for undovfs, undofile in repo.undofiles(): try: @@ -212,9 +224,6 @@ ui.warn(_('error removing %s: %s\n') % (undovfs.join(undofile), str(e))) - for m in updatebm: - bm[m] = repo[newbmtarget].node() - bm.write() except: # re-raises if backupfile: ui.warn(_("strip failed, full bundle stored in '%s'\n")