/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/tests/blackbox/test_bound_branches.py

First attempt to merge .dev and resolve the conflicts (but tests are 
failing)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005 by Canonical Ltd
 
1
# Copyright (C) 2005 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
 
18
 
"""Tests of bound branches (binding, unbinding, commit, etc) command.
19
 
"""
 
18
"""Tests of bound branches (binding, unbinding, commit, etc) command."""
20
19
 
21
20
import os
22
21
from cStringIO import StringIO
23
22
 
 
23
from bzrlib import (
 
24
    bzrdir,
 
25
    errors
 
26
    )
24
27
from bzrlib.branch import Branch
25
28
from bzrlib.bzrdir import (BzrDir, BzrDirFormat, BzrDirMetaFormat1)
26
29
from bzrlib.osutils import getcwd
34
37
    def setUp(self):
35
38
        super(TestLegacyFormats, self).setUp()
36
39
        self.build_tree(['master/', 'child/'])
37
 
        self.run_bzr('init', 'master')
38
 
        self.run_bzr('init', '--format=weave', 'child')
 
40
        self.make_branch_and_tree('master')
 
41
        self.make_branch_and_tree('child',
 
42
                        format=bzrdir.format_registry.make_bzrdir('weave'))
39
43
        os.chdir('child')
40
44
    
41
45
    def test_bind_format_6_bzrdir(self):
42
46
        # bind on a format 6 bzrdir should error
43
 
        out,err = self.run_bzr('bind', '../master', retcode=3)
 
47
        out,err = self.run_bzr('bind ../master', retcode=3)
44
48
        self.assertEqual('', out)
45
49
        # TODO: jam 20060427 Probably something like this really should
46
50
        #       print out the actual path, rather than the URL
60
64
class TestBoundBranches(TestCaseWithTransport):
61
65
 
62
66
    def create_branches(self):
63
 
        bzr = self.run_bzr
64
67
        self.build_tree(['base/', 'base/a', 'base/b'])
65
68
 
66
69
        branch = self.init_meta_branch('base')
67
 
        tree = branch.bzrdir.open_workingtree()
68
 
        tree.lock_write()
69
 
        tree.add(['a', 'b'])
70
 
        tree.commit('init')
71
 
        tree.unlock()
 
70
        base_tree = branch.bzrdir.open_workingtree()
 
71
        base_tree.lock_write()
 
72
        base_tree.add(['a', 'b'])
 
73
        base_tree.commit('init')
 
74
        base_tree.unlock()
72
75
 
73
 
        self.run_bzr('checkout', 'base', 'child')
 
76
        child_tree = branch.create_checkout('child')
74
77
 
75
78
        self.check_revno(1, 'child')
76
79
        d = BzrDir.open('child')
77
80
        self.assertNotEqual(None, d.open_branch().get_master_branch())
78
81
 
 
82
        return base_tree, child_tree
 
83
 
79
84
    def check_revno(self, val, loc='.'):
80
85
        self.assertEqual(
81
86
            val, len(BzrDir.open(loc).open_branch().revision_history()))
83
88
    def test_simple_binding(self):
84
89
        self.build_tree(['base/', 'base/a', 'base/b'])
85
90
 
86
 
        self.init_meta_branch('base')
87
 
        self.run_bzr('add', 'base')
88
 
        self.run_bzr('commit', '-m', 'init', 'base')
 
91
        branch = self.init_meta_branch('base')
 
92
        tree = branch.bzrdir.open_workingtree()
 
93
        tree.add('a', 'b')
 
94
        tree.commit(message='init')
89
95
 
90
 
        self.run_bzr('branch', 'base', 'child')
 
96
        tree.bzrdir.sprout('child')
91
97
 
92
98
        os.chdir('child')
93
 
        self.run_bzr('bind', '../base')
 
99
        self.run_bzr('bind ../base')
94
100
 
95
101
        d = BzrDir.open('')
96
102
        self.assertNotEqual(None, d.open_branch().get_master_branch())
100
106
 
101
107
        self.run_bzr('unbind', retcode=3)
102
108
 
 
109
    def test_bind_branch6(self):
 
110
        branch1 = self.make_branch('branch1', format='dirstate-tags')
 
111
        os.chdir('branch1')
 
