summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorTerence Haddock <thaddock@google.com>2011-03-31 12:33:34 +0200
committerShawn O. Pearce <sop@google.com>2011-04-07 16:36:42 -0400
commit4655e81a75f2ea5f1eaf93de1249886171281e61 (patch)
tree81ff7048880220c90c9ab0a7c5346a8dfab32a6d /project.py
parent723c5dc3d62fe07ba4faa17434870917ae87ce9d (diff)
downloadgit-repo-4655e81a75f2ea5f1eaf93de1249886171281e61.tar.gz
Add option to check status of projects in parallel.
Change-Id: I6ac653f88573def8bb3d96031d3570ff966251ad
Diffstat (limited to 'project.py')
-rw-r--r--project.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/project.py b/project.py
index 4cef856b..9d98041f 100644
--- a/project.py
+++ b/project.py
@@ -650,13 +650,18 @@ class Project(object):
650 650
651 return False 651 return False
652 652
653 def PrintWorkTreeStatus(self): 653 def PrintWorkTreeStatus(self, output_redir=None):
654 """Prints the status of the repository to stdout. 654 """Prints the status of the repository to stdout.
655
656 Args:
657 output: If specified, redirect the output to this object.
655 """ 658 """
656 if not os.path.isdir(self.worktree): 659 if not os.path.isdir(self.worktree):
657 print '' 660 if output_redir == None:
658 print 'project %s/' % self.relpath 661 output_redir = sys.stdout
659 print ' missing (run "repo sync")' 662 print >>output_redir, ''
663 print >>output_redir, 'project %s/' % self.relpath
664 print >>output_redir, ' missing (run "repo sync")'
660 return 665 return
661 666
662 self.work_git.update_index('-q', 667 self.work_git.update_index('-q',
@@ -671,6 +676,8 @@ class Project(object):
671 return 'CLEAN' 676 return 'CLEAN'
672 677
673 out = StatusColoring(self.config) 678 out = StatusColoring(self.config)
679 if not output_redir == None:
680 out.redirect(output_redir)
674 out.project('project %-40s', self.relpath + '/') 681 out.project('project %-40s', self.relpath + '/')
675 682
676 branch = self.CurrentBranch 683 branch = self.CurrentBranch
@@ -720,6 +727,7 @@ class Project(object):
720 else: 727 else:
721 out.write('%s', line) 728 out.write('%s', line)
722 out.nl() 729 out.nl()
730
723 return 'DIRTY' 731 return 'DIRTY'
724 732
725 def PrintWorkTreeDiff(self): 733 def PrintWorkTreeDiff(self):