~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_commit_merge.py

  • Committer: Patch Queue Manager
  • Date: 2016-02-01 19:13:13 UTC
  • mfrom: (6614.2.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20160201191313-wdfvmfff1djde6oq
(vila) Release 2.7.0 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2007, 2009, 2011 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007, 2009, 2010, 2011, 2016 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
20
20
from bzrlib import (
21
21
    check,
22
22
    osutils,
23
 
    revision as _mod_revision,
24
23
    )
25
24
from bzrlib.errors import PointlessCommit
26
25
from bzrlib.tests import (
29
28
from bzrlib.tests.features import (
30
29
    SymlinkFeature,
31
30
    )
 
31
from bzrlib.tests.matchers import RevisionHistoryMatches
32
32
 
33
33
 
34
34
class TestCommitMerge(TestCaseWithTransport):
58
58
        wty.merge_from_branch(bx)
59
59
        wty.commit('merge from x', rev_id='y@u-0-2', allow_pointless=False)
60
60
 
61
 
        self.assertEquals(by.revno(), 3)
 
61
        self.assertEqual(by.revno(), 3)
62
62
        graph = wty.branch.repository.get_graph()
63
63
        self.addCleanup(wty.lock_read().unlock)
64
 
        self.assertEquals(list(
65
 
            graph.iter_lefthand_ancestry(by.last_revision(),
66
 
                [_mod_revision.NULL_REVISION])),
67
 
            ['y@u-0-2', 'y@u-0-1', base_rev])
 
64
        self.assertThat(by,
 
65
            RevisionHistoryMatches([base_rev, 'y@u-0-1', 'y@u-0-2'])
 
66
            )
68
67
        rev = by.repository.get_revision('y@u-0-2')
69
 
        self.assertEquals(rev.parent_ids,
 
68
        self.assertEqual(rev.parent_ids,
70
69
                          ['y@u-0-1', 'x@u-0-1'])
71
70
 
72
71
    def test_merge_new_file(self):
99
98
 
100
99
        wty.commit('merge from x', rev_id='y@u-0-2', allow_pointless=False)
101
100
        tree = by.repository.revision_tree('y@u-0-2')
102
 
        self.assertEquals(tree.get_file_revision('ecks-id'), 'x@u-0-1')
103
 
        self.assertEquals(tree.get_file_revision('why-id'), 'y@u-0-1')
 
101
        self.assertEqual(tree.get_file_revision('ecks-id'), 'x@u-0-1')
 
102
        self.assertEqual(tree.get_file_revision('why-id'), 'y@u-0-1')
104
103
 
105
104
        check.check_dwim(bx.base, False, True, True)
106
105
        check.check_dwim(by.base, False, True, True)