103
103
self.runbzr("--pants off", retcode=3)
104
104
self.runbzr("diff --message foo", retcode=3)
106
def test_ignore_patterns(self):
108
self.assertEquals(self.capture('unknowns'), '')
110
file('foo.tmp', 'wt').write('tmp files are ignored')
111
self.assertEquals(self.capture('unknowns'), '')
113
file('foo.c', 'wt').write('int main() {}')
114
self.assertEquals(self.capture('unknowns'), 'foo.c\n')
116
self.runbzr(['add', 'foo.c'])
117
self.assertEquals(self.capture('unknowns'), '')
119
# 'ignore' works when creating the .bzignore file
120
file('foo.blah', 'wt').write('blah')
121
self.assertEquals(self.capture('unknowns'), 'foo.blah\n')
122
self.runbzr('ignore *.blah')
123
self.assertEquals(self.capture('unknowns'), '')
124
self.assertEquals(file('.bzrignore', 'rU').read(), '*.blah\n')
126
# 'ignore' works when then .bzrignore file already exists
127
file('garh', 'wt').write('garh')
128
self.assertEquals(self.capture('unknowns'), 'garh\n')
129
self.runbzr('ignore garh')
130
self.assertEquals(self.capture('unknowns'), '')
131
self.assertEquals(file('.bzrignore', 'rU').read(), '*.blah\ngarh\n')
133
106
def test_revert(self):
134
107
self.runbzr('init')
296
269
self.assertEquals(out, value)
299
open('a', 'wb').write('hello\n')
272
self.build_tree_contents(
273
[('.bzrignore', '*.pyo\n'),
301
277
# Can't supply both
302
278
bzr('ls --verbose --null', retcode=3)
305
ls_equals('? a\n', '--verbose')
306
ls_equals('a\n', '--unknown')
280
ls_equals('.bzrignore\na\n')
281
ls_equals('? .bzrignore\n'
284
ls_equals('.bzrignore\n'
307
287
ls_equals('', '--ignored')
308
288
ls_equals('', '--versioned')
309
ls_equals('a\n', '--unknown', '--ignored', '--versioned')
289
ls_equals('.bzrignore\n'
291
'--unknown', '--ignored', '--versioned')
310
292
ls_equals('', '--ignored', '--versioned')
311
ls_equals('a\0', '--null')
293
ls_equals('.bzrignore\0a\0', '--null')
314
ls_equals('V a\n', '--verbose')
296
ls_equals('? .bzrignore\nV a\n', '--verbose')
315
297
bzr('commit -m add')
317
299
os.mkdir('subdir')
300
ls_equals('? .bzrignore\n'
321
304
open('subdir/b', 'wb').write('b\n')
306
ls_equals('V .bzrignore\n'
327
311
bzr('commit -m subdir')
313
ls_equals('.bzrignore\n'
331
316
, '--non-recursive')
318
ls_equals('V .bzrignore\n'
335
321
, '--verbose', '--non-recursive')