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

Side by Side Diff: tools/rebaseline_imagefiles.py

Issue 18209010: rebaseline.py: look in gm-expected directory to see whether it's using git or svn (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 ''' 3 '''
4 Copyright 2013 Google Inc. 4 Copyright 2013 Google Inc.
5 5
6 Use of this source code is governed by a BSD-style license that can be 6 Use of this source code is governed by a BSD-style license that can be
7 found in the LICENSE file. 7 found in the LICENSE file.
8 ''' 8 '''
9 9
10 ''' 10 '''
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 self._configs = configs 75 self._configs = configs
76 self._json_base_url = json_base_url 76 self._json_base_url = json_base_url
77 self._json_filename = json_filename 77 self._json_filename = json_filename
78 self._dry_run = dry_run 78 self._dry_run = dry_run
79 self._add_new = add_new 79 self._add_new = add_new
80 self._missing_json_is_fatal = missing_json_is_fatal 80 self._missing_json_is_fatal = missing_json_is_fatal
81 self._googlestorage_gm_actuals_root = ( 81 self._googlestorage_gm_actuals_root = (
82 'http://chromium-skia-gm.commondatastorage.googleapis.com/gm') 82 'http://chromium-skia-gm.commondatastorage.googleapis.com/gm')
83 self._testname_pattern = re.compile('(\S+)_(\S+).png') 83 self._testname_pattern = re.compile('(\S+)_(\S+).png')
84 self._is_svn_checkout = ( 84 self._is_svn_checkout = (
85 os.path.exists('.svn') or 85 os.path.exists(os.path.join(expectations_root, '.svn')) or
86 os.path.exists(os.path.join(os.pardir, '.svn'))) 86 os.path.exists(os.path.join(expectations_root, os.pardir, '.svn')))
87 self._is_git_checkout = ( 87 self._is_git_checkout = (
88 os.path.exists('.git') or 88 os.path.exists(os.path.join(expectations_root, '.git')) or
89 os.path.exists(os.path.join(os.pardir, '.git'))) 89 os.path.exists(os.path.join(expectations_root, os.pardir, '.git')))
90 90
91 # If dry_run is False, execute subprocess.call(cmd). 91 # If dry_run is False, execute subprocess.call(cmd).
92 # If dry_run is True, print the command we would have otherwise run. 92 # If dry_run is True, print the command we would have otherwise run.
93 # Raises a CommandFailedException if the command fails. 93 # Raises a CommandFailedException if the command fails.
94 def _Call(self, cmd): 94 def _Call(self, cmd):
95 if self._dry_run: 95 if self._dry_run:
96 print '%s' % ' '.join(cmd) 96 print '%s' % ' '.join(cmd)
97 return 97 return
98 if subprocess.call(cmd) != 0: 98 if subprocess.call(cmd) != 0:
99 raise CommandFailedException('error running command: ' + 99 raise CommandFailedException('error running command: ' +
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 else: # get the raw list of files that need rebaselining from JSON 332 else: # get the raw list of files that need rebaselining from JSON
333 filenames = self._GetFilesToRebaseline(json_url=json_url, 333 filenames = self._GetFilesToRebaseline(json_url=json_url,
334 add_new=self._add_new) 334 add_new=self._add_new)
335 for filename in filenames: 335 for filename in filenames:
336 outfilename = os.path.join(subdir, filename); 336 outfilename = os.path.join(subdir, filename);
337 self._RebaselineOneFile(expectations_subdir=subdir, 337 self._RebaselineOneFile(expectations_subdir=subdir,
338 builder_name=builder, 338 builder_name=builder,
339 infilename=filename, 339 infilename=filename,
340 outfilename=outfilename, 340 outfilename=outfilename,
341 all_results=all_results) 341 all_results=all_results)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698