summaryrefslogtreecommitdiffstats
path: root/subcmds/info.py
diff options
context:
space:
mode:
authorLaMont Jones <lamontjones@google.com>2021-11-18 22:40:18 +0000
committerLaMont Jones <lamontjones@google.com>2022-02-17 21:57:55 +0000
commitcc879a97c3e2614d19b15b4661c3cab4d33139c9 (patch)
tree69d225e9f0e9d79fec8f423d9c40c275f0bf3b8c /subcmds/info.py
parent87cce68b28c34fa86895baa8d7f48307382e6c75 (diff)
downloadgit-repo-c4d9261b7e87a03fa3b0403d4811d05bbbddc0a4.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/info.py')
-rw-r--r--subcmds/info.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/subcmds/info.py b/subcmds/info.py
index 6c1246ef..4bedf9d5 100644
--- a/subcmds/info.py
+++ b/subcmds/info.py
@@ -61,6 +61,8 @@ class Info(PagedCommand):
61 61
62 self.opt = opt 62 self.opt = opt
63 63
64 if not opt.this_manifest_only:
65 self.manifest = self.manifest.outer_client
64 manifestConfig = self.manifest.manifestProject.config 66 manifestConfig = self.manifest.manifestProject.config
65 mergeBranch = manifestConfig.GetBranch("default").merge 67 mergeBranch = manifestConfig.GetBranch("default").merge
66 manifestGroups = (manifestConfig.GetString('manifest.groups') 68 manifestGroups = (manifestConfig.GetString('manifest.groups')
@@ -80,17 +82,17 @@ class Info(PagedCommand):
80 self.printSeparator() 82 self.printSeparator()
81 83
82 if not opt.overview: 84 if not opt.overview:
83 self.printDiffInfo(args) 85 self._printDiffInfo(opt, args)
84 else: 86 else:
85 self.printCommitOverview(args) 87 self._printCommitOverview(opt, args)
86 88
87 def printSeparator(self): 89 def printSeparator(self):
88 self.text("----------------------------") 90 self.text("----------------------------")
89 self.out.nl() 91 self.out.nl()
90 92
91 def printDiffInfo(self, args): 93 def _printDiffInfo(self, opt, args):
92 # We let exceptions bubble up to main as they'll be well structured. 94 # We let exceptions bubble up to main as they'll be well structured.
93 projs = self.GetProjects(args) 95 projs = self.GetProjects(args, all_manifests=not opt.this_manifest_only)
94 96
95 for p in projs: 97 for p in projs:
96 self.heading("Project: ") 98 self.heading("Project: ")
@@ -179,9 +181,9 @@ class Info(PagedCommand):
179 self.text(" ".join(split[1:])) 181 self.text(" ".join(split[1:]))
180 self.out.nl() 182 self.out.nl()
181 183
182 def printCommitOverview(self, args): 184 def _printCommitOverview(self, opt, args):
183 all_branches = [] 185 all_branches = []
184 for project in self.GetProjects(args): 186 for project in self.GetProjects(args, all_manifests=not opt.this_manifest_only):
185 br = [project.GetUploadableBranch(x) 187 br = [project.GetUploadableBranch(x)
186 for x in project.GetBranches()] 188 for x in project.GetBranches()]
187 br = [x for x in br if x] 189 br = [x for x in br if x]
@@ -200,7 +202,7 @@ class Info(PagedCommand):
200 if project != branch.project: 202 if project != branch.project:
201 project = branch.project 203 project = branch.project
202 self.out.nl() 204 self.out.nl()
203 self.headtext(project.relpath) 205 self.headtext(project.RelPath(local=opt.this_manifest_only))
204 self.out.nl() 206 self.out.nl()
205 207
206 commits = branch.commits 208 commits = branch.commits