[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

mjs at apple.com mjs at apple.com
Sun Feb 20 22:50:18 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit 9fdb2b7fc66501c30a1789bdc66fcda812497104
Author: mjs at apple.com <mjs at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jan 12 00:56:54 2011 +0000

    2011-01-11  Maciej Stachowiak  <mjs at apple.com>
    
            Reviewed by Adam Barth.
    
            Make webkit-patch support subdirectories for SVN checkouts
            https://bugs.webkit.org/show_bug.cgi?id=52261
    
            * Scripts/webkitpy/common/checkout/scm.py:
            * Scripts/webkitpy/style_references.py:
            * Scripts/webkitpy/tool/main.py:
            * Scripts/webkitpy/tool/steps/preparechangelog.py:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75575 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index e9ccd7a..e200f2c 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,3 +1,15 @@
+2011-01-11  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Adam Barth.
+
+        Make webkit-patch support subdirectories for SVN checkouts
+        https://bugs.webkit.org/show_bug.cgi?id=52261
+
+        * Scripts/webkitpy/common/checkout/scm.py:
+        * Scripts/webkitpy/style_references.py:
+        * Scripts/webkitpy/tool/main.py:
+        * Scripts/webkitpy/tool/steps/preparechangelog.py:
+
 2011-01-11  Eric Seidel  <eric at webkit.org>
 
         Unreviewed.
diff --git a/Tools/Scripts/webkitpy/common/checkout/scm.py b/Tools/Scripts/webkitpy/common/checkout/scm.py
index 3f77043..823438c 100644
--- a/Tools/Scripts/webkitpy/common/checkout/scm.py
+++ b/Tools/Scripts/webkitpy/common/checkout/scm.py
@@ -52,7 +52,7 @@ def find_checkout_root():
     return None
 
 
-def default_scm():
+def default_scm(patch_directories=None):
     """Return the default SCM object as determined by the CWD and running code.
 
     Returns the default SCM object for the current working directory; if the
@@ -62,10 +62,10 @@ def default_scm():
 
     """
     cwd = os.getcwd()
-    scm_system = detect_scm_system(cwd)
+    scm_system = detect_scm_system(cwd, patch_directories)
     if not scm_system:
         script_directory = os.path.dirname(os.path.abspath(__file__))
-        scm_system = detect_scm_system(script_directory)
+        scm_system = detect_scm_system(script_directory, patch_directories)
         if scm_system:
             log("The current directory (%s) is not a WebKit checkout, using %s" % (cwd, scm_system.checkout_root))
         else:
@@ -73,11 +73,14 @@ def default_scm():
     return scm_system
 
 
-def detect_scm_system(path):
+def detect_scm_system(path, patch_directories=None):
     absolute_path = os.path.abspath(path)
 
+    if patch_directories == []:
+        patch_directories = None
+
     if SVN.in_working_directory(absolute_path):
-        return SVN(cwd=absolute_path)
+        return SVN(cwd=absolute_path, patch_directories=patch_directories)
     
     if Git.in_working_directory(absolute_path):
         return Git(cwd=absolute_path)
@@ -319,9 +322,15 @@ class SVN(SCM):
     svn_server_host = "svn.webkit.org"
     svn_server_realm = "<http://svn.webkit.org:80> Mac OS Forge"
 
-    def __init__(self, cwd):
+    def __init__(self, cwd, patch_directories):
         SCM.__init__(self, cwd)
         self._bogus_dir = None
+        if patch_directories == []:
+            raise ScriptError(script_args=svn_info_args, message='Empty list of patch directories passed to SCM.__init__')
+        elif patch_directories == None:
+            self._patch_directories = [os.path.relpath(cwd, self.checkout_root)]
+        else:
+            self._patch_directories = patch_directories
 
     @staticmethod
     def in_working_directory(path):
@@ -427,7 +436,9 @@ class SVN(SCM):
         return self.run(["svn", "delete", "--force", base], cwd=parent)
 
     def changed_files(self, git_commit=None):
-        return self.run_status_and_extract_filenames(self.status_command(), self._status_regexp("ACDMR"))
+        status_command = ["svn", "status"]
+        status_command.extend(self._patch_directories)
+        return self.run_status_and_extract_filenames(status_command, self._status_regexp("ACDMR"))
 
     def changed_files_for_revision(self, revision):
         # As far as I can tell svn diff --summarize output looks just like svn status output.
@@ -463,10 +474,14 @@ class SVN(SCM):
         return "svn"
 
     # FIXME: This method should be on Checkout.
-    def create_patch(self, git_commit=None, changed_files=[]):
+    def create_patch(self, git_commit=None, changed_files=None):
         """Returns a byte array (str()) representing the patch file.
         Patch files are effectively binary since they may contain
         files of multiple different encodings."""
+        if changed_files == []:
+            return ""
+        elif changed_files == None:
+            changed_files = []
         return self.run([self.script_path("svn-create-patch")] + changed_files,
             cwd=self.checkout_root, return_stderr=False,
             decode_output=False)
diff --git a/Tools/Scripts/webkitpy/style_references.py b/Tools/Scripts/webkitpy/style_references.py
index a21e931..c92bad9 100644
--- a/Tools/Scripts/webkitpy/style_references.py
+++ b/Tools/Scripts/webkitpy/style_references.py
@@ -70,5 +70,4 @@ class WebKitCheckout(object):
         return self._scm.checkout_root
 
     def create_patch(self, git_commit, changed_files=None):
-        # FIXME: SCM.create_patch should understand how to handle None.
-        return self._scm.create_patch(git_commit, changed_files=changed_files or [])
+        return self._scm.create_patch(git_commit, changed_files=changed_files)
diff --git a/Tools/Scripts/webkitpy/tool/main.py b/Tools/Scripts/webkitpy/tool/main.py
index cad5a2a..76d5bef 100755
--- a/Tools/Scripts/webkitpy/tool/main.py
+++ b/Tools/Scripts/webkitpy/tool/main.py
@@ -49,6 +49,7 @@ import webkitpy.tool.commands as commands
 class WebKitPatch(MultiCommandTool):
     global_options = [
         make_option("-v", "--verbose", action="store_true", dest="verbose", default=False, help="enable all logging"),
+        make_option("-d", "--directory", action="append", dest="patch_directories", default=[], help="Directory to look at for changed files"),
         make_option("--dry-run", action="store_true", dest="dry_run", default=False, help="do not touch remote servers"),
         make_option("--status-host", action="store", dest="status_host", type="string", help="Hostname (e.g. localhost or commit.webkit.org) where status updates should be posted."),
         make_option("--bot-id", action="store", dest="bot_id", type="string", help="Identifier for this bot (if multiple bots are running for a queue)"),
@@ -82,7 +83,7 @@ class WebKitPatch(MultiCommandTool):
     def scm(self):
         # Lazily initialize SCM to not error-out before command line parsing (or when running non-scm commands).
         if not self._scm:
-            self._scm = default_scm()
+            self._scm = default_scm(self._options.patch_directories)
         return self._scm
 
     def checkout(self):
diff --git a/Tools/Scripts/webkitpy/tool/steps/preparechangelog.py b/Tools/Scripts/webkitpy/tool/steps/preparechangelog.py
index 099dfe3..392cd32 100644
--- a/Tools/Scripts/webkitpy/tool/steps/preparechangelog.py
+++ b/Tools/Scripts/webkitpy/tool/steps/preparechangelog.py
@@ -70,6 +70,8 @@ class PrepareChangeLog(AbstractStep):
         if self._tool.scm().supports_local_commits():
             args.append("--merge-base=%s" % self._tool.scm().merge_base(self._options.git_commit))
 
+        args.extend(self._changed_files(state))
+
         try:
             self._tool.executive.run_and_throw_if_fail(args, self._options.quiet)
         except ScriptError, e:

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list