diff options
author | victorw@chromium.org <victorw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-16 16:26:37 +0000 |
---|---|---|
committer | victorw@chromium.org <victorw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-16 16:26:37 +0000 |
commit | 3c540b02313d07c4d0ef92a837fc6d2ccb401f45 (patch) | |
tree | ffd739749b2e898bd23e93ca6e3eb98cbfb6da91 | |
parent | 68e3b47230aa88a848ba6cb7daee852993f51a62 (diff) | |
download | chromium_src-3c540b02313d07c4d0ef92a837fc6d2ccb401f45.zip chromium_src-3c540b02313d07c4d0ef92a837fc6d2ccb401f45.tar.gz chromium_src-3c540b02313d07c4d0ef92a837fc6d2ccb401f45.tar.bz2 |
Update rebaselining tool to auto create new directory if it does not exist.
TEST=rebaselining tool
BUG=none
Review URL: http://codereview.chromium.org/149718
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20871 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/tools/layout_tests/rebaseline.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/webkit/tools/layout_tests/rebaseline.py b/webkit/tools/layout_tests/rebaseline.py index 8199ec6..7f88ec0 100644 --- a/webkit/tools/layout_tests/rebaseline.py +++ b/webkit/tools/layout_tests/rebaseline.py @@ -30,6 +30,8 @@ import urllib import webbrowser import zipfile +import google.path_utils + from layout_package import path_utils from layout_package import platform_utils_linux from layout_package import platform_utils_mac @@ -359,6 +361,10 @@ class Rebaseliner(object): logging.debug(' Expected file full path: "%s"', expected_fullpath) data = zip_file.read(archive_test_name) + + # Create the new baseline directory if it doesn't already exist. + google.path_utils.MaybeMakeDirectory(os.path.dirname(expected_fullpath)) + f = open(expected_fullpath, 'wb') f.write(data) f.close() @@ -412,20 +418,29 @@ class Rebaseliner(object): False otherwise. """ + if not filename: + return False + status_output = RunShell(['svn', 'status', filename], False) output = status_output.upper() if output.startswith('A') or output.startswith('M'): logging.info(' File already added to SVN: "%s"', filename) return True + if output.find('IS NOT A WORKING COPY') >= 0: + parent_dir = os.path.split(filename)[0] + logging.info(' File is not a working copy, add its parent: "%s"', + parent_dir) + return self._SvnAdd(parent_dir) + add_output = RunShell(['svn', 'add', filename], True) output = add_output.upper().rstrip() - if output.startswith('A') and output.endswith(filename.upper()): + if output.startswith('A') and output.find(filename.upper()) >= 0: logging.info(' Added new file: "%s"', filename) return True if (not status_output) and (add_output.upper().find( - 'ALREADY UNDER VERSION CONTROL')): + 'ALREADY UNDER VERSION CONTROL') >= 0): logging.info(' File already under SVN and has no change: "%s"', filename) return True |