summaryrefslogtreecommitdiffstats
path: root/subcmds/stage.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/stage.py
parent87cce68b28c34fa86895baa8d7f48307382e6c75 (diff)
downloadgit-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/stage.py')
-rw-r--r--subcmds/stage.py11
1 files changed, 8 insertions, 3 deletions
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.
50 self.Usage() 50 self.Usage()
51 51
52 def _Interactive(self, opt, args): 52 def _Interactive(self, opt, args):
53 all_projects = [p for p in self.GetProjects(args) if p.IsDirty()] 53 all_projects = [
54 p for p in self.GetProjects(args, all_manifests=not opt.this_manifest_only)
55 if p.IsDirty()]
54 if not all_projects: 56 if not all_projects:
55 print('no projects have uncommitted modifications', file=sys.stderr) 57 print('no projects have uncommitted modifications', file=sys.stderr)
56 return 58 return
@@ -62,7 +64,8 @@ The '%prog' command stages files to prepare the next commit.
62 64
63 for i in range(len(all_projects)): 65 for i in range(len(all_projects)):
64 project = all_projects[i] 66 project = all_projects[i]
65 out.write('%3d: %s', i + 1, project.relpath + '/') 67 out.write('%3d: %s', i + 1,
68 project.RelPath(local=opt.this_manifest_only) + '/')
66 out.nl() 69 out.nl()
67 out.nl() 70 out.nl()
68 71
@@ -99,7 +102,9 @@ The '%prog' command stages files to prepare the next commit.
99 _AddI(all_projects[a_index - 1]) 102 _AddI(all_projects[a_index - 1])
100 continue 103 continue
101 104
102 projects = [p for p in all_projects if a in [p.name, p.relpath]] 105 projects = [
106 p for p in all_projects
107 if a in [p.name, p.RelPath(local=opt.this_manifest_only)]]
103 if len(projects) == 1: 108 if len(projects) == 1:
104 _AddI(projects[0]) 109 _AddI(projects[0])
105 continue 110 continue