Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0+ |
| 2 | # |
| 3 | # Copyright 2020 Google LLC |
| 4 | # |
| 5 | """Talks to the patchwork service to figure out what patches have been reviewed |
Simon Glass | 2112d07 | 2020-10-29 21:46:38 -0600 | [diff] [blame] | 6 | and commented on. Provides a way to display review tags and comments. |
| 7 | Allows creation of a new branch based on the old but with the review tags |
| 8 | collected from patchwork. |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 9 | """ |
| 10 | |
| 11 | import collections |
| 12 | import concurrent.futures |
| 13 | from itertools import repeat |
Simon Glass | d0a0a58 | 2020-10-29 21:46:36 -0600 | [diff] [blame] | 14 | |
| 15 | import pygit2 |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 16 | import requests |
| 17 | |
Simon Glass | 131444f | 2023-02-23 18:18:04 -0700 | [diff] [blame] | 18 | from u_boot_pylib import terminal |
| 19 | from u_boot_pylib import tout |
Simon Glass | 232eefd | 2025-04-29 07:22:14 -0600 | [diff] [blame] | 20 | from patman import patchstream |
| 21 | from patman import patchwork |
| 22 | from patman.patchstream import PatchStream |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 23 | |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 24 | |
| 25 | def to_int(vals): |
| 26 | """Convert a list of strings into integers, using 0 if not an integer |
| 27 | |
| 28 | Args: |
| 29 | vals (list): List of strings |
| 30 | |
| 31 | Returns: |
| 32 | list: List of integers, one for each input string |
| 33 | """ |
| 34 | out = [int(val) if val.isdigit() else 0 for val in vals] |
| 35 | return out |
| 36 | |
Simon Glass | 2112d07 | 2020-10-29 21:46:38 -0600 | [diff] [blame] | 37 | |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 38 | def compare_with_series(series, patches): |
| 39 | """Compare a list of patches with a series it came from |
| 40 | |
| 41 | This prints any problems as warnings |
| 42 | |
| 43 | Args: |
| 44 | series (Series): Series to compare against |
| 45 | patches (:type: list of Patch): list of Patch objects to compare with |
| 46 | |
| 47 | Returns: |
| 48 | tuple |
| 49 | dict: |
| 50 | key: Commit number (0...n-1) |
| 51 | value: Patch object for that commit |
| 52 | dict: |
| 53 | key: Patch number (0...n-1) |
| 54 | value: Commit object for that patch |
| 55 | """ |
| 56 | # Check the names match |
| 57 | warnings = [] |
| 58 | patch_for_commit = {} |
| 59 | all_patches = set(patches) |
| 60 | for seq, cmt in enumerate(series.commits): |
| 61 | pmatch = [p for p in all_patches if p.subject == cmt.subject] |
| 62 | if len(pmatch) == 1: |
| 63 | patch_for_commit[seq] = pmatch[0] |
| 64 | all_patches.remove(pmatch[0]) |
| 65 | elif len(pmatch) > 1: |
| 66 | warnings.append("Multiple patches match commit %d ('%s'):\n %s" % |
| 67 | (seq + 1, cmt.subject, |
| 68 | '\n '.join([p.subject for p in pmatch]))) |
| 69 | else: |
| 70 | warnings.append("Cannot find patch for commit %d ('%s')" % |
| 71 | (seq + 1, cmt.subject)) |
| 72 | |
| 73 | |
| 74 | # Check the names match |
| 75 | commit_for_patch = {} |
| 76 | all_commits = set(series.commits) |
| 77 | for seq, patch in enumerate(patches): |
| 78 | cmatch = [c for c in all_commits if c.subject == patch.subject] |
| 79 | if len(cmatch) == 1: |
| 80 | commit_for_patch[seq] = cmatch[0] |
| 81 | all_commits.remove(cmatch[0]) |
| 82 | elif len(cmatch) > 1: |
| 83 | warnings.append("Multiple commits match patch %d ('%s'):\n %s" % |
| 84 | (seq + 1, patch.subject, |
| 85 | '\n '.join([c.subject for c in cmatch]))) |
| 86 | else: |
| 87 | warnings.append("Cannot find commit for patch %d ('%s')" % |
| 88 | (seq + 1, patch.subject)) |
| 89 | |
| 90 | return patch_for_commit, commit_for_patch, warnings |
| 91 | |
Simon Glass | f9b03cf | 2020-11-03 13:54:14 -0700 | [diff] [blame] | 92 | def call_rest_api(url, subpath): |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 93 | """Call the patchwork API and return the result as JSON |
| 94 | |
| 95 | Args: |
Simon Glass | f9b03cf | 2020-11-03 13:54:14 -0700 | [diff] [blame] | 96 | url (str): URL of patchwork server, e.g. 'https://patchwork.ozlabs.org' |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 97 | subpath (str): URL subpath to use |
| 98 | |
| 99 | Returns: |
| 100 | dict: Json result |
| 101 | |
| 102 | Raises: |
| 103 | ValueError: the URL could not be read |
| 104 | """ |
Simon Glass | f9b03cf | 2020-11-03 13:54:14 -0700 | [diff] [blame] | 105 | full_url = '%s/api/1.2/%s' % (url, subpath) |
| 106 | response = requests.get(full_url) |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 107 | if response.status_code != 200: |
Simon Glass | f9b03cf | 2020-11-03 13:54:14 -0700 | [diff] [blame] | 108 | raise ValueError("Could not read URL '%s'" % full_url) |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 109 | return response.json() |
| 110 | |
Simon Glass | f9b03cf | 2020-11-03 13:54:14 -0700 | [diff] [blame] | 111 | def collect_patches(series, series_id, url, rest_api=call_rest_api): |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 112 | """Collect patch information about a series from patchwork |
| 113 | |
| 114 | Uses the Patchwork REST API to collect information provided by patchwork |
| 115 | about the status of each patch. |
| 116 | |
| 117 | Args: |
| 118 | series (Series): Series object corresponding to the local branch |
| 119 | containing the series |
| 120 | series_id (str): Patch series ID number |
Simon Glass | f9b03cf | 2020-11-03 13:54:14 -0700 | [diff] [blame] | 121 | url (str): URL of patchwork server, e.g. 'https://patchwork.ozlabs.org' |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 122 | rest_api (function): API function to call to access Patchwork, for |
| 123 | testing |
| 124 | |
| 125 | Returns: |
| 126 | list: List of patches sorted by sequence number, each a Patch object |
| 127 | |
| 128 | Raises: |
| 129 | ValueError: if the URL could not be read or the web page does not follow |
| 130 | the expected structure |
| 131 | """ |
Simon Glass | f9b03cf | 2020-11-03 13:54:14 -0700 | [diff] [blame] | 132 | data = rest_api(url, 'series/%s/' % series_id) |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 133 | |
| 134 | # Get all the rows, which are patches |
| 135 | patch_dict = data['patches'] |
| 136 | count = len(patch_dict) |
| 137 | num_commits = len(series.commits) |
| 138 | if count != num_commits: |
Simon Glass | 011f1b3 | 2022-01-29 14:14:15 -0700 | [diff] [blame] | 139 | tout.warning('Warning: Patchwork reports %d patches, series has %d' % |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 140 | (count, num_commits)) |
| 141 | |
| 142 | patches = [] |
| 143 | |
| 144 | # Work through each row (patch) one at a time, collecting the information |
| 145 | warn_count = 0 |
| 146 | for pw_patch in patch_dict: |
Simon Glass | 232eefd | 2025-04-29 07:22:14 -0600 | [diff] [blame] | 147 | patch = patchwork.Patch(pw_patch['id']) |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 148 | patch.parse_subject(pw_patch['name']) |
| 149 | patches.append(patch) |
| 150 | if warn_count > 1: |
Simon Glass | 011f1b3 | 2022-01-29 14:14:15 -0700 | [diff] [blame] | 151 | tout.warning(' (total of %d warnings)' % warn_count) |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 152 | |
| 153 | # Sort patches by patch number |
| 154 | patches = sorted(patches, key=lambda x: x.seq) |
| 155 | return patches |
| 156 | |
Simon Glass | f9b03cf | 2020-11-03 13:54:14 -0700 | [diff] [blame] | 157 | def find_new_responses(new_rtag_list, review_list, seq, cmt, patch, url, |
Simon Glass | 2112d07 | 2020-10-29 21:46:38 -0600 | [diff] [blame] | 158 | rest_api=call_rest_api): |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 159 | """Find new rtags collected by patchwork that we don't know about |
| 160 | |
| 161 | This is designed to be run in parallel, once for each commit/patch |
| 162 | |
| 163 | Args: |
| 164 | new_rtag_list (list): New rtags are written to new_rtag_list[seq] |
| 165 | list, each a dict: |
| 166 | key: Response tag (e.g. 'Reviewed-by') |
| 167 | value: Set of people who gave that response, each a name/email |
| 168 | string |
Simon Glass | 2112d07 | 2020-10-29 21:46:38 -0600 | [diff] [blame] | 169 | review_list (list): New reviews are written to review_list[seq] |
| 170 | list, each a |
| 171 | List of reviews for the patch, each a Review |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 172 | seq (int): Position in new_rtag_list to update |
| 173 | cmt (Commit): Commit object for this commit |
| 174 | patch (Patch): Corresponding Patch object for this patch |
Simon Glass | f9b03cf | 2020-11-03 13:54:14 -0700 | [diff] [blame] | 175 | url (str): URL of patchwork server, e.g. 'https://patchwork.ozlabs.org' |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 176 | rest_api (function): API function to call to access Patchwork, for |
| 177 | testing |
| 178 | """ |
| 179 | if not patch: |
| 180 | return |
| 181 | |
| 182 | # Get the content for the patch email itself as well as all comments |
Simon Glass | f9b03cf | 2020-11-03 13:54:14 -0700 | [diff] [blame] | 183 | data = rest_api(url, 'patches/%s/' % patch.id) |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 184 | pstrm = PatchStream.process_text(data['content'], True) |
| 185 | |
| 186 | rtags = collections.defaultdict(set) |
| 187 | for response, people in pstrm.commit.rtags.items(): |
| 188 | rtags[response].update(people) |
| 189 | |
Simon Glass | f9b03cf | 2020-11-03 13:54:14 -0700 | [diff] [blame] | 190 | data = rest_api(url, 'patches/%s/comments/' % patch.id) |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 191 | |
Simon Glass | 2112d07 | 2020-10-29 21:46:38 -0600 | [diff] [blame] | 192 | reviews = [] |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 193 | for comment in data: |
| 194 | pstrm = PatchStream.process_text(comment['content'], True) |
Simon Glass | 2112d07 | 2020-10-29 21:46:38 -0600 | [diff] [blame] | 195 | if pstrm.snippets: |
| 196 | submitter = comment['submitter'] |
| 197 | person = '%s <%s>' % (submitter['name'], submitter['email']) |
Simon Glass | 232eefd | 2025-04-29 07:22:14 -0600 | [diff] [blame] | 198 | reviews.append(patchwork.Review(person, pstrm.snippets)) |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 199 | for response, people in pstrm.commit.rtags.items(): |
| 200 | rtags[response].update(people) |
| 201 | |
| 202 | # Find the tags that are not in the commit |
| 203 | new_rtags = collections.defaultdict(set) |
| 204 | base_rtags = cmt.rtags |
| 205 | for tag, people in rtags.items(): |
| 206 | for who in people: |
| 207 | is_new = (tag not in base_rtags or |
| 208 | who not in base_rtags[tag]) |
| 209 | if is_new: |
| 210 | new_rtags[tag].add(who) |
| 211 | new_rtag_list[seq] = new_rtags |
Simon Glass | 2112d07 | 2020-10-29 21:46:38 -0600 | [diff] [blame] | 212 | review_list[seq] = reviews |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 213 | |
| 214 | def show_responses(rtags, indent, is_new): |
| 215 | """Show rtags collected |
| 216 | |
| 217 | Args: |
| 218 | rtags (dict): review tags to show |
| 219 | key: Response tag (e.g. 'Reviewed-by') |
| 220 | value: Set of people who gave that response, each a name/email string |
| 221 | indent (str): Indentation string to write before each line |
| 222 | is_new (bool): True if this output should be highlighted |
| 223 | |
| 224 | Returns: |
| 225 | int: Number of review tags displayed |
| 226 | """ |
| 227 | col = terminal.Color() |
| 228 | count = 0 |
Simon Glass | 2112d07 | 2020-10-29 21:46:38 -0600 | [diff] [blame] | 229 | for tag in sorted(rtags.keys()): |
| 230 | people = rtags[tag] |
| 231 | for who in sorted(people): |
Simon Glass | 0281158 | 2022-01-29 14:14:18 -0700 | [diff] [blame] | 232 | terminal.tprint(indent + '%s %s: ' % ('+' if is_new else ' ', tag), |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 233 | newline=False, colour=col.GREEN, bright=is_new) |
Simon Glass | 0281158 | 2022-01-29 14:14:18 -0700 | [diff] [blame] | 234 | terminal.tprint(who, colour=col.WHITE, bright=is_new) |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 235 | count += 1 |
| 236 | return count |
| 237 | |
Simon Glass | d0a0a58 | 2020-10-29 21:46:36 -0600 | [diff] [blame] | 238 | def create_branch(series, new_rtag_list, branch, dest_branch, overwrite, |
| 239 | repo=None): |
| 240 | """Create a new branch with review tags added |
| 241 | |
| 242 | Args: |
| 243 | series (Series): Series object for the existing branch |
| 244 | new_rtag_list (list): List of review tags to add, one for each commit, |
| 245 | each a dict: |
| 246 | key: Response tag (e.g. 'Reviewed-by') |
| 247 | value: Set of people who gave that response, each a name/email |
| 248 | string |
| 249 | branch (str): Existing branch to update |
| 250 | dest_branch (str): Name of new branch to create |
| 251 | overwrite (bool): True to force overwriting dest_branch if it exists |
| 252 | repo (pygit2.Repository): Repo to use (use None unless testing) |
| 253 | |
| 254 | Returns: |
| 255 | int: Total number of review tags added across all commits |
| 256 | |
| 257 | Raises: |
| 258 | ValueError: if the destination branch name is the same as the original |
| 259 | branch, or it already exists and @overwrite is False |
| 260 | """ |
| 261 | if branch == dest_branch: |
| 262 | raise ValueError( |
| 263 | 'Destination branch must not be the same as the original branch') |
| 264 | if not repo: |
| 265 | repo = pygit2.Repository('.') |
| 266 | count = len(series.commits) |
| 267 | new_br = repo.branches.get(dest_branch) |
| 268 | if new_br: |
| 269 | if not overwrite: |
| 270 | raise ValueError("Branch '%s' already exists (-f to overwrite)" % |
| 271 | dest_branch) |
| 272 | new_br.delete() |
| 273 | if not branch: |
| 274 | branch = 'HEAD' |
| 275 | target = repo.revparse_single('%s~%d' % (branch, count)) |
| 276 | repo.branches.local.create(dest_branch, target) |
| 277 | |
| 278 | num_added = 0 |
| 279 | for seq in range(count): |
| 280 | parent = repo.branches.get(dest_branch) |
| 281 | cherry = repo.revparse_single('%s~%d' % (branch, count - seq - 1)) |
| 282 | |
| 283 | repo.merge_base(cherry.oid, parent.target) |
| 284 | base_tree = cherry.parents[0].tree |
| 285 | |
| 286 | index = repo.merge_trees(base_tree, parent, cherry) |
| 287 | tree_id = index.write_tree(repo) |
| 288 | |
| 289 | lines = [] |
| 290 | if new_rtag_list[seq]: |
| 291 | for tag, people in new_rtag_list[seq].items(): |
| 292 | for who in people: |
| 293 | lines.append('%s: %s' % (tag, who)) |
| 294 | num_added += 1 |
| 295 | message = patchstream.insert_tags(cherry.message.rstrip(), |
| 296 | sorted(lines)) |
| 297 | |
| 298 | repo.create_commit( |
| 299 | parent.name, cherry.author, cherry.committer, message, tree_id, |
| 300 | [parent.target]) |
| 301 | return num_added |
| 302 | |
| 303 | def check_patchwork_status(series, series_id, branch, dest_branch, force, |
Simon Glass | f9b03cf | 2020-11-03 13:54:14 -0700 | [diff] [blame] | 304 | show_comments, url, rest_api=call_rest_api, |
Simon Glass | 2112d07 | 2020-10-29 21:46:38 -0600 | [diff] [blame] | 305 | test_repo=None): |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 306 | """Check the status of a series on Patchwork |
| 307 | |
| 308 | This finds review tags and comments for a series in Patchwork, displaying |
| 309 | them to show what is new compared to the local series. |
| 310 | |
| 311 | Args: |
| 312 | series (Series): Series object for the existing branch |
| 313 | series_id (str): Patch series ID number |
Simon Glass | d0a0a58 | 2020-10-29 21:46:36 -0600 | [diff] [blame] | 314 | branch (str): Existing branch to update, or None |
| 315 | dest_branch (str): Name of new branch to create, or None |
| 316 | force (bool): True to force overwriting dest_branch if it exists |
Simon Glass | 2112d07 | 2020-10-29 21:46:38 -0600 | [diff] [blame] | 317 | show_comments (bool): True to show the comments on each patch |
Simon Glass | f9b03cf | 2020-11-03 13:54:14 -0700 | [diff] [blame] | 318 | url (str): URL of patchwork server, e.g. 'https://patchwork.ozlabs.org' |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 319 | rest_api (function): API function to call to access Patchwork, for |
| 320 | testing |
Simon Glass | d0a0a58 | 2020-10-29 21:46:36 -0600 | [diff] [blame] | 321 | test_repo (pygit2.Repository): Repo to use (use None unless testing) |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 322 | """ |
Simon Glass | f9b03cf | 2020-11-03 13:54:14 -0700 | [diff] [blame] | 323 | patches = collect_patches(series, series_id, url, rest_api) |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 324 | col = terminal.Color() |
| 325 | count = len(series.commits) |
| 326 | new_rtag_list = [None] * count |
Simon Glass | 2112d07 | 2020-10-29 21:46:38 -0600 | [diff] [blame] | 327 | review_list = [None] * count |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 328 | |
| 329 | patch_for_commit, _, warnings = compare_with_series(series, patches) |
| 330 | for warn in warnings: |
Simon Glass | 011f1b3 | 2022-01-29 14:14:15 -0700 | [diff] [blame] | 331 | tout.warning(warn) |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 332 | |
| 333 | patch_list = [patch_for_commit.get(c) for c in range(len(series.commits))] |
| 334 | |
| 335 | with concurrent.futures.ThreadPoolExecutor(max_workers=16) as executor: |
| 336 | futures = executor.map( |
Simon Glass | 2112d07 | 2020-10-29 21:46:38 -0600 | [diff] [blame] | 337 | find_new_responses, repeat(new_rtag_list), repeat(review_list), |
Simon Glass | f9b03cf | 2020-11-03 13:54:14 -0700 | [diff] [blame] | 338 | range(count), series.commits, patch_list, repeat(url), |
| 339 | repeat(rest_api)) |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 340 | for fresponse in futures: |
| 341 | if fresponse: |
| 342 | raise fresponse.exception() |
| 343 | |
| 344 | num_to_add = 0 |
| 345 | for seq, cmt in enumerate(series.commits): |
| 346 | patch = patch_for_commit.get(seq) |
| 347 | if not patch: |
| 348 | continue |
Simon Glass | 0281158 | 2022-01-29 14:14:18 -0700 | [diff] [blame] | 349 | terminal.tprint('%3d %s' % (patch.seq, patch.subject[:50]), |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 350 | colour=col.BLUE) |
| 351 | cmt = series.commits[seq] |
| 352 | base_rtags = cmt.rtags |
| 353 | new_rtags = new_rtag_list[seq] |
| 354 | |
| 355 | indent = ' ' * 2 |
| 356 | show_responses(base_rtags, indent, False) |
| 357 | num_to_add += show_responses(new_rtags, indent, True) |
Simon Glass | 2112d07 | 2020-10-29 21:46:38 -0600 | [diff] [blame] | 358 | if show_comments: |
| 359 | for review in review_list[seq]: |
Simon Glass | 0281158 | 2022-01-29 14:14:18 -0700 | [diff] [blame] | 360 | terminal.tprint('Review: %s' % review.meta, colour=col.RED) |
Simon Glass | 2112d07 | 2020-10-29 21:46:38 -0600 | [diff] [blame] | 361 | for snippet in review.snippets: |
| 362 | for line in snippet: |
| 363 | quoted = line.startswith('>') |
Simon Glass | 0281158 | 2022-01-29 14:14:18 -0700 | [diff] [blame] | 364 | terminal.tprint(' %s' % line, |
Simon Glass | 2112d07 | 2020-10-29 21:46:38 -0600 | [diff] [blame] | 365 | colour=col.MAGENTA if quoted else None) |
Simon Glass | 0281158 | 2022-01-29 14:14:18 -0700 | [diff] [blame] | 366 | terminal.tprint() |
Simon Glass | 3db916d | 2020-10-29 21:46:35 -0600 | [diff] [blame] | 367 | |
Simon Glass | 0281158 | 2022-01-29 14:14:18 -0700 | [diff] [blame] | 368 | terminal.tprint("%d new response%s available in patchwork%s" % |
Simon Glass | d0a0a58 | 2020-10-29 21:46:36 -0600 | [diff] [blame] | 369 | (num_to_add, 's' if num_to_add != 1 else '', |
| 370 | '' if dest_branch |
| 371 | else ' (use -d to write them to a new branch)')) |
| 372 | |
| 373 | if dest_branch: |
| 374 | num_added = create_branch(series, new_rtag_list, branch, |
| 375 | dest_branch, force, test_repo) |
Simon Glass | 0281158 | 2022-01-29 14:14:18 -0700 | [diff] [blame] | 376 | terminal.tprint( |
Simon Glass | d0a0a58 | 2020-10-29 21:46:36 -0600 | [diff] [blame] | 377 | "%d response%s added from patchwork into new branch '%s'" % |
| 378 | (num_added, 's' if num_added != 1 else '', dest_branch)) |