~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/workingtree_implementations/test_add.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-03-10 05:01:04 UTC
  • mfrom: (2331.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20070310050104-4c59f87cee46be60
(robertc) Forward port of dirstate correctness committed to bzr 0.15.

Show diffs side-by-side

added added

removed removed

Lines of Context:
158
158
        # the root should have been changed to be a new unique root.
159
159
        self.assertNotEqual(inventory.ROOT_ID, tree.path2id(''))
160
160
        tree.unlock()
 
161
 
 
162
    def test_add_previously_added(self):
 
163
        # adding a path that was previously added should work
 
164
        tree = self.make_branch_and_tree('.')
 
165
        self.build_tree(['foo'])
 
166
        tree.add(['foo'], ['foo-id'])
 
167
        tree.unversion(['foo-id'])
 
168
        tree.add(['foo'], ['foo-id'])
 
169
        self.assertEqual('foo-id', tree.path2id('foo'))
 
170
 
 
171
    def test_add_present_in_basis(self):
 
172
        # adding a path that was present in the basis should work.
 
173
        tree = self.make_branch_and_tree('.')
 
174
        self.build_tree(['foo'])
 
175
        tree.add(['foo'], ['foo-id'])
 
176
        tree.commit('add foo')
 
177
        tree.unversion(['foo-id'])
 
178
        tree.add(['foo'], ['foo-id'])
 
179
        self.assertEqual('foo-id', tree.path2id('foo'))