[PATCH 3 of 4] bookmarks: jettison bmstore's write() method per deprecation policy

Augie Fackler raf at durin42.com
Wed May 4 22:56:06 EDT 2016


# HG changeset patch
# User Augie Fackler <augie at google.com>
# Date 1462410109 14400
#      Wed May 04 21:01:49 2016 -0400
# Node ID 0106c03f1d8b0ab36283392c816fdeab0e90f53c
# Parent  f3f96ad5b8314c87e7879553c2523dc3178f7a9d
bookmarks: jettison bmstore's write() method per deprecation policy

diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -109,39 +109,6 @@ class bmstore(dict):
                             location='plain')
         tr.hookargs['bookmark_moved'] = '1'
 
-    def write(self):
-        '''Write bookmarks
-
-        Write the given bookmark => hash dictionary to the .hg/bookmarks file
-        in a format equal to those of localtags.
-
-        We also store a backup of the previous state in undo.bookmarks that
-        can be copied back on rollback.
-        '''
-        msg = 'bm.write() is deprecated, use bm.recordchange(transaction)'
-        self._repo.ui.deprecwarn(msg, '3.7')
-        # TODO: writing the active bookmark should probably also use a
-        # transaction.
-        self._writeactive()
-        if self._clean:
-            return
-        repo = self._repo
-        if (repo.ui.configbool('devel', 'all-warnings')
-                or repo.ui.configbool('devel', 'check-locks')):
-            l = repo._wlockref and repo._wlockref()
-            if l is None or not l.held:
-                repo.ui.develwarn('bookmarks write with no wlock')
-
-        tr = repo.currenttransaction()
-        if tr:
-            self.recordchange(tr)
-            # invalidatevolatilesets() is omitted because this doesn't
-            # write changes out actually
-            return
-
-        self._writerepo(repo)
-        repo.invalidatevolatilesets()
-
     def _writerepo(self, repo):
         """Factored out for extensibility"""
         rbm = repo._bookmarks


More information about the Mercurial-devel mailing list