changeset 1637:23a34dce5131

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.
author Laurent Charignon <lcharignon@fb.com>
date Tue, 24 Nov 2015 17:16:27 -0800
parents 5a1cfb1160a6
children 333e056b3034
files hgext/inhibit.py
diffstat 1 files changed, 0 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/inhibit.py
+++ b/hgext/inhibit.py
@@ -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,