Rev 3230: * The branch interface tests were invalid for branches using subtree in http://people.ubuntu.com/~robertc/baz2.0/shallow-branch

Robert Collins robertc at robertcollins.net
Mon Feb 25 01:38:53 GMT 2008


At http://people.ubuntu.com/~robertc/baz2.0/shallow-branch

------------------------------------------------------------
revno: 3230
revision-id:robertc at robertcollins.net-20080225013831-0gsynkihg2bk066a
parent: robertc at robertcollins.net-20080222044646-uq0datkkxj96d24d
committer: Robert Collins <robertc at robertcollins.net>
branch nick: fix-branch-subtree-tests
timestamp: Mon 2008-02-25 12:38:31 +1100
message:
   * The branch interface tests were invalid for branches using subtree
     repositories by default. This has been fixed. (Robert Collins)
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/tests/branch_implementations/test_commit.py test_commit.py-20070206022134-117z1i5b644p63r0-1
=== modified file 'NEWS'
--- a/NEWS	2008-02-20 01:40:08 +0000
+++ b/NEWS	2008-02-25 01:38:31 +0000
@@ -30,6 +30,9 @@
 
   TESTING:
 
+    * The branch interface tests were invalid for branches using subtree
+      repositories by default. This has been fixed. (Robert Collins)
+
   INTERNALS:
 
     * New remote method ``RemoteBzrDir.find_repositoryV2`` adding support for

=== modified file 'bzrlib/tests/branch_implementations/test_commit.py'
--- a/bzrlib/tests/branch_implementations/test_commit.py	2007-09-03 12:32:14 +0000
+++ b/bzrlib/tests/branch_implementations/test_commit.py	2008-02-25 01:38:31 +0000
@@ -123,10 +123,10 @@
     def test_pre_commit_passes(self):
         empty_delta = TreeDelta()
         root_delta = TreeDelta()
-        root_delta.added = [('', '', 'directory')]
         tree = self.make_branch_and_memory_tree('branch')
         tree.lock_write()
-        tree.add('', '')
+        tree.add('')
+        root_delta.added = [('', tree.path2id(''), 'directory')]
         Branch.hooks.install_hook("pre_commit", self.capture_pre_commit_hook)
         revid1 = tree.commit('first revision')
         revid2 = tree.commit('second revision')
@@ -140,10 +140,10 @@
     def test_pre_commit_fails(self):
         empty_delta = TreeDelta()
         root_delta = TreeDelta()
-        root_delta.added = [('', '', 'directory')]
         tree = self.make_branch_and_memory_tree('branch')
         tree.lock_write()
-        tree.add('', '')
+        tree.add('')
+        root_delta.added = [('', tree.path2id(''), 'directory')]
         class PreCommitException(Exception): pass
         def hook_func(local, master,
                       old_revno, old_revid, new_revno, new_revid,



More information about the bazaar-commits mailing list