112
        error = self.run_bzr('bind', retcode=3)[1]
 
113
        self.assertContainsRe(error, 'no previous location known')
 
114
 
 
115
    def setup_rebind(self, format):
 
116
        branch1 = self.make_branch('branch1')
 
117
        branch2 = self.make_branch('branch2', format=format)
 
118
        branch2.bind(branch1)
 
119
        branch2.unbind()
 
120
 
 
121
    def test_rebind_branch6(self):
 
122
        self.setup_rebind('dirstate-tags')
 
123
        os.chdir('branch2')
 
124
        self.run_bzr('bind')
 
125
        b = Branch.open('.')
 
126
        self.assertContainsRe(b.get_bound_location(), '\/branch1\/$')
 
127
 
 
128
    def test_rebind_branch5(self):
 
129
        self.setup_rebind('knit')
 
130
        os.chdir('branch2')
 
131
        error = self.run_bzr('bind', retcode=3)[1]
 
132
        self.assertContainsRe(error, 'old locations')
 
133
 
103
134
    def init_meta_branch(self, path):
104
 
        old_format = BzrDirFormat.get_default_format()
105
 
        BzrDirFormat.set_default_format(BzrDirMetaFormat1())
106
 
        try:
107
 
            return BzrDir.create_branch_convenience(
108
 
                path, BzrDirMetaFormat1())
109
 
        finally:
110
 
            BzrDirFormat.set_default_format(old_format)
 
135
        format = bzrdir.format_registry.make_bzrdir('default')
 
136
        return BzrDir.create_branch_convenience(path, format=format)
111
137
 
112
138
    def test_bound_commit(self):
113
 
        bzr = self.run_bzr
114
 
        self.create_branches()
115
 
 
116
 
        os.chdir('child')
117
 
        open('a', 'wb').write('new contents\n')
118
 
        bzr('commit', '-m', 'child')
119
 
 
120
 
        self.check_revno(2)
 
139
        child_tree = self.create_branches()[1]
 
140
 
 
141
        self.build_tree_contents([('child/a', 'new contents')])
 
142
        child_tree.commit(message='child')
 
143
 
 
144
        self.check_revno(2, 'child')
121
145
 
122
146
        # Make sure it committed on the parent
123
 
        self.check_revno(2, '../base')
 
147
        self.check_revno(2, 'base')
124
148
 
125
149
    def test_bound_fail(self):
126
150
        # Make sure commit fails if out of date.
127
 
        bzr = self.run_bzr
128
 
        self.create_branches()
129
 
 
130
 
        os.chdir('base')
131
 
        open('a', 'wb').write('new base contents\n')
132
 
        bzr('commit', '-m', 'base')
133
 
        self.check_revno(2)
134
 
 
135
 
        os.chdir('../child')
136
 
        self.check_revno(1)
137
 
        open('b', 'wb').write('new b child contents\n')
138
 
        bzr('commit', '-m', 'child', retcode=3)
139
 
        self.check_revno(1)
140
 
 
141
 
        bzr('update')
142
 
        self.check_revno(2)
143
 
 
144
 
        bzr('commit', '-m', 'child')
145
 
        self.check_revno(3)
146
 
        self.check_revno(3, '../base')
 
151
        base_tree, child_tree = self.create_branches()
 
152
 
 
153
        self.build_tree_contents([
 
154
            ('base/a',  'new base contents\n'   ),
 
155
            ('child/b', 'new b child contents\n')])
 
156
        base_tree.commit(message='base')
 
157
        self.check_revno(2, 'base')
 
158
 
 
159
        self.check_revno(1, 'child')
 
160
        self.assertRaises(errors.BoundBranchOutOfDate, child_tree.commit,
 
161
                                                            message='child')
 
162
        self.check_revno(1, 'child')
 
163
 
 
164
        child_tree.update()
 
165
        self.check_revno(2, 'child')
 
166
 
 
167
        child_tree.commit(message='child')
 
168
        self.check_revno(3, 'child')
 
169
        self.check_revno(3, 'base')
147
170
 
148
171
    def test_double_binding(self):
149
 
        bzr = self.run_bzr
150
 
        self.create_branches()
151
 
 
152
 
        bzr('branch', 'child', 'child2')
 
