From 8bc5000423aef45900b7fba112458ed586e13251 Mon Sep 17 00:00:00 2001 From: Aravind Vasudevan Date: Fri, 13 Oct 2023 19:22:47 +0000 Subject: [PATCH] Update logger.warn to logger.warning Bug: 305035810 Change-Id: Ic2b35d5c3cbe92480c24da612f29382f5d26d4aa Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/389414 Reviewed-by: Mike Frysinger Tested-by: Aravind Vasudevan Commit-Queue: Aravind Vasudevan --- main.py | 8 +++++--- project.py | 12 ++++++------ subcmds/cherry_pick.py | 2 +- subcmds/manifest.py | 6 +++--- subcmds/rebase.py | 2 +- subcmds/sync.py | 2 +- subcmds/upload.py | 6 +++--- 7 files changed, 20 insertions(+), 18 deletions(-) diff --git a/main.py b/main.py index bafa64df..9c62722f 100755 --- a/main.py +++ b/main.py @@ -566,9 +566,11 @@ repo: error: sys.exit(1) if exp > ver: - logger.warn("\n... A new version of repo (%s) is available.", exp_str) + logger.warning( + "\n... A new version of repo (%s) is available.", exp_str + ) if os.access(repo_path, os.W_OK): - logger.warn( + logger.warning( """\ ... You should upgrade soon: cp %s %s @@ -577,7 +579,7 @@ repo: error: repo_path, ) else: - logger.warn( + logger.warning( """\ ... New version is available at: %s ... The launcher is run from: %s diff --git a/project.py b/project.py index 642c123f..80c20add 100644 --- a/project.py +++ b/project.py @@ -1262,7 +1262,7 @@ class Project(object): try: platform_utils.remove(tarpath) except OSError as e: - logger.warn("warn: Cannot remove archive %s: %s", tarpath, e) + logger.warning("warn: Cannot remove archive %s: %s", tarpath, e) self._CopyAndLinkFiles() return SyncNetworkHalfResult(True) @@ -1759,7 +1759,7 @@ class Project(object): """ if self.IsDirty(): if force: - logger.warn( + logger.warning( "warning: %s: Removing dirty project: uncommitted changes " "lost.", self.RelPath(local=False), @@ -3038,7 +3038,7 @@ class Project(object): # hardlink below. if not filecmp.cmp(stock_hook, dst, shallow=False): if not quiet: - logger.warn( + logger.warning( "warn: %s: Not replacing locally modified %s hook", self.RelPath(local=False), name, @@ -4336,7 +4336,7 @@ class ManifestProject(MetaProject): self.config.SetBoolean("repo.worktree", worktree) if is_new: self.use_git_worktrees = True - logger.warn("warning: --worktree is experimental!") + logger.warning("warning: --worktree is experimental!") if archive: if is_new: @@ -4400,7 +4400,7 @@ class ManifestProject(MetaProject): self.config.SetBoolean("repo.git-lfs", git_lfs) if not is_new: - logger.warn( + logger.warning( "warning: Changing --git-lfs settings will only affect new " "project checkouts.\n" " Existing projects will require manual updates.\n" @@ -4512,7 +4512,7 @@ class ManifestProject(MetaProject): submanifest = "" if self.manifest.path_prefix: submanifest = f"for {self.manifest.path_prefix} " - logger.warn( + logger.warning( "warning: git update of superproject %s failed, " "repo sync will not use superproject to fetch source; " "while this error is not fatal, and you can continue to " diff --git a/subcmds/cherry_pick.py b/subcmds/cherry_pick.py index f9ae3e32..3d219333 100644 --- a/subcmds/cherry_pick.py +++ b/subcmds/cherry_pick.py @@ -86,7 +86,7 @@ change id will be added. p.Wait() except GitError as e: logger.error(e) - logger.warn( + logger.warning( "NOTE: When committing (please see above) and editing the " "commit message, please remove the old Change-Id-line and " "add:\n%s", diff --git a/subcmds/manifest.py b/subcmds/manifest.py index 101240d1..bb6dc930 100644 --- a/subcmds/manifest.py +++ b/subcmds/manifest.py @@ -136,7 +136,7 @@ to indicate the remote ref to push changes to via 'repo upload'. manifest.SetUseLocalManifests(not opt.ignore_local_manifests) if opt.json: - logger.warn("warning: --json is experimental!") + logger.warning("warning: --json is experimental!") doc = manifest.ToDict( peg_rev=opt.peg_rev, peg_rev_upstream=opt.peg_rev_upstream, @@ -163,13 +163,13 @@ to indicate the remote ref to push changes to via 'repo upload'. if output_file != "-": fd.close() if manifest.path_prefix: - logger.warn( + logger.warning( "Saved %s submanifest to %s", manifest.path_prefix, output_file, ) else: - logger.warn("Saved manifest to %s", output_file) + logger.warning("Saved manifest to %s", output_file) def ValidateOptions(self, opt, args): if args: diff --git a/subcmds/rebase.py b/subcmds/rebase.py index 439557c2..db1b387c 100644 --- a/subcmds/rebase.py +++ b/subcmds/rebase.py @@ -113,7 +113,7 @@ branch but need to incorporate new upstream changes "underneath" them. ) if len(args) == 1: - logger.warn( + logger.warning( "note: project %s is mapped to more than one path", args[0] ) diff --git a/subcmds/sync.py b/subcmds/sync.py index 85428b18..e1f7d019 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -1877,7 +1877,7 @@ def _PostRepoUpgrade(manifest, quiet=False): def _PostRepoFetch(rp, repo_verify=True, verbose=False): if rp.HasChanges: - logger.warn("info: A new version of repo is available") + logger.warning("info: A new version of repo is available") wrapper = Wrapper() try: rev = rp.bare_git.describe(rp.GetRevisionId()) diff --git a/subcmds/upload.py b/subcmds/upload.py index 618a10e1..4bcdfaf9 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py @@ -72,16 +72,16 @@ def _VerifyPendingCommits(branches: List[ReviewableBranch]) -> bool: # If any branch has many commits, prompt the user. if many_commits: if len(branches) > 1: - logger.warn( + logger.warning( "ATTENTION: One or more branches has an unusually high number " "of commits." ) else: - logger.warn( + logger.warning( "ATTENTION: You are uploading an unusually high number of " "commits." ) - logger.warn( + logger.warning( "YOU PROBABLY DO NOT MEAN TO DO THIS. (Did you rebase across " "branches?)" )