diff --git a/pybugz-0.11-git3459d-default-limit.patch b/pybugz-0.11-git3459d-default-limit.patch new file mode 100644 index 0000000..b9aaca6 --- /dev/null +++ b/pybugz-0.11-git3459d-default-limit.patch @@ -0,0 +1,49 @@ +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 diff --git a/pybugz.spec b/pybugz.spec index 3cb02d9..04a00c8 100644 --- a/pybugz.spec +++ b/pybugz.spec @@ -5,7 +5,7 @@ Name: pybugz Summary: Command line interface for Bugzilla written in Python Version: 0.11 -Release: 23.%{posttag}%{?dist} +Release: 24.%{posttag}%{?dist} License: GPLv2 URL: https://github.com/williamh/pybugz BuildArch: noarch @@ -14,6 +14,7 @@ Requires: python3 BuildRequires: python3-devel Patch0: rh-default.patch +Patch1: pybugz-0.11-git3459d-default-limit.patch %if ! 0%{?rhel} # no bash-completion for RHEL @@ -76,6 +77,9 @@ mkdir -p %{buildroot}%{_docdir} %changelog +* Fri Dec 03 2021 Pavel Raiskup - 0.11-24.git3459d +- set the default limit for the Red Hat Bugzilla to 1000 + * Fri Jul 23 2021 Fedora Release Engineering - 0.11-23.git3459d - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild