/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: Martin Pool
  • Date: 2005-09-29 12:49:59 UTC
  • mto: (1185.14.2)
  • mto: This revision was merged to the branch mainline in revision 1396.
  • Revision ID: mbp@sourcefrog.net-20050929124959-df3f175844fc90ed
- remove redundant import

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
        # naughty - abstraction violations RBC 20050928  
 
231
        print "test_branch used to delete the stores, how is this meant to work ?"
 
232
        #shutil.rmtree('a/.bzr/revision-store')
 
233
        #shutil.rmtree('a/.bzr/inventory-store', ignore_errors=True)
 
234
        #shutil.rmtree('a/.bzr/text-store', ignore_errors=True)
 
235
        self.runbzr('branch a d --basis b')
 
236
 
 
237
    def test_merge(self):
 
238
        from bzrlib.branch import Branch
 
239
        
 
240
        os.mkdir('a')
 
241
        os.chdir('a')
 
242
        self.example_branch()
 
243
        os.chdir('..')
 
244
        self.runbzr('branch a b')
 
245
        os.chdir('b')
 
246
        file('goodbye', 'wt').write('quux')
 
247
        self.runbzr(['commit',  '-m',  "more u's are always good"])
 
248
 
 
249
        os.chdir('../a')
 
250
        file('hello', 'wt').write('quuux')
 
251
        # We can't merge when there are in-tree changes
 
252
        self.runbzr('merge ../b', retcode=1)
 
253
        self.runbzr(['commit', '-m', "Like an epidemic of u's"])
 
254
        self.runbzr('merge ../b')
 
255
        self.check_file_contents('goodbye', 'quux')
 
256
        # Merging a branch pulls its revision into the tree
 
257
        a = Branch.open('.')
 
258
        b = Branch.open('../b')
 
259
        a.get_revision_xml(b.last_revision())
 
260
        self.log('pending merges: %s', a.pending_merges())
 
261
        #        assert a.pending_merges() == [b.last_revision()], "Assertion %s %s" \
 
262
        #        % (a.pending_merges(), b.last_revision())
 
263
 
 
264
    def test_pull(self):
 
265
        """Pull changes from one branch to another."""
 
266
        os.mkdir('a')
 
267
        os.chdir('a')
 
268
 
 
269
        self.example_branch()
 
270
        self.runbzr('pull', retcode=1)
 
271
        self.runbzr('missing', retcode=1)
 
272
        self.runbzr('missing .')
 
273
        self.runbzr('missing')
 
274
        self.runbzr('pull')
 
275
        self.runbzr('pull /', retcode=1)
 
276
        self.runbzr('pull')
 
277
 
 
278
        os.chdir('..')
 
279
        self.runbzr('branch a b')
 
280
        os.chdir('b')
 
281
        self.runbzr('pull')
 
282
        os.mkdir('subdir')
 
283
        self.runbzr('add subdir')
 
284
        self.runbzr('commit -m blah --unchanged')
 
285
        os.chdir('../a')
 
286
        a = Branch.open('.')
 
287
        b = Branch.open('../b')
 
288
        assert a.revision_history() == b.revision_history()[:-1]
 
289
        self.runbzr('pull ../b')
 
290
        assert a.revision_history() == b.revision_history()
 
291
        self.runbzr('commit -m blah2 --unchanged')
 
292
        os.chdir('../b')
 
293
        self.runbzr('commit -m blah3 --unchanged')
 
294
        self.runbzr('pull ../a', retcode=1)
 
295
        print "DECIDE IF PULL CAN CONVERGE, blackbox.py"
 
296
        return
 
297
        os.chdir('../a')
 
298
        self.runbzr('merge ../b')
 
299
        self.runbzr('commit -m blah4 --unchanged')
 
300
        os.chdir('../b/subdir')
 
301
        self.runbzr('pull ../../a')
 
302
        assert a.revision_history()[-1] == b.revision_history()[-1]
 
