130
130
self.assertEquals(self.capture('unknowns'), '')
131
131
self.assertEquals(file('.bzrignore', 'rU').read(), '*.blah\ngarh\n')
133
def test_revert(self):
136
file('hello', 'wt').write('foo')
137
self.runbzr('add hello')
138
self.runbzr('commit -m setup hello')
140
file('goodbye', 'wt').write('baz')
141
self.runbzr('add goodbye')
142
self.runbzr('commit -m setup goodbye')
144
file('hello', 'wt').write('bar')
145
file('goodbye', 'wt').write('qux')
146
self.runbzr('revert hello')
147
self.check_file_contents('hello', 'foo')
148
self.check_file_contents('goodbye', 'qux')
149
self.runbzr('revert')
150
self.check_file_contents('goodbye', 'baz')
152
os.mkdir('revertdir')
153
self.runbzr('add revertdir')
154
self.runbzr('commit -m f')
155
os.rmdir('revertdir')
156
self.runbzr('revert')
159
os.symlink('/unlikely/to/exist', 'symlink')
160
self.runbzr('add symlink')
161
self.runbzr('commit -m f')
163
self.runbzr('revert')
164
self.failUnlessExists('symlink')
166
os.symlink('a-different-path', 'symlink')
167
self.runbzr('revert')
168
self.assertEqual('/unlikely/to/exist',
169
os.readlink('symlink'))
171
self.log("skipping revert symlink tests")
173
file('hello', 'wt').write('xyz')
174
self.runbzr('commit -m xyz hello')
175
self.runbzr('revert -r 1 hello')
176
self.check_file_contents('hello', 'foo')
177
self.runbzr('revert hello')
178
self.check_file_contents('hello', 'xyz')
179
os.chdir('revertdir')
180
self.runbzr('revert')
133
183
def test_mv_modes(self):
134
184
"""Test two modes of operation for mv"""
135
185
self.runbzr('init')
246
296
self.assertEquals(out, value)
249
open('a', 'wb').write('hello\n')
299
self.build_tree_contents(
300
[('.bzrignore', '*.pyo\n'),
251
304
# Can't supply both
252
305
bzr('ls --verbose --null', retcode=3)
255
ls_equals('? a\n', '--verbose')
256
ls_equals('a\n', '--unknown')
307
ls_equals('.bzrignore\na\n')
308
ls_equals('? .bzrignore\n'
311
ls_equals('.bzrignore\n'
257
314
ls_equals('', '--ignored')
258
315
ls_equals('', '--versioned')
259
ls_equals('a\n', '--unknown', '--ignored', '--versioned')
316
ls_equals('.bzrignore\n'
318
'--unknown', '--ignored', '--versioned')
260
319
ls_equals('', '--ignored', '--versioned')
261
ls_equals('a\0', '--null')
320
ls_equals('.bzrignore\0a\0', '--null')
264
ls_equals('V a\n', '--verbose')
323
ls_equals('? .bzrignore\nV a\n', '--verbose')
265
324
bzr('commit -m add')
267
326
os.mkdir('subdir')
327
ls_equals('? .bzrignore\n'
271
331
open('subdir/b', 'wb').write('b\n')
333
ls_equals('V .bzrignore\n'
277
338
bzr('commit -m subdir')
340
ls_equals('.bzrignore\n'
281
343
, '--non-recursive')
345
ls_equals('V .bzrignore\n'
285
348
, '--verbose', '--non-recursive')