From c993c5068e0f7e22124b1bfb17ad0425fe2b8c83 Mon Sep 17 00:00:00 2001 From: Aravind Vasudevan Date: Thu, 14 Sep 2023 08:46:44 +0000 Subject: 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 Commit-Queue: Aravind Vasudevan Tested-by: Aravind Vasudevan --- subcmds/rebase.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'subcmds/rebase.py') diff --git a/subcmds/rebase.py b/subcmds/rebase.py index c0e83adf..439557c2 100644 --- a/subcmds/rebase.py +++ b/subcmds/rebase.py @@ -17,6 +17,10 @@ import sys from color import Coloring from command import Command from git_command import GitCommand +from repo_logging import RepoLogger + + +logger = RepoLogger(__file__) class RebaseColoring(Coloring): @@ -104,17 +108,15 @@ branch but need to incorporate new upstream changes "underneath" them. one_project = len(all_projects) == 1 if opt.interactive and not one_project: - print( - "error: interactive rebase not supported with multiple " - "projects", - file=sys.stderr, + logger.error( + "error: interactive rebase not supported with multiple projects" ) + if len(args) == 1: - print( - "note: project %s is mapped to more than one path" - % (args[0],), - file=sys.stderr, + logger.warn( + "note: project %s is mapped to more than one path", args[0] ) + return 1 # Setup the common git rebase args that we use for all projects. @@ -145,10 +147,9 @@ branch but need to incorporate new upstream changes "underneath" them. cb = project.CurrentBranch if not cb: if one_project: - print( - "error: project %s has a detached HEAD" - % _RelPath(project), - file=sys.stderr, + logger.error( + "error: project %s has a detached HEAD", + _RelPath(project), ) return 1 # Ignore branches with detached HEADs. @@ -157,10 +158,9 @@ branch but need to incorporate new upstream changes "underneath" them. upbranch = project.GetBranch(cb) if not upbranch.LocalMerge: if one_project: - print( - "error: project %s does not track any remote branches" - % _RelPath(project), - file=sys.stderr, + logger.error( + "error: project %s does not track any remote branches", + _RelPath(project), ) return 1 # Ignore branches without remotes. -- cgit v1.2.3-54-g00ecf