Rev 994: Move v3-specific error to mapping3 package. in file:///data/jelmer/bzr-svn/layout/

Jelmer Vernooij jelmer at samba.org
Fri May 2 21:55:21 BST 2008


At file:///data/jelmer/bzr-svn/layout/

------------------------------------------------------------
revno: 994
revision-id: jelmer at samba.org-20080502205520-b79rcjs1ttzpzrh8
parent: jelmer at samba.org-20080502202505-dt4qe0v8dsdivtpk
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: layout
timestamp: Fri 2008-05-02 22:55:20 +0200
message:
  Move v3-specific error to mapping3 package.
modified:
  errors.py                      errors.py-20061226172623-w1sbj8ynpo0eojqp-1
  mapping3/scheme.py             scheme.py-20060516195850-95181aae6b272f9e
  tests/test_errors.py           test_errors.py-20070129114605-ban03f32t6ja14ez-1
  tests/test_scheme.py           test_scheme.py-20060621221855-va2xabhlxpmc9llx-1
=== modified file 'errors.py'
--- a/errors.py	2008-05-02 19:36:00 +0000
+++ b/errors.py	2008-05-02 20:55:20 +0000
@@ -41,18 +41,6 @@
         self.mapping = mapping
 
 
-class InvalidSvnBranchPath(NotBranchError):
-    """Error raised when a path was specified that is not a child of or itself
-    a valid branch path in the current branching scheme."""
-    _fmt = """%(path)s is not a valid Subversion branch path in the current 
-branching scheme. See 'bzr help svn-branching-schemes' for details."""
-
-    def __init__(self, path, scheme):
-        assert isinstance(path, str)
-        NotBranchError.__init__(self, urllib.quote(path))
-        self.scheme = scheme
-
-
 class NoSvnRepositoryPresent(NoRepositoryPresent):
 
     def __init__(self, url):

=== modified file 'mapping3/scheme.py'
--- a/mapping3/scheme.py	2008-05-02 20:24:01 +0000
+++ b/mapping3/scheme.py	2008-05-02 20:55:20 +0000
@@ -19,13 +19,25 @@
 from bzrlib.errors import BzrError
 from bzrlib.trace import mutter
 
-from errors import InvalidSvnBranchPath
+from bzrlib.errors import NotBranchError
 
 from base64 import urlsafe_b64decode, urlsafe_b64encode
 from layout import RepositoryLayout
 import util
 import bz2
 
+class InvalidSvnBranchPath(NotBranchError):
+    """Error raised when a path was specified that is not a child of or itself
+    a valid branch path in the current branching scheme."""
+    _fmt = """%(path)s is not a valid Subversion branch path in the current 
+branching scheme. See 'bzr help svn-branching-schemes' for details."""
+
+    def __init__(self, path, scheme):
+        assert isinstance(path, str)
+        NotBranchError.__init__(self, urllib.quote(path))
+        self.scheme = scheme
+
+
 class BranchingScheme(RepositoryLayout):
     """ Divides SVN repository data up into branches. Since there
     is no proper way to do this, there are several subclasses of this class

=== modified file 'tests/test_errors.py'
--- a/tests/test_errors.py	2008-03-24 04:52:30 +0000
+++ b/tests/test_errors.py	2008-05-02 20:55:20 +0000
@@ -20,7 +20,7 @@
 from bzrlib.tests import TestCase
 
 from errors import (convert_svn_error, convert_error, InvalidPropertyValue, 
-                    InvalidSvnBranchPath, NotSvnBranchPath, 
+                    NotSvnBranchPath, 
                     SVN_ERR_UNKNOWN_HOSTNAME)
 
 import svn.core
@@ -83,8 +83,5 @@
           "Invalid property value for Subversion property svn:foobar: corrupt", 
           str(error))
 
-    def test_invalidsvnbranchpath_nonascii(self):
-        InvalidSvnBranchPath('\xc3\xb6', None)
-
     def test_notsvnbranchpath_nonascii(self):
         NotSvnBranchPath('\xc3\xb6', None)

=== modified file 'tests/test_scheme.py'
--- a/tests/test_scheme.py	2008-05-02 18:37:05 +0000
+++ b/tests/test_scheme.py	2008-05-02 20:55:20 +0000
@@ -23,11 +23,16 @@
                     BranchingScheme, TrunkBranchingScheme, 
                     SingleBranchingSchemev0, 
                     SingleBranchingScheme, 
-                    UnknownBranchingScheme,
+                    UnknownBranchingScheme, InvalidSvnBranchPath, 
                     parse_list_scheme_text, find_commit_paths, 
                     guess_scheme_from_branch_path, guess_scheme_from_history,
                     guess_scheme_from_path, scheme_from_branch_list)
 
+class TestErrors(TestCase):
+    def test_invalidsvnbranchpath_nonascii(self):
+        InvalidSvnBranchPath('\xc3\xb6', None)
+
+
 class BranchingSchemeTest(TestCase):
     def test_is_branch(self):
         self.assertRaises(NotImplementedError, BranchingScheme().is_branch, "")




More information about the bazaar-commits mailing list