D242: context: rename troubled into isunstable

Brandon McCaig bamccaig at gmail.com
Wed Aug 9 12:32:43 EDT 2017


On Wed, Aug 09, 2017 at 03:37:26PM +0000, lothiraldan (Boris Feld) wrote:
> diff --git a/mercurial/context.py b/mercurial/context.py ---
> a/mercurial/context.py +++ b/mercurial/context.py @@ -240,6
> +240,12 @@ return self.rev() in obsmod.getrevs(self._repo,
> 'divergent')
>  
>      def troubled(self):
> +        msg = ("'context.troubled' is deprecated, "
> +               "use 'context.isunstable'")
> +        self._repo.ui.deprecwarn(msg, '4.4')
> +        return self.unstable()

Maybe I'm missing something, but shouldn't this be:

        return self.isunstable()

It sounded like context.unstable() has a different purpose and so
troubled was renamed to isunstable and so troubled() itself
should also be calling isunstable().

> +
> +    def isunstable(self):
>          """True if the changeset is either unstable, bumped or divergent"""
>          return self.orphan() or self.phasedivergent() or self.contentdivergent()

Regards,


-- 
Brandon McCaig <bamccaig at gmail.com> <bambams at castopulence.org>
Castopulence Software <https://www.castopulence.org/>
Blog <http://www.bambams.ca/>
perl -E '$_=q{V zrna gur orfg jvgu jung V fnl. }.
q{Vg qbrfa'\''g nyjnlf fbhaq gung jnl.};
tr/A-Ma-mN-Zn-z/N-Zn-zA-Ma-m/;say'

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20170809/0a9fc026/attachment.sig>


More information about the Mercurial-devel mailing list