Changeset 147984 in webkit
- Timestamp:
- Apr 8, 2013 11:44:56 PM (11 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r147982 r147984 1 2013-04-08 Ryosuke Niwa <rniwa@webkit.org> 2 3 WKR (new-commit-bot) is too slow 4 https://bugs.webkit.org/show_bug.cgi?id=110087 5 6 Reviewed by Geoffrey Garen. 7 8 Running "svn up" or "git svn fetch" is way too slow (takes 2-3 minutes) on the machine I'm running the bot. 9 Just run "svn log -r <revision>" instead to cut down the delay. 10 11 Unfortunately, this work around doesn't work in a git checkout but who cares given I'm the one running the bot. 12 13 * Scripts/webkitpy/tool/commands/newcommitbot.py: 14 (NewCommitBot): 15 (NewCommitBot.next_work_item): 16 (NewCommitBot._is_empty_log): 17 (NewCommitBot._update_checkout): 18 1 19 2013-04-08 Ryosuke Niwa <rniwa@webkit.org> 2 20 -
trunk/Tools/Scripts/webkitpy/tool/commands/newcommitbot.py
r144040 r147984 32 32 33 33 from webkitpy.common.config.committers import CommitterList 34 from webkitpy.common.system.executive import ScriptError 34 35 from webkitpy.tool.bot.irc_command import IRCCommand 35 36 from webkitpy.tool.bot.irc_command import Help … … 57 58 } 58 59 60 _maximum_number_of_revisions_to_avoid_spamming_irc = 10 61 59 62 # AbstractQueue methods 60 63 … … 73 76 _log.info('Last SVN revision: %d' % self._last_svn_revision) 74 77 75 _log.info('Updating checkout')76 self._update_checkout()78 if self._tool.scm().executable_name != 'svn': 79 _log.error('This bot only works inside a SVN checkout') 77 80 78 _log.info('Obtaining new SVN revisions') 79 revisions = self._new_svn_revisions() 81 for revision in range(self._last_svn_revision + 1, self._last_svn_revision + self._maximum_number_of_revisions_to_avoid_spamming_irc): 82 try: 83 commit_log = self._tool.scm().svn_commit_log(revision) 84 except ScriptError: 85 break 86 if self._is_empty_log(commit_log): 87 continue 88 _log.info('Found revision %d' % revision) 89 self._last_svn_revision = revision 90 self._tool.irc().post(self._summarize_commit_log(commit_log).encode('utf-8')) 80 91 81 _log.info('Obtaining commit logs for %d revisions' % len(revisions)) 82 for revision in revisions: 83 commit_log = self._tool.scm().svn_commit_log(revision) 84 self._tool.irc().post(self._summarize_commit_log(commit_log).encode('ascii', 'ignore')) 85 86 return 92 def _is_empty_log(self, commit_log): 93 return re.match(r'^\-+$', commit_log) 87 94 88 95 def process_work_item(self, failure_map): … … 92 99 tool = self._tool 93 100 tool.executive.run_and_throw_if_fail(tool.deprecated_port().update_webkit_command(), quiet=True, cwd=tool.scm().checkout_root) 94 95 def _new_svn_revisions(self):96 scm = self._tool.scm()97 current_head = int(scm.head_svn_revision())98 first_new_revision = self._last_svn_revision + 199 self._last_svn_revision = current_head100 return range(max(first_new_revision, current_head - 20), current_head + 1)101 101 102 102 _patch_by_regex = re.compile(r'^Patch\s+by\s+(?P<author>.+?)\s+on(\s+\d{4}-\d{2}-\d{2})?\n?', re.MULTILINE | re.IGNORECASE)
Note: See TracChangeset
for help on using the changeset viewer.