Rev 427: Fix a couple of tests. in sftp://people.samba.org/~/bzr/bzr-svn/customrevids/

Jelmer Vernooij jelmer at samba.org
Mon Apr 16 02:31:07 BST 2007


At sftp://people.samba.org/~/bzr/bzr-svn/customrevids/

------------------------------------------------------------
revno: 427
revision-id: jelmer at samba.org-20070416013009-i1fs5ukhj3hg1i1i
parent: jelmer at samba.org-20070415173504-fiwgffj0ijbvqj44
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: customrevids
timestamp: Mon 2007-04-16 03:30:09 +0200
message:
  Fix a couple of tests.
modified:
  branch.py                      svnbranch.py-20051017135706-11c749eb0dab04a7
  repository.py                  repository.py-20060306123302-1f8c5069b3fe0265
  tests/test_commit.py           test_commit.py-20060624213521-l5kcufywkh9mnilk-1
  tests/test_push.py             test_push.py-20070201165715-g2ievcdfqi33wqsy-1
=== modified file 'branch.py'
--- a/branch.py	2007-04-15 17:35:04 +0000
+++ b/branch.py	2007-04-16 01:30:09 +0000
@@ -80,7 +80,8 @@
 
     def parse_revision_id(self, revid):
         (bp, revnum) = self.repository.parse_revision_id(revid)
-        assert bp == self.branch_path
+        assert bp.strip("/") == self.branch_path.strip("/"), \
+                "Got %r, expected %r" % (bp, self.branch_path)
         return revnum
 
     def _create_lightweight_checkout(self, to_location, revision_id=None):

=== modified file 'repository.py'
--- a/repository.py	2007-04-14 18:00:15 +0000
+++ b/repository.py	2007-04-16 01:30:09 +0000
@@ -51,7 +51,7 @@
 SVN_PROP_BZR_FILEIDS = 'bzr:file-ids'
 SVN_PROP_BZR_REVPROP_PREFIX = 'bzr:revprop:'
 SVN_REVPROP_BZR_SIGNATURE = 'bzr:gpg-signature'
-SVN_PROP_BZR_REVISION_ID = 'svn:revision-id-v%d' % MAPPING_VERSION
+SVN_PROP_BZR_REVISION_ID = 'bzr:revision-id-v%d' % MAPPING_VERSION
 
 import urllib
 

=== modified file 'tests/test_commit.py'
--- a/tests/test_commit.py	2007-04-15 17:35:04 +0000
+++ b/tests/test_commit.py	2007-04-16 01:30:09 +0000
@@ -14,12 +14,13 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-from bzrlib.branch import PullResult
+from bzrlib.branch import Branch, PullResult
 from bzrlib.bzrdir import BzrDir
 from bzrlib.errors import DivergedBranches
 from bzrlib.workingtree import WorkingTree
 
 from copy import copy
+from repository import MAPPING_VERSION
 import os
 from tests import TestCaseWithSubversionRepository
 
@@ -93,12 +94,13 @@
                 self.client_get_prop(repos_url, "bzr:merge", 1))
 
     def test_commit_revision_id(self):
-        wt = self.checkout.create_workingtree()
+        repos_url = self.make_client('d', 'dc')
+        wt = self.open_checkout("dc")
         self.build_tree({'dc/foo/bla': "data", 'dc/bla': "otherdata"})
         wt.add('bla')
         wt.commit(message="data")
 
-        branch = Branch.open(self.repos_url)
+        branch = Branch.open(repos_url)
         builder = branch.get_commit_builder([branch.last_revision()], revision_id="my-revision-id")
         tree = branch.repository.revision_tree(branch.last_revision())
         new_tree = copy(tree)
@@ -109,7 +111,7 @@
         builder.commit("foo")
 
         self.assertEqual("my-revision-id", 
-                self.client_get_prop(self.repos_url, "bzr:revision-id-%d" % MAPPING_VERSION, 2))
+                self.client_get_prop("dc", "bzr:revision-id-v%d" % MAPPING_VERSION, 2))
 
     def test_mwh(self):
         repo = self.make_client('d', 'sc')

=== modified file 'tests/test_push.py'
--- a/tests/test_push.py	2007-02-01 17:36:14 +0000
+++ b/tests/test_push.py	2007-04-16 01:30:09 +0000
@@ -43,7 +43,8 @@
     def test_empty(self):
         svnbranch = self.svndir.open_branch()
         bzrbranch = self.bzrdir.open_branch()
-        self.assertEqual(0, svnbranch.pull(bzrbranch))
+        result = svnbranch.pull(bzrbranch)
+        self.assertEqual(0, result.new_revno - result.old_revno)
         self.assertEqual(svnbranch.revision_history(),
                          bzrbranch.revision_history())
 
@@ -54,7 +55,8 @@
 
         svnbranch = self.svndir.open_branch()
         bzrbranch = self.bzrdir.open_branch()
-        self.assertEqual(0, svnbranch.pull(bzrbranch))
+        result = svnbranch.pull(bzrbranch)
+        self.assertEqual(0, result.new_revno - result.old_revno)
 
     def test_diverged(self):
         self.build_tree({'sc/foo/bar': "data"})




More information about the bazaar-commits mailing list