Merge pull request #2923 from dirkmueller/deprecation_warning_osc1x

Add explicit deprecation warning
This commit is contained in:
Fabian Vogt 2023-01-25 19:20:26 +01:00 committed by GitHub
commit 2c0e252832
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,6 +61,14 @@ def get_request_list_with_history(
apiurl, project='', package='', req_who='', req_state=('new', 'review', 'declined'),
req_type=None, exclude_target_projects=[]):
"""using an xpath search to get full request history. deprecated copy of old code from osc 0.x."""
import warnings
warnings.warn(
"get_request_list_with_history() uses an xpath search, which is slow. consider porting to"
"use osc.core.get_request_collection() instead.",
DeprecationWarning
)
xpath = ''
if 'all' not in req_state:
for state in req_state: