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/abandon.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'subcmds/abandon.py') diff --git a/subcmds/abandon.py b/subcmds/abandon.py index 85d85f5a..c3d2d5b7 100644 --- a/subcmds/abandon.py +++ b/subcmds/abandon.py @@ -69,7 +69,8 @@ It is equivalent to "git branch -D ". nb = args[0] err = defaultdict(list) success = defaultdict(list) - all_projects = self.GetProjects(args[1:]) + all_projects = self.GetProjects(args[1:], all_manifests=not opt.this_manifest_only) + _RelPath = lambda p: p.RelPath(local=opt.this_manifest_only) def _ProcessResults(_pool, pm, states): for (results, project) in states: @@ -94,7 +95,7 @@ It is equivalent to "git branch -D ". err_msg = "error: cannot abandon %s" % br print(err_msg, file=sys.stderr) for proj in err[br]: - print(' ' * len(err_msg) + " | %s" % proj.relpath, file=sys.stderr) + print(' ' * len(err_msg) + " | %s" % _RelPath(proj), file=sys.stderr) sys.exit(1) elif not success: print('error: no project has local branch(es) : %s' % nb, @@ -110,5 +111,5 @@ It is equivalent to "git branch -D ". result = "all project" else: result = "%s" % ( - ('\n' + ' ' * width + '| ').join(p.relpath for p in success[br])) + ('\n' + ' ' * width + '| ').join(_RelPath(p) for p in success[br])) print("%s%s| %s\n" % (br, ' ' * (width - len(br)), result)) -- cgit v1.2.3-54-g00ecf