/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/test_uncommit.py

  • Committer: Richard Wilbur
  • Date: 2016-02-04 19:07:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6618.
  • Revision ID: richard.wilbur@gmail.com-20160204190728-p0zvfii6zase0fw7
Update COPYING.txt from the original http://www.gnu.org/licenses/gpl-2.0.txt  (Only differences were in whitespace.)  Thanks to Petr Stodulka for pointing out the discrepancy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008, 2009, 2011, 2016 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
17
17
"""Test uncommit."""
18
18
 
19
19
 
20
 
from .. import (
 
20
from bzrlib import (
21
21
    errors,
22
22
    tests,
23
23
    uncommit,
51
51
        # The file should not be removed
52
52
        self.assertPathExists('tree/two')
53
53
        # And it should still be listed as added
54
 
        self.assertTrue(tree.is_versioned('two'))
 
54
        self.assertIsNot(None, tree.path2id('two'))
55
55
 
56
56
    def test_uncommit_bound(self):
57
57
        tree, history = self.make_linear_tree()
58
 
        child = tree.controldir.sprout('child').open_workingtree()
 
58
        child = tree.bzrdir.sprout('child').open_workingtree()
59
59
        child.branch.bind(tree.branch)
60
60
 
61
61
        self.assertEqual(history[1], tree.last_revision())
74
74
 
75
75
    def test_uncommit_bound_local(self):
76
76
        tree, history = self.make_linear_tree()
77
 
        child = tree.controldir.sprout('child').open_workingtree()
 
77
        child = tree.bzrdir.sprout('child').open_workingtree()
78
78
        child.branch.bind(tree.branch)
79
79
 
80
80
        self.assertEqual(history[1], tree.last_revision())
112
112
 
113
113
    def test_uncommit_remove_tags_keeps_pending_merges(self):
114
114
        tree, history = self.make_linear_tree()
115
 
        copy = tree.controldir.sprout('copyoftree').open_workingtree()
116
 
        copy.commit(message='merged', rev_id=b'merged')
 
115
        copy = tree.bzrdir.sprout('copyoftree').open_workingtree()
 
116
        copy.commit(message='merged', rev_id='merged')
117
117
        tree.merge_from_branch(copy.branch)
118
118
        tree.branch.tags.set_tag('pointsatmerged', 'merged')
119
119
        history.append(tree.commit('merge'))
120
 
        self.assertEqual('merged', tree.branch.tags.lookup_tag('pointsatmerged'))
 
120
        self.assertEquals('merged', tree.branch.tags.lookup_tag('pointsatmerged'))
121
121
        self.assertEqual(history[2], tree.last_revision())
122
122
        self.assertEqual((3, history[2]), tree.branch.last_revision_info())
123
123
        tree.branch.tags.set_tag(u"pointsatexisting", history[1])
125
125
        uncommit.uncommit(tree.branch, tree=tree)
126
126
        self.assertEqual(history[1], tree.last_revision())
127
127
        self.assertEqual((2, history[1]), tree.branch.last_revision_info())
128
 
        self.assertEqual([history[1], 'merged'], tree.get_parent_ids())
 
128
        self.assertEquals([history[1], 'merged'], tree.get_parent_ids())
129
129
        self.assertEqual({
130
130
            "pointsatexisting": history[1],
131
131
            "pointsatmerged": 'merged',