[PATCH 2 of 3 STABLE] localrepo: reintroduce 'repo.changectx' as deprecated

Yuya Nishihara yuya at tcha.org
Thu Jul 26 09:09:18 EDT 2018


On Thu, 26 Jul 2018 14:21:19 +0200, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld at octobus.net>
> # Date 1532596370 -7200
> #      Thu Jul 26 11:12:50 2018 +0200
> # Branch stable
> # Node ID a920f2620726ef26e6caed3d72b24297699b5b39
> # Parent  fd0db472d69ac41a0540a15a3019707a368727b3
> # EXP-Topic compat-hggit
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r a920f2620726
> localrepo: reintroduce 'repo.changectx' as deprecated
> 
> This method is used by various extension (like hg-git, hg-subversion). It
> should go through the usual deprecated cycle to reduce the impact on users.
> 
> This changeset effectively backout changeset 836867586b83.

Why now?

It was removed before the release of 4.6, and fixing extension code is
pretty easy since repo.changectx() was an alias of repo[] for years.

> +    def changectx(self, changeid):
> +        msg = ("repo.changectx(...) is deprecated, use repo[...] or"
> +              " scmutil.revsymbol[...]")
> +        self.ui.deprecwarn(msg, '4.7')
> +        if nodemod.isnode(changeid):
> +            return self[changeid]
> +        else:
> +            return scmutil.revsymbol(self, changeid)

If we restore repo.changectx(changeid), it should be aliased to self[changeid].


More information about the Mercurial-devel mailing list