Index: third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py |
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py |
index 6acc7224e2ec5a56cea686a4c2c59070ff690199..a74fa6502e6f905d79ca2e51bf982b9a9fb2da63 100644 |
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py |
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py |
@@ -30,6 +30,7 @@ from __future__ import print_function |
import json |
import logging |
import optparse |
+import re |
import sys |
import traceback |
@@ -523,7 +524,13 @@ class AbstractParallelRebaselineCommand(AbstractRebaseliningCommand): |
self._remove_all_pass_testharness_baselines(test_prefix_list) |
- self._tool.scm().add_all(pathspec=self._layout_tests_dir()) |
+ self._tool.scm().add_list(self.unstaged_baselines()) |
+ |
+ def unstaged_baselines(self): |
+ """Returns absolute paths for unstaged (including untracked) baselines.""" |
+ baseline_re = re.compile(r'.*[\\/]LayoutTests[\\/].*-expected\.(txt|png|wav)$') |
+ unstaged_changes = self._tool.scm().unstaged_changes() |
+ return sorted(self._tool.scm().absolute_path(path) for path in unstaged_changes if re.match(baseline_re, path)) |
def _remove_all_pass_testharness_baselines(self, test_prefix_list): |
"""Removes all of the all-PASS baselines for the given builders and tests. |