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 diff = len(err.aggregate_errors) - MAX_PRINT_ERRORS
if diff: if diff > 0:
self.error("+%d additional errors...", diff) 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 expected:
if not opt.quiet: if not opt.quiet:
logger.info( print(
"%s: Shared project %s found, disabling pruning.", "\r%s: Shared project %s found, disabling pruning."
relpath, % (relpath, project.name)
project.name,
) )
if git_require((2, 7, 0)): 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") project.config.SetString("gc.pruneExpire", "never")
else: else:
if not opt.quiet: 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("extensions.preciousObjects", None)
project.config.SetString("gc.pruneExpire", 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 manifest_server = manifest.manifest_server
if not opt.quiet: if not opt.quiet:
logger.info("Using manifest server %s", manifest_server) print("Using manifest server %s" % manifest_server)
if "@" not in manifest_server: if "@" not in manifest_server:
username = None username = None
@ -1699,7 +1698,7 @@ later is required to fix a server side protocol bug.
if opt.mp_update: if opt.mp_update:
self._UpdateAllManifestProjects(opt, mp, manifest_name, errors) self._UpdateAllManifestProjects(opt, mp, manifest_name, errors)
else: 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 # Now that the manifests are up-to-date, setup options whose defaults
# might be in the manifest. # might be in the manifest.
@ -1855,7 +1854,7 @@ later is required to fix a server side protocol bug.
) )
if not opt.quiet: if not opt.quiet:
logger.info("repo sync has finished successfully.") print("repo sync has finished successfully.")
def _PostRepoUpgrade(manifest, quiet=False): def _PostRepoUpgrade(manifest, quiet=False):
@ -1878,7 +1877,7 @@ def _PostRepoUpgrade(manifest, quiet=False):
def _PostRepoFetch(rp, repo_verify=True, verbose=False): def _PostRepoFetch(rp, repo_verify=True, verbose=False):
if rp.HasChanges: 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() wrapper = Wrapper()
try: try:
rev = rp.bare_git.describe(rp.GetRevisionId()) 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) rp.work_git.reset("--keep", new_rev)
except GitError as e: except GitError as e:
raise RepoUnhandledExceptionError(e) raise RepoUnhandledExceptionError(e)
logger.info("info: Restarting repo with latest version") print("info: Restarting repo with latest version")
raise RepoChangedException(["--repo-upgraded"]) raise RepoChangedException(["--repo-upgraded"])
else: else:
logger.warning("warning: Skipped upgrade to unverified version") logger.warning("warning: Skipped upgrade to unverified version")
else: else:
if verbose: if verbose:
logger.info( print("repo version %s is current", rp.work_git.describe(HEAD))
"repo version %s is current", rp.work_git.describe(HEAD)
)
class _FetchTimes(object): class _FetchTimes(object):