139
139
super(TestEntryDiffing, self).setUp()
140
140
self.branch = Branch.initialize('.')
141
self.wt = self.branch.working_tree()
141
142
print >> open('file', 'wb'), 'foo'
142
143
self.branch.add(['file'], ['fileid'])
143
144
if has_symlinks():
144
145
os.symlink('target1', 'symlink')
145
146
self.branch.add(['symlink'], ['linkid'])
146
self.branch.commit('message_1', rev_id = '1')
147
self.wt.commit('message_1', rev_id = '1')
147
148
print >> open('file', 'wb'), 'bar'
148
149
if has_symlinks():
149
150
os.unlink('symlink')
244
245
self.branch.add(['subdir', 'subdir/file'], ['dirid', 'fileid'])
245
246
if has_symlinks():
247
self.branch.commit('message_1', rev_id = '1')
248
self.wt = self.branch.working_tree()
249
self.wt.commit('message_1', rev_id = '1')
248
250
self.tree_1 = self.branch.revision_tree('1')
249
251
self.inv_1 = self.branch.get_inventory('1')
250
252
self.file_1 = self.inv_1['fileid']
325
327
super(TestPreviousHeads, self).setUp()
326
328
self.build_tree(['file'])
327
329
self.branch = Branch.initialize('.')
328
self.branch.commit('new branch', allow_pointless=True, rev_id='A')
330
self.wt = self.branch.working_tree()
331
self.wt.commit('new branch', allow_pointless=True, rev_id='A')
329
332
self.inv_A = self.branch.get_inventory('A')
330
333
self.branch.add(['file'], ['fileid'])
331
self.branch.commit('add file', rev_id='B')
334
self.wt.commit('add file', rev_id='B')
332
335
self.inv_B = self.branch.get_inventory('B')
333
336
self.branch.put_controlfile('revision-history', 'A\n')
334
337
self.assertEqual(self.branch.revision_history(), ['A'])
335
self.branch.commit('another add of file', rev_id='C')
338
self.wt.commit('another add of file', rev_id='C')
336
339
self.inv_C = self.branch.get_inventory('C')
337
self.branch.working_tree().add_pending_merge('B')
338
self.branch.commit('merge in B', rev_id='D')
340
self.wt.add_pending_merge('B')
341
self.wt.commit('merge in B', rev_id='D')
339
342
self.inv_D = self.branch.get_inventory('D')
340
self.file_active = self.branch.working_tree().inventory['fileid']
343
self.file_active = self.wt.inventory['fileid']
341
344
self.weave = self.branch.weave_store.get_weave('fileid',
342
345
self.branch.get_transaction())