172
        child_tree = self.create_branches()[1]
 
173
 
 
174
        child2_tree = child_tree.bzrdir.sprout('child2').open_workingtree()
 
175
 
153
176
        os.chdir('child2')
154
 
 
155
177
        # Double binding succeeds, but committing to child2 should fail
156
 
        bzr('bind', '../child')
 
178
        self.run_bzr('bind ../child')
157
179
 
158
 
        bzr('commit', '-m', 'child2', '--unchanged', retcode=3)
 
180
        self.assertRaises(errors.CommitToDoubleBoundBranch,
 
181
                child2_tree.commit, message='child2', allow_pointless=True)
159
182
 
160
183
    def test_unbinding(self):
161
 
        bzr = self.run_bzr
162
 
        self.create_branches()
163
 
 
164
 
        os.chdir('base')
165
 
        open('a', 'wb').write('new base contents\n')
166
 
        bzr('commit', '-m', 'base')
167
 
        self.check_revno(2)
168
 
 
169
 
        os.chdir('../child')
170
 
        open('b', 'wb').write('new b child contents\n')
171
 
        self.check_revno(1)
172
 
        bzr('commit', '-m', 'child', retcode=3)
173
 
        self.check_revno(1)
174
 
        bzr('unbind')
175
 
        bzr('commit', '-m', 'child')
176
 
        self.check_revno(2)
177
 
 
178
 
        bzr('bind', retcode=3)
 
184
        base_tree, child_tree = self.create_branches()
 
185
 
 
186
        self.build_tree_contents([
 
187
            ('base/a',  'new base contents\n'   ),
 
188
            ('child/b', 'new b child contents\n')])
 
189
 
 
190
        base_tree.commit(message='base')
 
191
        self.check_revno(2, 'base')
 
192
 
 
193
        self.check_revno(1, 'child')
 
194
        os.chdir('child')
 
195
        self.run_bzr("commit -m child", retcode=3)
 
196
        self.check_revno(1)
 
197
        self.run_bzr('unbind')
 
198
        child_tree.commit(message='child')
 
199
        self.check_revno(2)
179
200
 
180
201
    def test_commit_remote_bound(self):
181
202
        # It is not possible to commit to a branch
182
203
        # which is bound to a branch which is bound
183
 
        bzr = self.run_bzr
184
 
        self.create_branches()
185
 
        bzr('branch', 'base', 'newbase')
 
204
        base_tree, child_tree = self.create_branches()
 
205
        base_tree.bzrdir.sprout('newbase')
 
206
 
186
207
        os.chdir('base')
187
 
        
188
208
        # There is no way to know that B has already
189
209
        # been bound by someone else, otherwise it
190
210
        # might be nice if this would fail
191
 
        bzr('bind', '../newbase')
 
211
        self.run_bzr('bind ../newbase')
192
212
 
193
213
        os.chdir('../child')
194
 
        bzr('commit', '-m', 'failure', '--unchanged', retcode=3)
 
214
        self.run_bzr('commit -m failure --unchanged', retcode=3)
195
215
 
196
216
    def test_pull_updates_both(self):
197
 
        bzr = self.run_bzr
198
 
        self.create_branches()
199
 
        bzr('branch', 'base', 'newchild')
200
 
        os.chdir('newchild')
201
 
        open('b', 'wb').write('newchild b contents\n')
202
 
        bzr('commit', '-m', 'newchild')
203
 
        self.check_revno(2)
 
217
        base_tree = self.create_branches()[0]
 
218
        newchild_tree = base_tree.bzrdir.sprout('newchild').open_workingtree()
 
219
        self.build_tree_contents([('newchild/b', 'newchild b contents\n')])
 
220
        newchild_tree.commit(message='newchild')
 
221
        self.check_revno(2, 'newchild')
204
222
 
205
 
        os.chdir('../child')
 
223
        os.chdir('child')
206
224
        # The pull should succeed, and update
207
225
        # the bound parent branch
208
 
        bzr('pull', '../newchild')
 
226
        self.run_bzr('pull ../newchild')
209
227
        self.check_revno(2)
210
228
 
211
229
        self.check_revno(2, '../base')
212
230
 
213
231
    def test_bind_diverged(self):
214
 
        bzr = self.run_bzr
