diff options
| author | Aravind Vasudevan <aravindvasudev@google.com> | 2023-09-14 08:46:44 +0000 |
|---|---|---|
| committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-09-14 17:13:37 +0000 |
| commit | c993c5068e0f7e22124b1bfb17ad0425fe2b8c83 (patch) | |
| tree | 7e1dadd9b04a42ebfd438e41f35c176f0f0578da /subcmds/selfupdate.py | |
| parent | c3d7c8536c408a54c7af1486f0beec7a1b0eb0ad (diff) | |
| download | git-repo-c993c5068e0f7e22124b1bfb17ad0425fe2b8c83.tar.gz | |
subcmds: Use repo logger
Bug: b/292704435
Change-Id: Ia3a45d87fc0bf0d4a1ba53050d9c3cd2dba20e55
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/386236
Reviewed-by: Jason Chang <jasonnc@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Tested-by: Aravind Vasudevan <aravindvasudev@google.com>
Diffstat (limited to 'subcmds/selfupdate.py')
| -rw-r--r-- | subcmds/selfupdate.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/subcmds/selfupdate.py b/subcmds/selfupdate.py index 51d963ee..72683097 100644 --- a/subcmds/selfupdate.py +++ b/subcmds/selfupdate.py | |||
| @@ -13,15 +13,18 @@ | |||
| 13 | # limitations under the License. | 13 | # limitations under the License. |
| 14 | 14 | ||
| 15 | import optparse | 15 | import optparse |
| 16 | import sys | ||
| 17 | 16 | ||
| 18 | from command import Command | 17 | from command import Command |
| 19 | from command import MirrorSafeCommand | 18 | from command import MirrorSafeCommand |
| 20 | from error import RepoExitError | 19 | from error import RepoExitError |
| 20 | from repo_logging import RepoLogger | ||
| 21 | from subcmds.sync import _PostRepoFetch | 21 | from subcmds.sync import _PostRepoFetch |
| 22 | from subcmds.sync import _PostRepoUpgrade | 22 | from subcmds.sync import _PostRepoUpgrade |
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | logger = RepoLogger(__file__) | ||
| 26 | |||
| 27 | |||
| 25 | class SelfupdateError(RepoExitError): | 28 | class SelfupdateError(RepoExitError): |
| 26 | """Exit error for failed selfupdate command.""" | 29 | """Exit error for failed selfupdate command.""" |
| 27 | 30 | ||
| @@ -66,7 +69,7 @@ need to be performed by an end-user. | |||
| 66 | else: | 69 | else: |
| 67 | result = rp.Sync_NetworkHalf() | 70 | result = rp.Sync_NetworkHalf() |
| 68 | if result.error: | 71 | if result.error: |
| 69 | print("error: can't update repo", file=sys.stderr) | 72 | logger.error("error: can't update repo") |
| 70 | raise SelfupdateError(aggregate_errors=[result.error]) | 73 | raise SelfupdateError(aggregate_errors=[result.error]) |
| 71 | 74 | ||
| 72 | rp.bare_git.gc("--auto") | 75 | rp.bare_git.gc("--auto") |
