~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_branch/test_reconcile.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) 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
"""Tests for branch implementations - test reconcile() functionality"""
18
18
 
19
19
from bzrlib import errors, reconcile
20
 
from bzrlib.branch import BzrBranch
21
20
from bzrlib.symbol_versioning import deprecated_in
22
21
from bzrlib.tests.per_branch import TestCaseWithBranch
23
 
from bzrlib.tests import TestNotApplicable
24
22
 
25
23
 
26
24
class TestBranchReconcile(TestCaseWithBranch):
27
25
 
28
26
    def test_reconcile_fixes_invalid_revhistory(self):
29
 
        if not isinstance(self.branch_format, BzrBranch):
30
 
            raise TestNotApplicable("test only applies to bzr formats")
31
27
        # Different formats have different ways of handling invalid revision
32
28
        # histories, so the setup portion is customized
33
29
        tree = self.make_branch_and_tree('test')
79
75
 
80
76
    def test_reconcile_handles_ghosts_in_revhistory(self):
81
77
        tree = self.make_branch_and_tree('test')
82
 
        if not tree.branch.repository._format.supports_ghosts:
83
 
            raise TestNotApplicable("repository format does not support ghosts")
84
78
        tree.set_parent_ids(["spooky"], allow_leftmost_as_ghost=True)
85
79
        r1 = tree.commit('one')
86
80
        r2 = tree.commit('two')
87
81
        tree.branch.set_last_revision_info(2, r2)
88
82
 
89
83
        reconciler = tree.branch.reconcile()
90
 
        self.assertEqual(r2, tree.branch.last_revision())
 
84
        self.assertEquals([r1, r2], tree.branch.revision_history())