69
70
knit3_repo = b_bzrdir.open_repository()
70
71
rev1_tree = knit3_repo.revision_tree('rev1')
71
lines = rev1_tree.get_file_lines(rev1_tree.inventory.root.file_id)
72
lines = rev1_tree.get_file_lines(rev1_tree.get_root_id())
72
73
self.assertEqual([], lines)
73
74
b_branch = b_bzrdir.create_branch()
74
75
b_branch.pull(tree_a.branch)
81
82
rev2_tree = knit3_repo.revision_tree('rev2')
82
83
self.assertEqual('rev1', rev2_tree.inventory.root.revision)
85
def test_fetch_all_from_self(self):
86
tree = self.make_branch_and_tree('.')
87
rev_id = tree.commit('one')
88
# This needs to be a new copy of the repository, if this changes, the
89
# test needs to be rewritten
90
repo = tree.branch.repository.bzrdir.open_repository()
91
# This fetch should be a no-op see bug #158333
92
tree.branch.repository.fetch(repo, None)
94
def test_fetch_from_self(self):
95
tree = self.make_branch_and_tree('.')
96
rev_id = tree.commit('one')
97
repo = tree.branch.repository.bzrdir.open_repository()
98
# This fetch should be a no-op see bug #158333
99
tree.branch.repository.fetch(repo, rev_id)
101
def test_fetch_missing_from_self(self):
102
tree = self.make_branch_and_tree('.')
103
rev_id = tree.commit('one')
104
# Even though the fetch() is a NO-OP it should assert the revision id
106
repo = tree.branch.repository.bzrdir.open_repository()
107
self.assertRaises(errors.NoSuchRevision, tree.branch.repository.fetch,
108
repo, 'no-such-revision')
84
110
def makeARepoWithSignatures(self):
85
111
wt = self.make_branch_and_tree('a-repo-with-sigs')
86
112
wt.commit('rev1', allow_pointless=True, rev_id='rev1')