From 8501d4602a4c85f1e22c7a51ad191af8166efecd Mon Sep 17 00:00:00 2001 From: LaMont Jones Date: Wed, 22 Jun 2022 19:21:15 +0000 Subject: 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 Tested-by: LaMont Jones --- subcmds/status.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'subcmds/status.py') 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: dest='orphans', action='store_true', help="include objects in working directory outside of repo projects") - def _StatusHelper(self, quiet, project): + def _StatusHelper(self, quiet, local, project): """Obtains the status for a specific project. Obtains the status for a project, redirecting the output to @@ -91,13 +91,17 @@ the following meanings: Args: quiet: Where to output the status. + local: a boolean, if True, the path is relative to the local + (sub)manifest. If false, the path is relative to the + outermost manifest. project: Project to get status of. Returns: The status of the project. """ buf = io.StringIO() - ret = project.PrintWorkTreeStatus(quiet=quiet, output_redir=buf) + ret = project.PrintWorkTreeStatus(quiet=quiet, output_redir=buf, + local=local) return (ret, buf.getvalue()) def _FindOrphans(self, dirs, proj_dirs, proj_dirs_parents, outstring): @@ -130,7 +134,7 @@ the following meanings: counter = self.ExecuteInParallel( opt.jobs, - functools.partial(self._StatusHelper, opt.quiet), + functools.partial(self._StatusHelper, opt.quiet, opt.this_manifest_only), all_projects, callback=_ProcessResults, ordered=True) -- cgit v1.2.3-54-g00ecf