2009-11-16 Eric Seidel <eric@webkit.org>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Nov 2009 08:38:57 +0000 (08:38 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Nov 2009 08:38:57 +0000 (08:38 +0000)
        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
WebKitTools/Scripts/bugzilla-tool
WebKitTools/Scripts/modules/scm.py

index 8cf707fbf01fb801699d4d63699dbdee27f264bb..a8cec7abb4b02c4a16580cd00645db0dcfba7317 100644 (file)
@@ -1,3 +1,12 @@
+2009-11-16  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Document check-style's use of force_clean.
+
+        * Scripts/bugzilla-tool:
+        * Scripts/modules/scm.py:
+
 2009-11-16  Adam Barth  <abarth@webkit.org>
 
         Reviewed by Eric Seidel.
index 192ca3e128c2541f7d99e7c0930356195a2d73da..26ab7625ac4a131dd0fa2bc302c3a3467314b642 100755 (executable)
@@ -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):
index 629e010e7fda03014f443c02164df6a4655edb60..40ace42da2af674a1f9569c0d98ac3df874cedb3 100644 (file)
@@ -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.")