Re: [PATCH 1 of 8] bookmarks: drop deprecated methods (API)

2018-02-03 Thread Yuya Nishihara
On Sat, 03 Feb 2018 01:34:57 -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison 
> # Date 1517631655 18000
> #  Fri Feb 02 23:20:55 2018 -0500
> # Node ID d293af8e5a4a48a38ff9103e129c1af5719081c1
> # Parent  c8e2d6ed1f9ea4eee7b28250b5aff22433d538b6
> bookmarks: drop deprecated methods (API)

Queued patches other than this, thanks.

> diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
> --- a/mercurial/bookmarks.py
> +++ b/mercurial/bookmarks.py
> @@ -102,32 +102,14 @@
>  self._active = mark
>  self._aclean = False
>  
> -def __setitem__(self, *args, **kwargs):
> -msg = ("'bookmarks[name] = node' is deprecated, "
> -   "use 'bookmarks.applychanges'")
> -self._repo.ui.deprecwarn(msg, '4.3')
> -self._set(*args, **kwargs)

We'd probably better to kill these dict functions by raising NotImplementedError
or ProgrammingError. It's pretty easy to use them by mistake.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 1 of 8] bookmarks: drop deprecated methods (API)

2018-02-02 Thread Matt Harbison
# HG changeset patch
# User Matt Harbison 
# Date 1517631655 18000
#  Fri Feb 02 23:20:55 2018 -0500
# Node ID d293af8e5a4a48a38ff9103e129c1af5719081c1
# Parent  c8e2d6ed1f9ea4eee7b28250b5aff22433d538b6
bookmarks: drop deprecated methods (API)

.. api::

   The following deprecated methods have been removed from bookmarks:
   __setitem__(), __delitem__(), update(), and recordchange().  Use
   bookmarks.applychanges() instead.

diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -102,32 +102,14 @@
 self._active = mark
 self._aclean = False
 
-def __setitem__(self, *args, **kwargs):
-msg = ("'bookmarks[name] = node' is deprecated, "
-   "use 'bookmarks.applychanges'")
-self._repo.ui.deprecwarn(msg, '4.3')
-self._set(*args, **kwargs)
-
 def _set(self, key, value):
 self._clean = False
 return dict.__setitem__(self, key, value)
 
-def __delitem__(self, key):
-msg = ("'del bookmarks[name]' is deprecated, "
-   "use 'bookmarks.applychanges'")
-self._repo.ui.deprecwarn(msg, '4.3')
-self._del(key)
-
 def _del(self, key):
 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
 """
@@ -146,12 +128,6 @@
 bmchanges[name] = (old, node)
 self._recordchange(tr)
 
-def recordchange(self, tr):
-msg = ("'bookmarks.recorchange' is deprecated, "
-   "use 'bookmarks.applychanges'")
-self._repo.ui.deprecwarn(msg, '4.3')
-return self._recordchange(tr)
-
 def _recordchange(self, tr):
 """record that bookmarks have been changed in a transaction
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel