33
33
return tree.iter_entries_by_dir([file_id]).next()[1]
36
class TestEntryDiffing(TestCaseWithTree):
39
super(TestEntryDiffing, self).setUp()
40
self.wt = self.make_branch_and_tree('.')
41
self.branch = self.wt.branch
42
open('file', 'wb').write('foo\n')
43
open('binfile', 'wb').write('foo\n')
44
self.wt.add(['file'], ['fileid'])
45
self.wt.add(['binfile'], ['binfileid'])
47
os.symlink('target1', 'symlink')
48
self.wt.add(['symlink'], ['linkid'])
49
self.wt.commit('message_1', rev_id = '1')
50
open('file', 'wb').write('bar\n')
51
open('binfile', 'wb').write('x' * 1023 + '\x00\n')
54
os.symlink('target2', 'symlink')
55
self.tree_1 = self.branch.repository.revision_tree('1')
56
self.inv_1 = self.branch.repository.get_inventory('1')
57
self.file_1 = self.inv_1['fileid']
58
self.file_1b = self.inv_1['binfileid']
59
self.tree_2 = self.workingtree_to_test_tree(self.wt)
60
self.tree_2.lock_read()
61
self.addCleanup(self.tree_2.unlock)
62
self.file_2 = get_entry(self.tree_2, 'fileid')
63
self.file_2b = get_entry(self.tree_2, 'binfileid')
65
self.link_1 = self.inv_1['linkid']
66
self.link_2 = get_entry(self.tree_2, 'linkid')
69
36
class TestPreviousHeads(TestCaseWithTree):