Compare commits

...

6 Commits

Author SHA1 Message Date
1328c35a4d superproject: Provide accurate feedback for user choice
Currently the code would give a message that would appear like the user
have enrolled the experiment regardless of the actual choice. For users
who choose to not enroll in the experiment, we should give them
instructions to override (enable) superproject once instead of how to
disable it, which is what the code already behave.

Bug: [google internal] b/199167992
Change-Id: Iba3314cb510aedf024375a26baa8bc1d5e2846cf
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/317382
Tested-by: Xin Li <delphij@google.com>
Reviewed-by: Raman Tenneti <rtenneti@google.com>
2021-09-08 20:35:42 +00:00
7f8bd85184 superoject: log error message in the 'fmt' field also.
Tested:
+ Verified error messages are being collected.

Bug: [google internal] b/193711236
Change-Id: I6c608a2af332ccd38722b7f83a82e5ac8fa143db
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/317162
Reviewed-by: Xin Li <delphij@google.com>
Tested-by: Raman Tenneti <rtenneti@google.com>
2021-09-03 00:32:04 +00:00
c63328e5ff docs: Add version for Ubuntu 21.04 Hirsute and Debian 11 Bullseye
* Add footer to the version table, so easier to read and maintain.
* Add version entry for Ubuntu 21.04 Hirsute (non-LTS).
* Add version entry for Debian 11 Bullseye (LTS).

Change-Id: Ic72f911e616b1a13901e56074004f05cdc2c7633
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/313322
Reviewed-by: Xin Li <delphij@google.com>
Tested-by: Xin Li <delphij@google.com>
2021-09-03 00:16:43 +00:00
b55769a5c9 superproject: print messages if the manifest has superproject tag.
1) If the manifest has superproject tag (git_master, etc), then
   display error/warning messages (as it is doing today)
2) If the manifest doesn't have superproject tag (nest, chromeos
   manifests), then don't display any error/warning messages about
   superrproject (behave as though user has specified
   --no-use-superproject).
3) Print error/warning messages if --use-superproject passed as
   argument to repo sync.
4) No change in behavior for the repo init command.

git_superproject.py:
+ Fixed typo in _WriteManifestFile method name
+ Superproject accepts print_message  as an argument and it defaults
  to True. All messages that are printed to stderr are controlled by
  this flag. If it is True, then messages get printed.
+ Added PrintMessages function which return true if either
  --use-superproject is specified on the command line or if the
  manifest has a superproject tag.

sync.py:
+ Displays the warning message if PrintMessgages are enabled and
  passes that as argument to superproject object.
+ Added 'hassuperprojecttag' trace2 log entry for analysis. We can
  find users/branches that are using superproject, but the manifest is
  missing the superproject tag.

Tested:
$ ./run_tests

+ Verified printing of messages with and without superproject tag, with
  with --use-superproject option.

+ aosp-master
  $ repo_dev init --use-superproject -u https://android.googlesource.com/platform/manifest
  $ repo_dev sync

+ A manifest without superproject tag.
  $ repo_dev init -m $(pwd)/manifest_7482982.xml
  $ repo_dev sync -n -c -j32 -m $(pwd)/manifest_7482982.xml

Bug: [google internal] b/196411099
Change-Id: I92166dcad15a4129fab82edcf869e7c8db3efd4b
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/314982
Reviewed-by: Xin Li <delphij@google.com>
Tested-by: Raman Tenneti <rtenneti@google.com>
2021-08-13 20:07:40 +00:00
5637afcc60 superproject: prepend messages with - "repo superproject"
Changed _LogError method to _LogWarning.

Replaced 'repo error:' with "repo superproject warning:"(except IOError
message, which is still an "repo superproject error:" message)

Tested:
$ ./run_tests

Tested the errors and warnings by forcing the error/warning.
$ repo_dev sync -j 20 --use-superproject platform/packages/apps/Music
  ...
  repo superproject warning: please file a bug using go/repo-bug to report missing commit_ids for: []
  ...
  repo superproject error: cannot write manifest to : /sdc/android/src/aosp/.repo/exp-superproject/superproject_override.xml
  ...

Bug: [google internal] b/193711236