215
 
        self.create_branches()
216
 
 
217
 
        os.chdir('child')
218
 
        bzr('unbind')
219
 
 
220
 
        bzr('commit', '-m', 'child', '--unchanged')
221
 
        self.check_revno(2)
222
 
 
223
 
        os.chdir('../base')
224
 
        self.check_revno(1)
225
 
        bzr('commit', '-m', 'base', '--unchanged')
226
 
        self.check_revno(2)
227
 
 
228
 
        os.chdir('../child')
229
 
        # These branches have diverged
230
 
        bzr('bind', '../base', retcode=3)
231
 
 
232
 
        # TODO: In the future, this might require actual changes
233
 
        # to have occurred, rather than just a new revision entry
234
 
        bzr('merge', '../base')
235
 
        bzr('commit', '-m', 'merged')
236
 
        self.check_revno(3)
237
 
 
238
 
        # After a merge, trying to bind again should succeed
239
 
        # by pushing the new change to base
240
 
        bzr('bind', '../base')
241
 
        self.check_revno(3)
242
 
        self.check_revno(3, '../base')
243
 
 
244
 
        # After binding, the revision history should be identical
245
 
        child_rh = bzr('revision-history')[0]
246
 
        os.chdir('../base')
247
 
        base_rh = bzr('revision-history')[0]
248
 
        self.assertEquals(child_rh, base_rh)
 
232
        base_tree, child_tree = self.create_branches()
 
233
        base_branch = base_tree.branch
 
234
        child_branch = child_tree.branch
 
235
 
 
236
        os.chdir('child')
 
237
        self.run_bzr('unbind')
 
238
 
 
239
        child_tree.commit(message='child', allow_pointless=True)
 
240
        self.check_revno(2)
 
241
 
 
242
        os.chdir('..')
 
243
        self.check_revno(1, 'base')
 
244
        base_tree.commit(message='base', allow_pointless=True)
 
245
        self.check_revno(2, 'base')
 
246
 
 
247
        os.chdir('child')
 
248
        # These branches have diverged, but bind should succeed anyway
 
249
        self.run_bzr('bind ../base')
 
250
 
 
251
        # This should turn the local commit into a merge
 
252
        child_tree.update()
 
253
        child_tree.commit(message='merged')
 
254
        self.check_revno(3)
 
255
 
 
256
        # After binding, the revision history should be unaltered
 
257
        # take a copy before
 
258
        base_history = base_branch.revision_history()
 
259
        child_history = child_branch.revision_history()
249
260
 
250
261
    def test_bind_parent_ahead(self):
251
 
        bzr = self.run_bzr
252
 
        self.create_branches()
 
262
        base_tree = self.create_branches()[0]
253
263
 
254
264
        os.chdir('child')
255
 
        bzr('unbind')
256
 
 
257
 
        os.chdir('../base')
258
 
        bzr('commit', '-m', 'base', '--unchanged')
259
 
 
260
 
        os.chdir('../child')
261
 
        self.check_revno(1)
262
 
        bzr('bind', '../base')
263
 
 
264
 
        self.check_revno(2)
265
 
        bzr('unbind')
 
265
        self.run_bzr('unbind')
 
266
 
 
267
        base_tree.commit(message='base', allow_pointless=True)
 
268
 
 
269
        self.check_revno(1)
 
270
        self.run_bzr('bind ../base')
 
271
 
 
272
        # binding does not pull data:
 
273
        self.check_revno(1)
 
274
        self.run_bzr('unbind')
266
275
 
267
276
        # Check and make sure it also works if parent is ahead multiple
268
 
        os.chdir('../base')
269
 
        bzr('commit', '-m', 'base 3', '--unchanged')
270
 
        bzr('commit', '-m', 'base 4', '--unchanged')
271
 
        bzr('commit', '-m', 'base 5', '--unchanged')
272
 
        self.check_revno(5)
 
277
        base_tree.commit(message='base 3', allow_pointless=True)
 
278
        base_tree.commit(message='base 4', allow_pointless=True)
 
279
        base_tree.commit(message='base 5', allow_pointless=True)
 
280
        self.check_revno(5, '../base')
273
281
 
274
 
        os.chdir('../child')
275
 
        self.check_revno(2)
