Changeset 73733 in webkit
- Timestamp:
- Dec 10, 2010 9:00:11 AM (13 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r73732 r73733 1 2010-12-10 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Ojan Vafai. 4 5 webkit-patch: not possible to use build-and-test with local commits 6 https://bugs.webkit.org/show_bug.cgi?id=33378 7 8 Make --no-clean not even check if we have local commits. 9 It's unclear to me why the code was originally written this way. 10 I was unable to dig up a reason from svn history. 11 12 * Scripts/webkitpy/tool/steps/cleanworkingdirectory.py: 13 * Scripts/webkitpy/tool/steps/cleanworkingdirectory_unittest.py: Copied from WebKitTools/Scripts/webkitpy/tool/steps/cleanworkingdirectory.py. 14 1 15 2010-12-10 Mario Sanchez Prada <msanchez@igalia.com> 2 16 -
trunk/WebKitTools/Scripts/webkitpy/tool/steps/cleanworkingdirectory.py
r58328 r73733 46 46 47 47 def run(self, state): 48 if not self._options.clean: 49 return 50 # FIXME: This chdir should not be necessary. 48 51 os.chdir(self._tool.scm().checkout_root) 49 52 if not self._allow_local_commits: 50 53 self._tool.scm().ensure_no_local_commits(self._options.force_clean) 51 if self._options.clean: 52 self._tool.scm().ensure_clean_working_directory(force_clean=self._options.force_clean) 54 self._tool.scm().ensure_clean_working_directory(force_clean=self._options.force_clean) -
trunk/WebKitTools/Scripts/webkitpy/tool/steps/cleanworkingdirectory_unittest.py
r73732 r73733 1 1 # Copyright (C) 2010 Google Inc. All rights reserved. 2 # 2 # 3 3 # Redistribution and use in source and binary forms, with or without 4 4 # modification, are permitted provided that the following conditions are 5 5 # met: 6 # 6 # 7 7 # * Redistributions of source code must retain the above copyright 8 8 # notice, this list of conditions and the following disclaimer. … … 14 14 # contributors may be used to endorse or promote products derived from 15 15 # this software without specific prior written permission. 16 # 16 # 17 17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 18 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT … … 27 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 29 import os29 import unittest 30 30 31 from webkitpy.tool.steps.abstractstep import AbstractStep 32 from webkitpy.tool.steps.options import Options 31 from webkitpy.thirdparty.mock import Mock 32 from webkitpy.tool.mocktool import MockOptions, MockTool 33 from webkitpy.tool.steps.cleanworkingdirectory import CleanWorkingDirectory 33 34 34 35 35 class CleanWorkingDirectory(AbstractStep): 36 def __init__(self, tool, options, allow_local_commits=False): 37 AbstractStep.__init__(self, tool, options) 38 self._allow_local_commits = allow_local_commits 36 class CleanWorkingDirectoryTest(unittest.TestCase): 37 def test_run(self): 38 tool = MockTool() 39 step = CleanWorkingDirectory(tool, MockOptions(clean=True, force_clean=False)) 40 step.run({}) 41 self.assertEqual(tool._scm.ensure_no_local_commits.call_count, 1) 42 self.assertEqual(tool._scm.ensure_clean_working_directory.call_count, 1) 39 43 40 @classmethod 41 def options(cls): 42 return AbstractStep.options() + [ 43 Options.force_clean, 44 Options.clean, 45 ] 46 47 def run(self, state): 48 os.chdir(self._tool.scm().checkout_root) 49 if not self._allow_local_commits: 50 self._tool.scm().ensure_no_local_commits(self._options.force_clean) 51 if self._options.clean: 52 self._tool.scm().ensure_clean_working_directory(force_clean=self._options.force_clean) 44 def test_no_clean(self): 45 tool = MockTool() 46 step = CleanWorkingDirectory(tool, MockOptions(clean=False)) 47 step.run({}) 48 self.assertEqual(tool._scm.ensure_no_local_commits.call_count, 0) 49 self.assertEqual(tool._scm.ensure_clean_working_directory.call_count, 0)
Note: See TracChangeset
for help on using the changeset viewer.