mirror of
				https://github.com/openSUSE/osc.git
				synced 2025-10-31 11:32:16 +01:00 
			
		
		
		
	Set limit=0 to disable pagination in all relevant git-obs subcommands
This commit is contained in:
		| @@ -41,7 +41,10 @@ class Branch: | |||||||
|         :param owner: Owner of the repo. |         :param owner: Owner of the repo. | ||||||
|         :param repo: Name of the repo. |         :param repo: Name of the repo. | ||||||
|         """ |         """ | ||||||
|         url = conn.makeurl("repos", owner, repo, "branches") |         q = { | ||||||
|  |             "limit": -1, | ||||||
|  |         } | ||||||
|  |         url = conn.makeurl("repos", owner, repo, "branches", query=q) | ||||||
|         # XXX: returns 'null' when there are no branches; an empty list would be a better API |         # XXX: returns 'null' when there are no branches; an empty list would be a better API | ||||||
|         return conn.request("GET", url) |         return conn.request("GET", url) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -20,8 +20,10 @@ class Fork: | |||||||
|         :param owner: Owner of the repo. |         :param owner: Owner of the repo. | ||||||
|         :param repo: Name of the repo. |         :param repo: Name of the repo. | ||||||
|         """ |         """ | ||||||
|  |         q = { | ||||||
|         url = conn.makeurl("repos", owner, repo, "forks") |             "limit": -1, | ||||||
|  |         } | ||||||
|  |         url = conn.makeurl("repos", owner, repo, "forks", query=q) | ||||||
|         return conn.request("GET", url) |         return conn.request("GET", url) | ||||||
|  |  | ||||||
|     @classmethod |     @classmethod | ||||||
|   | |||||||
| @@ -180,6 +180,7 @@ class PullRequest: | |||||||
|  |  | ||||||
|         q = { |         q = { | ||||||
|             "state": state, |             "state": state, | ||||||
|  |             "limit": -1, | ||||||
|         } |         } | ||||||
|         url = conn.makeurl("repos", owner, repo, "pulls", query=q) |         url = conn.makeurl("repos", owner, repo, "pulls", query=q) | ||||||
|         return conn.request("GET", url) |         return conn.request("GET", url) | ||||||
| @@ -220,6 +221,8 @@ class PullRequest: | |||||||
|             "created": created, |             "created": created, | ||||||
|             "mentioned": mentioned, |             "mentioned": mentioned, | ||||||
|             "review_requested": review_requested, |             "review_requested": review_requested, | ||||||
|  |             # HACK: limit=-1 doesn't work, the request gets stuck; we need to use a high number to avoid pagination | ||||||
|  |             "limit": 10**6, | ||||||
|         } |         } | ||||||
|         url = conn.makeurl("repos", "issues", "search", query=q) |         url = conn.makeurl("repos", "issues", "search", query=q) | ||||||
|         return conn.request("GET", url) |         return conn.request("GET", url) | ||||||
|   | |||||||
| @@ -23,7 +23,10 @@ class SSHKey: | |||||||
|  |  | ||||||
|         :param conn: Gitea ``Connection`` instance. |         :param conn: Gitea ``Connection`` instance. | ||||||
|         """ |         """ | ||||||
|         url = conn.makeurl("user", "keys") |         q = { | ||||||
|  |             "limit": -1, | ||||||
|  |         } | ||||||
|  |         url = conn.makeurl("user", "keys", query=q) | ||||||
|         return conn.request("GET", url) |         return conn.request("GET", url) | ||||||
|  |  | ||||||
|     @classmethod |     @classmethod | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user