303
        self.runbzr('commit -m blah5 --unchanged')
 
304
        self.runbzr('commit -m blah6 --unchanged')
 
305
        os.chdir('..')
 
306
        self.runbzr('pull ../a')
 
307
        os.chdir('../a')
 
308
        self.runbzr('commit -m blah7 --unchanged')
 
309
        self.runbzr('merge ../b')
 
310
        self.runbzr('commit -m blah8 --unchanged')
 
311
        self.runbzr('pull ../b')
 
312
        self.runbzr('pull ../b')
 
313
        
 
314
    def test_add_reports(self):
 
315
        """add command prints the names of added files."""
 
316
        b = Branch.initialize('.')
 
317
        self.build_tree(['top.txt', 'dir/', 'dir/sub.txt'])
 
318
        out = self.run_bzr_captured(['add'], retcode = 0)[0]
 
319
        # the ordering is not defined at the moment
 
320
        results = sorted(out.rstrip('\n').split('\n'))
 
321
        self.assertEquals(['added dir',
 
322
                           'added dir'+os.sep+'sub.txt',
 
323
                           'added top.txt',],
 
324
                          results)
 
325
 
 
326
    def test_unknown_command(self):
 
327
        """Handling of unknown command."""
 
328
        out, err = self.run_bzr_captured(['fluffy-badger'],
 
329
                                         retcode=1)
 
330
        self.assertEquals(out, '')
 
331
        err.index('unknown command')
 
332
        
180
333
 
181
334
 
182
335
class OldTests(ExternalBase):
183
 
    # old tests moved from ./testbzr
184
 
    def runTest(self):
 
336
    """old tests moved from ./testbzr."""
 
337
 
 
338
    def test_bzr(self):
185
339
        from os import chdir, mkdir
186
340
        from os.path import exists
187
 
        import os
188
341
 
189
342
        runbzr = self.runbzr
190
 
        backtick = self.backtick
 
343
        capture = self.capture
191
344
        progress = self.log
192
345
 
193
346
        progress("basic branch creation")
195
348
        chdir('branch1')
196
349
        runbzr('init')
197
350
 