Change-Id: Ia0b6c830e04cf18dfc1a2ce325181a5b1160e054
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/314642
Tested-by: Raman Tenneti <rtenneti@google.com>
Reviewed-by: Raman Tenneti <rtenneti@google.com>
Reviewed-by: Ian Kasprzak <iankaz@google.com>
Reviewed-by: Xin Li <delphij@google.com>
2021-08-12 16:30:26 +00:00
df8b1cba47 man: make output system independent
The current help output might change based on the number of CPU cores
available (since it reflects the dynamic --jobs logic).  This is good
for users running repo locally, but not good for shipping static man
pages.  Hook the help output to have it generate the same output all
the time.

Change-Id: I3098ceddc0ad914b0b8e3b25d660b5a264cb41ee
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/312882
Reviewed-by: Roger Shimizu <rosh@debian.org>
Reviewed-by: Mike Frysinger <vapier@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
2021-07-31 11:39:35 +00:00
19 changed files with 107 additions and 54 deletions

View File

@ -24,6 +24,10 @@ from error import InvalidProjectGroupsError
import progress import progress
# Are we generating man-pages?
GENERATE_MANPAGES = os.environ.get('_REPO_GENERATE_MANPAGES_') == ' indeed! '
# Number of projects to submit to a single worker process at a time. # Number of projects to submit to a single worker process at a time.
# This number represents a tradeoff between the overhead of IPC and finer # This number represents a tradeoff between the overhead of IPC and finer
# grained opportunity for parallelism. This particular value was chosen by # grained opportunity for parallelism. This particular value was chosen by
@ -122,10 +126,14 @@ class Command(object):
help='only show errors') help='only show errors')
if self.PARALLEL_JOBS is not None: if self.PARALLEL_JOBS is not None:
default = 'based on number of CPU cores'
if not GENERATE_MANPAGES:
# Only include active cpu count if we aren't generating man pages.
default = f'%default; {default}'
p.add_option( p.add_option(
'-j', '--jobs', '-j', '--jobs',
type=int, default=self.PARALLEL_JOBS, type=int, default=self.PARALLEL_JOBS,
help='number of jobs to run in parallel (default: %s)' % self.PARALLEL_JOBS) help=f'number of jobs to run in parallel (default: {default})')
def _Options(self, p): def _Options(self, p):
"""Initialize the option parser with subcommand-specific options.""" """Initialize the option parser with subcommand-specific options."""

View File

@ -277,6 +277,11 @@ Things in italics are things we used to care about but probably don't anymore.
| Nov 2019 | | 2.24.0 | | Nov 2019 | | 2.24.0 |
| Jan 2020 | | 2.25.0 | | **20.04 Focal** | | Jan 2020 | | 2.25.0 | | **20.04 Focal** |
| Apr 2020 | **Apr 2030** | | | **20.04 Focal** | 2.25.0 | 2.7.17 3.7.5 | | Apr 2020 | **Apr 2030** | | | **20.04 Focal** | 2.25.0 | 2.7.17 3.7.5 |
| Oct 2020 | **Oct 2025** | | 3.9.0 | 21.04 Hirsute / **Bullseye** |
| Dec 2020 | | 2.30.0 | | 21.04 Hirsute / **Bullseye** |
| Apr 2021 | *Jan 2022* | | | 21.04 Hirsute | 2.30.2 | 2.7.18 3.9.4 |
| Aug 2021 | **Aug 2026** | | | **Debian 11 Bullseye** | 2.30.2 | 2.7.18 3.9.2 |
| **Date** | **EOL** | **[Git][rel-g]** | **[Python][rel-p]** | **[Ubuntu][rel-u] / [Debian][rel-d]** | **Git** | **Python** |
[contact]: ../README.md#contact [contact]: ../README.md#contact

View File

