view hgext3rd/topic/common.py @ 5707:581203686284 stable

compat: make topics compatible across change to cmdutil.commitstatus() `cmdutil.commitstatus()` was changed in https://phab.mercurial-scm.org/D9257 so it has a new `tip` argument. This patch adds compatibility with that. It was harder than I expected because the callers all pass the arguments as positional, so we can't look for `opts` or `tip` in the `kwargs`. I instead extracted much of the override to a helper. I think the result is okay.
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 16 Nov 2020 13:08:08 -0800
parents 1d1f8f56daac
children 7ad8107d953a
line wrap: on
line source

# Copyright 2019 Pierre-Yves David <pierre-yves.david@octobus.net>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.

def hastopicext(repo):
    """True if the repo use the topic extension"""
    return getattr(repo, 'hastopicext', False)