/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/selftest/blackbox.py

  • Committer: Robert Collins
  • Date: 2005-09-29 00:24:44 UTC
  • Revision ID: robertc@robertcollins.net-20050929002444-76fe66e99fb9bcd5
reinstate testfetch test case

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
it's normally invoked.
27
27
"""
28
28
 
 
29
from cStringIO import StringIO
 
30
import os
 
31
import shutil
29
32
import sys
30
33
 
31
 
from bzrlib.selftest import TestBase, InTempDir, BzrTestBase
32
 
 
33
 
 
34
 
 
35
 
class ExternalBase(InTempDir):
36
 
    def runbzr(self, args, retcode=0):
37
 
        try:
38
 
            import shutil
39
 
            from subprocess import call
40
 
        except ImportError, e:
41
 
            _need_subprocess()
42
 
            raise
43
 
 
 
34
from bzrlib.selftest import TestCaseInTempDir, BzrTestBase
 
35
from bzrlib.branch import Branch
 
36
 
 
37
 
 
38
class ExternalBase(TestCaseInTempDir):
 
39
 
 
40
    def runbzr(self, args, retcode=0, backtick=False):
44
41
        if isinstance(args, basestring):
45
42
            args = args.split()
46
 
            
47
 
        return self.runcmd(['python', self.BZRPATH,] + args,
48
 
                           retcode=retcode)
49
 
 
50
 
 
51
 
 
52
 
class MvCommand(BzrTestBase):
53
 
    def runbzr(self):
54
 
        """Test two modes of operation for mv"""
55
 
        b = Branch('.', init=True)
56
 
        self.build_tree(['a', 'c', 'subdir/'])
57
 
        self.run_bzr('mv', 'a', 'b')
58
 
        self.run_bzr('mv', 'b', 'subdir')
59
 
        self.run_bzr('mv', 'subdir/b', 'a')
60
 
        self.run_bzr('mv', 'a', 'b', 'subdir')
61
 
        self.run_bzr('mv', 'subdir/a', 'subdir/newa')
62
 
 
63
 
 
64
 
 
65
 
class TestVersion(BzrTestBase):
66
 
    """Check output from version command and master option is reasonable"""
67
 
    def runTest(self):
68
 
        # output is intentionally passed through to stdout so that we
69
 
        # can see the version being tested
70
 
        from cStringIO import StringIO
71
 
        save_out = sys.stdout
72
 
        try:
73
 
            sys.stdout = tmp_out = StringIO()
74
 
            
75
 
            self.run_bzr('version')
76
 
        finally:
77
 
            sys.stdout = save_out
78
 
 
79
 
        output = tmp_out.getvalue()
80
 
        self.log('bzr version output:')
81
 
        self.log(output)
82
 
        
83
 
        self.assert_(output.startswith('bzr (bazaar-ng) '))
84
 
        self.assertNotEqual(output.index('Canonical'), -1)
85
 
 
86
 
        # make sure --version is consistent
87
 
        try:
88
 
            sys.stdout = tmp_out = StringIO()
89
 
            
90
 
            self.run_bzr('--version')
91
 
        finally:
92
 
            sys.stdout = save_out
93
 
 
94
 
        self.log('bzr --version output:')
95
 
        self.log(tmp_out.getvalue())
96
 
 
97
 
        self.assertEquals(output, tmp_out.getvalue())
98
 
 
99
 
 
100
 
        
101
 
 
102
 
 
103
 
class HelpCommands(ExternalBase):
104
 
    def runTest(self):
 
43
 
 
44
        if backtick:
 
45
            return self.run_bzr_captured(args, retcode=retcode)[0]
 
46
        else:
 
47
            return self.run_bzr_captured(args, retcode=retcode)
 
48
 
 
49
 
 
50
class TestCommands(ExternalBase):
 
51
 
 
52
    def test_help_commands(self):
105
53
        self.runbzr('--help')
106
54
        self.runbzr('help')
107
55
        self.runbzr('help commands')
108
56
        self.runbzr('help help')
109
57
        self.runbzr('commit -h')
110
58
 
111
 
 
112
 
class InitBranch(ExternalBase):
113
 
    def runTest(self):
114
 
        import os
 
59
    def test_init_branch(self):
115
60
        self.runbzr(['init'])
116
61
 
117
 
 
118
 
 
119
 
class UserIdentity(ExternalBase):
120
 
    def runTest(self):
 
62
    def test_whoami(self):
121
63
        # this should always identify something, if only "john@localhost"
122
64
        self.runbzr("whoami")
123
65
        self.runbzr("whoami --email")
124
 
        self.assertEquals(self.backtick("bzr whoami --email").count('@'),
125
 
                          1)
126
 
 
127
 
 
128
 
class InvalidCommands(ExternalBase):
129
 
    def runTest(self):
 
66
 
 
67
        self.assertEquals(self.runbzr("whoami --email",
 
68
                                      backtick=True).count('@'), 1)
 
69
        
 
70
    def test_whoami_branch(self):
 
71
        """branch specific user identity works."""
 
72
        self.runbzr('init')
 
73
        f = file('.bzr/email', 'wt')
 
74
        f.write('Branch Identity <branch@identi.ty>')
 
75
        f.close()
 
76
        bzr_email = os.environ.get('BZREMAIL')
 
77
        if bzr_email is not None:
 
78
            del os.environ['BZREMAIL']
 
79
        whoami = self.runbzr("whoami",backtick=True)
 
80
        whoami_email = self.runbzr("whoami --email",backtick=True)
 
81
        self.assertTrue(whoami.startswith('Branch Identity <branch@identi.ty>'))
 
82
        self.assertTrue(whoami_email.startswith('branch@identi.ty'))
 
83
        # Verify that the environment variable overrides the value 
 
84
        # in the file
 
85
        os.environ['BZREMAIL'] = 'Different ID <other@environ.ment>'
 
86
        whoami = self.runbzr("whoami",backtick=True)
 
87
        whoami_email = self.runbzr("whoami --email",backtick=True)
 
88
        self.assertTrue(whoami.startswith('Different ID <other@environ.ment>'))
 
89
        self.assertTrue(whoami_email.startswith('other@environ.ment'))
 
90
        if bzr_email is not None:
 
91
            os.environ['BZREMAIL'] = bzr_email
 
92
 
 
93
    def test_invalid_commands(self):
130
94
        self.runbzr("pants", retcode=1)
131
95
        self.runbzr("--pants off", retcode=1)
132
96
        self.runbzr("diff --message foo", retcode=1)
133
97
 
134
 
 
135
 
 
136
 
class EmptyCommit(ExternalBase):
137
 
    def runTest(self):
 
98
    def test_empty_commit(self):
138
99
        self.runbzr("init")
139
100
        self.build_tree(['hello.txt'])
140
101
        self.runbzr("commit -m empty", retcode=1)
141
102
        self.runbzr("add hello.txt")
142
103
        self.runbzr("commit -m added")
143
104
 
144
 
 
145
 
 
146
 
class IgnorePatterns(ExternalBase):
147
 
    def runTest(self):
 
105
    def test_ignore_patterns(self):
148
106
        from bzrlib.branch import Branch
149
107
        
150
 
        b = Branch('.', init=True)
 
108
        b = Branch.initialize('.')
151
109
        self.assertEquals(list(b.unknowns()), [])
152
110
 
153
111
        file('foo.tmp', 'wt').write('tmp files are ignored')
154
112
        self.assertEquals(list(b.unknowns()), [])
155
 
        assert self.backtick('bzr unknowns') == ''
 
113
        assert self.capture('unknowns') == ''
156
114
 
157
115
        file('foo.c', 'wt').write('int main() {}')
158
116
        self.assertEquals(list(b.unknowns()), ['foo.c'])
159
 
        assert self.backtick('bzr unknowns') == 'foo.c\n'
 
117
        assert self.capture('unknowns') == 'foo.c\n'
160
118
 
161
119
        self.runbzr(['add', 'foo.c'])
162
 
        assert self.backtick('bzr unknowns') == ''
 
120
        assert self.capture('unknowns') == ''
163
121
 
164
122
        # 'ignore' works when creating the .bzignore file
165
123
        file('foo.blah', 'wt').write('blah')
166
124
        self.assertEquals(list(b.unknowns()), ['foo.blah'])
167
125
        self.runbzr('ignore *.blah')
168
126
        self.assertEquals(list(b.unknowns()), [])
169
 
        assert file('.bzrignore', 'rb').read() == '*.blah\n'
 
127
        assert file('.bzrignore', 'rU').read() == '*.blah\n'
170
128
 
171
129
        # 'ignore' works when then .bzrignore file already exists
172
130
        file('garh', 'wt').write('garh')
173
131
        self.assertEquals(list(b.unknowns()), ['garh'])
174
 
        assert self.backtick('bzr unknowns') == 'garh\n'
 
132
        assert self.capture('unknowns') == 'garh\n'
175
133
        self.runbzr('ignore garh')
176
134
        self.assertEquals(list(b.unknowns()), [])
177
 
        assert file('.bzrignore', 'rb').read() == '*.blah\ngarh\n'
178
 
        
179
 
 
 
135
        assert file('.bzrignore', 'rU').read() == '*.blah\ngarh\n'
 
136
 
 
137
    def test_revert(self):
 
138
        self.runbzr('init')
 
139
 
 
140
        file('hello', 'wt').write('foo')
 
141
        self.runbzr('add hello')
 
142
        self.runbzr('commit -m setup hello')
 
143
 
 
144
        file('goodbye', 'wt').write('baz')
 
145
        self.runbzr('add goodbye')
 
146
        self.runbzr('commit -m setup goodbye')
 
147
        
 
148
        file('hello', 'wt').write('bar')
 
149
        file('goodbye', 'wt').write('qux')
 
150
        self.runbzr('revert hello')
 
151
        self.check_file_contents('hello', 'foo')
 
152
        self.check_file_contents('goodbye', 'qux')
 
153
        self.runbzr('revert')
 
154
        self.check_file_contents('goodbye', 'baz')
 
155
 
 
156
        os.mkdir('revertdir')
 
157
        self.runbzr('add revertdir')
 
158
        self.runbzr('commit -m f')
 
159
        os.rmdir('revertdir')
 
160
        self.runbzr('revert')
 
161
 
 
162
        file('hello', 'wt').write('xyz')
 
163
        self.runbzr('commit -m xyz hello')
 
164
        self.runbzr('revert -r 1 hello')
 
165
        self.check_file_contents('hello', 'foo')
 
166
        self.runbzr('revert hello')
 
167
        self.check_file_contents('hello', 'xyz')
 
168
        os.chdir('revertdir')
 
169
        self.runbzr('revert')
 
170
        os.chdir('..')
 
171
 
 
172
 
 
173
    def test_mv_modes(self):
 
174
        """Test two modes of operation for mv"""
 
175
        from bzrlib.branch import Branch
 
176
        b = Branch.initialize('.')
 
177
        self.build_tree(['a', 'c', 'subdir/'])
 
178
        self.run_bzr_captured(['add', self.test_dir])
 
179
        self.run_bzr_captured(['mv', 'a', 'b'])
 
180
        self.run_bzr_captured(['mv', 'b', 'subdir'])
 
181
        self.run_bzr_captured(['mv', 'subdir/b', 'a'])
 
182
        self.run_bzr_captured(['mv', 'a', 'c', 'subdir'])
 
183
        self.run_bzr_captured(['mv', 'subdir/a', 'subdir/newa'])
 
184
 
 
185
 
 
186
    def test_main_version(self):
 
187
        """Check output from version command and master option is reasonable"""
 
188
        # output is intentionally passed through to stdout so that we
 
189
        # can see the version being tested
 
190
        output = self.runbzr('version', backtick=1)
 
191
        self.log('bzr version output:')
 
192
        self.log(output)
 
193
        self.assert_(output.startswith('bzr (bazaar-ng) '))
 
194
        self.assertNotEqual(output.index('Canonical'), -1)
 
195
        # make sure --version is consistent
 
196
        tmp_output = self.runbzr('--version', backtick=1)
 
197
        self.log('bzr --version output:')
 
198
        self.log(tmp_output)
 
199
        self.assertEquals(output, tmp_output)
 
200
 
 
201
    def example_branch(test):
 
202
        test.runbzr('init')
 
203
        file('hello', 'wt').write('foo')
 
204
        test.runbzr('add hello')
 
205
        test.runbzr('commit -m setup hello')
 
206
        file('goodbye', 'wt').write('baz')
 
207
        test.runbzr('add goodbye')
 
208
        test.runbzr('commit -m setup goodbye')
 
209
 
 
210
    def test_diff(self):
 
211
        self.example_branch()
 
212
        file('hello', 'wt').write('hello world!')
 
213
        self.runbzr('commit -m fixing hello')
 
214
        output = self.runbzr('diff -r 2..3', backtick=1)
 
215
        self.assert_('\n+hello world!' in output)
 
216
        output = self.runbzr('diff -r last:3..last:1', backtick=1)
 
217
        self.assert_('\n+baz' in output)
 
218
 
 
219
    def test_branch(self):
 
220
        """Branch from one branch to another."""
 
221
        os.mkdir('a')
 
222
        os.chdir('a')
 
223
        self.example_branch()
 
224
        os.chdir('..')
 
225
        self.runbzr('branch a b')
 
226
        self.runbzr('branch a c -r 1')
 
227
        os.chdir('b')
 
228
        self.runbzr('commit -m foo --unchanged')
 
229
        os.chdir('..')
 
230
        shutil.rmtree('a/.bzr/revision-store')
 
231
        # naughty - abstraction violations RBC 20050928  
 
232
        shutil.rmtree('a/.bzr/inventory-store', ignore_errors=True)
 
233
        shutil.rmtree('a/.bzr/text-store', ignore_errors=True)
 
234
        self.runbzr('branch a d --basis b')
 
235
 
 
236
    def test_merge(self):
 
237
        from bzrlib.branch import Branch
 
238
        
 
239
        os.mkdir('a')
 
240
        os.chdir('a')
 
241
        self.example_branch()
 
242
        os.chdir('..')
 
243
        self.runbzr('branch a b')
 
244
        os.chdir('b')
 
245
        file('goodbye', 'wt').write('quux')
 
246
        self.runbzr(['commit',  '-m',  "more u's are always good"])
 
247
 
 
248
        os.chdir('../a')
 
249
        file('hello', 'wt').write('quuux')
 
250
        # We can't merge when there are in-tree changes
 
251
        self.runbzr('merge ../b', retcode=1)
 
252
        self.runbzr(['commit', '-m', "Like an epidemic of u's"])
 
253
        self.runbzr('merge ../b')
 
254
        self.check_file_contents('goodbye', 'quux')
 
255
        # Merging a branch pulls its revision into the tree
 
256
        a = Branch.open('.')
 
257
        b = Branch.open('../b')
 
258
        a.get_revision_xml(b.last_revision())
 
259
        self.log('pending merges: %s', a.pending_merges())
 
260
        #        assert a.pending_merges() == [b.last_revision()], "Assertion %s %s" \
 
261
        #        % (a.pending_merges(), b.last_revision())
 
262
 
 
263
    def test_pull(self):
 
264
        """Pull changes from one branch to another."""
 
265
        os.mkdir('a')
 
266
        os.chdir('a')
 
267
 
 
268
        self.example_branch()
 
269
        self.runbzr('pull', retcode=1)
 
270
        self.runbzr('missing', retcode=1)
 
271
        self.runbzr('missing .')
 
272
        self.runbzr('missing')
 
273
        self.runbzr('pull')
 
274
        self.runbzr('pull /', retcode=1)
 
275
        self.runbzr('pull')
 
276
 
 
277
        os.chdir('..')
 
278
        self.runbzr('branch a b')
 
279
        os.chdir('b')
 
280
        self.runbzr('pull')
 
281
        os.mkdir('subdir')
 
282
        self.runbzr('add subdir')
 
283
        self.runbzr('commit -m blah --unchanged')
 
284
        os.chdir('../a')
 
285
        a = Branch.open('.')
 
286
        b = Branch.open('../b')
 
287
        assert a.revision_history() == b.revision_history()[:-1]
 
288
        self.runbzr('pull ../b')
 
289
        assert a.revision_history() == b.revision_history()
 
290
        self.runbzr('commit -m blah2 --unchanged')
 
291
        os.chdir('../b')
 
292
        self.runbzr('commit -m blah3 --unchanged')
 
293
        self.runbzr('pull ../a', retcode=1)
 
294
        print "DECIDE IF PULL CAN CONVERGE, blackbox.py"
 
295
        return
 
296
        os.chdir('../a')
 
297
        self.runbzr('merge ../b')
 
298
        self.runbzr('commit -m blah4 --unchanged')
 
299
        os.chdir('../b/subdir')
 
300
        self.runbzr('pull ../../a')
 
301
        assert a.revision_history()[-1] == b.revision_history()[-1]
 
302
        self.runbzr('commit -m blah5 --unchanged')
 
303
        self.runbzr('commit -m blah6 --unchanged')
 
304
        os.chdir('..')
 
305
        self.runbzr('pull ../a')
 
306
        os.chdir('../a')
 
307
        self.runbzr('commit -m blah7 --unchanged')
 
308
        self.runbzr('merge ../b')
 
309
        self.runbzr('commit -m blah8 --unchanged')
 
310
        self.runbzr('pull ../b')
 
311
        self.runbzr('pull ../b')
 
312
        
 
313
    def test_add_reports(self):
 
314
        """add command prints the names of added files."""
 
315
        b = Branch.initialize('.')
 
316
        self.build_tree(['top.txt', 'dir/', 'dir/sub.txt'])
 
317
        out = self.run_bzr_captured(['add'], retcode = 0)[0]
 
318
        # the ordering is not defined at the moment
 
319
        results = sorted(out.rstrip('\n').split('\n'))
 
320
        self.assertEquals(['added dir',
 
321
                           'added dir'+os.sep+'sub.txt',
 
322
                           'added top.txt',],
 
323
                          results)
 
324
 
 
325
    def test_unknown_command(self):
 
326
        """Handling of unknown command."""
 
327
        out, err = self.run_bzr_captured(['fluffy-badger'],
 
328
                                         retcode=1)
 
329
        self.assertEquals(out, '')
 
330
        err.index('unknown command')
 
331
        
180
332
 
181
333
 
182
334
class OldTests(ExternalBase):
183
 
    # old tests moved from ./testbzr
184
 
    def runTest(self):
 
335
    """old tests moved from ./testbzr."""
 
336
 
 
337
    def test_bzr(self):
185
338
        from os import chdir, mkdir
186
339
        from os.path import exists
187
 
        import os
188
340
 
189
341
        runbzr = self.runbzr
190
 
        backtick = self.backtick
 
342
        capture = self.capture
191
343
        progress = self.log
192
344
 
193
345
        progress("basic branch creation")
195
347
        chdir('branch1')
196
348
        runbzr('init')
197
349
 
198
 
        self.assertEquals(backtick('bzr root').rstrip(),
 
350
        self.assertEquals(capture('root').rstrip(),
199
351
                          os.path.join(self.test_dir, 'branch1'))
200
352
 
201
353
        progress("status of new file")
204
356
        f.write('hello world!\n')
205
357
        f.close()
206
358
 
207
 
        out = backtick("bzr unknowns")
208
 
        self.assertEquals(out, 'test.txt\n')
 
359
        self.assertEquals(capture('unknowns'), 'test.txt\n')
209
360
 
210
 
        out = backtick("bzr status")
 
361
        out = capture("status")
211
362
        assert out == 'unknown:\n  test.txt\n'
212
363
 
213
 
        out = backtick("bzr status --all")
 
364
        out = capture("status --all")
214
365
        assert out == "unknown:\n  test.txt\n"
215
366
 
216
 
        out = backtick("bzr status test.txt --all")
 
367
        out = capture("status test.txt --all")
217
368
        assert out == "unknown:\n  test.txt\n"
218
369
 
219
370
        f = file('test2.txt', 'wt')
220
371
        f.write('goodbye cruel world...\n')
221
372
        f.close()
222
373
 
223
 
        out = backtick("bzr status test.txt")
 
374
        out = capture("status test.txt")
224
375
        assert out == "unknown:\n  test.txt\n"
225
376
 
226
 
        out = backtick("bzr status")
 
377
        out = capture("status")
227
378
        assert out == ("unknown:\n"
228
379
                       "  test.txt\n"
229
380
                       "  test2.txt\n")
231
382
        os.unlink('test2.txt')
232
383
 
233
384
        progress("command aliases")
234
 
        out = backtick("bzr st --all")
 
385
        out = capture("st --all")
235
386
        assert out == ("unknown:\n"
236
387
                       "  test.txt\n")
237
388
 
238
 
        out = backtick("bzr stat")
 
389
        out = capture("stat")
239
390
        assert out == ("unknown:\n"
240
391
                       "  test.txt\n")
241
392
 
245
396
        runbzr("help commands")
246
397
        runbzr("help slartibartfast", 1)
247
398
 
248
 
        out = backtick("bzr help ci")
 
399
        out = capture("help ci")
249
400
        out.index('aliases: ')
250
401
 
251
402
        progress("can't rename unversioned file")
254
405
        progress("adding a file")
255
406
 
256
407
        runbzr("add test.txt")
257
 
        assert backtick("bzr unknowns") == ''
258
 
        assert backtick("bzr status --all") == ("added:\n"
 
408
        assert capture("unknowns") == ''
 
409
        assert capture("status --all") == ("added:\n"
259
410
                                                "  test.txt\n")
260
411
 
261
412
        progress("rename newly-added file")
263
414
        assert os.path.exists("hello.txt")
264
415
        assert not os.path.exists("test.txt")
265
416
 
266
 
        assert backtick("bzr revno") == '0\n'
 
417
        assert capture("revno") == '0\n'
267
418
 
268
419
        progress("add first revision")
269
420
        runbzr(['commit', '-m', 'add first revision'])
277
428
        runbzr("add sub1")
278
429
        runbzr("rename sub1 sub2")
279
430
        runbzr("move hello.txt sub2")
280
 
        assert backtick("bzr relpath sub2/hello.txt") == os.path.join("sub2", "hello.txt\n")
 
431
        assert capture("relpath sub2/hello.txt") == os.path.join("sub2", "hello.txt\n")
281
432
 
282
433
        assert exists("sub2")
283
434
        assert exists("sub2/hello.txt")
298
449
        runbzr(['commit', '-m', 'rename nested subdirectories'])
299
450
 
300
451
        chdir('sub1/sub2')
301
 
        self.assertEquals(backtick('bzr root')[:-1],
 
452
        self.assertEquals(capture('root')[:-1],
302
453
                          os.path.join(self.test_dir, 'branch1'))
303
454
        runbzr('move ../hello.txt .')
304
455
        assert exists('./hello.txt')
305
 
        assert backtick('bzr relpath hello.txt') == os.path.join('sub1', 'sub2', 'hello.txt\n')
306
 
        assert backtick('bzr relpath ../../sub1/sub2/hello.txt') == os.path.join('sub1', 'sub2', 'hello.txt\n')
 
456
        self.assertEquals(capture('relpath hello.txt'),
 
457
                          os.path.join('sub1', 'sub2', 'hello.txt') + '\n')
 
458
        assert capture('relpath ../../sub1/sub2/hello.txt') == os.path.join('sub1', 'sub2', 'hello.txt\n')
307
459
        runbzr(['commit', '-m', 'move to parent directory'])
308
460
        chdir('..')
309
 
        assert backtick('bzr relpath sub2/hello.txt') == os.path.join('sub1', 'sub2', 'hello.txt\n')
 
461
        assert capture('relpath sub2/hello.txt') == os.path.join('sub1', 'sub2', 'hello.txt\n')
310
462
 
311
463
        runbzr('move sub2/hello.txt .')
312
464
        assert exists('hello.txt')
321
473
 
322
474
        runbzr('commit -F msg.tmp')
323
475
 
324
 
        assert backtick('bzr revno') == '5\n'
 
476
        assert capture('revno') == '5\n'
325
477
        runbzr('export -r 5 export-5.tmp')
326
478
        runbzr('export export.tmp')
327
479
 
329
481
        runbzr('log -v')
330
482
        runbzr('log -v --forward')
331
483
        runbzr('log -m', retcode=1)
332
 
        log_out = backtick('bzr log -m commit')
 
484
        log_out = capture('log -m commit')
333
485
        assert "this is my new commit" in log_out
334
486
        assert "rename nested" not in log_out
335
487
        assert 'revision-id' not in log_out
336
 
        assert 'revision-id' in backtick('bzr log --show-ids -m commit')
 
488
        assert 'revision-id' in capture('log --show-ids -m commit')
337
489
 
338
490
 
339
491
        progress("file with spaces in name")
349
501
 
350
502
        runbzr('info')
351
503
 
352
 
 
353
 
 
354
 
 
355
 
 
356
 
 
357
 
class RevertCommand(ExternalBase):
358
 
    def runTest(self):
359
 
        self.runbzr('init')
360
 
 
361
 
        file('hello', 'wt').write('foo')
362
 
        self.runbzr('add hello')
363
 
        self.runbzr('commit -m setup hello')
364
 
        
365
 
        file('hello', 'wt').write('bar')
366
 
        self.runbzr('revert hello')
367
 
        self.check_file_contents('hello', 'foo')
368