Rev 1361: Fix get_branch_path(). in http://people.samba.org/bzr/jelmer/bzr-svn/0.4
Jelmer Vernooij
jelmer at samba.org
Thu Jun 26 23:38:41 BST 2008
At http://people.samba.org/bzr/jelmer/bzr-svn/0.4
------------------------------------------------------------
revno: 1361
revision-id: jelmer at samba.org-20080626223840-p31esv00vqkqqyyr
parent: jelmer at samba.org-20080626222321-d1a43aaw07nbt19t
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Fri 2008-06-27 00:38:40 +0200
message:
Fix get_branch_path().
modified:
branch.py svnbranch.py-20051017135706-11c749eb0dab04a7
tests/test_branch.py test_branch.py-20060508162215-74ffeb5d608f8e20
=== modified file 'branch.py'
--- a/branch.py 2008-06-25 09:12:59 +0000
+++ b/branch.py 2008-06-26 22:38:40 +0000
@@ -115,8 +115,10 @@
if revnum is None:
return self._branch_path
- # TODO: Use revnum - this branch may have been moved in the past
- return self._branch_path
+ # Use revnum - this branch may have been moved in the past
+ return self.repository.transport.get_locations(
+ self._branch_path, self.get_revnum(),
+ [revnum])[revnum].strip("/")
def get_revnum(self):
"""Obtain the Subversion revision number this branch was
=== modified file 'tests/test_branch.py'
--- a/tests/test_branch.py 2008-06-26 16:28:29 +0000
+++ b/tests/test_branch.py 2008-06-26 22:38:40 +0000
@@ -16,6 +16,7 @@
"""Branch tests."""
+from bzrlib import urlutils
from bzrlib.branch import Branch
from bzrlib.bzrdir import BzrDir
from bzrlib.errors import NoSuchFile, NoSuchRevision, NotBranchError
@@ -45,6 +46,21 @@
branch = Branch.open(repos_url)
self.assertEqual("", branch.get_branch_path())
+ def test_get_branch_path_old(self):
+ repos_url = self.make_repository("a")
+
+ dc = self.get_commit_editor(repos_url)
+ dc.add_dir("trunk")
+ dc.close()
+
+ dc = self.get_commit_editor(repos_url)
+ dc.add_dir("trunk2", "trunk", 1)
+ dc.close()
+
+ branch = Branch.open(urlutils.join(repos_url, "trunk2"))
+ self.assertEqual("trunk2", branch.get_branch_path(2))
+ self.assertEqual("trunk", branch.get_branch_path(1))
+
def test_get_branch_path_subdir(self):
repos_url = self.make_repository("a")
More information about the bazaar-commits
mailing list