~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-11-17 03:20:35 UTC
  • mfrom: (4792.4.3 456036)
  • Revision ID: pqm@pqm.ubuntu.com-20091117032035-s3sgtlixj1lrminn
(Gordon Tyler) Fix IndexError during 'bzr ignore /' (#456036)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2008 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
108
108
        creator.shelve_change(('rename', 'baz-id', 'foo/baz', 'bar/baz'))
109
109
        self.check_shelve_move(creator, tree)
110
110
 
111
 
    def test_shelve_changed_root_id(self):
112
 
        tree = self.make_branch_and_tree('.')
113
 
        self.build_tree(['foo'])
114
 
        tree.set_root_id('first-root-id')
115
 
        tree.add(['foo'], ['foo-id'])
116
 
        tree.commit('foo')
117
 
        tree.set_root_id('second-root-id')
118
 
        tree.lock_tree_write()
119
 
        self.addCleanup(tree.unlock)
120
 
        creator = shelf.ShelfCreator(tree, tree.basis_tree())
121
 
        self.addCleanup(creator.finalize)
122
 
        self.expectFailure('shelf doesn\'t support shelving root changes yet',
123
 
            self.assertEqual, [
124
 
                ('delete file', 'first-root-id', 'directory', ''),
125
 
                ('add file', 'second-root-id', 'directory', ''),
126
 
                ('rename', 'foo-id', u'foo', u'foo'),
127
 
                ], list(creator.iter_shelvable()))
128
 
 
129
 
        self.assertEqual([('delete file', 'first-root-id', 'directory', ''),
130
 
                          ('add file', 'second-root-id', 'directory', ''),
131
 
                          ('rename', 'foo-id', u'foo', u'foo'),
132
 
                         ], list(creator.iter_shelvable()))
133
 
 
134
111
    def assertShelvedFileEqual(self, expected_content, creator, file_id):
135
112
        s_trans_id = creator.shelf_transform.trans_id_file_id(file_id)
136
113
        shelf_file = creator.shelf_transform._limbo_name(s_trans_id)