# HG changeset patch # User Laurent Charignon # Date 1448414187 28800 # Node ID 23a34dce5131dc1d9b8c63e3fffb4d7a72cc5cf3 # Parent 5a1cfb1160a685f8c7f56e6fae3c7e71c4294dc0 inhibit: remove unused bookmark operation wrapping Before this patch, inhibit was wrapping bookmarks.write and bookmarks.recordchange. Since all the usage of bookmarks.write are not replaced by bookmarks.recordchange all bookmarks operation happen in a transaction. Inhibit already wraps the transaction mechanism to make sure that no revision can end up being obsolete and visible. This makes the wrapping of bookmarks.write superfluous. Wrapping bookmarks.recordchange was wrong in the first place and redundant with wrapping transactions. diff -r 5a1cfb1160a6 -r 23a34dce5131 hgext/inhibit.py --- a/hgext/inhibit.py Tue Dec 01 10:25:38 2015 -0800 +++ b/hgext/inhibit.py Tue Nov 24 17:16:27 2015 -0800 @@ -21,7 +21,6 @@ from mercurial import scmutil from mercurial import commands from mercurial import lock as lockmod -from mercurial import bookmarks from mercurial import util from mercurial.i18n import _ @@ -72,13 +71,6 @@ finally: lockmod.release(wlock) -def _bookmarkchanged(orig, bkmstoreinst, *args, **kwargs): - """ Add inhibition markers to every obsolete bookmarks """ - repo = bkmstoreinst._repo - bkmstorenodes = [repo[v].node() for v in bkmstoreinst.values()] - _inhibitmarkers(repo, bkmstorenodes) - return orig(bkmstoreinst, *args, **kwargs) - def _bookmark(orig, ui, repo, *bookmarks, **opts): """ Add a -D option to the bookmark command, map it to prune -B """ haspruneopt = opts.get('prune', False) @@ -241,10 +233,6 @@ # wrap update to make sure that no obsolete commit is visible after an # update extensions.wrapcommand(commands.table, 'update', _update) - # There are two ways to save bookmark changes during a transation, we - # wrap both to add inhibition markers. - extensions.wrapfunction(bookmarks.bmstore, 'recordchange', _bookmarkchanged) - extensions.wrapfunction(bookmarks.bmstore, 'write', _bookmarkchanged) # Add bookmark -D option entry = extensions.wrapcommand(commands.table, 'bookmark', _bookmark) entry[1].append(('D','prune',None,