summaryrefslogtreecommitdiffstats
path: root/subcmds/status.py
diff options
context:
space:
mode:
authorLaMont Jones <lamontjones@google.com>2022-06-22 19:21:15 +0000
committerLaMont Jones <lamontjones@google.com>2022-07-14 16:00:18 +0000
commit8501d4602a4c85f1e22c7a51ad191af8166efecd (patch)
treee8c5bf46c22f029412b35fc48c04daed73cde633 /subcmds/status.py
parent8db78c7d4db84ff9e191457bbf4b1254da321c7e (diff)
downloadgit-repo-8501d4602a4c85f1e22c7a51ad191af8166efecd.tar.gz
status, diff: display correct path for multi-manifest
Display the project path relative to the outermost manifest by default, and relative to the sub manifest only when --this-manifest-only is specified. For project-related diagnostic messages, use the outermost manifest for messages. Change-Id: I4537d7dd412a2c182e77d6720e95c1b0ef70eb0e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/340754 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: LaMont Jones <lamontjones@google.com>
Diffstat (limited to 'subcmds/status.py')
-rw-r--r--subcmds/status.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/subcmds/status.py b/subcmds/status.py
index 0aa4200f..572c72f7 100644
--- a/subcmds/status.py
+++ b/subcmds/status.py
@@ -83,7 +83,7 @@ the following meanings:
83 dest='orphans', action='store_true', 83 dest='orphans', action='store_true',
84 help="include objects in working directory outside of repo projects") 84 help="include objects in working directory outside of repo projects")
85 85
86 def _StatusHelper(self, quiet, project): 86 def _StatusHelper(self, quiet, local, project):
87 """Obtains the status for a specific project. 87 """Obtains the status for a specific project.
88 88
89 Obtains the status for a project, redirecting the output to 89 Obtains the status for a project, redirecting the output to
@@ -91,13 +91,17 @@ the following meanings:
91 91
92 Args: 92 Args:
93 quiet: Where to output the status. 93 quiet: Where to output the status.
94 local: a boolean, if True, the path is relative to the local
95 (sub)manifest. If false, the path is relative to the
96 outermost manifest.
94 project: Project to get status of. 97 project: Project to get status of.
95 98
96 Returns: 99 Returns:
97 The status of the project. 100 The status of the project.
98 """ 101 """
99 buf = io.StringIO() 102 buf = io.StringIO()
100 ret = project.PrintWorkTreeStatus(quiet=quiet, output_redir=buf) 103 ret = project.PrintWorkTreeStatus(quiet=quiet, output_redir=buf,
104 local=local)
101 return (ret, buf.getvalue()) 105 return (ret, buf.getvalue())
102 106
103 def _FindOrphans(self, dirs, proj_dirs, proj_dirs_parents, outstring): 107 def _FindOrphans(self, dirs, proj_dirs, proj_dirs_parents, outstring):
@@ -130,7 +134,7 @@ the following meanings:
130 134
131 counter = self.ExecuteInParallel( 135 counter = self.ExecuteInParallel(
132 opt.jobs, 136 opt.jobs,
133 functools.partial(self._StatusHelper, opt.quiet), 137 functools.partial(self._StatusHelper, opt.quiet, opt.this_manifest_only),
134 all_projects, 138 all_projects,
135 callback=_ProcessResults, 139 callback=_ProcessResults,
136 ordered=True) 140 ordered=True)