Patchwork [1,of,2] compat: drop compatibility for `context.descendant`

login
register
mail settings
Submitter Boris Feld
Date Aug. 14, 2018, 1:35 p.m.
Message ID <27efa73dcb8082e41923.1534253712@FB-lair>
Download mbox | patch
Permalink /patch/33715/
State Accepted
Headers show

Comments

Boris Feld - Aug. 14, 2018, 1:35 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1534234106 -7200
#      Tue Aug 14 10:08:26 2018 +0200
# Node ID 27efa73dcb8082e41923a3b834d92f505daa509d
# Parent  d99468d2b09acc8f5c6c5ce5c1b08b47a742841f
# EXP-Topic compat-drop
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 27efa73dcb80
compat: drop compatibility for `context.descendant`

As advertised, the method is dropped in 4.8.
Gregory Szorc - Aug. 14, 2018, 8:39 p.m.
On Tue, Aug 14, 2018 at 6:35 AM, Boris Feld <boris.feld@octobus.net> wrote:

> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1534234106 -7200
> #      Tue Aug 14 10:08:26 2018 +0200
> # Node ID 27efa73dcb8082e41923a3b834d92f505daa509d
> # Parent  d99468d2b09acc8f5c6c5ce5c1b08b47a742841f
> # EXP-Topic compat-drop
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r
> 27efa73dcb80
> compat: drop compatibility for `context.descendant`
>

Queued this series with minor commit message tweaks to add (API) and
annotate to proper changed module.


>
> As advertised, the method is dropped in 4.8.
>
> diff --git a/mercurial/context.py b/mercurial/context.py
> --- a/mercurial/context.py
> +++ b/mercurial/context.py
> @@ -593,12 +593,6 @@ class changectx(basectx):
>                              short(n) for n in sorted(cahs) if n != anc))
>          return changectx(self._repo, anc)
>
> -    def descendant(self, other):
> -        msg = (b'ctx.descendant(other) is deprecated, '
> -               b'use ctx.isancestorof(other)')
> -        self._repo.ui.deprecwarn(msg, b'4.7')
> -        return self.isancestorof(other)
> -
>      def isancestorof(self, other):
>          """True if this changeset is an ancestor of other"""
>          return self._repo.changelog.isancestorrev(self._rev, other._rev)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -593,12 +593,6 @@  class changectx(basectx):
                             short(n) for n in sorted(cahs) if n != anc))
         return changectx(self._repo, anc)
 
-    def descendant(self, other):
-        msg = (b'ctx.descendant(other) is deprecated, '
-               b'use ctx.isancestorof(other)')
-        self._repo.ui.deprecwarn(msg, b'4.7')
-        return self.isancestorof(other)
-
     def isancestorof(self, other):
         """True if this changeset is an ancestor of other"""
         return self._repo.changelog.isancestorrev(self._rev, other._rev)