From d538122ebdacd565e4df955d30a17f9a2fa9f9e7 Mon Sep 17 00:00:00 2001 From: "eric@webkit.org" Date: Mon, 16 Nov 2009 08:38:57 +0000 Subject: [PATCH] 2009-11-16 Eric Seidel Reviewed by Adam Barth. Document check-style's use of force_clean. * Scripts/bugzilla-tool: * Scripts/modules/scm.py: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@51015 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- WebKitTools/ChangeLog | 9 +++++++++ WebKitTools/Scripts/bugzilla-tool | 6 ++++-- WebKitTools/Scripts/modules/scm.py | 4 ++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog index 8cf707fbf01f..a8cec7abb4b0 100644 --- a/WebKitTools/ChangeLog +++ b/WebKitTools/ChangeLog @@ -1,3 +1,12 @@ +2009-11-16 Eric Seidel + + Reviewed by Adam Barth. + + Document check-style's use of force_clean. + + * Scripts/bugzilla-tool: + * Scripts/modules/scm.py: + 2009-11-16 Adam Barth Reviewed by Eric Seidel. diff --git a/WebKitTools/Scripts/bugzilla-tool b/WebKitTools/Scripts/bugzilla-tool index 192ca3e128c2..26ab7625ac4a 100755 --- a/WebKitTools/Scripts/bugzilla-tool +++ b/WebKitTools/Scripts/bugzilla-tool @@ -152,7 +152,9 @@ class CheckStyleOnBug(Command): log("Patch failed to apply and check style") log(e.output) - tool.scm().ensure_clean_working_directory(True) + # This is safe because in order to get here the working directory had to be + # clean at the beginning. Clean it out again before we exit. + tool.scm().ensure_clean_working_directory(force_clean=True) def execute(self, options, args, tool): bug_id = args[0] @@ -280,7 +282,7 @@ class WebKitLandingScripts: os.chdir(scm.checkout_root) scm.ensure_no_local_commits(options.force_clean) if options.clean: - scm.ensure_clean_working_directory(options.force_clean) + scm.ensure_clean_working_directory(force_clean=options.force_clean) @classmethod def build_and_commit(cls, scm, options): diff --git a/WebKitTools/Scripts/modules/scm.py b/WebKitTools/Scripts/modules/scm.py index 629e010e7fda..40ace42da2af 100644 --- a/WebKitTools/Scripts/modules/scm.py +++ b/WebKitTools/Scripts/modules/scm.py @@ -146,8 +146,8 @@ class SCM: def script_path(self, script_name): return os.path.join(self.scripts_directory(), script_name) - def ensure_clean_working_directory(self, force): - if not force and not self.working_directory_is_clean(): + def ensure_clean_working_directory(self, force_clean): + if not force_clean and not self.working_directory_is_clean(): print self.run_command(self.status_command(), error_handler=ignore_error) raise ScriptError(message="Working directory has modifications, pass --force-clean or --no-clean to continue.") -- 2.36.0