mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-10 06:46:15 +01:00
- add new config option include_request_from_project (default True)
This way it's possible to hide requests which have a given project as a source project when running "osc rq list project". Original patch by darix (just a bit beautified)
This commit is contained in:
parent
704199f279
commit
7c59949f33
@ -136,6 +136,7 @@ DEFAULTS = { 'apiurl': 'https://api.opensuse.org',
|
||||
'submitrequest_accepted_template': '',
|
||||
'submitrequest_declined_template': '',
|
||||
'linkcontrol': '0',
|
||||
'include_request_from_project': '1',
|
||||
|
||||
# Maintenance defaults to OBS instance defaults
|
||||
'maintained_attribute': 'OBS:Maintained',
|
||||
@ -150,7 +151,7 @@ config = DEFAULTS.copy()
|
||||
|
||||
boolean_opts = ['debug', 'do_package_tracking', 'http_debug', 'post_mortem', 'traceback', 'check_filelist', 'plaintext_passwd',
|
||||
'checkout_no_colon', 'checkout_rooted', 'check_for_request_on_action', 'linkcontrol', 'show_download_progress', 'request_show_interactive',
|
||||
'use_keyring', 'gnome_keyring', 'no_verify', 'builtin_signature_check', 'http_full_debug']
|
||||
'use_keyring', 'gnome_keyring', 'no_verify', 'builtin_signature_check', 'http_full_debug', 'include_request_from_project']
|
||||
|
||||
api_host_options = ['user', 'pass', 'passx', 'aliases', 'http_headers', 'email', 'sslcertck', 'cafile', 'capath', 'trusted_prj']
|
||||
|
||||
|
23
osc/core.py
23
osc/core.py
@ -3645,10 +3645,13 @@ def get_review_list(apiurl, project='', package='', byuser='', bygroup='', bypro
|
||||
if package:
|
||||
todo['package'] = package
|
||||
for kind, val in todo.iteritems():
|
||||
xpath = xpath_join(xpath, '(action/target/@%(kind)s=\'%(val)s\' or ' \
|
||||
'action/source/@%(kind)s=\'%(val)s\' or ' \
|
||||
'submit/target/@%(kind)s=\'%(val)s\' or ' \
|
||||
'submit/source/@%(kind)s=\'%(val)s\')' % {'kind': kind, 'val': val}, op='and')
|
||||
xpath_base = 'action/target/@%(kind)s=\'%(val)s\' or ' \
|
||||
'submit/target/@%(kind)s=\'%(val)s\''
|
||||
|
||||
if conf.config['include_request_from_project']:
|
||||
xpath_base = xpath_join(xpath_base, 'action/source/@%(kind)s=\'%(val)s\' or ' \
|
||||
'submit/source/@%(kind)s=\'%(val)s\'', op='or', inner=True)
|
||||
xpath = xpath_join(xpath, xpath_base % {'kind': kind, 'val': val}, op='and', nexpr_parentheses=True)
|
||||
|
||||
if conf.config['verbose'] > 1:
|
||||
print '[ %s ]' % xpath
|
||||
@ -3677,10 +3680,14 @@ def get_request_list(apiurl, project='', package='', req_who='', req_state=('new
|
||||
if package:
|
||||
todo['package'] = package
|
||||
for kind, val in todo.iteritems():
|
||||
xpath = xpath_join(xpath, '(action/target/@%(kind)s=\'%(val)s\' or ' \
|
||||
'action/source/@%(kind)s=\'%(val)s\' or ' \
|
||||
'submit/target/@%(kind)s=\'%(val)s\' or ' \
|
||||
'submit/source/@%(kind)s=\'%(val)s\')' % {'kind': kind, 'val': val}, op='and')
|
||||
xpath_base = 'action/target/@%(kind)s=\'%(val)s\' or ' \
|
||||
'submit/target/@%(kind)s=\'%(val)s\''
|
||||
|
||||
if conf.config['include_request_from_project']:
|
||||
xpath_base = xpath_join(xpath_base, 'action/source/@%(kind)s=\'%(val)s\' or ' \
|
||||
'submit/source/@%(kind)s=\'%(val)s\'', op='or', inner=True)
|
||||
xpath = xpath_join(xpath, xpath_base % {'kind': kind, 'val': val}, op='and', nexpr_parentheses=True)
|
||||
|
||||
if req_type:
|
||||
xpath = xpath_join(xpath, 'action/@type=\'%s\'' % req_type, op='and')
|
||||
for i in exclude_target_projects:
|
||||
|
Loading…
Reference in New Issue
Block a user