@ -59,7 +59,7 @@ class CommitIdsResult(NamedTuple):
class UpdateProjectsResult(NamedTuple): class UpdateProjectsResult(NamedTuple):
"""Return the overriding manifest file and whether caller should exit.""" """Return the overriding manifest file and whether caller should exit."""
# Path name of the overriding manfiest file if successful, otherwise None. # Path name of the overriding manifest file if successful, otherwise None.
manifest_path: str manifest_path: str
# Whether the caller should exit. # Whether the caller should exit.
fatal: bool fatal: bool
@ -73,7 +73,7 @@ class Superproject(object):
is a dictionary with project/commit id entries. is a dictionary with project/commit id entries.
""" """
def __init__(self, manifest, repodir, git_event_log, def __init__(self, manifest, repodir, git_event_log,
superproject_dir='exp-superproject', quiet=False): superproject_dir='exp-superproject', quiet=False, print_messages=False):
"""Initializes superproject. """Initializes superproject.
Args: Args:
@ -83,11 +83,13 @@ class Superproject(object):
git_event_log: A git trace2 event log to log events. git_event_log: A git trace2 event log to log events.
superproject_dir: Relative path under |repodir| to checkout superproject. superproject_dir: Relative path under |repodir| to checkout superproject.
quiet: If True then only print the progress messages. quiet: If True then only print the progress messages.
print_messages: if True then print error/warning messages.
""" """
self._project_commit_ids = None self._project_commit_ids = None
self._manifest = manifest self._manifest = manifest
self._git_event_log = git_event_log self._git_event_log = git_event_log
self._quiet = quiet self._quiet = quiet
self._print_messages = print_messages
self._branch = self._GetBranch() self._branch = self._GetBranch()
self._repodir = os.path.abspath(repodir) self._repodir = os.path.abspath(repodir)
self._superproject_dir = superproject_dir self._superproject_dir = superproject_dir
@ -122,10 +124,19 @@ class Superproject(object):
branch = branch[len(R_HEADS):] branch = branch[len(R_HEADS):]
return branch return branch
def _LogError(self, message): def _LogMessage(self, message):
"""Logs message to stderr and _git_event_log.""" """Logs message to stderr and _git_event_log."""
if self._print_messages:
print(message, file=sys.stderr) print(message, file=sys.stderr)
self._git_event_log.ErrorEvent(message, '') self._git_event_log.ErrorEvent(message, f'{message}')
def _LogError(self, message):
"""Logs error message to stderr and _git_event_log."""
self._LogMessage(f'repo superproject error: {message}')
def _LogWarning(self, message):
"""Logs warning message to stderr and _git_event_log."""
self._LogMessage(f'repo superproject warning: {message}')
def _Init(self): def _Init(self):
"""Sets up a local Git repository to get a copy of a superproject. """Sets up a local Git repository to get a copy of a superproject.
@ -146,7 +157,7 @@ class Superproject(object):
capture_stderr=True) capture_stderr=True)
retval = p.Wait() retval = p.Wait()
if retval: if retval:
self._LogError(f'repo: error: git init call failed, command: git {cmd}, ' self._LogWarning(f'git init call failed, command: git {cmd}, '
f'return code: {retval}, stderr: {p.stderr}') f'return code: {retval}, stderr: {p.stderr}')
return False return False
return True return True
@ -161,10 +172,10 @@ class Superproject(object):
True if fetch is successful, or False. True if fetch is successful, or False.
""" """
if not os.path.exists(self._work_git): if not os.path.exists(self._work_git):
self._LogError(f'git fetch missing directory: {self._work_git}') self._LogWarning(f'git fetch missing directory: {self._work_git}')
return False return False
if not git_require((2, 28, 0)): if not git_require((2, 28, 0)):
print('superproject requires a git version 2.28 or later', file=sys.stderr) self._LogWarning('superproject requires a git version 2.28 or later')
return False return False
cmd = ['fetch', url, '--depth', '1', '--force', '--no-tags', '--filter', 'blob:none'] cmd = ['fetch', url, '--depth', '1', '--force', '--no-tags', '--filter', 'blob:none']
if self._branch: if self._branch:
@ -176,7 +187,7 @@ class Superproject(object):
capture_stderr=True) capture_stderr=True)
retval = p.Wait() retval = p.Wait()
if retval: if retval:
self._LogError(f'repo: error: git fetch call failed, command: git {cmd}, ' self._LogWarning(f'git fetch call failed, command: git {cmd}, '
f'return code: {retval}, stderr: {p.stderr}') f'return code: {retval}, stderr: {p.stderr}')
return False return False
return True return True
@ -190,7 +201,7 @@ class Superproject(object):
data: data returned from 'git ls-tree ...' instead of None. data: data returned from 'git ls-tree ...' instead of None.
""" """
if not os.path.exists(self._work_git): if not os.path.exists(self._work_git):
self._LogError(f'git ls-tree missing directory: {self._work_git}') self._LogWarning(f'git ls-tree missing directory: {self._work_git}')
return None return None
data = None data = None
branch = 'HEAD' if not self._branch else self._branch branch = 'HEAD' if not self._branch else self._branch
@ -205,7 +216,7 @@ class Superproject(object):
if retval == 0: if retval == 0:
data = p.stdout data = p.stdout
else: else:
self._LogError(f'repo: error: git ls-tree call failed, command: git {cmd}, ' self._LogWarning(f'git ls-tree call failed, command: git {cmd}, '
f'return code: {retval}, stderr: {p.stderr}') f'return code: {retval}, stderr: {p.stderr}')
return data return data
@ -215,18 +226,17 @@ class Superproject(object):
Returns: Returns:
SyncResult SyncResult
""" """
print('NOTICE: --use-superproject is in beta; report any issues to the '
'address described in `repo version`', file=sys.stderr)
if not self._manifest.superproject: if not self._manifest.superproject:
self._LogError(f'repo error: superproject tag is not defined in manifest: ' self._LogWarning(f'superproject tag is not defined in manifest: '
f'{self._manifest.manifestFile}') f'{self._manifest.manifestFile}')
return SyncResult(False, False) return SyncResult(False, False)
print('NOTICE: --use-superproject is in beta; report any issues to the '
'address described in `repo version`', file=sys.stderr)
should_exit = True should_exit = True
url = self._manifest.superproject['remote'].url url = self._manifest.superproject['remote'].url
if not url: if not url:
self._LogError(f'repo error: superproject URL is not defined in manifest: ' self._LogWarning(f'superproject URL is not defined in manifest: '
f'{self._manifest.manifestFile}') f'{self._manifest.manifestFile}')
return SyncResult(False, should_exit) return SyncResult(False, should_exit)
@ -250,8 +260,8 @@ class Superproject(object):
data = self._LsTree() data = self._LsTree()
if not data: if not data:
print('warning: git ls-tree failed to return data for superproject', self._LogWarning(f'warning: git ls-tree failed to return data for manifest: '
file=sys.stderr) f'{self._manifest.manifestFile}')
return CommitIdsResult(None, True) return CommitIdsResult(None, True)
# Parse lines like the following to select lines starting with '160000' and # Parse lines like the following to select lines starting with '160000' and
@ -270,14 +280,14 @@ class Superproject(object):
self._project_commit_ids = commit_ids self._project_commit_ids = commit_ids
return CommitIdsResult(commit_ids, False) return CommitIdsResult(commit_ids, False)
def _WriteManfiestFile(self): def _WriteManifestFile(self):
"""Writes manifest to a file. """Writes manifest to a file.
Returns: Returns:
manifest_path: Path name of the file into which manifest is written instead of None. manifest_path: Path name of the file into which manifest is written instead of None.
""" """
if not os.path.exists(self._superproject_path): if not os.path.exists(self._superproject_path):
self._LogError(f'error: missing superproject directory: {self._superproject_path}') self._LogWarning(f'missing superproject directory: {self._superproject_path}')
return None return None
manifest_str = self._manifest.ToXml(groups=self._manifest.GetGroupsStr()).toxml() manifest_str = self._manifest.ToXml(groups=self._manifest.GetGroupsStr()).toxml()
manifest_path = self._manifest_path manifest_path = self._manifest_path
@ -285,7 +295,7 @@ class Superproject(object):
with open(manifest_path, 'w', encoding='utf-8') as fp: with open(manifest_path, 'w', encoding='utf-8') as fp:
fp.write(manifest_str) fp.write(manifest_str)
except IOError as e: except IOError as e:
self._LogError(f'error: cannot write manifest to : {manifest_path} {e}') self._LogError(f'cannot write manifest to : {manifest_path} {e}')
return None return None
return manifest_path return manifest_path
@ -321,7 +331,6 @@ class Superproject(object):
commit_ids_result = self._GetAllProjectsCommitIds() commit_ids_result = self._GetAllProjectsCommitIds()
commit_ids = commit_ids_result.commit_ids commit_ids = commit_ids_result.commit_ids
if not commit_ids: if not commit_ids:
print('warning: Cannot get project commit ids from manifest', file=sys.stderr)
return UpdateProjectsResult(None, commit_ids_result.fatal) return UpdateProjectsResult(None, commit_ids_result.fatal)
projects_missing_commit_ids = [] projects_missing_commit_ids = []
@ -336,7 +345,7 @@ class Superproject(object):
# If superproject doesn't have a commit id for a project, then report an # If superproject doesn't have a commit id for a project, then report an
# error event and continue as if do not use superproject is specified. # error event and continue as if do not use superproject is specified.
if projects_missing_commit_ids: if projects_missing_commit_ids:
self._LogError(f'error: please file a bug using {self._manifest.contactinfo.bugurl} ' self._LogWarning(f'please file a bug using {self._manifest.contactinfo.bugurl} '
f'to report missing commit_ids for: {projects_missing_commit_ids}') f'to report missing commit_ids for: {projects_missing_commit_ids}')
return UpdateProjectsResult(None, False) return UpdateProjectsResult(None, False)
@ -344,7 +353,7 @@ class Superproject(object):
if not self._SkipUpdatingProjectRevisionId(project): if not self._SkipUpdatingProjectRevisionId(project):
project.SetRevisionId(commit_ids.get(project.relpath)) project.SetRevisionId(commit_ids.get(project.relpath))
manifest_path = self._WriteManfiestFile() manifest_path = self._WriteManifestFile()
return UpdateProjectsResult(manifest_path, False) return UpdateProjectsResult(manifest_path, False)
@ -352,7 +361,6 @@ class Superproject(object):
def _UseSuperprojectFromConfiguration(): def _UseSuperprojectFromConfiguration():
"""Returns the user choice of whether to use superproject.""" """Returns the user choice of whether to use superproject."""
user_cfg = RepoConfig.ForUser() user_cfg = RepoConfig.ForUser()
system_cfg = RepoConfig.ForSystem()
time_now = int(time.time()) time_now = int(time.time())
user_value = user_cfg.GetBoolean('repo.superprojectChoice') user_value = user_cfg.GetBoolean('repo.superprojectChoice')
@ -361,12 +369,18 @@ def _UseSuperprojectFromConfiguration():
if user_expiration is not None and (user_expiration <= 0 or user_expiration >= time_now): if user_expiration is not None and (user_expiration <= 0 or user_expiration >= time_now):
# TODO(b/190688390) - Remove prompt when we are comfortable with the new # TODO(b/190688390) - Remove prompt when we are comfortable with the new
# default value. # default value.
if user_value:
print(('You are currently enrolled in Git submodules experiment ' print(('You are currently enrolled in Git submodules experiment '
'(go/android-submodules-quickstart). Use --no-use-superproject ' '(go/android-submodules-quickstart). Use --no-use-superproject '
'to override.\n'), file=sys.stderr) 'to override.\n'), file=sys.stderr)
else:
print(('You are not currently enrolled in Git submodules experiment '
'(go/android-submodules-quickstart). Use --use-superproject '
'to override.\n'), file=sys.stderr)
return user_value return user_value
# We don't have an unexpired choice, ask for one. # We don't have an unexpired choice, ask for one.
system_cfg = RepoConfig.ForSystem()
system_value = system_cfg.GetBoolean('repo.superprojectChoice') system_value = system_cfg.GetBoolean('repo.superprojectChoice')
if system_value: if system_value:
# The system configuration is proposing that we should enable the # The system configuration is proposing that we should enable the
@ -413,6 +427,11 @@ def _UseSuperprojectFromConfiguration():
return False return False
def PrintMessages(opt, manifest):
"""Returns a boolean if error/warning messages are to be printed."""
return opt.use_superproject is not None or manifest.superproject
def UseSuperproject(opt, manifest): def UseSuperproject(opt, manifest):
"""Returns a boolean if use-superproject option is enabled.""" """Returns a boolean if use-superproject option is enabled."""

