From 809dfd6d4196378bd54f7123a16fe292d6e84c9f Mon Sep 17 00:00:00 2001 From: "eric@webkit.org" Date: Tue, 31 Jan 2012 22:45:22 +0000 Subject: [PATCH] webkit-patch apply-from-bug should work regardless of your CWD https://bugs.webkit.org/show_bug.cgi?id=77482 Reviewed by Adam Barth. webkit-patch only ever works with patches made from the root directory. We should pass the CWD to svn-apply in the case where we're running not from the webkit root. I believe this used to work in the past and regressed. * Scripts/webkitpy/common/checkout/checkout.py: (Checkout.apply_patch): * Scripts/webkitpy/common/checkout/checkout_unittest.py: (CheckoutTest.test_apply_patch): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106396 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Tools/ChangeLog | 17 +++++++++++++++++ Tools/Scripts/webkitpy/common/checkout/checkout.py | 2 +- .../webkitpy/common/checkout/checkout_unittest.py | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Tools/ChangeLog b/Tools/ChangeLog index 0a50adc..9bbd6a4 100644 --- a/Tools/ChangeLog +++ b/Tools/ChangeLog @@ -1,3 +1,20 @@ +2012-01-31 Eric Seidel + + webkit-patch apply-from-bug should work regardless of your CWD + https://bugs.webkit.org/show_bug.cgi?id=77482 + + Reviewed by Adam Barth. + + webkit-patch only ever works with patches made from the root + directory. We should pass the CWD to svn-apply in the case + where we're running not from the webkit root. I believe + this used to work in the past and regressed. + + * Scripts/webkitpy/common/checkout/checkout.py: + (Checkout.apply_patch): + * Scripts/webkitpy/common/checkout/checkout_unittest.py: + (CheckoutTest.test_apply_patch): + 2012-01-31 Sheriff Bot Unreviewed, rolling out r106302. diff --git a/Tools/Scripts/webkitpy/common/checkout/checkout.py b/Tools/Scripts/webkitpy/common/checkout/checkout.py index 5b30627..8f45024 100644 --- a/Tools/Scripts/webkitpy/common/checkout/checkout.py +++ b/Tools/Scripts/webkitpy/common/checkout/checkout.py @@ -158,7 +158,7 @@ class Checkout(object): args = [self._scm.script_path('svn-apply'), "--force"] if patch.reviewer(): args += ['--reviewer', patch.reviewer().full_name] - self._executive.run_command(args, input=patch.contents()) + self._executive.run_command(args, input=patch.contents(), cwd=self._scm.checkout_root) def apply_reverse_diff(self, revision): self._scm.apply_reverse_diff(revision) diff --git a/Tools/Scripts/webkitpy/common/checkout/checkout_unittest.py b/Tools/Scripts/webkitpy/common/checkout/checkout_unittest.py index 3eb327d..3b09432 100644 --- a/Tools/Scripts/webkitpy/common/checkout/checkout_unittest.py +++ b/Tools/Scripts/webkitpy/common/checkout/checkout_unittest.py @@ -261,5 +261,5 @@ class CheckoutTest(unittest.TestCase): mock_patch = Mock() mock_patch.contents = lambda: "foo" mock_patch.reviewer = lambda: None - expected_stderr = "MOCK run_command: ['svn-apply', '--force'], cwd=None\n" + expected_stderr = "MOCK run_command: ['svn-apply', '--force'], cwd=/mock-checkout\n" OutputCapture().assert_outputs(self, checkout.apply_patch, [mock_patch], expected_stderr=expected_stderr) -- 2.7.4