107
107
self.runbzr('init')
108
108
self.assertEquals(self.capture('unknowns'), '')
110
file('foo.tmp', 'wt').write('tmp files are ignored')
111
self.assertEquals(self.capture('unknowns'), '')
113
110
file('foo.c', 'wt').write('int main() {}')
114
111
self.assertEquals(self.capture('unknowns'), 'foo.c\n')
130
127
self.assertEquals(self.capture('unknowns'), '')
131
128
self.assertEquals(file('.bzrignore', 'rU').read(), '*.blah\ngarh\n')
130
def test_revert(self):
133
file('hello', 'wt').write('foo')
134
self.runbzr('add hello')
135
self.runbzr('commit -m setup hello')
137
file('goodbye', 'wt').write('baz')
138
self.runbzr('add goodbye')
139
self.runbzr('commit -m setup goodbye')
141
file('hello', 'wt').write('bar')
142
file('goodbye', 'wt').write('qux')
143
self.runbzr('revert hello')
144
self.check_file_contents('hello', 'foo')
145
self.check_file_contents('goodbye', 'qux')
146
self.runbzr('revert')
147
self.check_file_contents('goodbye', 'baz')
149
os.mkdir('revertdir')
150
self.runbzr('add revertdir')
151
self.runbzr('commit -m f')
152
os.rmdir('revertdir')
153
self.runbzr('revert')
156
os.symlink('/unlikely/to/exist', 'symlink')
157
self.runbzr('add symlink')
158
self.runbzr('commit -m f')
160
self.runbzr('revert')
161
self.failUnlessExists('symlink')
163
os.symlink('a-different-path', 'symlink')
164
self.runbzr('revert')
165
self.assertEqual('/unlikely/to/exist',
166
os.readlink('symlink'))
168
self.log("skipping revert symlink tests")
170
file('hello', 'wt').write('xyz')
171
self.runbzr('commit -m xyz hello')
172
self.runbzr('revert -r 1 hello')
173
self.check_file_contents('hello', 'foo')
174
self.runbzr('revert hello')
175
self.check_file_contents('hello', 'xyz')
176
os.chdir('revertdir')
177
self.runbzr('revert')
133
180
def test_mv_modes(self):
134
181
"""Test two modes of operation for mv"""
135
182
self.runbzr('init')
246
293
self.assertEquals(out, value)
249
open('a', 'wb').write('hello\n')
296
self.build_tree_contents(
297
[('.bzrignore', '*.pyo\n'),
251
301
# Can't supply both
252
302
bzr('ls --verbose --null', retcode=3)
255
ls_equals('? a\n', '--verbose')
256
ls_equals('a\n', '--unknown')
304
ls_equals('.bzrignore\na\n')
305
ls_equals('? .bzrignore\n'
308
ls_equals('.bzrignore\n'
257
311
ls_equals('', '--ignored')
258
312
ls_equals('', '--versioned')
259
ls_equals('a\n', '--unknown', '--ignored', '--versioned')
313
ls_equals('.bzrignore\n'
315
'--unknown', '--ignored', '--versioned')
260
316
ls_equals('', '--ignored', '--versioned')
261
ls_equals('a\0', '--null')
317
ls_equals('.bzrignore\0a\0', '--null')
264
ls_equals('V a\n', '--verbose')
320
ls_equals('? .bzrignore\nV a\n', '--verbose')
265
321
bzr('commit -m add')
267
323
os.mkdir('subdir')
324
ls_equals('? .bzrignore\n'
271
328
open('subdir/b', 'wb').write('b\n')
330
ls_equals('V .bzrignore\n'
277
335
bzr('commit -m subdir')
337
ls_equals('.bzrignore\n'
281
340
, '--non-recursive')
342
ls_equals('V .bzrignore\n'
285
345
, '--verbose', '--non-recursive')