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 <vapier@google.com>
Tested-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
This commit is contained in:
Aravind Vasudevan 2023-10-13 19:22:47 +00:00 committed by LUCI
parent 6a7f73bb9a
commit 8bc5000423
7 changed files with 20 additions and 18 deletions

View File

@ -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

View File

@ -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 "

View File

@ -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",

View File

@ -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:

View File

@ -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]
)

View File

@ -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())

View File

@ -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?)"
)