Changeset 70014 in webkit
- Timestamp:
- Oct 18, 2010 6:38:00 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r70013 r70014 1 2010-10-18 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 scm.py should be able tell us what revisions made changes to a given file 6 https://bugs.webkit.org/show_bug.cgi?id=47863 7 8 Look again, your SCM.py can now log files. 9 10 * Scripts/webkitpy/common/checkout/scm.py: 11 * Scripts/webkitpy/common/checkout/scm_unittest.py: 12 1 13 2010-10-18 Dirk Pranke <dpranke@chromium.org> 2 14 -
trunk/WebKitTools/Scripts/webkitpy/common/checkout/scm.py
r66064 r70014 246 246 self._subclass_must_implement() 247 247 248 def changed_files_for_revision(self): 248 def changed_files_for_revision(self, revision): 249 self._subclass_must_implement() 250 251 def revisions_changing_file(self, path, limit=5): 249 252 self._subclass_must_implement() 250 253 … … 428 431 return self.run_status_and_extract_filenames(status_command, self._status_regexp("ACDMR")) 429 432 433 def revisions_changing_file(self, path, limit=5): 434 revisions = [] 435 log_command = ['svn', 'log', '--quiet', '--limit=%s' % limit, path] 436 for line in self.run(log_command, cwd=self.checkout_root).splitlines(): 437 match = re.search('^r(?P<revision>\d+) ', line) 438 if not match: 439 continue 440 revisions.append(int(match.group('revision'))) 441 return revisions 442 430 443 def conflicted_files(self): 431 444 return self.run_status_and_extract_filenames(self.status_command(), self._status_regexp("C")) … … 654 667 return self._changes_files_for_commit(commit_id) 655 668 669 def revisions_changing_file(self, path, limit=5): 670 commit_ids = self.run(["git", "log", "--pretty=format:%H", "-%s" % limit, path]).splitlines() 671 return map(self.svn_revision_from_git_commit, commit_ids) 672 656 673 def conflicted_files(self): 657 674 # We do not need to pass decode_output for this diff command … … 688 705 raise ScriptError(message='Failed to find git commit for revision %s, your checkout likely needs an update.' % revision) 689 706 return git_commit 707 708 def svn_revision_from_git_commit(self, commit_id): 709 return int(self.run(['git', 'svn', 'find-rev', commit_id]).rstrip()) 690 710 691 711 def contents_at_revision(self, path, revision): -
trunk/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py
r65572 r70014 353 353 self.assertRaises(ScriptError, self.scm.contents_at_revision, "does_not_exist", 2) 354 354 355 def _shared_test_revisions_changing_file(self): 356 self.assertEqual(self.scm.revisions_changing_file("test_file"), [5, 4, 3, 2]) 357 self.assertRaises(ScriptError, self.scm.revisions_changing_file, "non_existent_file") 358 355 359 def _shared_test_committer_email_for_revision(self): 356 360 self.assertEqual(self.scm.committer_email_for_revision(3), getpass.getuser()) # Committer "email" will be the current user … … 697 701 self._shared_test_contents_at_revision() 698 702 703 def test_revisions_changing_file(self): 704 self._shared_test_revisions_changing_file() 705 699 706 def test_committer_email_for_revision(self): 700 707 self._shared_test_committer_email_for_revision() … … 1200 1207 self._shared_test_contents_at_revision() 1201 1208 1209 def test_revisions_changing_file(self): 1210 self._shared_test_revisions_changing_file() 1211 1202 1212 def test_added_files(self): 1203 1213 self._shared_test_added_files()
Note: See TracChangeset
for help on using the changeset viewer.