~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/test_commit.py

  • Committer: Robert Collins
  • Date: 2005-09-29 02:01:49 UTC
  • Revision ID: robertc@robertcollins.net-20050929020149-1ff16722c6a01b2c
reenable remotebranch tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
145
145
        self.assertFalse(tree1.has_filename('fruity'))
146
146
        self.check_inventory_shape(tree1.inventory, ['hello'])
147
147
        ie = tree1.inventory['hello-id']
148
 
        eq(ie.revision, 'test@rev-1')
 
148
        eq(ie.name_version, 'test@rev-1')
149
149
 
150
150
        tree2 = b.revision_tree('test@rev-2')
151
151
        eq(tree2.id2path('hello-id'), 'fruity')
152
152
        eq(tree2.get_file_text('hello-id'), 'contents of hello\n')
153
153
        self.check_inventory_shape(tree2.inventory, ['fruity'])
154
154
        ie = tree2.inventory['hello-id']
155
 
        eq(ie.revision, 'test@rev-2')
 
155
        eq(ie.name_version, 'test@rev-2')
156
156
 
157
157
 
158
158
    def test_reused_rev_id(self):
198
198
                                   ['a', 'a/b/hello', 'a/b'])
199
199
 
200
200
        inv = b.get_revision_inventory(r4)
201
 
        eq(inv['hello-id'].revision, r4)
202
 
        eq(inv['a-id'].revision, r1)
203
 
        eq(inv['b-id'].revision, r3)
 
201
        eq(inv['hello-id'].name_version, r4)
 
202
        eq(inv['a-id'].name_version, r1)
 
203
        eq(inv['b-id'].name_version, r3)
204
204
 
205
205
        
206
206
    def test_removed_commit(self):
234
234
        for i in range(4):
235
235
            anc = b.get_ancestry(rev_ids[i])
236
236
            eq(anc, [None] + rev_ids[:i+1])
237
 
 
238
 
    def test_commit_new_subdir_child_selective(self):
239
 
        b = Branch.initialize('.')
240
 
        self.build_tree(['dir/', 'dir/file1', 'dir/file2'])
241
 
        b.add(['dir', 'dir/file1', 'dir/file2'],
242
 
              ['dirid', 'file1id', 'file2id'])
243
 
        b.commit('dir/file1', specific_files=['dir/file1'], rev_id='1')
244
 
        inv = b.get_inventory('1')
245
 
        self.assertEqual('1', inv['dirid'].revision)
246
 
        self.assertEqual('1', inv['file1id'].revision)
247
 
        # FIXME: This should raise a KeyError I think, rbc20051006
248
 
        self.assertRaises(BzrError, inv.__getitem__, 'file2id')