/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 bzrlib/tests/workingtree_implementations/test_flush.py

merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""Tests for WorkingTree.flush."""
18
18
 
36
36
        # _set_inventory for now until add etc have lazy writes of
37
37
        # the inventory on unlock).
38
38
        tree = self.make_branch_and_tree('tree')
39
 
        # prepare for a series of changes that will modify the 
 
39
        # prepare for a series of changes that will modify the
40
40
        # inventory
41
41
        tree.lock_write()
42
42
        try:
53
53
            self.assertEqual('new-root', reference_tree.get_root_id())
54
54
        finally:
55
55
            tree.unlock()
56
 
            
 
56
 
57
57
    def test_flush_with_read_lock_fails(self):
58
58
        """Flush cannot be used during a read lock."""
59
59
        tree = self.make_branch_and_tree('t1')
62
62
            self.assertRaises(errors.NotWriteLocked, tree.flush)
63
63
        finally:
64
64
            tree.unlock()
65
 
            
 
65
 
66
66
    def test_flush_with_no_lock_fails(self):
67
67
        tree = self.make_branch_and_tree('t1')
68
68
        self.assertRaises(errors.NotWriteLocked, tree.flush)