/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/workingtree_implementations/test_commit.py

  • Committer: Martin Pool
  • Date: 2006-06-20 03:30:14 UTC
  • mfrom: (1793 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1797.
  • Revision ID: mbp@sourcefrog.net-20060620033014-e19ce470e2ce6561
[merge] bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
 
90
90
    def test_commit_sets_last_revision(self):
91
91
        tree = self.make_branch_and_tree('tree')
92
 
        tree.commit('foo', rev_id='foo', allow_pointless=True)
 
92
        committed_id = tree.commit('foo', rev_id='foo', allow_pointless=True)
93
93
        self.assertEqual('foo', tree.last_revision())
 
94
        # the commit should have returned the same id we asked for.
 
95
        self.assertEqual('foo', committed_id)
 
96
 
 
97
    def test_commit_returns_revision_id(self):
 
98
        tree = self.make_branch_and_tree('.')
 
99
        committed_id = tree.commit('message', allow_pointless=True)
 
100
        self.assertTrue(tree.branch.repository.has_revision(committed_id))
 
101
        self.assertNotEqual(None, committed_id)
94
102
 
95
103
    def test_commit_local_unbound(self):
96
104
        # using the library api to do a local commit on unbound branches is 
137
145
        self.assertEqual(None, master.last_revision())
138
146
        
139
147
 
140
 
class TestCommmitProgress(TestCaseWithWorkingTree):
 
148
class TestCommitProgress(TestCaseWithWorkingTree):
141
149
    
142
150
    def restoreDefaults(self):
143
151
        ui.ui_factory = self.old_ui_factory
167
175
        # into the factory for this test - just make the test ui factory
168
176
        # pun as a reporter. Then we can check the ordering is right.
169
177
        tree.commit('second post', specific_files=['b'])
170
 
        # 11 steps: 1 for rev, 1 for inventory, 1 for finishing. 2 for root
171
 
        # and 3 for basis files, and 3 for new inventory files.
 
178
        # 9 steps: 1 for rev, 2 for inventory, 1 for finishing. 2 for root
 
179
        # and 6 for inventory files.
 
180
        # 2 steps don't trigger an update, as 'a' and 'c' are not 
 
181
        # committed.
172
182
        self.assertEqual(
173
 
            [("update", 0, 10),
174
 
             ("update", 1, 10),
175
 
             ("update", 2, 10),
176
 
             ("update", 3, 10),
177
 
             ("update", 4, 10),
178
 
             ("update", 5, 10),
179
 
             ("update", 6, 10),
180
 
             ("update", 7, 10),
181
 
             ("update", 8, 10),
182
 
             ("update", 9, 10),
183
 
             ("update", 10, 10)],
 
183
            [("update", 0, 9),
 
184
             ("update", 1, 9),
 
185
             ("update", 2, 9),
 
186
             ("update", 3, 9),
 
187
             ("update", 4, 9),
 
188
             ("update", 5, 9),
 
189
             ("update", 6, 9),
 
190
             ("update", 7, 9)],
184
191
            factory._calls
185
192
           )