diff options
| author | Andrew Wheeler <agwheeler@gmail.com> | 2012-02-27 13:52:22 -0600 | 
|---|---|---|
| committer | Andrew Wheeler <agwheeler@gmail.com> | 2016-10-17 15:24:09 -0500 | 
| commit | 4d5bb68d58f12885ea06fb73d5e17d8c780c9ff8 (patch) | |
| tree | 9388a9c030c05bb8780a8bfaa1ff962f2dac1afb /project.py | |
| parent | 82f67987a3e665f9c66e8fb944042a1b4815b61b (diff) | |
| download | git-repo-4d5bb68d58f12885ea06fb73d5e17d8c780c9ff8.tar.gz | |
status: add -q/--quiet option
The --quiet option reduces the output to just
a list of projects with modified workspaces (and
orphans if -o is specified)
A common use case is when performing a full-workspace
merge.  The integrator will kick-off a merge via:
    repo forall -c git merge <some tag>
And then produce a short list of conflicted projects via:
    repo status -q
The integrator can then iteratively fix and clean up all conficted
components.  The merge is complete when:
    repo status -q
    returns no output.
Change-Id: Ibbba8713eac35befd8287c95948874e23fd5c7e2
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 ***)') | 
