206
205
self.assertContainsRe(err, r'ERROR:.*\.bzr.*control file')
208
207
def test_add_via_symlink(self):
209
self.requireFeature(features.SymlinkFeature)
208
self.requireFeature(tests.SymlinkFeature)
210
209
self.make_branch_and_tree('source')
211
210
self.build_tree(['source/top.txt'])
212
211
os.symlink('source', 'link')
214
213
self.assertEquals(out, 'adding top.txt\n')
216
215
def test_add_symlink_to_abspath(self):
217
self.requireFeature(features.SymlinkFeature)
216
self.requireFeature(tests.SymlinkFeature)
218
217
self.make_branch_and_tree('tree')
219
218
os.symlink(osutils.abspath('target'), 'tree/link')
220
219
out = self.run_bzr(['add', 'tree/link'])[0]
234
233
def test_add_multiple_files_in_unicode_cwd(self):
235
234
"""Adding multiple files in a non-ascii cwd, see lp:686611"""
236
self.requireFeature(features.UnicodeFilenameFeature)
235
self.requireFeature(tests.UnicodeFilename)
237
236
self.make_branch_and_tree(u"\xA7")
238
237
self.build_tree([u"\xA7/a", u"\xA7/b"])
239
238
out, err = self.run_bzr(["add", "a", "b"], working_dir=u"\xA7")
240
239
self.assertEquals(out, "adding a\n" "adding b\n")
241
240
self.assertEquals(err, "")
243
def test_add_skip_large_files(self):
244
"""Test skipping files larger than add.maximum_file_size"""
245
tree = self.make_branch_and_tree('.')
246
self.build_tree(['small.txt', 'big.txt', 'big2.txt'])
247
self.build_tree_contents([('small.txt', '0\n')])
248
self.build_tree_contents([('big.txt', '01234567890123456789\n')])
249
self.build_tree_contents([('big2.txt', '01234567890123456789\n')])
250
tree.branch.get_config().set_user_option('add.maximum_file_size', 5)
251
out = self.run_bzr('add')[0]
252
results = sorted(out.rstrip('\n').split('\n'))
253
self.assertEquals(['adding small.txt'],
255
# named items never skipped, even if over max
256
out, err = self.run_bzr(["add", "big2.txt"])
257
results = sorted(out.rstrip('\n').split('\n'))
258
self.assertEquals(['adding big2.txt'],
260
self.assertEquals(err, "")
261
tree.branch.get_config().set_user_option('add.maximum_file_size', 30)
262
out = self.run_bzr('add')[0]
263
results = sorted(out.rstrip('\n').split('\n'))
264
self.assertEquals(['adding big.txt'],