~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_branch/test_reconcile.py

  • Committer: Tarmac
  • Author(s): Vincent Ladeuil
  • Date: 2017-01-30 14:42:05 UTC
  • mfrom: (6620.1.1 trunk)
  • Revision ID: tarmac-20170130144205-r8fh2xpmiuxyozpv
Merge  2.7 into trunk including fix for bug #1657238 [r=vila]

Show diffs side-by-side

added added

removed removed

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