changeset 1807:7a2e0629bdee stable

inhibit: protect agains dropped 'bmstore.write' As planned per the deprecation policy, 'bmstore.write' have been dropped in Mercurial core (052c9318e464).
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Fri, 27 May 2016 17:33:53 +0200
parents aec233d3cafd
children a4de197218cf 21c12b09d78f 1650f7dd2048
files hgext/inhibit.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/inhibit.py
+++ b/hgext/inhibit.py
@@ -296,7 +296,8 @@
     # 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)
+    if getattr(bookmarks.bmstore, 'write', None) is not None:# mercurial < 3.9
+        extensions.wrapfunction(bookmarks.bmstore, 'write', _bookmarkchanged)
     # Add bookmark -D option
     entry = extensions.wrapcommand(commands.table, 'bookmark', _bookmark)
     entry[1].append(('D','prune',None,