Changeset 73384 in webkit
- Timestamp:
- Dec 6, 2010 12:00:21 PM (13 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r73378 r73384 1 2010-12-02 Ojan Vafai <ojan@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 make webkit-patch command work when the git branch is not synced to the remote svn branch 6 https://bugs.webkit.org/show_bug.cgi?id=50424 7 8 * Scripts/webkitpy/common/checkout/scm.py: 9 * Scripts/webkitpy/common/checkout/scm_unittest.py: 10 1 11 2010-12-06 Patrick Gansterer <paroga@webkit.org> 2 12 -
trunk/WebKitTools/Scripts/webkitpy/common/checkout/scm.py
r72575 r73384 643 643 return self.run(["git", "rm", "-f", path]) 644 644 645 def _assert_synced(self):646 if len(run_command(['git', 'rev-list', '--max-count=1', self.remote_branch_ref(), '^HEAD'])):647 raise ScriptError(message="Not fully merged/rebased to %s. This branch needs to be synced first." % self.remote_branch_ref())648 649 645 def merge_base(self, git_commit): 650 646 if git_commit: … … 657 653 return git_commit 658 654 659 self._assert_synced()660 655 return self.remote_merge_base() 661 656 … … 789 784 if not force_squash: 790 785 self._assert_can_squash(working_directory_is_clean) 791 self._assert_synced() 792 self.run(['git', 'reset', '--soft', self.remote_branch_ref()]) 786 self.run(['git', 'reset', '--soft', self.remote_merge_base()]) 793 787 self.commit_locally_with_message(message) 794 788 return self.push_local_commits_to_server() -
trunk/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py
r72575 r73384 963 963 self.assertTrue(re.search(r'test_file_commit1', svn_log)) 964 964 965 def _local_commit(self, filename, contents, message): 966 write_into_file_at_path(filename, contents) 967 run_command(['git', 'add', filename]) 968 self.scm.commit_locally_with_message(message) 969 965 970 def _one_local_commit(self): 966 write_into_file_at_path('test_file_commit1', 'more test content') 967 run_command(['git', 'add', 'test_file_commit1']) 968 self.scm.commit_locally_with_message("another test commit") 971 self._local_commit('test_file_commit1', 'more test content', 'another test commit') 969 972 970 973 def _one_local_commit_plus_working_copy_changes(self): … … 975 978 def _two_local_commits(self): 976 979 self._one_local_commit() 977 write_into_file_at_path('test_file_commit2', 'still more test content') 978 run_command(['git', 'add', 'test_file_commit2']) 979 self.scm.commit_locally_with_message("yet another test commit") 980 self._local_commit('test_file_commit2', 'still more test content', 'yet another test commit') 980 981 981 982 def _three_local_commits(self): 982 write_into_file_at_path('test_file_commit0', 'more test content') 983 run_command(['git', 'add', 'test_file_commit0']) 984 self.scm.commit_locally_with_message("another test commit") 983 self._local_commit('test_file_commit0', 'more test content', 'another test commit') 985 984 self._two_local_commits() 986 985 … … 1084 1083 scm = detect_scm_system(self.git_checkout_path) 1085 1084 self.assertRaises(AmbiguousCommitError, scm.commit_with_message, "another test commit") 1085 commit_text = scm.commit_with_message("another test commit", force_squash=True) 1086 1087 self.assertEqual(scm.svn_revision_from_commit_text(commit_text), '6') 1088 1089 svn_log = run_command(['git', 'svn', 'log', '--limit=1', '--verbose']) 1090 self.assertFalse(re.search(r'test_file2', svn_log)) 1091 self.assertTrue(re.search(r'test_file_commit2', svn_log)) 1092 self.assertTrue(re.search(r'test_file_commit1', svn_log)) 1093 1094 def test_commit_with_message_not_synced_with_conflict(self): 1095 run_command(['git', 'checkout', '-b', 'my-branch', 'trunk~3']) 1096 self._local_commit('test_file2', 'asdf', 'asdf commit') 1097 1098 scm = detect_scm_system(self.git_checkout_path) 1099 # There's a conflict between trunk and the test_file2 modification. 1086 1100 self.assertRaises(ScriptError, scm.commit_with_message, "another test commit", force_squash=True) 1087 1101 … … 1159 1173 self._two_local_commits() 1160 1174 scm = detect_scm_system(self.git_checkout_path) 1161 self.assertRaises(ScriptError, scm.create_patch) 1175 patch = scm.create_patch() 1176 self.assertFalse(re.search(r'test_file2', patch)) 1177 self.assertTrue(re.search(r'test_file_commit2', patch)) 1178 self.assertTrue(re.search(r'test_file_commit1', patch)) 1162 1179 1163 1180 def test_create_binary_patch(self): … … 1227 1244 self._two_local_commits() 1228 1245 scm = detect_scm_system(self.git_checkout_path) 1229 self.assertRaises(ScriptError, scm.changed_files) 1246 files = scm.changed_files() 1247 self.assertFalse('test_file2' in files) 1248 self.assertTrue('test_file_commit2' in files) 1249 self.assertTrue('test_file_commit1' in files) 1250 1251 def test_changed_files_not_synced(self): 1252 run_command(['git', 'checkout', '-b', 'my-branch', 'trunk~3']) 1253 self._two_local_commits() 1254 scm = detect_scm_system(self.git_checkout_path) 1255 files = scm.changed_files() 1256 self.assertFalse('test_file2' in files) 1257 self.assertTrue('test_file_commit2' in files) 1258 self.assertTrue('test_file_commit1' in files) 1230 1259 1231 1260 def test_changed_files(self):
Note: See TracChangeset
for help on using the changeset viewer.