Changeset 56835 in webkit
- Timestamp:
- Mar 31, 2010 3:45:57 AM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r56828 r56835 1 2010-03-31 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 path to committers.py in commit-queue rejection message is wrong 6 https://bugs.webkit.org/show_bug.cgi?id=36865 7 8 This fix would have only been 3 lines long if we had 9 1. Had access to an SCM object or tool to give us the checkout root 10 2. Been able to depend on Python 2.6 11 Instead I've added a bunch of hack code, but at least now 12 we should never have to update this string again as the location 13 of committers.py is fully dynamically discovered. :p 14 15 * Scripts/webkitpy/common/net/bugzilla.py: 16 * Scripts/webkitpy/common/net/bugzilla_unittest.py: 17 1 18 2010-03-31 Shinichiro Hamaji <hamaji@chromium.org> 2 19 -
trunk/WebKitTools/Scripts/webkitpy/common/net/bugzilla.py
r56544 r56835 31 31 # WebKit's Python module for interacting with Bugzilla 32 32 33 import os.path 33 34 import re 34 35 import subprocess … … 38 39 # Import WebKit-specific modules. 39 40 from webkitpy.common.system.deprecated_logging import error, log 40 from webkitpy.common.config .committers import CommitterList41 from webkitpy.common.config import committers 41 42 from webkitpy.common.net.credentials import Credentials 42 43 from webkitpy.common.system.user import User … … 278 279 return "http://trac.webkit.org/browser/trunk/%s" % local_path 279 280 281 def _checkout_root(self): 282 # FIXME: This is a hack, we would have this from scm.checkout_root 283 # if we had any way to get to an scm object here. 284 components = __file__.split(os.sep) 285 tools_index = components.index("WebKitTools") 286 return os.sep.join(components[:tools_index]) 287 288 def _relpath(self, path, start): 289 # FIXME: When we're allowed to use python 2.6 we can use the real os.path.relpath 290 path_components = os.path.realpath(path).split(os.sep) 291 start_components = os.path.realpath(start).split(os.sep) 292 if path_components[len(start_components) - 1].lower() != start_components[-1].lower(): 293 raise "This os.path.relpath hack can't handle path=%s start=%s" % (path, start) 294 return os.sep.join(path_components[len(start_components):]) 295 296 def _committers_py_path(self): 297 # extension can sometimes be .pyc, we always want .py 298 (path, extension) = os.path.splitext(committers.__file__) 299 path = self._relpath(path, self._checkout_root()) 300 return ".".join([path, "py"]) 301 280 302 def _flag_permission_rejection_message(self, setter_email, flag_name): 281 # This could be computed from CommitterList.__file__282 committer_list = "WebKitTools/Scripts/webkitpy/committers.py"283 303 # Should come from some webkit_config.py 284 304 contribution_guidlines = "http://webkit.org/coding/contributing.html" … … 287 307 # This could be queried from the tool. 288 308 queue_name = "commit-queue" 309 committers_list = self._committers_py_path() 289 310 message = "%s does not have %s permissions according to %s." % ( 290 311 setter_email, 291 312 flag_name, 292 self._view_source_url(committer _list))313 self._view_source_url(committers_list)) 293 314 message += "\n\n- If you do not have %s rights please read %s for instructions on how to use bugzilla flags." % ( 294 315 flag_name, contribution_guidlines) 295 316 message += "\n\n- If you have %s rights please correct the error in %s by adding yourself to the file (no review needed). " % ( 296 flag_name, committer _list)317 flag_name, committers_list) 297 318 message += "Due to bug 30084 the %s will require a restart after your change. " % queue_name 298 319 message += "Please contact %s to request a %s restart. " % ( … … 347 368 class Bugzilla(object): 348 369 349 def __init__(self, dryrun=False, committers= CommitterList()):370 def __init__(self, dryrun=False, committers=committers.CommitterList()): 350 371 self.dryrun = dryrun 351 372 self.authenticated = False -
trunk/WebKitTools/Scripts/webkitpy/common/net/bugzilla_unittest.py
r56519 r56835 62 62 def test_flag_permission_rejection_message(self): 63 63 validator = CommitterValidator(bugzilla=None) 64 expected_messsage="""foo@foo.com does not have review permissions according to http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/committers.py. 64 self.assertEqual(validator._committers_py_path(), "WebKitTools/Scripts/webkitpy/common/config/committers.py") 65 expected_messsage="""foo@foo.com does not have review permissions according to http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/common/config/committers.py. 65 66 66 67 - If you do not have review rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags. 67 68 68 - If you have review rights please correct the error in WebKitTools/Scripts/webkitpy/comm itters.py by adding yourself to the file (no review needed). Due to bug 30084 the commit-queue will require a restart after your change. Please contact eseidel@chromium.org to request a commit-queue restart. After restart the commit-queue will correctly respect your review rights."""69 - If you have review rights please correct the error in WebKitTools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed). Due to bug 30084 the commit-queue will require a restart after your change. Please contact eseidel@chromium.org to request a commit-queue restart. After restart the commit-queue will correctly respect your review rights.""" 69 70 self.assertEqual(validator._flag_permission_rejection_message("foo@foo.com", "review"), expected_messsage) 70 71
Note: See TracChangeset
for help on using the changeset viewer.