Reset info logs back to print in sync

Bug: b/292704435
Change-Id: Ib4b4873de726888fc68e476167ff2dcd74ec9045
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/387974
Tested-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Reviewed-by: Jason Chang <jasonnc@google.com>
This commit is contained in:
Aravind Vasudevan 2023-09-28 19:06:59 +00:00 committed by LUCI
parent 87058c6ca5
commit 83c66ec661
2 changed files with 11 additions and 14 deletions

View File

@ -88,5 +88,5 @@ class RepoLogger(logging.Logger):
)
diff = len(err.aggregate_errors) - MAX_PRINT_ERRORS
if diff:
if diff > 0:
self.error("+%d additional errors...", diff)

View File

@ -1112,10 +1112,9 @@ later is required to fix a server side protocol bug.
)
if expected:
if not opt.quiet:
logger.info(
"%s: Shared project %s found, disabling pruning.",
relpath,
project.name,
print(
"\r%s: Shared project %s found, disabling pruning."
% (relpath, project.name)
)
if git_require((2, 7, 0)):
@ -1132,7 +1131,7 @@ later is required to fix a server side protocol bug.
project.config.SetString("gc.pruneExpire", "never")
else:
if not opt.quiet:
logger.info("%s: not shared, disabling pruning.", relpath)
print(f"\r{relpath}: not shared, disabling pruning.")
project.config.SetString("extensions.preciousObjects", None)
project.config.SetString("gc.pruneExpire", None)
@ -1366,7 +1365,7 @@ later is required to fix a server side protocol bug.
manifest_server = manifest.manifest_server
if not opt.quiet:
logger.info("Using manifest server %s", manifest_server)
print("Using manifest server %s" % manifest_server)
if "@" not in manifest_server:
username = None
@ -1699,7 +1698,7 @@ later is required to fix a server side protocol bug.
if opt.mp_update:
self._UpdateAllManifestProjects(opt, mp, manifest_name, errors)
else:
logger.info("Skipping update of local manifest project.")
print("Skipping update of local manifest project.")
# Now that the manifests are up-to-date, setup options whose defaults
# might be in the manifest.
@ -1855,7 +1854,7 @@ later is required to fix a server side protocol bug.
)
if not opt.quiet:
logger.info("repo sync has finished successfully.")
print("repo sync has finished successfully.")
def _PostRepoUpgrade(manifest, quiet=False):
@ -1878,7 +1877,7 @@ def _PostRepoUpgrade(manifest, quiet=False):
def _PostRepoFetch(rp, repo_verify=True, verbose=False):
if rp.HasChanges:
logger.info("info: A new version of repo is available")
logger.warn("info: A new version of repo is available")
wrapper = Wrapper()
try:
rev = rp.bare_git.describe(rp.GetRevisionId())
@ -1900,15 +1899,13 @@ def _PostRepoFetch(rp, repo_verify=True, verbose=False):
rp.work_git.reset("--keep", new_rev)
except GitError as e:
raise RepoUnhandledExceptionError(e)
logger.info("info: Restarting repo with latest version")
print("info: Restarting repo with latest version")
raise RepoChangedException(["--repo-upgraded"])
else:
logger.warning("warning: Skipped upgrade to unverified version")
else:
if verbose:
logger.info(
"repo version %s is current", rp.work_git.describe(HEAD)
)
print("repo version %s is current", rp.work_git.describe(HEAD))
class _FetchTimes(object):