1
# Copyright (C) 2005, 2006 Canonical Ltd
1
# Copyright (C) 2005, 2006, 2007 Canonical Ltd
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
47
47
from bzrlib.transport.memory import MemoryServer
48
48
from bzrlib.upgrade import upgrade
49
49
from bzrlib.workingtree import WorkingTree
50
from bzrlib.symbol_versioning import (
52
55
class TestBranch(TestCaseWithBranch):
54
def test_append_revisions(self):
55
"""Test appending more than one revision"""
56
wt = self.make_branch_and_tree('tree')
57
wt.commit('f', rev_id='rev1')
58
wt.commit('f', rev_id='rev2')
59
wt.commit('f', rev_id='rev3')
61
br = self.get_branch()
63
br.append_revision("rev1")
64
self.assertEquals(br.revision_history(), ["rev1",])
65
br.append_revision("rev2", "rev3")
66
self.assertEquals(br.revision_history(), ["rev1", "rev2", "rev3"])
67
self.assertRaises(errors.ReservedId, br.append_revision, 'current:')
69
57
def test_create_tree_with_merge(self):
70
58
tree = self.create_tree_with_merge()
71
59
ancestry_graph = tree.branch.repository.get_revision_graph('rev-3')