Rebase against the upstream HEAD

This changed the authentication a bit.

Version: 0.13-1.gitbb0ae
This commit is contained in:
Pavel Raiskup 2021-12-03 13:54:43 +01:00
commit 39626eadb0
7 changed files with 16 additions and 137 deletions

2
.gitignore vendored
View file

@ -1 +1 @@
/pybugz-0.11-git3459d.tar.gz
/pybugz-*.tar.gz

View file

@ -1,58 +0,0 @@
diff --git a/bugz/cli.py b/bugz/cli.py
index aa45d3b..12e2224 100644
--- a/bugz/cli.py
+++ b/bugz/cli.py
@@ -240,7 +240,10 @@ class PrettyBugz:
log_info(log_msg)
if not 'status' in params.keys():
- params['status'] = ['CONFIRMED', 'IN_PROGRESS', 'UNCONFIRMED']
+ params['status'] = ['CONFIRMED', 'IN_PROGRESS',
+ 'UNCONFIRMED', 'NEW', 'ASSIGNED', 'ON_DEV',
+ 'POST', 'MODIFIED', 'ON_QA', 'VERIFIED',
+ 'RELEASE_PENDING']
elif 'ALL' in params['status']:
del params['status']
diff --git a/bugzrc.example b/bugzrc.example
index f516bf0..e8e1234 100644
--- a/bugzrc.example
+++ b/bugzrc.example
@@ -59,3 +59,20 @@
#
# All parameters listed above can be used in the default section if you
# only use one bugzilla installation.
+
+[gentoo]
+base: https://bugs.gentoo.org/xmlrpc.cgi
+columns: 80
+encoding: utf-8
+# user: myname@my.project.com
+# password: secret2
+
+[redhat]
+base: https://bugzilla.redhat.com/xmlrpc.cgi
+columns: 80
+encoding: utf-8
+# user: myname@my.project.com
+# password: secret2
+
+[default]
+connection: redhat
diff --git a/man/bugz.1 b/man/bugz.1
index 5a88494..365ab7e 100644
--- a/man/bugz.1
+++ b/man/bugz.1
@@ -28,6 +28,12 @@ This man page is a stub; the bugz program has extensive built in help.
will show the help for the global options and
.B bugz [subcommand] -h
will show the help for a specific subcommand.
+.SH CONFIGURATION
+PyBugz is still configured just using the ~/.bugzrc file. For simple template
+look at the bugzrc.example
+.B (rpm -qd pybugz | grep example)
+- you may copy it directly into your home directory to make PyBugz work by
+default with Red Hat bugzilla.
.SH BUGS
.PP
The home page of this project is http://www.github.com/williamh/pybugz.

View file

@ -1,49 +0,0 @@
Red Hat bugzilla sets the default limit to 20
This is terribly small number for a random use-case. Let's configure the
default on client-side to the maximal 1000 (users can provide their own default
in ~/.bugzrc).
Anyways, the --limit/--offset options are already implemented.
diff --git a/bugz/cli.py b/bugz/cli.py
index 94842f2..03ca31f 100644
--- a/bugz/cli.py
+++ b/bugz/cli.py
@@ -625,6 +625,10 @@ the keywords given on the title (or the body if specified).
search_term = ' '.join(conn.terms).strip()
+ def_limit = getattr(conn, "default_limit", None)
+ if def_limit and "limit" not in params:
+ params["limit"] = def_limit
+
if not (params or search_term):
raise BugzError('Please give search terms or options.')
diff --git a/bugz/connection.py b/bugz/connection.py
index bdf5734..aaa5e04 100644
--- a/bugz/connection.py
+++ b/bugz/connection.py
@@ -57,6 +57,11 @@ class Connection:
self.password = get_config_option(config.get,
self.connection, 'password')
+ if not hasattr(self, 'default_limit'):
+ if config.has_option(self.connection, 'default_limit'):
+ self.default_limit = get_config_option(config.get,
+ self.connection, 'default_limit')
+
if not hasattr(self, 'passwordcmd'):
if config.has_option(self.connection, 'passwordcmd'):
self.passwordcmd = get_config_option(config.get,
diff --git a/pybugz.d/redhat.conf b/pybugz.d/redhat.conf
index 66c6281..b27d004 100644
--- a/pybugz.d/redhat.conf
+++ b/pybugz.d/redhat.conf
@@ -1,3 +1,4 @@
[RedHat]
base = https://bugzilla.redhat.com/xmlrpc.cgi
search_statuses = NEW ASSIGNED MODIFIED ON_DEV POST
+default_limit = 1000

View file

@ -0,0 +1,8 @@
diff --git a/pybugz.d/default.conf b/pybugz.d/default.conf
index cef06b8..32bdd41 100644
--- a/pybugz.d/default.conf
+++ b/pybugz.d/default.conf
@@ -1,2 +1,2 @@
[default]
-connection = Gentoo
+connection = RedHat

View file

@ -1,11 +1,11 @@
%global gitrev 3459d
%global gitrev bb0ae
%global posttag git%{gitrev}
%global snapshot %{version}-%{posttag}
Name: pybugz
Summary: Command line interface for Bugzilla written in Python
Version: 0.11
Release: 24.%{posttag}%{?dist}
Version: 0.13
Release: 1.%{posttag}%{?dist}
License: GPLv2
URL: https://github.com/williamh/pybugz
BuildArch: noarch
@ -13,8 +13,7 @@ BuildArch: noarch
Requires: python3
BuildRequires: python3-devel
Patch0: rh-default.patch
Patch1: pybugz-0.11-git3459d-default-limit.patch
Patch0: pybugz-0.13-gitbb0ae-rh-default.patch
%if ! 0%{?rhel}
# no bash-completion for RHEL
@ -77,8 +76,8 @@ mkdir -p %{buildroot}%{_docdir}
%changelog
* Fri Dec 03 2021 Pavel Raiskup <praiskup@redhat.com> - 0.11-24.git3459d
- set the default limit for the Red Hat Bugzilla to 1000
* Fri Dec 03 2021 Pavel Raiskup <praiskup@redhat.com> - 0.13-1.gitbb0ae
- rebase to the latest git HEAD
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-23.git3459d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

View file

@ -1,21 +0,0 @@
From 7e2b0baa8f8229668fb23f30bb741dfd79b412b4 Mon Sep 17 00:00:00 2001
From: Pavel Raiskup <praiskup@redhat.com>
Date: Mon, 19 Oct 2015 15:49:00 +0200
Subject: [PATCH] config: set RedHat connection as default
---
pybugz.d/default.conf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pybugz.d/default.conf b/pybugz.d/default.conf
index 33d48d6..c3fe9cd 100644
--- a/pybugz.d/default.conf
+++ b/pybugz.d/default.conf
@@ -1,3 +1,3 @@
[default]
-connection = Gentoo
+connection = RedHat
search_statuses = CONFIRMED IN_PROGRESS UNCONFIRMED
--
2.5.0

View file

@ -1 +1 @@
d061d49b70858c64a1d24b3c11f7d9be pybugz-0.11-git3459d.tar.gz
SHA512 (pybugz-0.13-gitbb0ae.tar.gz) = cca9c875f747d2a5153ee79aee68d7c83fc86a25f31ae035ca7c11f74fa4fe7a5df57562fedb5447d126d0747762b7af4bd33fdf54d0c6fe9cd08893a3261383