[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
ojan at chromium.org
ojan at chromium.org
Wed Dec 22 18:03:42 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 9fff970bc439e78d6f551af3c6210daa2050942c
Author: ojan at chromium.org <ojan at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Dec 6 20:00:21 2010 +0000
2010-12-02 Ojan Vafai <ojan at chromium.org>
Reviewed by Eric Seidel.
make webkit-patch command work when the git branch is not synced to the remote svn branch
https://bugs.webkit.org/show_bug.cgi?id=50424
* Scripts/webkitpy/common/checkout/scm.py:
* Scripts/webkitpy/common/checkout/scm_unittest.py:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73384 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index c3d0318..f9778e5 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,13 @@
+2010-12-02 Ojan Vafai <ojan at chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ make webkit-patch command work when the git branch is not synced to the remote svn branch
+ https://bugs.webkit.org/show_bug.cgi?id=50424
+
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+
2010-12-06 Patrick Gansterer <paroga at webkit.org>
Reviewed by Andreas Kling.
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/scm.py b/WebKitTools/Scripts/webkitpy/common/checkout/scm.py
index d39b8b4..ee2bb41 100644
--- a/WebKitTools/Scripts/webkitpy/common/checkout/scm.py
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/scm.py
@@ -642,10 +642,6 @@ class Git(SCM):
def delete(self, path):
return self.run(["git", "rm", "-f", path])
- def _assert_synced(self):
- if len(run_command(['git', 'rev-list', '--max-count=1', self.remote_branch_ref(), '^HEAD'])):
- raise ScriptError(message="Not fully merged/rebased to %s. This branch needs to be synced first." % self.remote_branch_ref())
-
def merge_base(self, git_commit):
if git_commit:
# Special-case HEAD.. to mean working-copy changes only.
@@ -656,7 +652,6 @@ class Git(SCM):
git_commit = git_commit + "^.." + git_commit
return git_commit
- self._assert_synced()
return self.remote_merge_base()
def changed_files(self, git_commit=None):
@@ -788,8 +783,7 @@ class Git(SCM):
if not force_squash:
self._assert_can_squash(working_directory_is_clean)
- self._assert_synced()
- self.run(['git', 'reset', '--soft', self.remote_branch_ref()])
+ self.run(['git', 'reset', '--soft', self.remote_merge_base()])
self.commit_locally_with_message(message)
return self.push_local_commits_to_server()
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py b/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py
index 46a2acf..55cfce3 100644
--- a/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py
@@ -962,10 +962,13 @@ class GitSVNTest(SCMTest):
svn_log = run_command(['git', 'svn', 'log', '--limit=1', '--verbose'])
self.assertTrue(re.search(r'test_file_commit1', svn_log))
+ def _local_commit(self, filename, contents, message):
+ write_into_file_at_path(filename, contents)
+ run_command(['git', 'add', filename])
+ self.scm.commit_locally_with_message(message)
+
def _one_local_commit(self):
- write_into_file_at_path('test_file_commit1', 'more test content')
- run_command(['git', 'add', 'test_file_commit1'])
- self.scm.commit_locally_with_message("another test commit")
+ self._local_commit('test_file_commit1', 'more test content', 'another test commit')
def _one_local_commit_plus_working_copy_changes(self):
self._one_local_commit()
@@ -974,14 +977,10 @@ class GitSVNTest(SCMTest):
def _two_local_commits(self):
self._one_local_commit()
- write_into_file_at_path('test_file_commit2', 'still more test content')
- run_command(['git', 'add', 'test_file_commit2'])
- self.scm.commit_locally_with_message("yet another test commit")
+ self._local_commit('test_file_commit2', 'still more test content', 'yet another test commit')
def _three_local_commits(self):
- write_into_file_at_path('test_file_commit0', 'more test content')
- run_command(['git', 'add', 'test_file_commit0'])
- self.scm.commit_locally_with_message("another test commit")
+ self._local_commit('test_file_commit0', 'more test content', 'another test commit')
self._two_local_commits()
def test_revisions_changing_files_with_local_commit(self):
@@ -1083,6 +1082,21 @@ class GitSVNTest(SCMTest):
self._two_local_commits()
scm = detect_scm_system(self.git_checkout_path)
self.assertRaises(AmbiguousCommitError, scm.commit_with_message, "another test commit")
+ commit_text = scm.commit_with_message("another test commit", force_squash=True)
+
+ self.assertEqual(scm.svn_revision_from_commit_text(commit_text), '6')
+
+ svn_log = run_command(['git', 'svn', 'log', '--limit=1', '--verbose'])
+ self.assertFalse(re.search(r'test_file2', svn_log))
+ self.assertTrue(re.search(r'test_file_commit2', svn_log))
+ self.assertTrue(re.search(r'test_file_commit1', svn_log))
+
+ def test_commit_with_message_not_synced_with_conflict(self):
+ run_command(['git', 'checkout', '-b', 'my-branch', 'trunk~3'])
+ self._local_commit('test_file2', 'asdf', 'asdf commit')
+
+ scm = detect_scm_system(self.git_checkout_path)
+ # There's a conflict between trunk and the test_file2 modification.
self.assertRaises(ScriptError, scm.commit_with_message, "another test commit", force_squash=True)
def test_remote_branch_ref(self):
@@ -1158,7 +1172,10 @@ class GitSVNTest(SCMTest):
run_command(['git', 'checkout', '-b', 'my-branch', 'trunk~3'])
self._two_local_commits()
scm = detect_scm_system(self.git_checkout_path)
- self.assertRaises(ScriptError, scm.create_patch)
+ patch = scm.create_patch()
+ self.assertFalse(re.search(r'test_file2', patch))
+ self.assertTrue(re.search(r'test_file_commit2', patch))
+ self.assertTrue(re.search(r'test_file_commit1', patch))
def test_create_binary_patch(self):
# Create a git binary patch and check the contents.
@@ -1226,7 +1243,19 @@ class GitSVNTest(SCMTest):
run_command(['git', 'checkout', '-b', 'my-branch', 'trunk~3'])
self._two_local_commits()
scm = detect_scm_system(self.git_checkout_path)
- self.assertRaises(ScriptError, scm.changed_files)
+ files = scm.changed_files()
+ self.assertFalse('test_file2' in files)
+ self.assertTrue('test_file_commit2' in files)
+ self.assertTrue('test_file_commit1' in files)
+
+ def test_changed_files_not_synced(self):
+ run_command(['git', 'checkout', '-b', 'my-branch', 'trunk~3'])
+ self._two_local_commits()
+ scm = detect_scm_system(self.git_checkout_path)
+ files = scm.changed_files()
+ self.assertFalse('test_file2' in files)
+ self.assertTrue('test_file_commit2' in files)
+ self.assertTrue('test_file_commit1' in files)
def test_changed_files(self):
self._shared_test_changed_files()
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list