Description: Allow creating branches with a slash in their name
Author: Jelmer Vernooij <jelmer@samba.org>
Status: submitted upstream

=== modified file 'bzrlib/tests/per_controldir_colo/test_supported.py'
--- a/bzrlib/tests/per_controldir_colo/test_supported.py	2012-02-19 14:34:22 +0000
+++ b/bzrlib/tests/per_controldir_colo/test_supported.py	2012-03-05 23:34:55 +0000
@@ -137,7 +137,11 @@
 
     def test_branch_name_with_slash(self):
         repo = self.make_repository('branch-1')
-        target_branch = repo.bzrdir.create_branch(name='foo/bar')
+        try:
+            target_branch = repo.bzrdir.create_branch(name='foo/bar')
+        except errors.InvalidBranchName:
+            raise tests.TestNotApplicable(
+                "format does not support branches with / in their name")
         self.assertEqual(['foo/bar'], repo.bzrdir.get_branches().keys())
         self.assertEqual(
             target_branch.base, repo.bzrdir.open_branch(name='foo/bar').base)

=== modified file 'bzrlib/errors.py'
--- a/bzrlib/errors.py	2012-02-02 12:10:04 +0000
+++ b/bzrlib/errors.py	2012-03-05 23:50:00 +0000
@@ -710,6 +710,15 @@
     _fmt = 'Already a branch: "%(path)s".'
 
 
+class InvalidBranchName(PathError):
+
+    _fmt = "Invalid branch name: %(name)s"
+
+    def __init__(self, name):
+        BzrError.__init__(self)
+        self.name = name
+
+
 class ParentBranchExists(AlreadyBranchError):
 
     _fmt = 'Parent branch already exists: "%(path)s".'

