~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: 2012-03-14 14:39:16 UTC
  • mfrom: (6027.1.18 deprecations)
  • Revision ID: pqm@pqm.ubuntu.com-20120314143916-dggf9d1d26j3kizq
(vila) Remove some code deprecated in series older than 2.4 (inclusive)
 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

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