~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_workingtree.py

 * The internal storage of history, and logical branch identity have now
   been split into Branch, and Repository. The common locking and file 
   management routines are now in bzrlib.lockablefiles. 
   (Aaron Bentley, Robert Collins, Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
        branch = Branch.initialize(u'.')
103
103
        tree = WorkingTree(branch.base)
104
104
        tree.lock_read()
105
 
        self.assertEqual(1, tree.branch._lock_count)
106
 
        self.assertEqual('r', tree.branch._lock_mode)
 
105
        self.assertEqual('r', tree.branch.peek_lock_mode())
107
106
        tree.unlock()
108
 
        self.assertEqual(None, tree.branch._lock_count)
 
107
        self.assertEqual(None, tree.branch.peek_lock_mode())
109
108
        tree.lock_write()
110
 
        self.assertEqual(1, tree.branch._lock_count)
111
 
        self.assertEqual('w', tree.branch._lock_mode)
 
109
        self.assertEqual('w', tree.branch.peek_lock_mode())
112
110
        tree.unlock()
113
 
        self.assertEqual(None, tree.branch._lock_count)
 
111
        self.assertEqual(None, tree.branch.peek_lock_mode())
114
112
 
115
113
    def get_pullable_branches(self):
116
114
        self.build_tree(['from/', 'from/file', 'to/'])
124
122
    def test_pull(self):
125
123
        br_a, br_b = self.get_pullable_branches()
126
124
        br_b.working_tree().pull(br_a)
127
 
        self.failUnless(br_b.has_revision('A'))
 
125
        self.failUnless(br_b.repository.has_revision('A'))
128
126
        self.assertEqual(['A'], br_b.revision_history())
129
127
 
130
128
    def test_pull_overwrites(self):
132
130
        br_b.working_tree().commit('foo', rev_id='B')
133
131
        self.assertEqual(['B'], br_b.revision_history())
134
132
        br_b.working_tree().pull(br_a, overwrite=True)
135
 
        self.failUnless(br_b.has_revision('A'))
136
 
        self.failUnless(br_b.has_revision('B'))
 
133
        self.failUnless(br_b.repository.has_revision('A'))
 
134
        self.failUnless(br_b.repository.has_revision('B'))
137
135
        self.assertEqual(['A'], br_b.revision_history())
138
136
 
139
137
    def test_revert(self):