198
 
        self.assertEquals(backtick('bzr root').rstrip(),
 
351
        self.assertEquals(capture('root').rstrip(),
199
352
                          os.path.join(self.test_dir, 'branch1'))
200
353
 
201
354
        progress("status of new file")
204
357
        f.write('hello world!\n')
205
358
        f.close()
206
359
 
207
 
        out = backtick("bzr unknowns")
208
 
        self.assertEquals(out, 'test.txt\n')
 
360
        self.assertEquals(capture('unknowns'), 'test.txt\n')
209
361
 
210
 
        out = backtick("bzr status")
 
362
        out = capture("status")
211
363
        assert out == 'unknown:\n  test.txt\n'
212
364
 
213
 
        out = backtick("bzr status --all")
 
365
        out = capture("status --all")
214
366
        assert out == "unknown:\n  test.txt\n"
215
367
 
216
 
        out = backtick("bzr status test.txt --all")
 
368
        out = capture("status test.txt --all")
217
369
        assert out == "unknown:\n  test.txt\n"
218
370
 
219
371
        f = file('test2.txt', 'wt')
220
372
        f.write('goodbye cruel world...\n')
221
373
        f.close()
222
374
 
223
 
        out = backtick("bzr status test.txt")
 
375
        out = capture("status test.txt")
224
376
        assert out == "unknown:\n  test.txt\n"
225
377
 
226
 
        out = backtick("bzr status")
 
378
        out = capture("status")
227
379
        assert out == ("unknown:\n"
228
380
                       "  test.txt\n"
229
381
                       "  test2.txt\n")
231
383
        os.unlink('test2.txt')
232
384
 
233
385
        progress("command aliases")
234
 
        out = backtick("bzr st --all")
 
386
        out = capture("st --all")
235
387
        assert out == ("unknown:\n"
236
388
                       "  test.txt\n")
237
389
 
238
 
        out = backtick("bzr stat")
 
390
        out = capture("stat")
239
391
        assert out == ("unknown:\n"
240
392
                       "  test.txt\n")
241
393
 
245
397
        runbzr("help commands")
246
398
        runbzr("help slartibartfast", 1)
247
399
 
248
 
        out = backtick("bzr help ci")
 
400
        out = capture("help ci")
249
401
        out.index('aliases: ')
250
402
 
251
403
        progress("can't rename unversioned file")
254
406
        progress("adding a file")
255
407
 
256
408
        runbzr("add test.txt")
257
 
        assert backtick("bzr unknowns") == ''
258
 
        assert backtick("bzr status --all") == ("added:\n"
 
409
        assert capture("unknowns") == ''
 
410
        assert capture("status --all") == ("added:\n"
259
411
                                                "  test.txt\n")
260
412
 
261
413
        progress("rename newly-added file")
263
415
        assert os.path.exists("hello.txt")
264
416
        assert not os.path.exists("test.txt")
265
417
 
266
 
        assert backtick("bzr revno") == '0\n'
 
418
        assert capture("revno") == '0\n'
267
419
 
268
420
        progress("add first revision")
269
421
        runbzr(['commit', '-m', 'add first revision'])
277
429
        runbzr("add sub1")
278
430
        runbzr("rename sub1 sub2")
279
431
        runbzr("move hello.txt sub2")
280
 
        assert backtick("bzr relpath sub2/hello.txt") == os.path.join("sub2", "hello.txt\n")
 
432
        assert capture("relpath sub2/hello.txt") == os.path.join("sub2", "hello.txt\n")
281
433
 
282
434
        assert exists("sub2")
283
435
        assert exists("sub2/hello.txt")
298
450
        runbzr(['commit', '-m', 'rename nested subdirectories'])
299
451
 
300
452
        chdir('sub1/sub2')
301
 
        self.assertEquals(backtick('bzr root')[:-1],
 
453
        self.assertEquals(capture('root')[:-1],
302
454
                          os.path.join(self.test_dir, 'branch1'))
303
455
        runbzr('move ../hello.txt .')
304
456
        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')
 
457
        self.assertEquals(capture('relpath hello.txt'),
 
458
                          os.path.join('sub1', 'sub2', 'hello.txt') + '\n')
 
459
        assert capture('relpath ../../sub1/sub2/hello.txt') == os.path.join('sub1', 'sub2', 'hello.txt\n')
307
460
        runbzr(['commit', '-m', 'move to parent directory'])
308
461
        chdir('..')
309
 
        assert backtick('bzr relpath sub2/hello.txt') == os.path.join('sub1', 'sub2', 'hello.txt\n')
 
462
        assert capture('relpath sub2/hello.txt') == os.path.join('sub1', 'sub2', 'hello.txt\n')
310
463
 
311
464
        runbzr('move sub2/hello.txt .')
312
465
        assert exists('hello.txt')
321
474
 
322
475
        runbzr('commit -F msg.tmp')
323
476
 
324
 
        assert backtick('bzr revno') == '5\n'
 
477
        assert capture('revno') == '5\n'
325
478
        runbzr('export -r 5 export-5.tmp')
326
479
        runbzr('export export.tmp')
327
480
 
329
482
        runbzr('log -v')
330
483
        runbzr('log -v --forward')
331
484
        runbzr('log -m', retcode=1)
332
 
        log_out = backtick('bzr log -m commit')
 
485
        log_out = capture('log -m commit')
333
486
        assert "this is my new commit" in log_out
334
487
        assert "rename nested" not in log_out
335
488
        assert 'revision-id' not in log_out
336
 
        assert 'revision-id' in backtick('bzr log --show-ids -m commit')
 
489
        assert 'revision-id' in capture('log --show-ids -m commit')
337
490
 
338
491
 
339
492
        progress("file with spaces in name")
349
502
 
350
503
        runbzr('info')
351
504
 
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