~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: 2010-12-02 14:58:47 UTC
  • mfrom: (5554.1.3 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20101202145847-fw822sd3nyhvrwmi
(vila) Merge 2.2 into trunk including fix for bug #583667 and bug
        #681885 (Vincent Ladeuil)

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 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
16
16
 
17
17
 
18
18
import os
 
19
import shutil
19
20
 
20
 
from bzrlib import (
21
 
    check,
22
 
    osutils,
23
 
    )
24
 
from bzrlib.errors import PointlessCommit
 
21
from bzrlib import check, osutils
 
22
from bzrlib.branch import Branch
 
23
from bzrlib.errors import PointlessCommit, BzrError
25
24
from bzrlib.tests import (
 
25
    SymlinkFeature,
26
26
    TestCaseWithTransport,
27
27
    )
28
 
from bzrlib.tests.features import (
29
 
    SymlinkFeature,
30
 
    )
31
 
from bzrlib.tests.matchers import RevisionHistoryMatches
 
28
from bzrlib.tests.test_revision import make_branches
32
29
 
33
30
 
34
31
class TestCommitMerge(TestCaseWithTransport):
58
55
        wty.merge_from_branch(bx)
59
56
        wty.commit('merge from x', rev_id='y@u-0-2', allow_pointless=False)
60
57
 
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
 
            )
 
58
        self.assertEquals(by.revno(), 3)
 
59
        self.assertEquals(list(by.revision_history()),
 
60
                          [base_rev, 'y@u-0-1', 'y@u-0-2'])
67
61
        rev = by.repository.get_revision('y@u-0-2')
68
 
        self.assertEqual(rev.parent_ids,
 
62
        self.assertEquals(rev.parent_ids,
69
63
                          ['y@u-0-1', 'x@u-0-1'])
70
64
 
71
65
    def test_merge_new_file(self):
98
92
 
99
93
        wty.commit('merge from x', rev_id='y@u-0-2', allow_pointless=False)
100
94
        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')
 
95
        inv = tree.inventory
 
96
        self.assertEquals(inv['ecks-id'].revision, 'x@u-0-1')
 
97
        self.assertEquals(inv['why-id'].revision, 'y@u-0-1')
103
98
 
104
99
        check.check_dwim(bx.base, False, True, True)
105
100
        check.check_dwim(by.base, False, True, True)