Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1973)

Unified Diff: Tools/Scripts/webkitpy/tool/commands/rebaseline.py

Issue 327633003: Fix rebaseline-o-matic logging. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Tools/Scripts/webkitpy/tool/commands/rebaseline.py
diff --git a/Tools/Scripts/webkitpy/tool/commands/rebaseline.py b/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
index 4ab1ee1094bf99a9057f96f01ff58413da5037c1..5e4c3279ca532d99e0dd381e07e85994a8735dde 100644
--- a/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
+++ b/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
@@ -877,25 +877,36 @@ class RebaselineOMatic(AbstractDeclarativeCommand):
query['newentry'] = 'on'
urllib2.urlopen("http://" + self.LOG_SERVER + "/updatelog", data=urllib.urlencode(query))
+ def _log_line(self, handle):
+ out = handle.readline().rstrip('\n')
+ if out:
+ if self._verbose:
+ print out
+ self._log_to_server(out)
+ return out
+
+ def _log_remaining_lines(self, handle):
+ out = self._log_line(handle)
+ while out:
+ out = self._log_line(handle)
+
def _run_logged_command(self, command):
process = self._tool.executive.popen(command, stdout=self._tool.executive.PIPE, stderr=self._tool.executive.PIPE)
while process.poll() == None:
# FIXME: This should probably batch up lines if they're available and log to the server once.
- out = process.stdout.readline()
- if out:
- self._log_to_server(out)
+ self._log_line(process.stdout)
+ self._log_line(process.stderr)
- err = process.stderr.readline()
- if err:
- self._log_to_server(err)
+ self._log_remaining_lines(process.stdout)
+ self._log_remaining_lines(process.stderr)
- def _do_one_rebaseline(self, verbose):
+ def _do_one_rebaseline(self):
try:
old_branch_name = self._tool.scm().current_branch()
self._log_to_server(is_new_entry=True)
self._run_logged_command(['git', 'pull'])
rebaseline_command = [self._tool.filesystem.join(self._tool.scm().checkout_root, 'Tools', 'Scripts', 'webkit-patch'), 'auto-rebaseline']
- if verbose:
+ if self._verbose:
rebaseline_command.append('--verbose')
self._run_logged_command(rebaseline_command)
except:
@@ -904,6 +915,7 @@ class RebaselineOMatic(AbstractDeclarativeCommand):
self._tool.scm().checkout_branch(old_branch_name)
def execute(self, options, args, tool):
+ self._verbose = options.verbose
while True:
- self._do_one_rebaseline(options.verbose)
+ self._do_one_rebaseline()
time.sleep(self.SLEEP_TIME_IN_SECONDS)
« no previous file with comments | « no previous file | Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698