Rev 359: Add test. in http://people.samba.org/bzr/jelmer/bzr-svn/bzr.dev
Jelmer Vernooij
jelmer at samba.org
Tue Jan 2 01:13:11 GMT 2007
------------------------------------------------------------
revno: 359
revision-id: jelmer at samba.org-20070102011143-vht8hgu5s3kmuxf3
parent: jelmer at samba.org-20070102004553-kz46oy53p72cgm6j
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: main
timestamp: Tue 2007-01-02 02:11:43 +0100
message:
Add test.
modified:
branch.py svnbranch.py-20051017135706-11c749eb0dab04a7
tests/test_branch.py test_branch.py-20060508162215-74ffeb5d608f8e20
=== modified file 'branch.py'
--- a/branch.py 2007-01-01 06:17:51 +0000
+++ b/branch.py 2007-01-02 01:11:43 +0000
@@ -91,10 +91,11 @@
if revision_id is None:
rev.kind = svn.core.svn_opt_revision_head
else:
+ assert revision_id in self.revision_history()
(bp, revnum) = self.repository.parse_revision_id(revision_id)
- assert bp == self.branch_path
rev.kind = svn.core.svn_opt_revision_number
rev.value.number = revnum
+ mutter('hist: %r' % self.revision_history())
client_ctx = svn.client.create_context()
svn.client.checkout(bzr_to_svn_url(self.base), to_location, rev,
=== modified file 'tests/test_branch.py'
--- a/tests/test_branch.py 2006-12-31 20:03:11 +0000
+++ b/tests/test_branch.py 2007-01-02 01:11:43 +0000
@@ -457,9 +457,32 @@
oldbranch = Branch.open(url)
newtree = oldbranch.create_checkout("e", lightweight=True)
- self.assertTrue(
- newtree.branch.repository.has_revision(
- 'svn-v%d:1@%s-trunk' % (MAPPING_VERSION, oldbranch.repository.uuid)))
+ self.assertEqual(
+ 'svn-v%d:1@%s-trunk' % (MAPPING_VERSION, oldbranch.repository.uuid),
+ newtree.base_revid)
+ self.assertTrue(os.path.exists("e/.svn"))
+ self.assertFalse(os.path.exists("e/.bzr"))
+
+ def test_create_checkout_lightweight_stop_rev(self):
+ repos_url = self.make_client('d', 'dc')
+
+ self.build_tree({'dc/trunk': None,
+ 'dc/trunk/hosts': 'hej1'})
+ self.client_add("dc/trunk")
+ self.client_commit("dc", "created trunk and added hosts") #1
+
+ self.build_tree({'dc/trunk/hosts': 'bloe'})
+ self.client_commit("dc", "added another revision")
+
+ url = "svn+"+repos_url+"/trunk"
+ oldbranch = Branch.open(url)
+
+ newtree = oldbranch.create_checkout("e", revision_id=
+ 'svn-v%d:1@%s-trunk' % (MAPPING_VERSION, oldbranch.repository.uuid),
+ lightweight=True)
+ self.assertEqual(
+ 'svn-v%d:1@%s-trunk' % (MAPPING_VERSION, oldbranch.repository.uuid),
+ newtree.base_revid)
self.assertTrue(os.path.exists("e/.svn"))
self.assertFalse(os.path.exists("e/.bzr"))
More information about the bazaar-commits
mailing list