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

  • Committer: John Arbash Meinel
  • Date: 2005-11-13 01:50:16 UTC
  • mto: (1587.1.6 bound-branches)
  • mto: This revision was merged to the branch mainline in revision 1590.
  • Revision ID: john@arbash-meinel.com-20051113015016-6ca45e7115ab63f6
Cleaned up tests and code, all bound branch tests succeed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
class TestBoundBranches(TestCaseInTempDir):
29
29
    
30
30
    def create_branches(self):
 
31
        bzr = self.run_bzr
31
32
        self.build_tree(['base/', 'base/a', 'base/b'])
32
33
 
33
34
        os.chdir('base')
34
 
        self.run_bzr('init')
35
 
        self.run_bzr('add')
36
 
        self.run_bzr('commit', '-m', 'init')
 
35
        bzr('init')
 
36
        bzr('add')
 
37
        bzr('commit', '-m', 'init')
37
38
 
38
39
        os.chdir('..')
39
40
 
50
51
        if loc is not None:
51
52
            cwd = os.getcwd()
52
53
            os.chdir(loc)
53
 
        self.assertEquals(self.capture('bzr revno').strip(), str(val))
 
54
        self.assertEquals(self.capture('revno').strip(), str(val))
54
55
        if loc is not None:
55
56
            os.chdir(cwd)
56
57
 
113
114
        self.check_revno(3)
114
115
 
115
116
    def test_double_binding(self):
116
 
        # The behavior of this test is under debate
117
117
        bzr = self.run_bzr
118
118
        self.create_branches()
119
119
 
120
120
        bzr('branch', 'child', 'child2')
121
121
        os.chdir('child2')
122
122
 
123
 
        bzr('bind', '../child', retcode=1)
 
123
        # Double binding succeeds, but committing to child2 should fail
 
124
        bzr('bind', '../child')
124
125
 
125
 
        # The binding should fail, because child is bound
126
 
        self.failIf(os.path.lexists('.bzr/bound'))
 
126
        bzr('commit', '-m', 'child2', '--unchanged', retcode=1)
127
127
 
128
128
    def test_unbinding(self):
129
129
        bzr = self.run_bzr
149
149
        # It is not possible to commit to a branch
150
150
        # which is bound to a branch which is bound
151
151
        bzr = self.run_bzr
 
152
        self.create_branches()
152
153
        bzr('branch', 'base', 'newbase')
153
154
        os.chdir('base')
154
155
        
214
215
        bzr('bind', '../base')
215
216
 
216
217
        # After binding, the revision history should be identical
217
 
        child_rh = self.capture('bzr revision-history')
 
218
        child_rh = self.capture('revision-history')
218
219
        os.chdir('../base')
219
 
        base_rh = self.capture('bzr revision-history')
 
220
        base_rh = self.capture('revision-history')
220
221
        self.assertEquals(child_rh, base_rh)
221
222
 
222
223
    def test_bind_parent_ahead(self):