276
 
        bzr('bind', '../base')
277
 
        self.check_revno(5)
 
282
        self.check_revno(1)
 
283
        self.run_bzr('bind ../base')
 
284
        self.check_revno(1)
278
285
 
279
286
    def test_bind_child_ahead(self):
280
287
        # test binding when the master branches history is a prefix of the 
281
 
        # childs
282
 
        bzr = self.run_bzr
283
 
        self.create_branches()
284
 
        return
 
288
        # childs - it should bind ok but the revision histories should not
 
289
        # be altered
 
290
        child_tree = self.create_branches()[1]
285
291
 
286
292
        os.chdir('child')
287
 
        bzr('unbind')
288
 
        bzr('commit', '-m', 'child', '--unchanged')
 
293
        self.run_bzr('unbind')
 
294
        child_tree.commit(message='child', allow_pointless=True)
289
295
        self.check_revno(2)
290
296
        self.check_revno(1, '../base')
291
297
 
292
 
        bzr('bind', '../base')
293
 
        self.check_revno(2, '../base')
 
298
        self.run_bzr('bind ../base')
 
299
        self.check_revno(1, '../base')
294
300
 
295
301
        # Check and make sure it also works if child is ahead multiple
296
 
        bzr('unbind')
297
 
        bzr('commit', '-m', 'child 3', '--unchanged')
298
 
        bzr('commit', '-m', 'child 4', '--unchanged')
299
 
        bzr('commit', '-m', 'child 5', '--unchanged')
 
302
        self.run_bzr('unbind')
 
303
        child_tree.commit(message='child 3', allow_pointless=True)
 
304
        child_tree.commit(message='child 4', allow_pointless=True)
 
305
        child_tree.commit(message='child 5', allow_pointless=True)
300
306
        self.check_revno(5)
301
307
 
302
 
        self.check_revno(2, '../base')
303
 
        bzr('bind', '../base')
304
 
        self.check_revno(5, '../base')
 
308
        self.check_revno(1, '../base')
 
309
        self.run_bzr('bind ../base')
 
310
        self.check_revno(1, '../base')
 
311
 
 
312
    def test_bind_fail_if_missing(self):
 
313
        """We should not be able to bind to a missing branch."""
 
314
        tree = self.make_branch_and_tree('tree_1')
 
315
        tree.commit('dummy commit')
 
316
        self.run_bzr_error(['Not a branch.*no-such-branch/'], ['bind', '../no-such-branch'],
 
317
                            working_dir='tree_1')
 
318
        self.assertIs(None, tree.branch.get_bound_location())
305
319
 
306
320
    def test_commit_after_merge(self):
307
 
        bzr = self.run_bzr
308
 
        self.create_branches()
 
321
        base_tree, child_tree = self.create_branches()
309
322
 
310
323
        # We want merge to be able to be a local only
311
324
        # operation, because it can be without violating
312
325
        # the binding invariants.
313
326
        # But we can't fail afterwards
314
 
 
315
 
        bzr('branch', 'child', 'other')
316
 
 
317
 
        os.chdir('other')
318
 
        open('c', 'wb').write('file c\n')
319
 
        bzr('add', 'c')
320
 
        bzr('commit', '-m', 'adding c')
321
 
        new_rev_id = bzr('revision-history')[0].strip().split('\n')[-1]
322
 
 
323
 
        os.chdir('../child')
324
 
        bzr('merge', '../other')
325
 
 
326
 
        self.failUnlessExists('c')
327
 
        tree = WorkingTree.open('.') # opens child
328
 
        self.assertEqual([new_rev_id], tree.get_parent_ids()[1:])
 
327
        other_tree = child_tree.bzrdir.sprout('other').open_workingtree()
 
328
        other_branch = other_tree.branch
 
329
 
 
330
        self.build_tree_contents([('other/c', 'file c\n')])
 
331
        other_tree.add('c')
 
332
        other_tree.commit(message='adding c')
 
333
        new_rev_id = other_branch.revision_history()[-1]
 
334
 
 
335
        child_tree.merge_from_branch(other_branch)
 
336
 
 
337
        self.failUnlessExists('child/c')
 
338
        self.assertEqual([new_rev_id], child_tree.get_parent_ids()[1:])
