From 4655e81a75f2ea5f1eaf93de1249886171281e61 Mon Sep 17 00:00:00 2001 From: Terence Haddock Date: Thu, 31 Mar 2011 12:33:34 +0200 Subject: Add option to check status of projects in parallel. Change-Id: I6ac653f88573def8bb3d96031d3570ff966251ad --- project.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'project.py') 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): return False - def PrintWorkTreeStatus(self): + def PrintWorkTreeStatus(self, output_redir=None): """Prints the status of the repository to stdout. + + Args: + output: If specified, redirect the output to this object. """ if not os.path.isdir(self.worktree): - print '' - print 'project %s/' % self.relpath - print ' missing (run "repo sync")' + if output_redir == None: + output_redir = sys.stdout + print >>output_redir, '' + print >>output_redir, 'project %s/' % self.relpath + print >>output_redir, ' missing (run "repo sync")' return self.work_git.update_index('-q', @@ -671,6 +676,8 @@ class Project(object): return 'CLEAN' out = StatusColoring(self.config) + if not output_redir == None: + out.redirect(output_redir) out.project('project %-40s', self.relpath + '/') branch = self.CurrentBranch @@ -720,6 +727,7 @@ class Project(object): else: out.write('%s', line) out.nl() + return 'DIRTY' def PrintWorkTreeDiff(self): -- cgit v1.2.3-54-g00ecf