View File

@ -20,7 +20,8 @@ It is equivalent to "git branch \fB\-D\fR <branchname>".
show this help message and exit show this help message and exit
.TP .TP
\fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR \fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR
number of jobs to run in parallel (default: 4) number of jobs to run in parallel (default: based on
number of CPU cores)
.TP .TP
\fB\-\-all\fR \fB\-\-all\fR
delete all branches in all projects delete all branches in all projects

View File

@ -46,7 +46,8 @@ is shown, then the branch appears in all projects.
show this help message and exit show this help message and exit
.TP .TP
\fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR \fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR
number of jobs to run in parallel (default: 4) number of jobs to run in parallel (default: based on
number of CPU cores)
.SS Logging options: .SS Logging options:
.TP .TP
\fB\-v\fR, \fB\-\-verbose\fR \fB\-v\fR, \fB\-\-verbose\fR

View File

@ -15,7 +15,8 @@ Checkout a branch for development
show this help message and exit show this help message and exit
.TP .TP
\fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR \fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR
number of jobs to run in parallel (default: 4) number of jobs to run in parallel (default: based on
number of CPU cores)
.SS Logging options: .SS Logging options:
.TP .TP
\fB\-v\fR, \fB\-\-verbose\fR \fB\-v\fR, \fB\-\-verbose\fR

