/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to tests/test_shelf.py

  • Committer: Aaron Bentley
  • Date: 2008-10-09 02:39:54 UTC
  • mto: (0.15.10 unshelve)
  • mto: This revision was merged to the branch mainline in revision 3820.
  • Revision ID: aaron@aaronbentley.com-20081009023954-i8s53pbwun9o3y43
Handle new dangling ids

Show diffs side-by-side

added added

removed removed

Lines of Context:
127
127
        limbo_name = creator.shelf_transform._limbo_name(s_trans_id)
128
128
        self.assertEqual('bar', os.readlink(limbo_name))
129
129
 
 
130
    def test_shelve_creation_no_contents(self):
 
131
        tree = self.make_branch_and_tree('.')
 
132
        tree.lock_write()
 
133
        self.addCleanup(tree.unlock)
 
134
        tree.commit('Empty tree')
 
135
        self.build_tree(['foo'])
 
136
        tree.add('foo', 'foo-id')
 
137
        os.unlink('foo')
 
138
        creator = shelf.ShelfCreator(tree, tree.basis_tree())
 
139
        self.addCleanup(creator.finalize)
 
140
        self.assertEqual([('add file', 'foo-id', None)],
 
141
                         sorted(list(creator)))
 
142
        creator.shelve_creation('foo-id')
 
143
        creator.transform()
 
144
        self.assertRaises(StopIteration,
 
145
                          tree.iter_entries_by_dir(['foo-id']).next)
 
146
        self.assertShelvedFileEqual('', creator, 'foo-id')
 
147
        s_trans_id = creator.shelf_transform.trans_id_file_id('foo-id')
 
148
        self.assertEqual('foo-id',
 
149
                         creator.shelf_transform.final_file_id(s_trans_id))
 
150
        self.failIfExists('foo')
 
151
 
130
152
    def test_shelve_deletion(self):
131
153
        tree = self.make_branch_and_tree('tree')
132
154
        tree.lock_write()