diff options
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r-- | subcmds/sync.py | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index ed2e516a..582bd057 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
@@ -204,14 +204,13 @@ class _SyncResult(NamedTuple): | |||
204 | relpath (str): The project's relative path from the repo client top. | 204 | relpath (str): The project's relative path from the repo client top. |
205 | remote_fetched (bool): True if the remote was actually queried. | 205 | remote_fetched (bool): True if the remote was actually queried. |
206 | fetch_success (bool): True if the fetch operation was successful. | 206 | fetch_success (bool): True if the fetch operation was successful. |
207 | fetch_error (Optional[Exception]): The Exception from a failed fetch, | 207 | fetch_errors (List[Exception]): The Exceptions from a failed fetch. |
208 | or None. | ||
209 | fetch_start (Optional[float]): The time.time() when fetch started. | 208 | fetch_start (Optional[float]): The time.time() when fetch started. |
210 | fetch_finish (Optional[float]): The time.time() when fetch finished. | 209 | fetch_finish (Optional[float]): The time.time() when fetch finished. |
211 | checkout_success (bool): True if the checkout operation was | 210 | checkout_success (bool): True if the checkout operation was |
212 | successful. | 211 | successful. |
213 | checkout_error (Optional[Exception]): The Exception from a failed | 212 | checkout_errors (List[Exception]): The Exceptions from a failed |
214 | checkout, or None. | 213 | checkout. |
215 | checkout_start (Optional[float]): The time.time() when checkout | 214 | checkout_start (Optional[float]): The time.time() when checkout |
216 | started. | 215 | started. |
217 | checkout_finish (Optional[float]): The time.time() when checkout | 216 | checkout_finish (Optional[float]): The time.time() when checkout |
@@ -224,12 +223,12 @@ class _SyncResult(NamedTuple): | |||
224 | 223 | ||
225 | remote_fetched: bool | 224 | remote_fetched: bool |
226 | fetch_success: bool | 225 | fetch_success: bool |
227 | fetch_error: Optional[Exception] | 226 | fetch_errors: List[Exception] |
228 | fetch_start: Optional[float] | 227 | fetch_start: Optional[float] |
229 | fetch_finish: Optional[float] | 228 | fetch_finish: Optional[float] |
230 | 229 | ||
231 | checkout_success: bool | 230 | checkout_success: bool |
232 | checkout_error: Optional[Exception] | 231 | checkout_errors: List[Exception] |
233 | checkout_start: Optional[float] | 232 | checkout_start: Optional[float] |
234 | checkout_finish: Optional[float] | 233 | checkout_finish: Optional[float] |
235 | 234 | ||
@@ -2210,7 +2209,7 @@ later is required to fix a server side protocol bug. | |||
2210 | """Syncs a single project for interleaved sync.""" | 2209 | """Syncs a single project for interleaved sync.""" |
2211 | fetch_success = False | 2210 | fetch_success = False |
2212 | remote_fetched = False | 2211 | remote_fetched = False |
2213 | fetch_error = None | 2212 | fetch_errors = [] |
2214 | fetch_start = None | 2213 | fetch_start = None |
2215 | fetch_finish = None | 2214 | fetch_finish = None |
2216 | network_output = "" | 2215 | network_output = "" |
@@ -2243,16 +2242,17 @@ later is required to fix a server side protocol bug. | |||
2243 | ) | 2242 | ) |
2244 | fetch_success = sync_result.success | 2243 | fetch_success = sync_result.success |
2245 | remote_fetched = sync_result.remote_fetched | 2244 | remote_fetched = sync_result.remote_fetched |
2246 | fetch_error = sync_result.error | 2245 | if sync_result.error: |
2246 | fetch_errors.append(sync_result.error) | ||
2247 | except KeyboardInterrupt: | 2247 | except KeyboardInterrupt: |
2248 | logger.error( | 2248 | logger.error( |
2249 | "Keyboard interrupt while processing %s", project.name | 2249 | "Keyboard interrupt while processing %s", project.name |
2250 | ) | 2250 | ) |
2251 | except GitError as e: | 2251 | except GitError as e: |
2252 | fetch_error = e | 2252 | fetch_errors.append(e) |
2253 | logger.error("error.GitError: Cannot fetch %s", e) | 2253 | logger.error("error.GitError: Cannot fetch %s", e) |
2254 | except Exception as e: | 2254 | except Exception as e: |
2255 | fetch_error = e | 2255 | fetch_errors.append(e) |
2256 | logger.error( | 2256 | logger.error( |
2257 | "error: Cannot fetch %s (%s: %s)", | 2257 | "error: Cannot fetch %s (%s: %s)", |
2258 | project.name, | 2258 | project.name, |
@@ -2264,7 +2264,7 @@ later is required to fix a server side protocol bug. | |||
2264 | network_output = network_output_capture.getvalue() | 2264 | network_output = network_output_capture.getvalue() |
2265 | 2265 | ||
2266 | checkout_success = False | 2266 | checkout_success = False |
2267 | checkout_error = None | 2267 | checkout_errors = [] |
2268 | checkout_start = None | 2268 | checkout_start = None |
2269 | checkout_finish = None | 2269 | checkout_finish = None |
2270 | checkout_stderr = "" | 2270 | checkout_stderr = "" |
@@ -2293,22 +2293,20 @@ later is required to fix a server side protocol bug. | |||
2293 | ) | 2293 | ) |
2294 | checkout_success = syncbuf.Finish() | 2294 | checkout_success = syncbuf.Finish() |
2295 | if syncbuf.errors: | 2295 | if syncbuf.errors: |
2296 | checkout_error = SyncError( | 2296 | checkout_errors.extend(syncbuf.errors) |
2297 | aggregate_errors=syncbuf.errors | ||
2298 | ) | ||
2299 | except KeyboardInterrupt: | 2297 | except KeyboardInterrupt: |
2300 | logger.error( | 2298 | logger.error( |
2301 | "Keyboard interrupt while processing %s", project.name | 2299 | "Keyboard interrupt while processing %s", project.name |
2302 | ) | 2300 | ) |
2303 | except GitError as e: | 2301 | except GitError as e: |
2304 | checkout_error = e | 2302 | checkout_errors.append(e) |
2305 | logger.error( | 2303 | logger.error( |
2306 | "error.GitError: Cannot checkout %s: %s", | 2304 | "error.GitError: Cannot checkout %s: %s", |
2307 | project.name, | 2305 | project.name, |
2308 | e, | 2306 | e, |
2309 | ) | 2307 | ) |
2310 | except Exception as e: | 2308 | except Exception as e: |
2311 | checkout_error = e | 2309 | checkout_errors.append(e) |
2312 | logger.error( | 2310 | logger.error( |
2313 | "error: Cannot checkout %s: %s: %s", | 2311 | "error: Cannot checkout %s: %s: %s", |
2314 | project.name, | 2312 | project.name, |
@@ -2333,8 +2331,8 @@ later is required to fix a server side protocol bug. | |||
2333 | fetch_success=fetch_success, | 2331 | fetch_success=fetch_success, |
2334 | remote_fetched=remote_fetched, | 2332 | remote_fetched=remote_fetched, |
2335 | checkout_success=checkout_success, | 2333 | checkout_success=checkout_success, |
2336 | fetch_error=fetch_error, | 2334 | fetch_errors=fetch_errors, |
2337 | checkout_error=checkout_error, | 2335 | checkout_errors=checkout_errors, |
2338 | stderr_text=stderr_text.strip(), | 2336 | stderr_text=stderr_text.strip(), |
2339 | fetch_start=fetch_start, | 2337 | fetch_start=fetch_start, |
2340 | fetch_finish=fetch_finish, | 2338 | fetch_finish=fetch_finish, |
@@ -2429,14 +2427,14 @@ later is required to fix a server side protocol bug. | |||
2429 | if not success: | 2427 | if not success: |
2430 | ret = False | 2428 | ret = False |
2431 | err_event.set() | 2429 | err_event.set() |
2432 | if result.fetch_error: | 2430 | if result.fetch_errors: |
2433 | errors.append(result.fetch_error) | 2431 | errors.extend(result.fetch_errors) |
2434 | self._interleaved_err_network = True | 2432 | self._interleaved_err_network = True |
2435 | self._interleaved_err_network_results.append( | 2433 | self._interleaved_err_network_results.append( |
2436 | result.relpath | 2434 | result.relpath |
2437 | ) | 2435 | ) |
2438 | if result.checkout_error: | 2436 | if result.checkout_errors: |
2439 | errors.append(result.checkout_error) | 2437 | errors.extend(result.checkout_errors) |
2440 | self._interleaved_err_checkout = True | 2438 | self._interleaved_err_checkout = True |
2441 | self._interleaved_err_checkout_results.append( | 2439 | self._interleaved_err_checkout_results.append( |
2442 | result.relpath | 2440 | result.relpath |