Rev 1650: Avoid returning None as branch nick. in http://people.samba.org/bzr/jelmer/bzr-svn/trunk

Jelmer Vernooij jelmer at samba.org
Mon Aug 25 03:03:41 BST 2008


At http://people.samba.org/bzr/jelmer/bzr-svn/trunk

------------------------------------------------------------
revno: 1650
revision-id: jelmer at samba.org-20080825020339-0xtn3igqndm1ybxs
parent: jelmer at samba.org-20080825013246-fgsbl340zifzsbfc
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Mon 2008-08-25 04:03:39 +0200
message:
  Avoid returning None as branch nick.
modified:
  branch.py                      svnbranch.py-20051017135706-11c749eb0dab04a7
  tests/test_branch.py           test_branch.py-20060508162215-74ffeb5d608f8e20
  tests/test_workingtree.py      test_workingtree.py-20060622191524-0di7bc3q1ckdbybb-1
=== modified file 'branch.py'
--- a/branch.py	2008-08-25 00:05:15 +0000
+++ b/branch.py	2008-08-25 02:03:39 +0000
@@ -243,7 +243,7 @@
         """
         bp = self._branch_path.strip("/")
         if self._branch_path == "":
-            return None
+            return self.base.split("/")[-1]
         return bp
 
     nick = property(_get_nick)

=== modified file 'tests/test_branch.py'
--- a/tests/test_branch.py	2008-08-24 15:29:46 +0000
+++ b/tests/test_branch.py	2008-08-25 02:03:39 +0000
@@ -370,7 +370,7 @@
 
         branch = Branch.open(repos_url)
 
-        self.assertIs(None, branch.nick)
+        self.assertEquals("a", branch.nick)
 
     def test_get_nick_path(self):
         repos_url = self.make_repository('a')

=== modified file 'tests/test_workingtree.py'
--- a/tests/test_workingtree.py	2008-08-23 20:18:49 +0000
+++ b/tests/test_workingtree.py	2008-08-25 02:03:39 +0000
@@ -632,7 +632,7 @@
         tree = WorkingTree.open("dc")
         tree.add(["some strange file"])
         tree.commit("message")
-        self.assertEqual(None, tree.branch.nick)
+        self.assertEqual("a", tree.branch.nick)
 
     def test_out_of_date(self):
         repos_url = self.make_client('a', 'dc')




More information about the bazaar-commits mailing list