~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_shelf.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-03-12 06:32:29 UTC
  • mfrom: (4123.1.4 bzr.ab.integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090312063229-ucuyuhmuc7ya8e54
(bpierre, abentley) Fix cleanup when unversioned files specified.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
import os
18
18
 
19
 
from bzrlib import errors, pack, shelf, tests, transform
 
19
from bzrlib import errors, pack, shelf, tests, transform, workingtree
20
20
 
21
21
 
22
22
EMPTY_SHELF = ("Bazaar pack format 1 (introduced in 0.18)\n"
268
268
        records.next()
269
269
        tt.deserialize(records)
270
270
 
 
271
    def test_shelve_unversioned(self):
 
272
        tree = self.make_branch_and_tree('tree')
 
273
        self.assertRaises(errors.PathsNotVersionedError,
 
274
                          shelf.ShelfCreator, tree, tree.basis_tree(), ['foo'])
 
275
        # We should be able to lock/unlock the tree if ShelfCreator cleaned
 
276
        # after itself.
 
277
        wt = workingtree.WorkingTree.open('tree')
 
278
        wt.lock_tree_write()
 
279
        wt.unlock()
 
280
        # And a second tentative should raise the same error (no
 
281
        # limbo/pending_deletion leftovers).
 
282
        self.assertRaises(errors.PathsNotVersionedError,
 
283
                          shelf.ShelfCreator, tree, tree.basis_tree(), ['foo'])
 
284
 
271
285
 
272
286
class TestUnshelver(tests.TestCaseWithTransport):
273
287