changeset 35679:5a2d505a9174

bookmark: deprecate direct update of a bookmark value This changeset was part of an older series preventing direct update of the bookmarks store without the change being tracked by a transaction. For some unclear reason, this was not sent to the list. So we are sending it now. Initial series: 3325c7dcabaa+08bf0ebc6c8e+712a85b3677f. We want to channel all bookmarks update through 'applychanges' so let's remove more way to work around this function.
author Boris Feld <boris.feld@octobus.net>
date Fri, 14 Jul 2017 19:59:10 +0200
parents 43154a76f392
children 077ee15b8493
files mercurial/bookmarks.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bookmarks.py	Mon Oct 16 14:32:06 2017 +0200
+++ b/mercurial/bookmarks.py	Fri Jul 14 19:59:10 2017 +0200
@@ -122,6 +122,12 @@
         self._clean = False
         return dict.__delitem__(self, key)
 
+    def update(self, *others):
+        msg = ("bookmarks.update(...)' is deprecated, "
+               "use 'bookmarks.applychanges'")
+        self._repo.ui.deprecwarn(msg, '4.5')
+        return dict.update(self, *others)
+
     def applychanges(self, repo, tr, changes):
         """Apply a list of changes to bookmarks
         """