Patchwork bookmark: deprecate direct update of a bookmark value

login
register
mail settings
Submitter Boris Feld
Date Jan. 17, 2018, noon
Message ID <66b6d899ce1dfc8e9773.1516190439@FB>
Download mbox | patch
Permalink /patch/26813/
State Accepted
Headers show

Comments

Boris Feld - Jan. 17, 2018, noon
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1500055150 -7200
#      Fri Jul 14 19:59:10 2017 +0200
# Node ID 66b6d899ce1dfc8e9773dd4be0afbed7236df7c2
# Parent  0e369eca888fc80ee980fe8200c59dc7b0024dae
# EXP-Topic tr.changes.bookmarks
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 66b6d899ce1d
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.
Augie Fackler - Jan. 17, 2018, 10:24 p.m.
> On Jan 17, 2018, at 07:00, Boris Feld <boris.feld@octobus.net> wrote:
> 
> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1500055150 -7200
> #      Fri Jul 14 19:59:10 2017 +0200
> # Node ID 66b6d899ce1dfc8e9773dd4be0afbed7236df7c2
> # Parent  0e369eca888fc80ee980fe8200c59dc7b0024dae
> # EXP-Topic tr.changes.bookmarks
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 66b6d899ce1d
> bookmark: deprecate direct update of a bookmark value

queued, thanks

Patch

diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -122,6 +122,12 @@  class bmstore(dict):
         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
         """