Skip to content

Commit

Permalink
Update logger.warn to logger.warning
Browse files Browse the repository at this point in the history
Bug: 305035810
Change-Id: Ic2b35d5c3cbe92480c24da612f29382f5d26d4aa
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/389414
Reviewed-by: Mike Frysinger <vapier@google.com>
Tested-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
  • Loading branch information
Aravind Vasudevan authored and LUCI committed Oct 13, 2023
1 parent 6a7f73b commit 8bc5000
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 18 deletions.
8 changes: 5 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,9 +566,11 @@ def _CheckWrapperVersion(ver_str, repo_path):
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
Expand All @@ -577,7 +579,7 @@ def _CheckWrapperVersion(ver_str, repo_path):
repo_path,
)
else:
logger.warn(
logger.warning(
"""\
... New version is available at: %s
... The launcher is run from: %s
Expand Down
12 changes: 6 additions & 6 deletions project.py
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ def Sync_NetworkHalf(
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)

Expand Down Expand Up @@ -1759,7 +1759,7 @@ def DeleteWorktree(self, quiet=False, force=False):
"""
if self.IsDirty():
if force:
logger.warn(
logger.warning(
"warning: %s: Removing dirty project: uncommitted changes "
"lost.",
self.RelPath(local=False),
Expand Down Expand Up @@ -3038,7 +3038,7 @@ def _InitHooks(self, quiet=False):
# 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,
Expand Down Expand Up @@ -4336,7 +4336,7 @@ def Sync(
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:
Expand Down Expand Up @@ -4400,7 +4400,7 @@ def Sync(

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"
Expand Down Expand Up @@ -4512,7 +4512,7 @@ def Sync(
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 "
Expand Down
2 changes: 1 addition & 1 deletion subcmds/cherry_pick.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def Execute(self, opt, args):
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",
Expand Down
6 changes: 3 additions & 3 deletions subcmds/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def _Output(self, opt):
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,
Expand All @@ -163,13 +163,13 @@ def _Output(self, opt):
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:
Expand Down
2 changes: 1 addition & 1 deletion subcmds/rebase.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def Execute(self, opt, args):
)

if len(args) == 1:
logger.warn(
logger.warning(
"note: project %s is mapped to more than one path", args[0]
)

Expand Down
2 changes: 1 addition & 1 deletion subcmds/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
6 changes: 3 additions & 3 deletions subcmds/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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?)"
)
Expand Down

0 comments on commit 8bc5000

Please sign in to comment.