Rev 419: Make sure returns work when using the error decorator, add simple test for nick names in working trees. in http://people.samba.org/bzr/jelmer/bzr-svn/bzr.dev
Jelmer Vernooij
jelmer at samba.org
Wed Jan 31 12:55:01 GMT 2007
At http://people.samba.org/bzr/jelmer/bzr-svn/bzr.dev
------------------------------------------------------------
revno: 419
revision-id: jelmer at samba.org-20070131125440-9iuoz9y1oo3omtxv
parent: jelmer at samba.org-20070131120255-aty0vln7gmh7wfgh
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: main
timestamp: Wed 2007-01-31 13:54:40 +0100
message:
Make sure returns work when using the error decorator, add simple test for nick names in working trees.
modified:
branch.py svnbranch.py-20051017135706-11c749eb0dab04a7
errors.py errors.py-20061226172623-w1sbj8ynpo0eojqp-1
tests/test_errors.py test_errors.py-20070129114605-ban03f32t6ja14ez-1
tests/test_workingtree.py test_workingtree.py-20060622191524-0di7bc3q1ckdbybb-1
=== modified file 'branch.py'
--- a/branch.py 2007-01-14 23:38:09 +0000
+++ b/branch.py 2007-01-31 12:54:40 +0000
@@ -132,9 +132,10 @@
return inv.root.file_id
def _get_nick(self):
+ bp = self.branch_path.strip("/")
if self.branch_path == "":
return None
- return self.branch_path.strip("/")
+ return bp
nick = property(_get_nick)
=== modified file 'errors.py'
--- a/errors.py 2007-01-29 17:21:00 +0000
+++ b/errors.py 2007-01-31 12:54:40 +0000
@@ -42,7 +42,7 @@
"""
def convert(*args, **kwargs):
try:
- unbound(*args, **kwargs)
+ return unbound(*args, **kwargs)
except svn.core.SubversionException, e:
raise convert_error(e)
=== modified file 'tests/test_errors.py'
--- a/tests/test_errors.py 2007-01-29 17:21:00 +0000
+++ b/tests/test_errors.py 2007-01-31 12:54:40 +0000
@@ -44,4 +44,9 @@
def test_convert_error_reset(self):
self.assertIsInstance(convert_error(SubversionException(svn.core.SVN_ERR_RA_SVN_CONNECTION_CLOSED, "Connection closed")), ConnectionReset)
+ def test_decorator_nothrow(self):
+ @convert_svn_error
+ def test_nothrow(foo):
+ return foo+1
+ self.assertEqual(2, test_nothrow(1))
=== modified file 'tests/test_workingtree.py'
--- a/tests/test_workingtree.py 2007-01-15 17:28:15 +0000
+++ b/tests/test_workingtree.py 2007-01-31 12:54:40 +0000
@@ -496,4 +496,11 @@
tree.commit("msg")
self.assertEqual("fooid", tree.inventory.path2id("file with spaces"))
+ def test_get_branch_nick(self):
+ self.make_client('a', 'dc')
+ self.build_tree({'dc/some strange file': 'data'})
+ tree = WorkingTree.open("dc")
+ tree.add(["some strange file"])
+ tree.commit("message")
+ self.assertEqual(None, tree.branch.nick)
More information about the bazaar-commits
mailing list