diff options
author | LaMont Jones <lamontjones@google.com> | 2021-11-18 22:40:18 +0000 |
---|---|---|
committer | LaMont Jones <lamontjones@google.com> | 2022-02-17 21:57:55 +0000 |
commit | cc879a97c3e2614d19b15b4661c3cab4d33139c9 (patch) | |
tree | 69d225e9f0e9d79fec8f423d9c40c275f0bf3b8c /subcmds/download.py | |
parent | 87cce68b28c34fa86895baa8d7f48307382e6c75 (diff) | |
download | git-repo-cc879a97c3e2614d19b15b4661c3cab4d33139c9.tar.gz |
Add multi-manifest support with <submanifest> elementv2.22
To be addressed in another change:
- a partial `repo sync` (with a list of projects/paths to sync)
requires `--this-tree-only`.
Change-Id: I6c7400bf001540e9d7694fa70934f8f204cb5f57
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/322657
Tested-by: LaMont Jones <lamontjones@google.com>
Reviewed-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'subcmds/download.py')
-rw-r--r-- | subcmds/download.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/subcmds/download.py b/subcmds/download.py index 523f25e0..15824843 100644 --- a/subcmds/download.py +++ b/subcmds/download.py | |||
@@ -48,7 +48,7 @@ If no project is specified try to use current directory as a project. | |||
48 | dest='ffonly', action='store_true', | 48 | dest='ffonly', action='store_true', |
49 | help="force fast-forward merge") | 49 | help="force fast-forward merge") |
50 | 50 | ||
51 | def _ParseChangeIds(self, args): | 51 | def _ParseChangeIds(self, opt, args): |
52 | if not args: | 52 | if not args: |
53 | self.Usage() | 53 | self.Usage() |
54 | 54 | ||
@@ -77,7 +77,7 @@ If no project is specified try to use current directory as a project. | |||
77 | ps_id = max(int(match.group(1)), ps_id) | 77 | ps_id = max(int(match.group(1)), ps_id) |
78 | to_get.append((project, chg_id, ps_id)) | 78 | to_get.append((project, chg_id, ps_id)) |
79 | else: | 79 | else: |
80 | projects = self.GetProjects([a]) | 80 | projects = self.GetProjects([a], all_manifests=not opt.this_manifest_only) |
81 | if len(projects) > 1: | 81 | if len(projects) > 1: |
82 | # If the cwd is one of the projects, assume they want that. | 82 | # If the cwd is one of the projects, assume they want that. |
83 | try: | 83 | try: |
@@ -88,8 +88,8 @@ If no project is specified try to use current directory as a project. | |||
88 | print('error: %s matches too many projects; please re-run inside ' | 88 | print('error: %s matches too many projects; please re-run inside ' |
89 | 'the project checkout.' % (a,), file=sys.stderr) | 89 | 'the project checkout.' % (a,), file=sys.stderr) |
90 | for project in projects: | 90 | for project in projects: |
91 | print(' %s/ @ %s' % (project.relpath, project.revisionExpr), | 91 | print(' %s/ @ %s' % (project.RelPath(local=opt.this_manifest_only), |
92 | file=sys.stderr) | 92 | project.revisionExpr), file=sys.stderr) |
93 | sys.exit(1) | 93 | sys.exit(1) |
94 | else: | 94 | else: |
95 | project = projects[0] | 95 | project = projects[0] |
@@ -105,7 +105,7 @@ If no project is specified try to use current directory as a project. | |||
105 | self.OptionParser.error('-x and --ff are mutually exclusive options') | 105 | self.OptionParser.error('-x and --ff are mutually exclusive options') |
106 | 106 | ||
107 | def Execute(self, opt, args): | 107 | def Execute(self, opt, args): |
108 | for project, change_id, ps_id in self._ParseChangeIds(args): | 108 | for project, change_id, ps_id in self._ParseChangeIds(opt, args): |
109 | dl = project.DownloadPatchSet(change_id, ps_id) | 109 | dl = project.DownloadPatchSet(change_id, ps_id) |
110 | if not dl: | 110 | if not dl: |
111 | print('[%s] change %d/%d not found' | 111 | print('[%s] change %d/%d not found' |