~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_revert.py

  • Committer: Andrew Starr-Bochicchio
  • Date: 2014-03-30 17:59:29 UTC
  • mto: This revision was merged to the branch mainline in revision 6592.
  • Revision ID: a.starr.b@gmail.com-20140330175929-rd97jstcbau2j1gy
Use LooseVersion from distutils to check Cython version in order to handle non-integers in the version string.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007, 2009, 2010, 2011, 2016 Canonical Ltd
 
1
# Copyright (C) 2006, 2007, 2009, 2010 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
43
43
        f.close()
44
44
 
45
45
        # check status
46
 
        self.assertEqual('modified:\n  dir/file\n', self.run_bzr('status')[0])
 
46
        self.assertEquals('modified:\n  dir/file\n', self.run_bzr('status')[0])
47
47
 
48
48
    def _prepare_rename_mod_tree(self):
49
49
        self.build_tree(['a/', 'a/b', 'a/c', 'a/d/', 'a/d/e', 'f/', 'f/g',
66
66
        os.chdir('dir')
67
67
        mutter('cd dir\n')
68
68
 
69
 
        self.assertEqual('1\n', self.run_bzr('revno')[0])
 
69
        self.assertEquals('1\n', self.run_bzr('revno')[0])
70
70
        self.run_bzr('revert %s file' % param)
71
 
        self.assertEqual('spam', open('file', 'rb').read())
 
71
        self.assertEquals('spam', open('file', 'rb').read())
72
72
 
73
73
    def test_revert_in_subdir(self):
74
74
        self.helper()
199
199
        first_rev_id = tree.commit('initial commit')
200
200
        self.build_tree_contents([('file', 'new content')])
201
201
        existing_parents = tree.get_parent_ids()
202
 
        self.assertEqual([first_rev_id], existing_parents)
 
202
        self.assertEquals([first_rev_id], existing_parents)
203
203
        merged_parents = existing_parents + ['merged-in-rev']
204
204
        tree.set_parent_ids(merged_parents)
205
 
        self.assertEqual(merged_parents, tree.get_parent_ids())
 
205
        self.assertEquals(merged_parents, tree.get_parent_ids())
206
206
        self.run_bzr(['revert', '--forget-merges'])
207
 
        self.assertEqual([first_rev_id], tree.get_parent_ids())
 
207
        self.assertEquals([first_rev_id], tree.get_parent_ids())
208
208
        # changed files are not reverted
209
209
        self.assertFileEqual('new content', 'file')
210
210
        # you can give it the path of a tree