Rev 1850: Fix tests. in file:///data/jelmer/bzr-svn/trunk/
Jelmer Vernooij
jelmer at samba.org
Sun Sep 7 03:22:40 BST 2008
At file:///data/jelmer/bzr-svn/trunk/
------------------------------------------------------------
revno: 1850
revision-id: jelmer at samba.org-20080907022228-jgxoyt0vnd6lr7uw
parent: jelmer at samba.org-20080907020805-p3ltwvhuvrluxf5a
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Sun 2008-09-07 04:22:28 +0200
message:
Fix tests.
modified:
convert.py svn2bzr.py-20051018015439-cb4563bff29e632d
repository.py repository.py-20060306123302-1f8c5069b3fe0265
tests/mapping_implementations/test_repository.py test_repository.py-20080902013845-ity7d1ymye69sobm-2
=== modified file 'convert.py'
--- a/convert.py 2008-09-07 02:08:05 +0000
+++ b/convert.py 2008-09-07 02:22:28 +0000
@@ -175,7 +175,7 @@
# just listing the branches in HEAD, so avoid it if possible.
# If there's more than one subdirectory (we always have .bzr), we may
# have to remove existing branches.
- if (not keep and len(to_transport.list_dir(".")) > 1):
+ if (not keep and to_transport.has(".") and len(to_transport.list_dir(".")) > 1):
removed_branches = source_repos.find_deleted_branches_between(layout=layout,
from_revnum=from_revnum, to_revnum=to_revnum, project=project)
else:
=== modified file 'repository.py'
--- a/repository.py 2008-09-07 02:01:34 +0000
+++ b/repository.py 2008-09-07 02:22:28 +0000
@@ -596,7 +596,8 @@
if project is None:
prefixes = [""]
else:
- prefixes = layout.get_project_prefixes(project)
+ # FIXME: Use prefixes = layout.get_project_prefixes(project)
+ prefixes = [""]
try:
for (paths, revnum, revprops) in self._log.iter_changes(prefixes, from_revnum, to_revnum, pb=pb):
if revprops is None:
=== modified file 'tests/mapping_implementations/test_repository.py'
--- a/tests/mapping_implementations/test_repository.py 2008-09-05 20:24:24 +0000
+++ b/tests/mapping_implementations/test_repository.py 2008-09-07 02:22:28 +0000
@@ -411,7 +411,7 @@
self.assertEqual([("tags/branchab", 2, True),
("tags/brancha", 2, True)],
- list(repos.find_branchpaths(TrunkLayout(0).is_tag, TrunkLayout(0).is_tag_parent, to_revnum=2)))
+ list(repos.find_branchpaths(TrunkLayout(0), to_revnum=2)))
def test_find_branchpaths_start_revno(self):
repos_url = self.make_repository("a")
@@ -430,8 +430,7 @@
repos.set_layout(TrunkLayout(0))
self.assertEqual([("branches/branchb", 2, True)],
- list(repos.find_branchpaths(TrunkLayout(0).is_branch, TrunkLayout(0).is_branch_parent, from_revnum=2,
- to_revnum=2)))
+ list(repos.find_branchpaths(TrunkLayout(0), from_revnum=2, to_revnum=2)))
def test_find_branchpaths_file_moved_from_nobranch(self):
repos_url = self.make_client("a", "dc")
@@ -445,7 +444,7 @@
self.client_delete("dc/tmp/branches/somefile")
self.client_commit("dc", "My Message 2")
- Repository.open(repos_url).find_branchpaths(TrunkLayout(2).is_branch, TrunkLayout(2).is_branch_parent)
+ Repository.open(repos_url).find_branchpaths(TrunkLayout(2))
def test_find_branchpaths_deleted_from_nobranch(self):
repos_url = self.make_client("a", "dc")
@@ -459,7 +458,7 @@
self.client_delete("dc/tmp/branches/somefile")
self.client_commit("dc", "My Message 2")
- Repository.open(repos_url).find_branchpaths(TrunkLayout(1).is_branch, TrunkLayout(1).is_branch_parent)
+ Repository.open(repos_url).find_branchpaths(TrunkLayout(1))
def test_find_branchpaths_moved_nobranch(self):
repos_url = self.make_client("a", "dc")
@@ -479,7 +478,7 @@
self.assertEqual([("t2/branches/brancha", 2, True),
("t2/branches/branchab", 2, True)],
- list(repos.find_branchpaths(TrunkLayout(1).is_branch, TrunkLayout(1).is_branch_parent, to_revnum=2)))
+ list(repos.find_branchpaths(TrunkLayout(1), to_revnum=2)))
def test_find_branchpaths_root(self):
repos_url = self.make_repository("a")
@@ -488,7 +487,7 @@
repos.set_layout(RootLayout())
self.assertEqual([("", 0, True)],
- list(repos.find_branchpaths(RootLayout().is_branch, RootLayout().is_branch_parent, to_revnum=0)))
+ list(repos.find_branchpaths(RootLayout(), to_revnum=0)))
def test_find_branchpaths_no_later(self):
repos_url = self.make_repository("a")
@@ -497,7 +496,7 @@
repos.set_layout(RootLayout())
self.assertEqual([("", 0, True)],
- list(repos.find_branchpaths(RootLayout().is_branch, RootLayout().is_branch_parent, to_revnum=0)))
+ list(repos.find_branchpaths(RootLayout(), to_revnum=0)))
def test_find_branchpaths_trunk_empty(self):
repos_url = self.make_repository("a")
@@ -506,7 +505,7 @@
repos.set_layout(TrunkLayout(0))
self.assertEqual([],
- list(repos.find_branchpaths(TrunkLayout(0).is_branch, TrunkLayout(0).is_branch_parent, to_revnum=0)))
+ list(repos.find_branchpaths(TrunkLayout(0), to_revnum=0)))
def test_find_branchpaths_trunk_one(self):
repos_url = self.make_repository("a")
@@ -520,7 +519,7 @@
dc.close()
self.assertEqual([("trunk", 1, True)],
- list(repos.find_branchpaths(TrunkLayout(0).is_branch, TrunkLayout(0).is_branch_parent, to_revnum=1)))
+ list(repos.find_branchpaths(TrunkLayout(0), to_revnum=1)))
def test_find_branchpaths_removed(self):
repos_url = self.make_repository("a")
@@ -538,9 +537,9 @@
dc.close()
self.assertEqual([("trunk", 1, True)],
- list(repos.find_branchpaths(TrunkLayout(0).is_branch, TrunkLayout(0).is_branch_parent, to_revnum=1)))
+ list(repos.find_branchpaths(TrunkLayout(0), to_revnum=1)))
self.assertEqual([("trunk", 1, False)],
- list(repos.find_branchpaths(TrunkLayout(0).is_branch, TrunkLayout(0).is_branch_parent, to_revnum=2)))
+ list(repos.find_branchpaths(TrunkLayout(0), to_revnum=2)))
def test_has_revision(self):
bzrdir = self.make_client_and_bzrdir('d', 'dc')
More information about the bazaar-commits
mailing list