diff options
author | Tomasz Wasilczyk <twasilczyk@google.com> | 2023-12-08 13:42:17 -0800 |
---|---|---|
committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-12-08 23:08:46 +0000 |
commit | 4c80921d22c20a28d531c9e3e8a0ce4433c6509d (patch) | |
tree | 583b21bce8c6b6be7a078d02eb11569dc7321699 /subcmds/sync.py | |
parent | f56484c05b545b7b798e025971673f9593dcc51c (diff) | |
download | git-repo-4c80921d22c20a28d531c9e3e8a0ce4433c6509d.tar.gz |
Don't log spam `repo sync` by defaultv2.40
Most times a repo sync after some time (week+) results in a bunch of
messages, which are not very useful for average user:
- discarding 1 commits
- Deleting obsolete checkout.
Bug: N/A
Test: repo sync
Change-Id: I881eab61f9f261e98f3656c09e73ddd159ce288c
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/397038
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Tested-by: Tomasz Wasilczyk <twasilczyk@google.com>
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r-- | subcmds/sync.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index b7236629..ac6a451b 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
@@ -956,12 +956,13 @@ later is required to fix a server side protocol bug. | |||
956 | 956 | ||
957 | return _FetchMainResult(all_projects) | 957 | return _FetchMainResult(all_projects) |
958 | 958 | ||
959 | def _CheckoutOne(self, detach_head, force_sync, project): | 959 | def _CheckoutOne(self, detach_head, force_sync, verbose, project): |
960 | """Checkout work tree for one project | 960 | """Checkout work tree for one project |
961 | 961 | ||
962 | Args: | 962 | Args: |
963 | detach_head: Whether to leave a detached HEAD. | 963 | detach_head: Whether to leave a detached HEAD. |
964 | force_sync: Force checking out of the repo. | 964 | force_sync: Force checking out of the repo. |
965 | verbose: Whether to show verbose messages. | ||
965 | project: Project object for the project to checkout. | 966 | project: Project object for the project to checkout. |
966 | 967 | ||
967 | Returns: | 968 | Returns: |
@@ -975,7 +976,7 @@ later is required to fix a server side protocol bug. | |||
975 | errors = [] | 976 | errors = [] |
976 | try: | 977 | try: |
977 | project.Sync_LocalHalf( | 978 | project.Sync_LocalHalf( |
978 | syncbuf, force_sync=force_sync, errors=errors | 979 | syncbuf, force_sync=force_sync, errors=errors, verbose=verbose |
979 | ) | 980 | ) |
980 | success = syncbuf.Finish() | 981 | success = syncbuf.Finish() |
981 | except GitError as e: | 982 | except GitError as e: |
@@ -1042,7 +1043,7 @@ later is required to fix a server side protocol bug. | |||
1042 | proc_res = self.ExecuteInParallel( | 1043 | proc_res = self.ExecuteInParallel( |
1043 | opt.jobs_checkout, | 1044 | opt.jobs_checkout, |
1044 | functools.partial( | 1045 | functools.partial( |
1045 | self._CheckoutOne, opt.detach_head, opt.force_sync | 1046 | self._CheckoutOne, opt.detach_head, opt.force_sync, opt.verbose |
1046 | ), | 1047 | ), |
1047 | all_projects, | 1048 | all_projects, |
1048 | callback=_ProcessResults, | 1049 | callback=_ProcessResults, |
@@ -1288,7 +1289,7 @@ later is required to fix a server side protocol bug. | |||
1288 | groups=None, | 1289 | groups=None, |
1289 | ) | 1290 | ) |
1290 | project.DeleteWorktree( | 1291 | project.DeleteWorktree( |
1291 | quiet=opt.quiet, force=opt.force_remove_dirty | 1292 | verbose=opt.verbose, force=opt.force_remove_dirty |
1292 | ) | 1293 | ) |
1293 | 1294 | ||
1294 | new_project_paths.sort() | 1295 | new_project_paths.sort() |
@@ -1533,7 +1534,10 @@ later is required to fix a server side protocol bug. | |||
1533 | syncbuf = SyncBuffer(mp.config) | 1534 | syncbuf = SyncBuffer(mp.config) |
1534 | start = time.time() | 1535 | start = time.time() |
1535 | mp.Sync_LocalHalf( | 1536 | mp.Sync_LocalHalf( |
1536 | syncbuf, submodules=mp.manifest.HasSubmodules, errors=errors | 1537 | syncbuf, |
1538 | submodules=mp.manifest.HasSubmodules, | ||
1539 | errors=errors, | ||
1540 | verbose=opt.verbose, | ||
1537 | ) | 1541 | ) |
1538 | clean = syncbuf.Finish() | 1542 | clean = syncbuf.Finish() |
1539 | self.event_log.AddSync( | 1543 | self.event_log.AddSync( |