# HG changeset patch # User cmlenz # Date 1136896275 0 # Node ID 9644b07b90c65751b3db0ea1e6c2df0c137d0847 # Parent 72682b71eb3d2dcbe699ed6549685ea657e9e59e Ported [341] to 0.5.x. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Version 0.5.1 +(10 January 2006, from 0.5.x branch) +http://bitten.cmlenz.net/repos/bitten/tags/0.5.1 + + * Fixes compatibility with Trac 0.9.3 release, as well as the current trunk. + * Improves PostgreSQL compatibility. + * Fixes encoding of non-ASCII characters in command output. + * Fix for missing log output when using on Windows. + Version 0.5 (6 October 2005, from 0.5.x branch) http://bitten.cmlenz.net/repos/bitten/tags/0.5 diff --git a/bitten/__init__.py b/bitten/__init__.py --- a/bitten/__init__.py +++ b/bitten/__init__.py @@ -7,4 +7,4 @@ # you should have received as part of this distribution. The terms # are also available at http://bitten.cmlenz.net/wiki/License. -__version__ = '0.5' +__version__ = '0.5.1' diff --git a/bitten/trac_ext/tests/web_ui.py b/bitten/trac_ext/tests/web_ui.py --- a/bitten/trac_ext/tests/web_ui.py +++ b/bitten/trac_ext/tests/web_ui.py @@ -186,6 +186,18 @@ assert module.match_request(req) self.assertRaises(TracError, module.process_request, req) + def test_new_config_submit_with_invalid_name(self): + PermissionSystem(self.env).grant_permission('joe', 'BUILD_ADMIN') + req = Mock(Request, method='POST', cgi_location='', path_info='/build', + hdf=HDFWrapper(), perm=PermissionCache(self.env, 'joe'), + args={'action': 'new', 'name': 'Foo bar', + 'path': 'test/trunk', 'label': 'Test', + 'description': 'Bla bla'}) + + module = BuildConfigController(self.env) + assert module.match_request(req) + self.assertRaises(TracError, module.process_request, req) + def test_new_config_submit_invalid_path(self): PermissionSystem(self.env).grant_permission('joe', 'BUILD_ADMIN') req = Mock(Request, method='POST', cgi_location='', path_info='/build', diff --git a/bitten/trac_ext/web_ui.py b/bitten/trac_ext/web_ui.py --- a/bitten/trac_ext/web_ui.py +++ b/bitten/trac_ext/web_ui.py @@ -220,8 +220,12 @@ req.redirect(self.env.href.build(config.name)) def _process_config(self, req, config): - if not req.args.get('name'): + name = req.args.get('name') + if not name: raise TracError('Missing required field "name"', 'Missing field') + if not re.match(r'^[\w.-]+$', name): + raise TracError('The field "name" may only contain letters, ' + 'digits, periods, or dashes.', 'Invalid field') path = req.args.get('path', '') repos = self.env.get_repository(req.authname) @@ -247,7 +251,7 @@ except InvalidRecipeError, e: raise TracError(e, 'Invalid recipe') - config.name = req.args.get('name') + config.name = name config.path = repos.normalize_path(path) config.recipe = recipe_xml config.min_rev = req.args.get('min_rev')