~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_annotate.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-11-22 21:20:30 UTC
  • mfrom: (3010.1.17 pack.read-locks)
  • Revision ID: pqm@pqm.ubuntu.com-20071122212030-ehfexlt3qzptnsdv
(robertc) Various lock and write-group correctness issues which show
        up when packs are the default format. (Robert Collins, #154204).

Show diffs side-by-side

added added

removed removed

Lines of Context:
149
149
        tree1.commit('merge 2', rev_id='rev-3',
150
150
                     committer='sal@foo.com',
151
151
                     timestamp=1166046003.00, timezone=0)
 
152
        tree1.lock_read()
 
153
        self.addCleanup(tree1.unlock)
152
154
        return tree1, tree2
153
155
 
154
156
    def create_deeply_merged_trees(self):
175
177
        rev-6
176
178
        """
177
179
        tree1, tree2 = self.create_merged_trees()
 
180
        tree1.unlock()
178
181
 
179
182
        tree3 = tree2.bzrdir.clone('tree3').open_workingtree()
180
183
 
202
205
                     timestamp=1166046005.00, timezone=0)
203
206
        self.assertEqual(0, tree1.merge_from_branch(tree4.branch))
204
207
        tree1.commit('merge five and six', rev_id='rev-6')
 
208
        tree1.lock_read()
205
209
        return tree1
206
210
 
207
211
    def test_annotate_shows_dotted_revnos(self):
325
329
                     committer=u'p\xe9rez',
326
330
                     timestamp=1166046000.00, timezone=0)
327
331
 
 
332
        tree1.lock_read()
 
333
        self.addCleanup(tree1.unlock)
328
334
        # this passes if no exception is raised
329
335
        to_file = StringIO()
330
336
        annotate.annotate_file(tree1.branch, 'rev-1', 'a-id', to_file=to_file)
362
368
                     author='Author <author@example.com>',
363
369
                     timestamp=1166046000.00, timezone=0)
364
370
 
 
371
        tree1.lock_read()
 
372
        self.addCleanup(tree1.unlock)
365
373
        to_file = StringIO()
366
374
        annotate.annotate_file(tree1.branch, 'rev-1', 'a-id', to_file=to_file)
367
375
        self.assertEqual('1   committ | hello\n', to_file.getvalue())