Rev 6497: (jelmer) Allow control directories to not support branch names containing in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/
Patch Queue Manager
pqm at pqm.ubuntu.com
Mon Mar 12 15:31:15 UTC 2012
At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 6497 [merge]
revision-id: pqm at pqm.ubuntu.com-20120312153114-roz3tzlcn7eaiwmc
parent: pqm at pqm.ubuntu.com-20120312150317-nrt00el7ooyvbk94
parent: jelmer at samba.org-20120305235000-vc2dj2soccxxh5kj
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2012-03-12 15:31:14 +0000
message:
(jelmer) Allow control directories to not support branch names containing
slashes. (Jelmer Vernooij)
modified:
bzrlib/errors.py errors.py-20050309040759-20512168c4e14fbd
bzrlib/tests/per_controldir_colo/test_supported.py test_supported.py-20100411192232-kawv9qu1t42gv89k-3
=== 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".'
=== 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:50:00 +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)
More information about the bazaar-commits
mailing list