help='Name of branch to create with collected responses')
status.add_argument('-f', '--force', action='store_true',
help='Force overwriting an existing branch')
+ status.add_argument('-T', '--single-thread', action='store_true',
+ help='Disable multithreading when reading patchwork')
# Parse options twice: first to get the project and second to handle
# defaults properly (which depends on project)
def patchwork_status(branch, count, start, end, dest_branch, force,
- show_comments, url):
+ show_comments, url, single_thread=False):
"""Check the status of patches in patchwork
This finds the series in patchwork using the Series-link tag, checks for new
# Allow the series to override the URL
if 'patchwork_url' in series:
url = series.patchwork_url
- pwork = patchwork.Patchwork(url)
+ pwork = patchwork.Patchwork(url, single_thread=single_thread)
# Import this here to avoid failing on other commands if the dependencies
# are not present
class Patchwork:
"""Class to handle communication with patchwork
"""
- def __init__(self, url, show_progress=True):
+ def __init__(self, url, show_progress=True, single_thread=False):
"""Set up a new patchwork handler
Args:
self.proj_id = None
self.link_name = None
self._show_progress = show_progress
- self.semaphore = asyncio.Semaphore(MAX_CONCURRENT)
+ self.semaphore = asyncio.Semaphore(
+ 1 if single_thread else MAX_CONCURRENT)
self.request_count = 0
async def _request(self, client, subpath):