329
339
 
330
340
        # Make sure the local branch has the installed revision
331
 
        bzr('cat-revision', new_rev_id)
332
 
        
 
341
        self.assertTrue(child_tree.branch.repository.has_revision(new_rev_id))
 
342
 
333
343
        # And make sure that the base tree does not
334
 
        os.chdir('../base')
335
 
        bzr('cat-revision', new_rev_id, retcode=3)
 
344
        self.assertFalse(base_tree.branch.repository.has_revision(new_rev_id))
336
345
 
337
346
        # Commit should succeed, and cause merged revisions to
338
347
        # be pulled into base
339
 
        os.chdir('../child')
340
 
        bzr('commit', '-m', 'merge other')
341
 
 
342
 
        self.check_revno(2)
343
 
 
344
 
        os.chdir('../base')
345
 
        self.check_revno(2)
346
 
 
347
 
        bzr('cat-revision', new_rev_id)
348
 
 
349
 
    def test_pull_overwrite_fails(self):
350
 
        bzr = self.run_bzr
351
 
        self.create_branches()
352
 
 
353
 
        bzr('branch', 'child', 'other')
354
 
        
355
 
        os.chdir('other')
356
 
        open('a', 'wb').write('new contents\n')
357
 
        bzr('commit', '-m', 'changed a')
358
 
        self.check_revno(2)
359
 
        open('a', 'ab').write('and then some\n')
360
 
        bzr('commit', '-m', 'another a')
361
 
        self.check_revno(3)
362
 
        open('a', 'ab').write('and some more\n')
363
 
        bzr('commit', '-m', 'yet another a')
 
348
        os.chdir('child')
 
349
        self.run_bzr(['commit', '-m', 'merge other'])
 
350
 
 
351
        self.check_revno(2)
 
352
 
 
353
        self.check_revno(2, '../base')
 
354
 
 
355
        self.assertTrue(base_tree.branch.repository.has_revision(new_rev_id))
 
356
 
 
357
    def test_pull_overwrite(self):
 
358
        # XXX: This test should be moved to branch-implemenations/test_pull
 
359
        child_tree = self.create_branches()[1]
 
360
 
 
361
        other_tree = child_tree.bzrdir.sprout('other').open_workingtree()
 
362
 
 
363
        self.build_tree_contents([('other/a', 'new contents\n')])
 
364
        other_tree.commit(message='changed a')
 
365
        self.check_revno(2, 'other')
 
366
        self.build_tree_contents([
 
367
            ('other/a', 'new contents\nand then some\n')])
 
368
        other_tree.commit(message='another a')
 
369
        self.check_revno(3, 'other')
 
370
        self.build_tree_contents([
 
371
            ('other/a', 'new contents\nand then some\nand some more\n')])
 
372
        other_tree.commit('yet another a')
 
373
        self.check_revno(4, 'other')
 
374
 
 
375
        self.build_tree_contents([('child/a', 'also changed a\n')])
 
376
        child_tree.commit(message='child modified a')
 
377
 
 
378
        self.check_revno(2, 'child')
 
379
        self.check_revno(2, 'base')
 
380
 
 
381
        os.chdir('child')
 
382
        self.run_bzr('pull --overwrite ../other')
 
383
 
 
384
        # both the local and master should have been updated.
364
385
        self.check_revno(4)
365
 
 
366
 
        os.chdir('../child')
367
 
        open('a', 'wb').write('also changed a\n')
368
 
        bzr('commit', '-m', 'child modified a')
369
 
 
370
 
        self.check_revno(2)
371
 
        self.check_revno(2, '../base')
372
 
 
373
 
        # It might be possible that we want pull --overwrite to
374
 
        # actually succeed.
375
 
        # If we want it, just change this test to make sure that 
376
 
        # both base and child are updated properly
377
 
        bzr('pull', '--overwrite', '../other', retcode=3)
378
 
 
379
 
        # It should fail without changing the local revision
380
 
        self.check_revno(2)
381
 
        self.check_revno(2, '../base')
382
 
 
383
 
    # TODO: jam 20051230 Test that commit & pull fail when the branch we 
384
 
    #       are bound to is not available
385
 
 
386
 
 
 
386
        self.check_revno(4, '../base')