1
0
Fork 0

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>
This commit is contained in:
Aravind Vasudevan 2023-09-14 08:46:44 +00:00 committed by LUCI
parent c3d7c8536c
commit c993c5068e
12 changed files with 121 additions and 115 deletions

View file

@ -13,7 +13,6 @@
# limitations under the License.
import functools
import sys
from typing import NamedTuple
from command import Command
@ -22,6 +21,10 @@ from error import GitError
from error import RepoExitError
from progress import Progress
from project import Project
from repo_logging import RepoLogger
logger = RepoLogger(__file__)
class CheckoutBranchResult(NamedTuple):
@ -99,12 +102,9 @@ The command is equivalent to:
if err_projects:
for p in err_projects:
print(
"error: %s/: cannot checkout %s" % (p.relpath, nb),
file=sys.stderr,
)
logger.error("error: %s/: cannot checkout %s", p.relpath, nb)
raise CheckoutCommandError(aggregate_errors=err)
elif not success:
msg = f"error: no project has branch {nb}"
print(msg, file=sys.stderr)
logger.error(msg)
raise MissingBranchError(msg)