diff options
author | Tomasz Wasilczyk <twasilczyk@google.com> | 2024-01-05 12:23:10 -0800 |
---|---|---|
committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2024-01-05 21:40:43 +0000 |
commit | 208f34495086eba60f744408aa26b4c62d6db6c6 (patch) | |
tree | ea9289ad709323b675edd7760bf07af6a501c406 /project.py | |
parent | 138c8a9ff543ce93c0e0a72581b255a0cb136994 (diff) | |
download | git-repo-208f34495086eba60f744408aa26b4c62d6db6c6.tar.gz |
Clean up remaining `repo sync` log spam.
There are still some verbose messages (e.g. "remote: ...") when doing
repo sync after a couple days. Let's hide them behind verbose flag.
Bug: N/A
Test: repo sync
Change-Id: I1408472c95ed80d9555adfe8f92211245c03cf41
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/400855
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Tested-by: Tomasz Wasilczyk <twasilczyk@google.com>
Commit-Queue: Tomasz Wasilczyk <twasilczyk@google.com>
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 37 |
1 files changed, 21 insertions, 16 deletions
@@ -1636,9 +1636,9 @@ class Project: | |||
1636 | elif pub == head: | 1636 | elif pub == head: |
1637 | # All published commits are merged, and thus we are a | 1637 | # All published commits are merged, and thus we are a |
1638 | # strict subset. We can fast-forward safely. | 1638 | # strict subset. We can fast-forward safely. |
1639 | syncbuf.later1(self, _doff) | 1639 | syncbuf.later1(self, _doff, not verbose) |
1640 | if submodules: | 1640 | if submodules: |
1641 | syncbuf.later1(self, _dosubmodules) | 1641 | syncbuf.later1(self, _dosubmodules, not verbose) |
1642 | return | 1642 | return |
1643 | 1643 | ||
1644 | # Examine the local commits not in the remote. Find the | 1644 | # Examine the local commits not in the remote. Find the |
@@ -1697,10 +1697,10 @@ class Project: | |||
1697 | def _dorebase(): | 1697 | def _dorebase(): |
1698 | self._Rebase(upstream="%s^1" % last_mine, onto=revid) | 1698 | self._Rebase(upstream="%s^1" % last_mine, onto=revid) |
1699 | 1699 | ||
1700 | syncbuf.later2(self, _dorebase) | 1700 | syncbuf.later2(self, _dorebase, not verbose) |
1701 | if submodules: | 1701 | if submodules: |
1702 | syncbuf.later2(self, _dosubmodules) | 1702 | syncbuf.later2(self, _dosubmodules, not verbose) |
1703 | syncbuf.later2(self, _docopyandlink) | 1703 | syncbuf.later2(self, _docopyandlink, not verbose) |
1704 | elif local_changes: | 1704 | elif local_changes: |
1705 | try: | 1705 | try: |
1706 | self._ResetHard(revid) | 1706 | self._ResetHard(revid) |
@@ -1711,9 +1711,9 @@ class Project: | |||
1711 | fail(e) | 1711 | fail(e) |
1712 | return | 1712 | return |
1713 | else: | 1713 | else: |
1714 | syncbuf.later1(self, _doff) | 1714 | syncbuf.later1(self, _doff, not verbose) |
1715 | if submodules: | 1715 | if submodules: |
1716 | syncbuf.later1(self, _dosubmodules) | 1716 | syncbuf.later1(self, _dosubmodules, not verbose) |
1717 | 1717 | ||
1718 | def AddCopyFile(self, src, dest, topdir): | 1718 | def AddCopyFile(self, src, dest, topdir): |
1719 | """Mark |src| for copying to |dest| (relative to |topdir|). | 1719 | """Mark |src| for copying to |dest| (relative to |topdir|). |
@@ -2883,10 +2883,12 @@ class Project: | |||
2883 | if GitCommand(self, cmd).Wait() != 0: | 2883 | if GitCommand(self, cmd).Wait() != 0: |
2884 | raise GitError(f"{self.name} rebase {upstream} ", project=self.name) | 2884 | raise GitError(f"{self.name} rebase {upstream} ", project=self.name) |
2885 | 2885 | ||
2886 | def _FastForward(self, head, ffonly=False): | 2886 | def _FastForward(self, head, ffonly=False, quiet=True): |
2887 | cmd = ["merge", "--no-stat", head] | 2887 | cmd = ["merge", "--no-stat", head] |
2888 | if ffonly: | 2888 | if ffonly: |
2889 | cmd.append("--ff-only") | 2889 | cmd.append("--ff-only") |
2890 | if quiet: | ||
2891 | cmd.append("-q") | ||
2890 | if GitCommand(self, cmd).Wait() != 0: | 2892 | if GitCommand(self, cmd).Wait() != 0: |
2891 | raise GitError(f"{self.name} merge {head} ", project=self.name) | 2893 | raise GitError(f"{self.name} merge {head} ", project=self.name) |
2892 | 2894 | ||
@@ -3759,17 +3761,20 @@ class _Failure: | |||
3759 | 3761 | ||
3760 | 3762 | ||
3761 | class _Later: | 3763 | class _Later: |
3762 | def __init__(self, project, action): | 3764 | def __init__(self, project, action, quiet): |
3763 | self.project = project | 3765 | self.project = project |
3764 | self.action = action | 3766 | self.action = action |
3767 | self.quiet = quiet | ||
3765 | 3768 | ||
3766 | def Run(self, syncbuf): | 3769 | def Run(self, syncbuf): |
3767 | out = syncbuf.out | 3770 | out = syncbuf.out |
3768 | out.project("project %s/", self.project.RelPath(local=False)) | 3771 | if not self.quiet: |
3769 | out.nl() | 3772 | out.project("project %s/", self.project.RelPath(local=False)) |
3773 | out.nl() | ||
3770 | try: | 3774 | try: |
3771 | self.action() | 3775 | self.action() |
3772 | out.nl() | 3776 | if not self.quiet: |
3777 | out.nl() | ||
3773 | return True | 3778 | return True |
3774 | except GitError: | 3779 | except GitError: |
3775 | out.nl() | 3780 | out.nl() |
@@ -3805,11 +3810,11 @@ class SyncBuffer: | |||
3805 | self._failures.append(_Failure(project, err)) | 3810 | self._failures.append(_Failure(project, err)) |
3806 | self._MarkUnclean() | 3811 | self._MarkUnclean() |
3807 | 3812 | ||
3808 | def later1(self, project, what): | 3813 | def later1(self, project, what, quiet): |
3809 | self._later_queue1.append(_Later(project, what)) | 3814 | self._later_queue1.append(_Later(project, what, quiet)) |
3810 | 3815 | ||
3811 | def later2(self, project, what): | 3816 | def later2(self, project, what, quiet): |
3812 | self._later_queue2.append(_Later(project, what)) | 3817 | self._later_queue2.append(_Later(project, what, quiet)) |
3813 | 3818 | ||
3814 | def Finish(self): | 3819 | def Finish(self): |
3815 | self._PrintMessages() | 3820 | self._PrintMessages() |