diff options
Diffstat (limited to 'project.py')
| -rw-r--r-- | project.py | 8 |
1 files changed, 7 insertions, 1 deletions
| @@ -911,11 +911,13 @@ class Project(object): | |||
| 911 | else: | 911 | else: |
| 912 | return False | 912 | return False |
| 913 | 913 | ||
| 914 | def PrintWorkTreeStatus(self, output_redir=None): | 914 | def PrintWorkTreeStatus(self, output_redir=None, quiet=False): |
| 915 | """Prints the status of the repository to stdout. | 915 | """Prints the status of the repository to stdout. |
| 916 | 916 | ||
| 917 | Args: | 917 | Args: |
| 918 | output: If specified, redirect the output to this object. | 918 | output: If specified, redirect the output to this object. |
| 919 | quiet: If True then only print the project name. Do not print | ||
| 920 | the modified files, branch name, etc. | ||
| 919 | """ | 921 | """ |
| 920 | if not os.path.isdir(self.worktree): | 922 | if not os.path.isdir(self.worktree): |
| 921 | if output_redir is None: | 923 | if output_redir is None: |
| @@ -941,6 +943,10 @@ class Project(object): | |||
| 941 | out.redirect(output_redir) | 943 | out.redirect(output_redir) |
| 942 | out.project('project %-40s', self.relpath + '/ ') | 944 | out.project('project %-40s', self.relpath + '/ ') |
| 943 | 945 | ||
| 946 | if quiet: | ||
| 947 | out.nl() | ||
| 948 | return 'DIRTY' | ||
| 949 | |||
| 944 | branch = self.CurrentBranch | 950 | branch = self.CurrentBranch |
| 945 | if branch is None: | 951 | if branch is None: |
| 946 | out.nobranch('(*** NO BRANCH ***)') | 952 | out.nobranch('(*** NO BRANCH ***)') |