View File

@ -19,7 +19,8 @@ to the Unix 'patch' command.
show this help message and exit show this help message and exit
.TP .TP
\fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR \fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR
number of jobs to run in parallel (default: 4) number of jobs to run in parallel (default: based on
number of CPU cores)
.TP .TP
\fB\-u\fR, \fB\-\-absolute\fR \fB\-u\fR, \fB\-\-absolute\fR
paths are relative to the repository root paths are relative to the repository root

View File

@ -17,7 +17,8 @@ repo forall \fB\-r\fR str1 [str2] ... \fB\-c\fR <command> [<arg>...]
show this help message and exit show this help message and exit
.TP .TP
\fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR \fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR
number of jobs to run in parallel (default: 4) number of jobs to run in parallel (default: based on
number of CPU cores)
.TP .TP
\fB\-r\fR, \fB\-\-regex\fR \fB\-r\fR, \fB\-\-regex\fR
execute the command only on projects matching regex or execute the command only on projects matching regex or

View File

@ -15,7 +15,8 @@ Print lines matching a pattern
show this help message and exit show this help message and exit
.TP .TP
\fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR \fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR
number of jobs to run in parallel (default: 4) number of jobs to run in parallel (default: based on
number of CPU cores)
.SS Logging options: .SS Logging options:
.TP .TP
\fB\-\-verbose\fR \fB\-\-verbose\fR

