Changeset 47598 in webkit


Ignore:
Timestamp:
Aug 20, 2009 3:02:25 PM (15 years ago)
Author:
eric@webkit.org
Message:

2009-08-20 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.

bugzilla-tool post-diff can post partial diffs from SVN checkouts.
https://bugs.webkit.org/show_bug.cgi?id=28445

Pass the checkout root as the cwd. Also wrote a test to ensure this.

  • Scripts/modules/scm.py:
  • Scripts/modules/scm_unittest.py:
Location:
trunk/WebKitTools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r47591 r47598  
     12009-08-20  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        bugzilla-tool post-diff can post partial diffs from SVN checkouts.
     6        https://bugs.webkit.org/show_bug.cgi?id=28445
     7
     8        Pass the checkout root as the cwd.  Also wrote a test to ensure this.
     9
     10        * Scripts/modules/scm.py:
     11        * Scripts/modules/scm_unittest.py:
     12
    1132009-08-20  Mark Rowe  <mrowe@apple.com>
    214
  • trunk/WebKitTools/Scripts/modules/scm.py

    r47563 r47598  
    275275
    276276    def create_patch(self):
    277         return self.run_command(self.script_path("svn-create-patch"))
     277        return self.run_command(self.script_path("svn-create-patch"), cwd=self.checkout_root)
    278278
    279279    def commit_with_message(self, message):
  • trunk/WebKitTools/Scripts/modules/scm_unittest.py

    r47540 r47598  
    2828
    2929import os
     30import stat
    3031import subprocess
    3132import tempfile
     
    105106        SVNTestRepository.tear_down(self)
    106107
     108    def test_create_patch_is_full_patch(self):
     109        test_dir_path = os.path.join(self.svn_checkout_path, 'test_dir')
     110        os.mkdir(test_dir_path)
     111        test_file_path = os.path.join(test_dir_path, 'test_file2')
     112        write_into_file_at_path(test_file_path, 'test content')
     113        run(['svn', 'add', 'test_dir'])
     114
     115        # create_patch depends on 'svn-create-patch', so make a dummy version.
     116        scripts_path = os.path.join(self.svn_checkout_path, 'WebKitTools', 'Scripts')
     117        os.makedirs(scripts_path)
     118        create_patch_path = os.path.join(scripts_path, 'svn-create-patch')
     119        write_into_file_at_path(create_patch_path, '#!/bin/sh\necho $PWD')
     120        os.chmod(create_patch_path, stat.S_IXUSR | stat.S_IRUSR)
     121
     122        # Change into our test directory and run the create_patch command.
     123        os.chdir(test_dir_path)
     124        scm = detect_scm_system(test_dir_path)
     125        self.assertEqual(scm.checkout_root, self.svn_checkout_path) # Sanity check that detection worked right.
     126        patch_contents = scm.create_patch()
     127        # Our fake 'svn-create-patch' returns $PWD instead of a patch, check that it was executed from the root of the repo.
     128        self.assertEqual(os.path.realpath(scm.checkout_root), patch_contents)
     129
    107130    def test_detection(self):
    108131        scm = detect_scm_system(self.svn_checkout_path)
Note: See TracChangeset for help on using the changeset viewer.