~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_too_much.py

  • Committer: Martin Pool
  • Date: 2006-07-03 04:59:44 UTC
  • mfrom: (1765.1.1 ignored)
  • mto: This revision was merged to the branch mainline in revision 1832.
  • Revision ID: mbp@sourcefrog.net-20060703045944-3b6a4e9d2c693b1e
[merge] remove default ignore list & update

Show diffs side-by-side

added added

removed removed

Lines of Context:
130
130
        self.assertEquals(self.capture('unknowns'), '')
131
131
        self.assertEquals(file('.bzrignore', 'rU').read(), '*.blah\ngarh\n')
132
132
 
 
133
    def test_revert(self):
 
134
        self.runbzr('init')
 
135
 
 
136
        file('hello', 'wt').write('foo')
 
137
        self.runbzr('add hello')
 
138
        self.runbzr('commit -m setup hello')
 
139
 
 
140
        file('goodbye', 'wt').write('baz')
 
141
        self.runbzr('add goodbye')
 
142
        self.runbzr('commit -m setup goodbye')
 
143
 
 
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')
 
151
 
 
152
        os.mkdir('revertdir')
 
153
        self.runbzr('add revertdir')
 
154
        self.runbzr('commit -m f')
 
155
        os.rmdir('revertdir')
 
156
        self.runbzr('revert')
 
157
 
 
158
        if has_symlinks():
 
159
            os.symlink('/unlikely/to/exist', 'symlink')
 
160
            self.runbzr('add symlink')
 
161
            self.runbzr('commit -m f')
 
162
            os.unlink('symlink')
 
163
            self.runbzr('revert')
 
164
            self.failUnlessExists('symlink')
 
165
            os.unlink('symlink')
 
166
            os.symlink('a-different-path', 'symlink')
 
167
            self.runbzr('revert')
 
168
            self.assertEqual('/unlikely/to/exist',
 
169
                             os.readlink('symlink'))
 
170
        else:
 
171
            self.log("skipping revert symlink tests")
 
172
        
 
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')
 
181
        os.chdir('..')
 
182
 
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)
247
297
 
248
298
        bzr('init')
249
 
        open('a', 'wb').write('hello\n')
 
299
        self.build_tree_contents(
 
300
            [('.bzrignore', '*.pyo\n'),
 
301
             ('a', 'hello\n'),
 
302
             ])
250
303
 
251
304
        # Can't supply both
252
305
        bzr('ls --verbose --null', retcode=3)
253
306
 
254
 
        ls_equals('a\n')
255
 
        ls_equals('?        a\n', '--verbose')
256
 
        ls_equals('a\n', '--unknown')
 
307
        ls_equals('.bzrignore\na\n')
 
308
        ls_equals('?        .bzrignore\n'
 
309
                  '?        a\n',
 
310
                  '--verbose')
 
311
        ls_equals('.bzrignore\n'
 
312
                  'a\n',
 
313
                  '--unknown')
257
314
        ls_equals('', '--ignored')
258
315
        ls_equals('', '--versioned')
259
 
        ls_equals('a\n', '--unknown', '--ignored', '--versioned')
 
316
        ls_equals('.bzrignore\n'
 
317
                  'a\n',
 
318
                  '--unknown', '--ignored', '--versioned')
260
319
        ls_equals('', '--ignored', '--versioned')
261
 
        ls_equals('a\0', '--null')
 
320
        ls_equals('.bzrignore\0a\0', '--null')
262
321
 
263
322
        bzr('add a')
264
 
        ls_equals('V        a\n', '--verbose')
 
323
        ls_equals('?        .bzrignore\nV        a\n', '--verbose')
265
324
        bzr('commit -m add')
266
325
        
267
326
        os.mkdir('subdir')
268
 
        ls_equals('V        a\n'
 
327
        ls_equals('?        .bzrignore\n'
 
328
                  'V        a\n'
269
329
                  '?        subdir/\n'
270
330
                  , '--verbose')
271
331
        open('subdir/b', 'wb').write('b\n')
272
332
        bzr('add')
273
 
        ls_equals('V        a\n'
 
333
        ls_equals('V        .bzrignore\n'
 
334
                  'V        a\n'
274
335
                  'V        subdir/\n'
275
336
                  'V        subdir/b\n'
276
337
                  , '--verbose')
277
338
        bzr('commit -m subdir')
278
339
 
279
 
        ls_equals('a\n'
 
340
        ls_equals('.bzrignore\n'
 
341
                  'a\n'
280
342
                  'subdir\n'
281
343
                  , '--non-recursive')
282
344
 
283
 
        ls_equals('V        a\n'
 
345
        ls_equals('V        .bzrignore\n'
 
346
                  'V        a\n'
284
347
                  'V        subdir/\n'
285
348
                  , '--verbose', '--non-recursive')
286
349
 
289
352
        ls_equals('b\n')
290
353
        ls_equals('b\0'
291
354
                  , '--null')
292
 
        ls_equals('a\n'
 
355
        ls_equals('.bzrignore\n'
 
356
                  'a\n'
293
357
                  'subdir\n'
294
358
                  'subdir/b\n'
295
359
                  , '--from-root')
296
 
        ls_equals('a\0'
 
360
        ls_equals('.bzrignore\0'
 
361
                  'a\0'
297
362
                  'subdir\0'
298
363
                  'subdir/b\0'
299
364
                  , '--from-root', '--null')
300
 
        ls_equals('a\n'
 
365
        ls_equals('.bzrignore\n'
 
366
                  'a\n'
301
367
                  'subdir\n'
302
368
                  , '--from-root', '--non-recursive')
303
369
 
315
381
        os.chdir('..')
316
382
        open('blah.py', 'wb').write('unknown\n')
317
383
        open('blah.pyo', 'wb').write('ignored\n')
318
 
        ls_equals('a\n'
 
384
        ls_equals('.bzrignore\n'
 
385
                  'a\n'
319
386
                  'blah.py\n'
320
387
                  'blah.pyo\n'
321
388
                  'subdir\n'
322
389
                  'subdir/b\n')
323
 
        ls_equals('V        a\n'
 
390
        ls_equals('V        .bzrignore\n'
 
391
                  'V        a\n'
324
392
                  '?        blah.py\n'
325
393
                  'I        blah.pyo\n'
326
394
                  'V        subdir/\n'
330
398
                  , '--ignored')
331
399
        ls_equals('blah.py\n'
332
400
                  , '--unknown')
333
 
        ls_equals('a\n'
 
401
        ls_equals('.bzrignore\n'
 
402
                  'a\n'
334
403
                  'subdir\n'
335
404
                  'subdir/b\n'
336
405
                  , '--versioned')