diff options
author | LaMont Jones <lamontjones@google.com> | 2021-11-18 22:40:18 +0000 |
---|---|---|
committer | LaMont Jones <lamontjones@google.com> | 2022-02-17 21:57:55 +0000 |
commit | cc879a97c3e2614d19b15b4661c3cab4d33139c9 (patch) | |
tree | 69d225e9f0e9d79fec8f423d9c40c275f0bf3b8c /subcmds/abandon.py | |
parent | 87cce68b28c34fa86895baa8d7f48307382e6c75 (diff) | |
download | git-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/abandon.py')
-rw-r--r-- | subcmds/abandon.py | 7 |
1 files changed, 4 insertions, 3 deletions
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 <branchname>". | |||
69 | nb = args[0] | 69 | nb = args[0] |
70 | err = defaultdict(list) | 70 | err = defaultdict(list) |
71 | success = defaultdict(list) | 71 | success = defaultdict(list) |
72 | all_projects = self.GetProjects(args[1:]) | 72 | all_projects = self.GetProjects(args[1:], all_manifests=not opt.this_manifest_only) |
73 | _RelPath = lambda p: p.RelPath(local=opt.this_manifest_only) | ||
73 | 74 | ||
74 | def _ProcessResults(_pool, pm, states): | 75 | def _ProcessResults(_pool, pm, states): |
75 | for (results, project) in states: | 76 | for (results, project) in states: |
@@ -94,7 +95,7 @@ It is equivalent to "git branch -D <branchname>". | |||
94 | err_msg = "error: cannot abandon %s" % br | 95 | err_msg = "error: cannot abandon %s" % br |
95 | print(err_msg, file=sys.stderr) | 96 | print(err_msg, file=sys.stderr) |
96 | for proj in err[br]: | 97 | for proj in err[br]: |
97 | print(' ' * len(err_msg) + " | %s" % proj.relpath, file=sys.stderr) | 98 | print(' ' * len(err_msg) + " | %s" % _RelPath(proj), file=sys.stderr) |
98 | sys.exit(1) | 99 | sys.exit(1) |
99 | elif not success: | 100 | elif not success: |
100 | print('error: no project has local branch(es) : %s' % nb, | 101 | print('error: no project has local branch(es) : %s' % nb, |
@@ -110,5 +111,5 @@ It is equivalent to "git branch -D <branchname>". | |||
110 | result = "all project" | 111 | result = "all project" |
111 | else: | 112 | else: |
112 | result = "%s" % ( | 113 | result = "%s" % ( |
113 | ('\n' + ' ' * width + '| ').join(p.relpath for p in success[br])) | 114 | ('\n' + ' ' * width + '| ').join(_RelPath(p) for p in success[br])) |
114 | print("%s%s| %s\n" % (br, ' ' * (width - len(br)), result)) | 115 | print("%s%s| %s\n" % (br, ' ' * (width - len(br)), result)) |