aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/download_baselines.py
diff options
context:
space:
mode:
authorGravatar epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-05-22 19:14:01 +0000
committerGravatar epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-05-22 19:14:01 +0000
commit0f645b68a37ea0d494f578d1ff779f4a3ea6423a (patch)
tree85acec7a24913a765e727716c5971f1ee624d426 /tools/download_baselines.py
parenta3e5c63ab0264332169df4583a8a7da186fb4e66 (diff)
download_baselines.py : only set svn properties of files whose content has changed
and while I was at it, sort the filenames before acting on them, to make the output easier to read BUG=http://code.google.com/p/skia/issues/detail?id=618 Review URL: https://codereview.appspot.com/6223061 git-svn-id: http://skia.googlecode.com/svn/trunk@4031 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tools/download_baselines.py')
-rw-r--r--tools/download_baselines.py26
1 files changed, 15 insertions, 11 deletions
diff --git a/tools/download_baselines.py b/tools/download_baselines.py
index 59069e9322..4a4f6c9603 100644
--- a/tools/download_baselines.py
+++ b/tools/download_baselines.py
@@ -108,17 +108,21 @@ def DownloadBaselinesForOnePlatform(baseline_subdir):
download_repo = None
# Add any new files to SVN control (if we are running with add_new_files).
- new_files = repo_to_modify.GetNewFiles()
- if new_files and options.add_new_files:
- repo_to_modify.AddFiles(new_files)
-
- # Set the mimetype property on *all* image files in baseline_subdir, even
- # the ones that were already there (in case that property wasn't properly
- # set already).
- repo_to_modify.SetPropertyByFilenamePattern(
- '*.png', svn.PROPERTY_MIMETYPE, 'image/png')
- repo_to_modify.SetPropertyByFilenamePattern(
- '*.pdf', svn.PROPERTY_MIMETYPE, 'application/pdf')
+ if options.add_new_files:
+ new_files = repo_to_modify.GetNewFiles()
+ if new_files:
+ repo_to_modify.AddFiles(sorted(new_files))
+
+ # Set the mimetype property on any new/modified image files in
+ # baseline_subdir. (We used to set the mimetype property on *all* image
+ # files in the directory, even those whose content wasn't changing,
+ # but that caused confusion. See
+ # http://code.google.com/p/skia/issues/detail?id=618 .)
+ modified_files = repo_to_modify.GetNewAndModifiedFiles()
+ repo_to_modify.SetProperty(sorted(fnmatch.filter(modified_files, '*.png')),
+ svn.PROPERTY_MIMETYPE, 'image/png')
+ repo_to_modify.SetProperty(sorted(fnmatch.filter(modified_files, '*.pdf')),
+ svn.PROPERTY_MIMETYPE, 'application/pdf')
def RaiseUsageException():
raise Exception('%s\nRun with --help for more detail.' % (