Changeset 90978 in webkit
- Timestamp:
- Jul 13, 2011 10:05:10 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r90977 r90978 1 2011-07-13 Eric Seidel <eric@webkit.org> 2 3 Move webkitpy off of loose mocks 4 https://bugs.webkit.org/show_bug.cgi?id=64508 5 6 Reviewed by Adam Barth. 7 8 Using Mock has caused us more pain than help. 9 It's possible that there was a cleaner way to use it 10 (maybe Mock(class) instead of inheriting from it?). 11 But for now, I've removed all uses of Mock from mocktool.py. 12 13 I also moved run_command into the only 3 files which call it 14 instead of leaving the deprecated method in executive.py. 15 16 I changed various direct calls to os.* to use filesystem instead. 17 18 * Scripts/webkitpy/common/checkout/checkout.py: 19 * Scripts/webkitpy/common/checkout/checkout_unittest.py: 20 * Scripts/webkitpy/common/checkout/scm/git.py: 21 * Scripts/webkitpy/common/checkout/scm/scm.py: 22 * Scripts/webkitpy/common/checkout/scm/scm_unittest.py: 23 * Scripts/webkitpy/common/checkout/scm/svn.py: 24 * Scripts/webkitpy/common/system/executive.py: 25 * Scripts/webkitpy/common/system/executive_unittest.py: 26 * Scripts/webkitpy/tool/mocktool.py: 27 * Scripts/webkitpy/tool/steps/cleanworkingdirectory_unittest.py: 28 * Scripts/webkitpy/tool/steps/ensurelocalcommitifneeded.py: 29 1 30 2011-07-13 Eric Seidel <eric@webkit.org> 2 31 -
trunk/Tools/Scripts/webkitpy/common/checkout/checkout.py
r90968 r90978 27 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 29 import os30 29 import StringIO 31 30 … … 36 35 from webkitpy.common.checkout.deps import DEPS 37 36 from webkitpy.common.memoized import memoized 38 from webkitpy.common.system.executive import run_command,ScriptError37 from webkitpy.common.system.executive import ScriptError 39 38 from webkitpy.common.system.deprecated_logging import log 40 39 … … 44 43 # NOTE: All paths returned from this class should be absolute. 45 44 class Checkout(object): 46 def __init__(self, scm ):45 def __init__(self, scm, executive=None, filesystem=None): 47 46 self._scm = scm 47 # FIXME: We shouldn't be grabbing at private members on scm. 48 self._executive = executive or self._scm._executive 49 self._filesystem = filesystem or self._scm._filesystem 48 50 49 51 def is_path_to_changelog(self, path): 50 return os.path.basename(path) == "ChangeLog"52 return self._filesystem.basename(path) == "ChangeLog" 51 53 52 54 def _latest_entry_for_changelog_at_revision(self, changelog_path, revision): … … 112 114 if not changed_files: 113 115 changed_files = self._scm.changed_files(git_commit) 114 absolute_paths = [os.path.join(self._scm.checkout_root, path) for path in changed_files] 115 return [path for path in absolute_paths if predicate(path)] 116 return filter(predicate, map(self._scm.absolute_path, changed_files)) 116 117 117 118 def modified_changelogs(self, git_commit, changed_files=None): … … 148 149 149 150 def chromium_deps(self): 150 return DEPS( os.path.join(self._scm.checkout_root,"Source", "WebKit", "chromium", "DEPS"))151 return DEPS(self._scm.absolute_path("Source", "WebKit", "chromium", "DEPS")) 151 152 152 153 def apply_patch(self, patch, force=False): … … 159 160 if force: 160 161 args.append('--force') 161 self._ scm._executive.run_command(args, input=patch.contents())162 self._executive.run_command(args, input=patch.contents()) 162 163 163 164 def apply_reverse_diff(self, revision): -
trunk/Tools/Scripts/webkitpy/common/checkout/checkout_unittest.py
r90968 r90978 39 39 from .scm import detect_scm_system, CommitMessage 40 40 from webkitpy.common.system.executive import Executive, ScriptError 41 from webkitpy.common.system.filesystem_mock import MockFileSystem 42 from webkitpy.tool.mocktool import MockSCM, MockExecutive 41 43 from webkitpy.thirdparty.mock import Mock 42 44 … … 130 132 real_scm = detect_scm_system(self.old_cwd) 131 133 132 mock_scm = Mock ()134 mock_scm = MockSCM() 133 135 mock_scm.run = mock_run 134 136 mock_scm.script_path = real_scm.script_path … … 141 143 142 144 class CheckoutTest(unittest.TestCase): 145 def _make_checkout(self): 146 return Checkout(scm=MockSCM(), filesystem=MockFileSystem(), executive=MockExecutive()) 147 143 148 def test_latest_entry_for_changelog_at_revision(self): 144 scm = Mock()145 149 def mock_contents_at_revision(changelog_path, revision): 146 150 self.assertEqual(changelog_path, "foo") … … 151 155 invalid_utf8 = "\255" 152 156 return _changelog1.encode("utf-8") + invalid_utf8 153 scm.contents_at_revision = mock_contents_at_revision154 checkout = Checkout(scm)157 checkout = self._make_checkout() 158 checkout._scm.contents_at_revision = mock_contents_at_revision 155 159 entry = checkout._latest_entry_for_changelog_at_revision("foo", "bar") 156 160 self.assertEqual(entry.contents(), _changelog1entry1) … … 161 165 # recover from those and still return the other ChangeLog entries. 162 166 def test_changelog_entries_for_revision(self): 163 scm = Mock() 164 scm.changed_files_for_revision = lambda revision: ['foo/ChangeLog', 'bar/ChangeLog'] 165 checkout = Checkout(scm) 167 checkout = self._make_checkout() 168 checkout._scm.changed_files_for_revision = lambda revision: ['foo/ChangeLog', 'bar/ChangeLog'] 166 169 167 170 def mock_latest_entry_for_changelog_at_revision(path, revision): … … 178 181 179 182 def test_commit_info_for_revision(self): 180 scm = Mock() 181 scm.changed_files_for_revision = lambda revision: ['path/to/file', 'another/file'] 182 scm.committer_email_for_revision = lambda revision, changed_files=None: "committer@example.com" 183 checkout = Checkout(scm) 183 checkout = self._make_checkout() 184 checkout._scm.changed_files_for_revision = lambda revision: ['path/to/file', 'another/file'] 185 checkout._scm.committer_email_for_revision = lambda revision, changed_files=None: "committer@example.com" 184 186 checkout.changelog_entries_for_revision = lambda revision, changed_files=None: [ChangeLogEntry(_changelog1entry1)] 185 187 commitinfo = checkout.commit_info_for_revision(4) … … 206 208 207 209 def test_bug_id_for_revision(self): 208 scm = Mock() 209 scm.committer_email_for_revision = lambda revision: "committer@example.com" 210 checkout = Checkout(scm) 210 checkout = self._make_checkout() 211 checkout._scm.committer_email_for_revision = lambda revision: "committer@example.com" 211 212 checkout.changelog_entries_for_revision = lambda revision, changed_files=None: [ChangeLogEntry(_changelog1entry1)] 212 213 self.assertEqual(checkout.bug_id_for_revision(4), 36629) 213 214 214 215 def test_bug_id_for_this_commit(self): 215 scm = Mock() 216 checkout = Checkout(scm) 216 checkout = self._make_checkout() 217 217 checkout.commit_message_for_this_commit = lambda git_commit, changed_files=None: CommitMessage(ChangeLogEntry(_changelog1entry1).contents().splitlines()) 218 218 self.assertEqual(checkout.bug_id_for_this_commit(git_commit=None), 36629) 219 219 220 220 def test_modified_changelogs(self): 221 scm = Mock() 222 scm.checkout_root = "/foo/bar" 223 scm.changed_files = lambda git_commit: ["file1", "ChangeLog", "relative/path/ChangeLog"] 224 checkout = Checkout(scm) 221 checkout = self._make_checkout() 222 checkout._scm.checkout_root = "/foo/bar" 223 checkout._scm.changed_files = lambda git_commit: ["file1", "ChangeLog", "relative/path/ChangeLog"] 225 224 expected_changlogs = ["/foo/bar/ChangeLog", "/foo/bar/relative/path/ChangeLog"] 226 225 self.assertEqual(checkout.modified_changelogs(git_commit=None), expected_changlogs) … … 237 236 return [4, 8] 238 237 239 scm = Mock() 240 scm.checkout_root = "/foo/bar" 241 scm.changed_files = lambda git_commit: ["file1", "file2", "relative/path/ChangeLog"] 242 scm.revisions_changing_file = mock_revisions_changing_file 243 checkout = Checkout(scm) 238 checkout = self._make_checkout() 239 checkout._scm.checkout_root = "/foo/bar" 240 checkout._scm.changed_files = lambda git_commit: ["file1", "file2", "relative/path/ChangeLog"] 241 checkout._scm.revisions_changing_file = mock_revisions_changing_file 244 242 checkout.changelog_entries_for_revision = mock_changelog_entries_for_revision 245 243 reviewers = checkout.suggested_reviewers(git_commit=None) -
trunk/Tools/Scripts/webkitpy/common/checkout/scm/git.py
r90967 r90978 33 33 from webkitpy.common.memoized import memoized 34 34 from webkitpy.common.system.deprecated_logging import log 35 from webkitpy.common.system.executive import Executive, run_command, ScriptError 35 from webkitpy.common.system.executive import Executive, ScriptError 36 from webkitpy.common.system import ospath 36 37 37 38 from .commitmessage import CommitMessage 38 39 from .scm import AuthenticationError, SCM, commit_error_handler 39 40 from .svn import SVN, SVNRepository 41 42 43 def run_command(*args, **kwargs): 44 # FIXME: This should not be a global static. 45 # New code should use Executive.run_command directly instead 46 return Executive().run_command(*args, **kwargs) 40 47 41 48 … … 96 103 # "git rev-parse --show-cdup" would be another way to get to the root 97 104 (checkout_root, dot_git) = os.path.split(run_command(['git', 'rev-parse', '--git-dir'], cwd=(path or "./"))) 98 # If we were using 2.6 # checkout_root = os.path.relpath(checkout_root, path)99 105 if not os.path.isabs(checkout_root): # Sometimes git returns relative paths 100 106 checkout_root = os.path.join(path, checkout_root) … … 103 109 @classmethod 104 110 def to_object_name(cls, filepath): 105 root_end_with_slash = os.path.join(cls.find_checkout_root(os.path.dirname(filepath)), '')111 root_end_with_slash = self._filesystem.join(cls.find_checkout_root(self._filesystem.dirname(filepath)), '') 106 112 return filepath.replace(root_end_with_slash, '') 107 113 … … 126 132 127 133 def rebase_in_progress(self): 128 return os.path.exists(os.path.join(self.checkout_root, '.git/rebase-apply'))134 return self._filesystem.exists(self.absolute_path('.git', 'rebase-apply')) 129 135 130 136 def working_directory_is_clean(self): … … 335 341 # trunk. Move up to the top of the tree so that git commands that expect a 336 342 # valid CWD won't fail after we check out the merge branch. 337 os.chdir(self.checkout_root) 343 # FIXME: We should never be using chdir! We can instead pass cwd= to run_command/self.run! 344 self._filesystem.chdir(self.checkout_root) 338 345 339 346 # Stuff our change into the merge branch. -
trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm.py
r90967 r90978 31 31 32 32 import logging 33 import os34 33 import re 35 import sys36 import shutil37 34 38 35 from webkitpy.common.system.deprecated_logging import error, log 39 36 from webkitpy.common.system.executive import Executive, ScriptError 40 from webkitpy.common.system import ospath37 from webkitpy.common.system.filesystem import FileSystem 41 38 42 39 … … 62 59 # SCM methods are expected to return paths relative to self.checkout_root. 63 60 class SCM: 64 def __init__(self, cwd, executive=None ):61 def __init__(self, cwd, executive=None, filesystem=None): 65 62 self.cwd = cwd 66 63 self.checkout_root = self.find_checkout_root(self.cwd) 67 64 self.dryrun = False 68 65 self._executive = executive or Executive() 66 self._filesystem = filesystem or FileSystem() 69 67 70 68 # A wrapper used by subclasses to create processes. … … 82 80 # absolute paths to pass to rm, etc. 83 81 def absolute_path(self, repository_relative_path): 84 return os.path.join(self.checkout_root, repository_relative_path)82 return self._filesystem.join(self.checkout_root, repository_relative_path) 85 83 86 84 # FIXME: This belongs in Checkout, not SCM. 87 85 def scripts_directory(self): 88 return os.path.join(self.checkout_root, "Tools", "Scripts")86 return self._filesystem.join(self.checkout_root, "Tools", "Scripts") 89 87 90 88 # FIXME: This belongs in Checkout, not SCM. 91 89 def script_path(self, script_name): 92 return os.path.join(self.scripts_directory(), script_name)90 return self._filesystem.join(self.scripts_directory(), script_name) 93 91 94 92 def ensure_clean_working_directory(self, force_clean): … … 96 94 return 97 95 if not force_clean: 98 # FIXME: Shouldn't this use cwd=self.checkout_root? 96 # FIXME: Shouldn't this use cwd=self.checkout_root? (Git definitely would want that, unclear if SVN would.) 99 97 print self.run(self.status_command(), error_handler=Executive.ignore_error) 100 98 raise ScriptError(message="Working directory has modifications, pass --force-clean or --no-clean to continue.") -
trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py
r90967 r90978 50 50 from webkitpy.common.config.committers import Committer # FIXME: This should not be needed 51 51 from webkitpy.common.net.bugzilla import Attachment # FIXME: This should not be needed 52 from webkitpy.common.system.executive import Executive, run_command,ScriptError52 from webkitpy.common.system.executive import Executive, ScriptError 53 53 from webkitpy.common.system.outputcapture import OutputCapture 54 54 from webkitpy.tool.mocktool import MockExecutive … … 79 79 # Eventually we will want to write tests which work for both scms. (like update_webkit, changed_files, etc.) 80 80 # Perhaps through some SCMTest base-class which both SVNTest and GitTest inherit from. 81 82 83 def run_command(*args, **kwargs): 84 # FIXME: This should not be a global static. 85 # New code should use Executive.run_command directly instead 86 return Executive().run_command(*args, **kwargs) 87 81 88 82 89 # FIXME: This should be unified into one of the executive.py commands! -
trunk/Tools/Scripts/webkitpy/common/checkout/scm/svn.py
r90967 r90978 36 36 from webkitpy.common.memoized import memoized 37 37 from webkitpy.common.system.deprecated_logging import log 38 from webkitpy.common.system.executive import Executive, run_command,ScriptError38 from webkitpy.common.system.executive import Executive, ScriptError 39 39 from webkitpy.common.system import ospath 40 40 … … 93 93 def value_from_svn_info(cls, path, field_name): 94 94 svn_info_args = ['svn', 'info', path] 95 # FIXME: This should use an Executive.96 info_output = run_command(svn_info_args).rstrip()95 # FIXME: This method should use a passed in executive or be made an instance method and use self._executive. 96 info_output = Executive().run_command(svn_info_args).rstrip() 97 97 match = re.search("^%s: (?P<value>.+)$" % field_name, info_output, re.MULTILINE) 98 98 if not match: -
trunk/Tools/Scripts/webkitpy/common/system/executive.py
r90826 r90978 97 97 98 98 99 def run_command(*args, **kwargs):100 # FIXME: This should not be a global static.101 # New code should use Executive.run_command directly instead102 return Executive().run_command(*args, **kwargs)103 104 105 99 class Executive(object): 106 100 PIPE = subprocess.PIPE -
trunk/Tools/Scripts/webkitpy/common/system/executive_unittest.py
r89843 r90978 34 34 import unittest 35 35 36 from webkitpy.common.system.executive import Executive, run_command,ScriptError36 from webkitpy.common.system.executive import Executive, ScriptError 37 37 from webkitpy.common.system.filesystem_mock import MockFileSystem 38 38 from webkitpy.test import cat, echo … … 96 96 def test_run_command_with_bad_command(self): 97 97 def run_bad_command(): 98 run_command(["foo_bar_command_blah"], error_handler=Executive.ignore_error, return_exit_code=True)98 Executive().run_command(["foo_bar_command_blah"], error_handler=Executive.ignore_error, return_exit_code=True) 99 99 self.failUnlessRaises(OSError, run_bad_command) 100 100 -
trunk/Tools/Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests_unittest.py
r90520 r90978 360 360 # *) 2 files in /tmp for the image diffs for the two ports 361 361 # *) 1 file in /tmp for the rebaseline results html file 362 # FIXME: These numbers depend on MockSCM.exists() returning True for all files. 362 363 self.assertEqual(res, 0) 363 364 self.assertEqual(len(filesystem.written_files), 38) -
trunk/Tools/Scripts/webkitpy/tool/mocktool.py
r90968 r90978 28 28 29 29 import os 30 import StringIO 30 31 import threading 31 32 … … 37 38 from webkitpy.common.system.executive import ScriptError 38 39 from webkitpy.common.system.filesystem_mock import MockFileSystem 39 from webkitpy.thirdparty.mock import Mock40 40 41 41 … … 208 208 209 209 210 # FIXME: This should not inherit from Mock 211 class MockBugzillaQueries(Mock): 210 class MockBugzillaQueries(object): 212 211 213 212 def __init__(self, bugzilla): 214 Mock.__init__(self)215 213 self._bugzilla = bugzilla 216 214 … … 249 247 return [self._bugzilla.fetch_bug(78), self._bugzilla.fetch_bug(77)] 250 248 249 251 250 _mock_reviewer = Reviewer("Foo Bar", "foo@bar.com") 252 251 … … 255 254 # class we should mock that instead. 256 255 # Most of this class is just copy/paste from Bugzilla. 257 # FIXME: This should not inherit from Mock 258 class MockBugzilla(Mock): 256 class MockBugzilla(object): 259 257 260 258 bug_server_url = "http://example.com" … … 271 269 272 270 def __init__(self): 273 Mock.__init__(self)274 271 self.queries = MockBugzillaQueries(self) 275 272 self.committers = CommitterList(reviewers=[_mock_reviewer]) … … 378 375 log("-- End comment --") 379 376 377 def add_cc_to_bug(self, bug_id, ccs): 378 pass 379 380 def obsolete_attachment(self, attachment_id, message=None): 381 pass 382 383 def reopen_bug(self, bug_id, message): 384 pass 385 386 def close_bug_as_fixed(self, bug_id, message): 387 pass 388 389 def clear_attachment_flags(self, attachment_id, message): 390 pass 391 380 392 381 393 class MockBuilder(object): … … 464 476 465 477 466 # FIXME: This should not inherit from Mock 467 class MockSCM(Mock): 478 class MockSCM(object): 468 479 469 480 fake_checkout_root = os.path.realpath("/tmp") # realpath is needed to allow for Mac OS X's /private/tmp 470 481 471 def __init__(self, filesystem=None): 472 Mock.__init__(self) 482 def __init__(self, filesystem=None, executive=None): 473 483 # FIXME: We should probably use real checkout-root detection logic here. 474 484 # os.getcwd() can't work here because other parts of the code assume that "checkout_root" … … 476 486 self.checkout_root = self.fake_checkout_root 477 487 self.added_paths = set() 478 self._filesystem = filesystem 488 self._filesystem = filesystem or MockFileSystem() 489 self._executive = executive or MockExecutive() 479 490 480 491 def add(self, destination_path, return_exit_code=False): … … 483 494 return 0 484 495 496 def ensure_clean_working_directory(self, force_clean): 497 pass 498 499 def supports_local_commits(self): 500 return True 501 502 def ensure_no_local_commits(self, force_clean): 503 pass 504 505 def exists(self, path): 506 # TestRealMain.test_real_main (and several other rebaseline tests) are sensitive to this return value. 507 # We should make those tests more robust, but for now we just return True always (since no test needs otherwise). 508 return True 509 510 def absolute_path(self, *comps): 511 return self._filesystem.join(self.checkout_root, *comps) 512 485 513 def changed_files(self, git_commit=None): 486 514 return ["MockFile1"] 487 515 516 def changed_files_for_revision(self, revision): 517 return ["MockFile1"] 518 519 def head_svn_revision(self): 520 return 1234 521 488 522 def create_patch(self, git_commit, changed_files=None): 489 523 return "Patch1" … … 491 525 def commit_ids_from_commitish_arguments(self, args): 492 526 return ["Commitish1", "Commitish2"] 527 528 def committer_email_for_revision(self, revision): 529 return "mock@webkit.org" 530 531 def commit_locally_with_message(self, message): 532 pass 533 534 def commit_with_message(self, message, username=None, password=None, git_commit=None, force_squash=False, changed_files=None): 535 pass 536 537 def merge_base(self, git_commit): 538 return None 493 539 494 540 def commit_message_for_local_commit(self, commit_id): … … 505 551 506 552 def diff_for_revision(self, revision): 507 return "DiffForRevision%s\n" \ 508 "http://bugs.webkit.org/show_bug.cgi?id=12345" % revision 553 return "DiffForRevision%s\nhttp://bugs.webkit.org/show_bug.cgi?id=12345" % revision 509 554 510 555 def show_head(self, path): … … 528 573 log("MOCK: MockDEPS.write_variable(%s, %s)" % (name, value)) 529 574 575 576 class MockCommitMessage(object): 577 def message(self): 578 return "This is a fake commit message that is at least 50 characters." 530 579 531 580 class MockCheckout(object): … … 565 614 566 615 def commit_message_for_this_commit(self, git_commit, changed_files=None): 567 commit_message = Mock() 568 commit_message.message = lambda:"This is a fake commit message that is at least 50 characters." 569 return commit_message 616 return MockCommitMessage() 570 617 571 618 def chromium_deps(self): … … 667 714 668 715 669 # FIXME: This should not inherit from Mock670 716 # FIXME: Unify with common.system.executive_mock.MockExecutive. 671 class MockExecutive( Mock):717 class MockExecutive(object): 672 718 def __init__(self, should_log=False, should_throw=False): 673 719 self._should_log = should_log … … 707 753 708 754 709 class MockPort( Mock):755 class MockPort(object): 710 756 def name(self): 711 757 return "MockPort" … … 719 765 def update_webkit_command(self): 720 766 return ["mock-update-webkit"] 767 768 def build_webkit_command(self, build_style=None): 769 return ["mock-build-webkit"] 770 771 def run_bindings_tests_command(self): 772 return ["mock-run-bindings-tests"] 773 774 def prepare_changelog_command(self): 775 return ['mock-prepare-ChangeLog'] 776 777 def run_python_unittests_command(self): 778 return ['mock-test-webkitpy'] 779 780 def run_perl_unittests_command(self): 781 return ['mock-test-webkitperl'] 782 783 def run_javascriptcore_tests_command(self): 784 return ['mock-run-javacriptcore-tests'] 785 786 def run_webkit_tests_command(self): 787 return ['mock-run-webkit-tests'] 721 788 722 789 … … 765 832 self.executive = MockExecutive(should_log=log_executive) 766 833 self.web = MockWeb() 767 self.filesystem = MockFileSystem()768 834 self.workspace = MockWorkspace() 769 835 self._irc = None 770 836 self.user = MockUser() 771 837 self._scm = MockSCM() 838 # Various pieces of code (wrongly) call filesystem.chdir(checkout_root). 839 # Making the checkout_root exist in the mock filesystem makes that chdir not raise. 840 self.filesystem = MockFileSystem(dirs=set([self._scm.checkout_root])) 772 841 self._port = MockPort() 773 842 self._checkout = MockCheckout() … … 810 879 811 880 def submit(self): 812 return Mock(file)881 return StringIO.StringIO() -
trunk/Tools/Scripts/webkitpy/tool/steps/cleanworkingdirectory.py
r74639 r90978 48 48 if not self._options.clean: 49 49 return 50 # FIXME: This chdir should not be necessary and can be removed as51 # soon as ensure_no_local_commits and ensure_clean_working_directory52 # are known to set the CWD to checkout_root when calling run_command.53 os.chdir(self._tool.scm().checkout_root)54 50 if not self._allow_local_commits: 55 51 self._tool.scm().ensure_no_local_commits(self._options.force_clean) -
trunk/Tools/Scripts/webkitpy/tool/steps/cleanworkingdirectory_unittest.py
r73733 r90978 37 37 def test_run(self): 38 38 tool = MockTool() 39 tool._scm = Mock() 40 tool._scm.checkout_root = '/mock' 39 41 step = CleanWorkingDirectory(tool, MockOptions(clean=True, force_clean=False)) 40 42 step.run({}) … … 44 46 def test_no_clean(self): 45 47 tool = MockTool() 48 tool._scm = Mock() 46 49 step = CleanWorkingDirectory(tool, MockOptions(clean=False)) 47 50 step.run({}) -
trunk/Tools/Scripts/webkitpy/tool/steps/ensurelocalcommitifneeded.py
r58328 r90978 41 41 def run(self, state): 42 42 if self._options.local_commit and not self._tool.scm().supports_local_commits(): 43 error("--local-commit passed, but %s does not support local commits" % self._tool.scm .display_name())43 error("--local-commit passed, but %s does not support local commits" % self._tool.scm().display_name())
Note: See TracChangeset
for help on using the changeset viewer.