View File

@ -15,7 +15,8 @@ Prune (delete) already merged topics
show this help message and exit show this help message and exit
.TP .TP
\fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR \fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR
number of jobs to run in parallel (default: 4) number of jobs to run in parallel (default: based on
number of CPU cores)
.SS Logging options: .SS Logging options:
.TP .TP
\fB\-v\fR, \fB\-\-verbose\fR \fB\-v\fR, \fB\-\-verbose\fR

View File

@ -15,7 +15,8 @@ Update working tree to the latest known good revision
show this help message and exit show this help message and exit
.TP .TP
\fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR \fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR
number of jobs to run in parallel (default: 1) number of jobs to run in parallel (default: based on
number of CPU cores)
.TP .TP
\fB\-\-jobs\-network\fR=\fI\,JOBS\/\fR \fB\-\-jobs\-network\fR=\fI\,JOBS\/\fR
number of network jobs to run in parallel (defaults to number of network jobs to run in parallel (defaults to

View File

@ -15,7 +15,8 @@ Start a new branch for development
show this help message and exit show this help message and exit
.TP .TP
\fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR \fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR
number of jobs to run in parallel (default: 4) number of jobs to run in parallel (default: based on
number of CPU cores)
.TP .TP
\fB\-\-all\fR \fB\-\-all\fR
begin branch in all projects begin branch in all projects

View File

@ -15,7 +15,8 @@ Show the working tree status
show this help message and exit show this help message and exit
.TP .TP
\fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR \fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR
number of jobs to run in parallel (default: 4) number of jobs to run in parallel (default: based on
number of CPU cores)
.TP .TP
\fB\-o\fR, \fB\-\-orphans\fR \fB\-o\fR, \fB\-\-orphans\fR
include objects in working directory outside of repo include objects in working directory outside of repo

View File

@ -15,7 +15,8 @@ Update working tree to the latest revision
show this help message and exit show this help message and exit
.TP .TP
\fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR \fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR
number of jobs to run in parallel (default: 1) number of jobs to run in parallel (default: based on
number of CPU cores)
.TP .TP
\fB\-\-jobs\-network\fR=\fI\,JOBS\/\fR \fB\-\-jobs\-network\fR=\fI\,JOBS\/\fR
number of network jobs to run in parallel (defaults to number of network jobs to run in parallel (defaults to

View File

@ -15,7 +15,8 @@ Upload changes for code review
show this help message and exit show this help message and exit
.TP .TP
\fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR \fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR
number of jobs to run in parallel (default: 4) number of jobs to run in parallel (default: based on
number of CPU cores)
.TP .TP
\fB\-t\fR \fB\-t\fR
send local branch name to Gerrit Code Review send local branch name to Gerrit Code Review

View File

@ -47,6 +47,11 @@ def main(argv):
if not shutil.which('help2man'): if not shutil.which('help2man'):
sys.exit('Please install help2man to continue.') sys.exit('Please install help2man to continue.')
# Let repo know we're generating man pages so it can avoid some dynamic
# behavior (like probing active number of CPUs). We use a weird name &
# value to make it less likely for users to set this var themselves.
os.environ['_REPO_GENERATE_MANPAGES_'] = ' indeed! '
# "repo branch" is an alias for "repo branches". # "repo branch" is an alias for "repo branches".
del subcmds.all_commands['branch'] del subcmds.all_commands['branch']
(MANDIR / 'repo-branch.1').write_text('.so man1/repo-branches.1') (MANDIR / 'repo-branch.1').write_text('.so man1/repo-branches.1')

View File

@ -298,10 +298,12 @@ later is required to fix a server side protocol bug.
Returns: Returns:
Returns path to the overriding manifest file instead of None. Returns path to the overriding manifest file instead of None.
""" """
print_messages = git_superproject.PrintMessages(opt, self.manifest)
superproject = git_superproject.Superproject(self.manifest, superproject = git_superproject.Superproject(self.manifest,
self.repodir, self.repodir,
self.git_event_log, self.git_event_log,
quiet=opt.quiet) quiet=opt.quiet,
print_messages=print_messages)
if opt.local_only: if opt.local_only:
manifest_path = superproject.manifest_path manifest_path = superproject.manifest_path
if manifest_path: if manifest_path:
@ -317,6 +319,7 @@ later is required to fix a server side protocol bug.
if manifest_path: if manifest_path:
self._ReloadManifest(manifest_path, load_local_manifests) self._ReloadManifest(manifest_path, load_local_manifests)
else: else:
if print_messages:
print('warning: Update of revisionId from superproject has failed, ' print('warning: Update of revisionId from superproject has failed, '
'repo sync will not use superproject to fetch the source. ', 'repo sync will not use superproject to fetch the source. ',
'Please resync with the --no-use-superproject option to avoid this repo warning.', 'Please resync with the --no-use-superproject option to avoid this repo warning.',
@ -970,6 +973,7 @@ later is required to fix a server side protocol bug.
superproject_logging_data = { superproject_logging_data = {
'superproject': use_superproject, 'superproject': use_superproject,
'haslocalmanifests': bool(self.manifest.HasLocalManifests), 'haslocalmanifests': bool(self.manifest.HasLocalManifests),
'hassuperprojecttag': bool(self.manifest.superproject),
} }
if use_superproject: if use_superproject:
manifest_name = self._UpdateProjectsRevisionId( manifest_name = self._UpdateProjectsRevisionId(

View File

@ -12,7 +12,7 @@
intm = 10m intm = 10m
intg = 10g intg = 10g
[repo "syncstate.main"] [repo "syncstate.main"]
synctime = 2021-07-29T22:07:43.463365Z synctime = 2021-08-13T18:37:43.928600Z
version = 1 version = 1
[repo "syncstate.sys"] [repo "syncstate.sys"]
argv = ['/usr/bin/pytest-3'] argv = ['/usr/bin/pytest-3']

View File

@ -203,7 +203,7 @@ class SuperprojectTestCase(unittest.TestCase):
project.SetRevisionId('ABCDEF') project.SetRevisionId('ABCDEF')
# Create temporary directory so that it can write the file. # Create temporary directory so that it can write the file.
os.mkdir(self._superproject._superproject_path) os.mkdir(self._superproject._superproject_path)
manifest_path = self._superproject._WriteManfiestFile() manifest_path = self._superproject._WriteManifestFile()
self.assertIsNotNone(manifest_path) self.assertIsNotNone(manifest_path)
with open(manifest_path, 'r') as fp: with open(manifest_path, 'r') as fp:
manifest_xml_data = fp.read() manifest_xml_data = fp.read()