297
298
self.assertEqual(self.sorted_ids(btree), ['a', 'b', 'd', 'e'])
300
class BundleTester(TestCaseInTempDir):
301
class BundleTester(TestCaseWithTransport):
302
303
def create_bundle_text(self, base_rev_id, rev_id):
303
304
bundle_txt = StringIO()
473
474
# to_tree.get_file(fileid).read())
475
476
def test_bundle(self):
476
self.tree1 = BzrDir.create_standalone_workingtree('b1')
477
self.tree1 = self.make_branch_and_tree('b1')
477
478
self.b1 = self.tree1.branch
479
480
open('b1/one', 'wb').write('one\n')
501
502
, 'b1/sub/sub/nonempty.txt'
502
# Tabs are not valid in filenames on windows
505
504
open('b1/sub/sub/emptyfile.txt', 'wb').close()
506
505
open('b1/dir/nolastnewline.txt', 'wb').write('bloop')
697
696
self.assertContainsRe(bundle_file.getvalue(), 'one')
698
697
self.assertContainsRe(bundle_file.getvalue(), 'three')
699
def test_whitespace_bundle(self):
700
if sys.platform in ('win32', 'cygwin'):
701
raise TestSkipped('Windows doesn\'t support filenames'
702
' with tabs or trailing spaces')
703
self.tree1 = self.make_branch_and_tree('b1')
704
self.b1 = self.tree1.branch
706
self.build_tree(['b1/trailing space '])
707
self.tree1.add(['trailing space '])
708
# TODO: jam 20060701 Check for handling files with '\t' characters
709
# once we actually support them
712
self.tree1.commit('funky whitespace', rev_id='white-1')
714
bundle = self.get_valid_bundle(None, 'white-1')
717
open('b1/trailing space ', 'ab').write('add some text\n')
718
self.tree1.commit('add text', rev_id='white-2')
720
bundle = self.get_valid_bundle('white-1', 'white-2')
723
self.tree1.rename_one('trailing space ', ' start and end space ')
724
self.tree1.commit('rename', rev_id='white-3')
726
bundle = self.get_valid_bundle('white-2', 'white-3')
729
self.tree1.remove([' start and end space '])
730
self.tree1.commit('removed', rev_id='white-4')
732
bundle = self.get_valid_bundle('white-3', 'white-4')
734
# Now test a complet roll-up
735
bundle = self.get_valid_bundle(None, 'white-4')
701
738
class MungedBundleTester(TestCaseWithTransport):