~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_commit_merge.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-08-17 18:13:57 UTC
  • mfrom: (5268.7.29 transport-segments)
  • Revision ID: pqm@pqm.ubuntu.com-20110817181357-y5q5eth1hk8bl3om
(jelmer) Allow specifying the colocated branch to use in the branch URL,
 and retrieving the branch name using ControlDir._get_selected_branch.
 (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

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