Use tuples with startswith()
authorGregory Szorc <gps@mozilla.com>
Wed, 16 Oct 2013 15:59:18 -0700
changeset 50 9bd88e34d7dcab13b6b4a665b216e48fff123e34
parent 49 62f51eeea26b0b4cbd301ee8e19fe90ea872521a
child 51 3dc420de34e5f6b10d56ebd2257c1c00ccbb248b
push id33
push usergszorc@mozilla.com
push dateWed, 16 Oct 2013 22:59:18 +0000
Use tuples with startswith()
__init__.py
--- a/__init__.py
+++ b/__init__.py
@@ -499,17 +499,17 @@ def critic_hook(ui, repo, node=None, **o
 
 
 def reject_repo_names_hook(ui, repo, namespace=None, key=None, old=None,
         new=None, **kwargs):
     """prepushkey hook that prevents changes to reserved names.
 
     Names that begin with the name of a repository identifier are rejected.
     """
-    if key.lower().startswith(REPOS.keys()):
+    if key.lower().startswith(tuple(REPOS.keys())):
         ui.warn('You are not allowed to push tags or bookmarks that share '
             'names with official Mozilla repositories: %s' % key)
         return True
 
     return False
 
 
 def pullexpand(orig, ui, repo, source='default', **opts):