From cc879a97c3e2614d19b15b4661c3cab4d33139c9 Mon Sep 17 00:00:00 2001 From: LaMont Jones Date: Thu, 18 Nov 2021 22:40:18 +0000 Subject: Add multi-manifest support with element 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 Reviewed-by: Mike Frysinger --- subcmds/info.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'subcmds/info.py') 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): self.opt = opt + if not opt.this_manifest_only: + self.manifest = self.manifest.outer_client manifestConfig = self.manifest.manifestProject.config mergeBranch = manifestConfig.GetBranch("default").merge manifestGroups = (manifestConfig.GetString('manifest.groups') @@ -80,17 +82,17 @@ class Info(PagedCommand): self.printSeparator() if not opt.overview: - self.printDiffInfo(args) + self._printDiffInfo(opt, args) else: - self.printCommitOverview(args) + self._printCommitOverview(opt, args) def printSeparator(self): self.text("----------------------------") self.out.nl() - def printDiffInfo(self, args): + def _printDiffInfo(self, opt, args): # We let exceptions bubble up to main as they'll be well structured. - projs = self.GetProjects(args) + projs = self.GetProjects(args, all_manifests=not opt.this_manifest_only) for p in projs: self.heading("Project: ") @@ -179,9 +181,9 @@ class Info(PagedCommand): self.text(" ".join(split[1:])) self.out.nl() - def printCommitOverview(self, args): + def _printCommitOverview(self, opt, args): all_branches = [] - for project in self.GetProjects(args): + for project in self.GetProjects(args, all_manifests=not opt.this_manifest_only): br = [project.GetUploadableBranch(x) for x in project.GetBranches()] br = [x for x in br if x] @@ -200,7 +202,7 @@ class Info(PagedCommand): if project != branch.project: project = branch.project self.out.nl() - self.headtext(project.relpath) + self.headtext(project.RelPath(local=opt.this_manifest_only)) self.out.nl() commits = branch.commits -- cgit v1.2.3-54-g00ecf