diff options
Diffstat (limited to 'subcmds')
-rw-r--r-- | subcmds/diff.py | 9 | ||||
-rw-r--r-- | subcmds/status.py | 10 |
2 files changed, 13 insertions, 6 deletions
diff --git a/subcmds/diff.py b/subcmds/diff.py index a1f4ba88..a606ee9a 100644 --- a/subcmds/diff.py +++ b/subcmds/diff.py | |||
@@ -35,18 +35,21 @@ to the Unix 'patch' command. | |||
35 | dest='absolute', action='store_true', | 35 | dest='absolute', action='store_true', |
36 | help='paths are relative to the repository root') | 36 | help='paths are relative to the repository root') |
37 | 37 | ||
38 | def _ExecuteOne(self, absolute, project): | 38 | def _ExecuteOne(self, absolute, local, project): |
39 | """Obtains the diff for a specific project. | 39 | """Obtains the diff for a specific project. |
40 | 40 | ||
41 | Args: | 41 | Args: |
42 | absolute: Paths are relative to the root. | 42 | absolute: Paths are relative to the root. |
43 | local: a boolean, if True, the path is relative to the local | ||
44 | (sub)manifest. If false, the path is relative to the | ||
45 | outermost manifest. | ||
43 | project: Project to get status of. | 46 | project: Project to get status of. |
44 | 47 | ||
45 | Returns: | 48 | Returns: |
46 | The status of the project. | 49 | The status of the project. |
47 | """ | 50 | """ |
48 | buf = io.StringIO() | 51 | buf = io.StringIO() |
49 | ret = project.PrintWorkTreeDiff(absolute, output_redir=buf) | 52 | ret = project.PrintWorkTreeDiff(absolute, output_redir=buf, local=local) |
50 | return (ret, buf.getvalue()) | 53 | return (ret, buf.getvalue()) |
51 | 54 | ||
52 | def Execute(self, opt, args): | 55 | def Execute(self, opt, args): |
@@ -63,7 +66,7 @@ to the Unix 'patch' command. | |||
63 | 66 | ||
64 | return self.ExecuteInParallel( | 67 | return self.ExecuteInParallel( |
65 | opt.jobs, | 68 | opt.jobs, |
66 | functools.partial(self._ExecuteOne, opt.absolute), | 69 | functools.partial(self._ExecuteOne, opt.absolute, opt.this_manifest_only), |
67 | all_projects, | 70 | all_projects, |
68 | callback=_ProcessResults, | 71 | callback=_ProcessResults, |
69 | ordered=True) | 72 | ordered=True) |
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) |