From 5d8ea42f4924b6278a11a30c378ad3fe0e0009bf Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Jan 25 2021 13:58:19 +0000 Subject: readFullInheritance stops/jumps deprecation Fixes: https://pagure.io/koji/issue/2606 --- diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index 3b08898..51b3976 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -22,7 +22,7 @@ import six.moves.xmlrpc_client from six.moves import filter, map, range, zip import koji -from koji.util import base64encode, md5_constructor, to_list +from koji.util import base64encode, md5_constructor, to_list, deprecated from koji_cli.lib import ( TimeOption, _, @@ -4127,6 +4127,7 @@ def anon_handle_list_tag_inheritance(goptions, session, args): opts['event'] = event['id'] if options.jump: + deprecated("--jump option is deprecated and will be removed in 1.26") match = re.match(r'^(.*)/(.*)$', options.jump) if match: tag1 = session.getTagID(match.group(1)) @@ -4138,6 +4139,7 @@ def anon_handle_list_tag_inheritance(goptions, session, args): opts['jumps'][str(tag1)] = tag2 if options.stop: + deprecated("--stop option is deprecated and will be removed in 1.26") tag1 = session.getTagID(options.stop) if not tag1: parser.error(_("Unknown tag: %s" % options.stop)) diff --git a/hub/kojihub.py b/hub/kojihub.py index 8841bd7..b99c70d 100644 --- a/hub/kojihub.py +++ b/hub/kojihub.py @@ -771,10 +771,16 @@ def _writeInheritanceData(tag_id, changes, clear=False): def readFullInheritance(tag_id, event=None, reverse=False, stops=None, jumps=None): """Returns a list representing the full, ordered inheritance from tag""" - if stops is None: + if not stops: stops = {} - if jumps is None: + else: + logger.warning( + "readFullInheritance stops option is deprecated and will be removed in 1.26") + if not jumps: jumps = {} + else: + logger.warning( + "readFullInheritance jumps option is deprecated and will be removed in 1.26") order = [] readFullInheritanceRecurse(tag_id, event, order, stops, {}, {}, 0, None, False, [], reverse, jumps)