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/rebase.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'subcmds/rebase.py') diff --git a/subcmds/rebase.py b/subcmds/rebase.py index 7c53eb7a..3d1a63e4 100644 --- a/subcmds/rebase.py +++ b/subcmds/rebase.py @@ -69,7 +69,7 @@ branch but need to incorporate new upstream changes "underneath" them. 'consistent if you previously synced to a manifest)') def Execute(self, opt, args): - all_projects = self.GetProjects(args) + all_projects = self.GetProjects(args, all_manifests=not opt.this_manifest_only) one_project = len(all_projects) == 1 if opt.interactive and not one_project: @@ -98,6 +98,7 @@ branch but need to incorporate new upstream changes "underneath" them. config = self.manifest.manifestProject.config out = RebaseColoring(config) out.redirect(sys.stdout) + _RelPath = lambda p: p.RelPath(local=opt.this_manifest_only) ret = 0 for project in all_projects: @@ -107,7 +108,7 @@ branch but need to incorporate new upstream changes "underneath" them. cb = project.CurrentBranch if not cb: if one_project: - print("error: project %s has a detached HEAD" % project.relpath, + print("error: project %s has a detached HEAD" % _RelPath(project), file=sys.stderr) return 1 # ignore branches with detatched HEADs @@ -117,7 +118,7 @@ branch but need to incorporate new upstream changes "underneath" them. if not upbranch.LocalMerge: if one_project: print("error: project %s does not track any remote branches" - % project.relpath, file=sys.stderr) + % _RelPath(project), file=sys.stderr) return 1 # ignore branches without remotes continue @@ -130,7 +131,7 @@ branch but need to incorporate new upstream changes "underneath" them. args.append(upbranch.LocalMerge) out.project('project %s: rebasing %s -> %s', - project.relpath, cb, upbranch.LocalMerge) + _RelPath(project), cb, upbranch.LocalMerge) out.nl() out.flush() -- cgit v1.2.3-54-g00ecf