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/stage.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'subcmds/stage.py') diff --git a/subcmds/stage.py b/subcmds/stage.py index 0389a4ff..5f17cb64 100644 --- a/subcmds/stage.py +++ b/subcmds/stage.py @@ -50,7 +50,9 @@ The '%prog' command stages files to prepare the next commit. self.Usage() def _Interactive(self, opt, args): - all_projects = [p for p in self.GetProjects(args) if p.IsDirty()] + all_projects = [ + p for p in self.GetProjects(args, all_manifests=not opt.this_manifest_only) + if p.IsDirty()] if not all_projects: print('no projects have uncommitted modifications', file=sys.stderr) return @@ -62,7 +64,8 @@ The '%prog' command stages files to prepare the next commit. for i in range(len(all_projects)): project = all_projects[i] - out.write('%3d: %s', i + 1, project.relpath + '/') + out.write('%3d: %s', i + 1, + project.RelPath(local=opt.this_manifest_only) + '/') out.nl() out.nl() @@ -99,7 +102,9 @@ The '%prog' command stages files to prepare the next commit. _AddI(all_projects[a_index - 1]) continue - projects = [p for p in all_projects if a in [p.name, p.relpath]] + projects = [ + p for p in all_projects + if a in [p.name, p.RelPath(local=opt.this_manifest_only)]] if len(projects) == 1: _AddI(projects[0]) continue -- cgit v1.2.3-54-g00ecf