~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2006-07-03 13:48:52 UTC
  • mfrom: (1835 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1836.
  • Revision ID: john@arbash-meinel.com-20060703134852-295eeb195b8e2811
[merge] bzr.dev 1835

Show diffs side-by-side

added added

removed removed

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