~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_commit.py

  • Committer: Martin Packman
  • Date: 2011-12-08 19:00:14 UTC
  • mto: This revision was merged to the branch mainline in revision 6359.
  • Revision ID: martin.packman@canonical.com-20111208190014-mi8jm6v7jygmhb0r
Use --include-duplicates for make update-pot which already combines multiple msgid strings prettily

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
        b = wt.branch
91
91
        file('hello', 'w').write('hello world')
92
92
        wt.add('hello')
93
 
        wt.commit(message='add hello')
 
93
        rev1 = wt.commit(message='add hello')
94
94
        file_id = wt.path2id('hello')
95
95
 
96
96
        file('hello', 'w').write('version 2')
97
 
        wt.commit(message='commit 2')
 
97
        rev2 = wt.commit(message='commit 2')
98
98
 
99
99
        eq = self.assertEquals
100
100
        eq(b.revno(), 2)
101
 
        rh = b.revision_history()
102
 
        rev = b.repository.get_revision(rh[0])
 
101
        rev = b.repository.get_revision(rev1)
103
102
        eq(rev.message, 'add hello')
104
103
 
105
 
        tree1 = b.repository.revision_tree(rh[0])
 
104
        tree1 = b.repository.revision_tree(rev1)
106
105
        tree1.lock_read()
107
106
        text = tree1.get_file_text(file_id)
108
107
        tree1.unlock()
109
108
        self.assertEqual('hello world', text)
110
109
 
111
 
        tree2 = b.repository.revision_tree(rh[1])
 
110
        tree2 = b.repository.revision_tree(rev2)
112
111
        tree2.lock_read()
113
112
        text = tree2.get_file_text(file_id)
114
113
        tree2.unlock()
365
364
            rev_ids.append(rev_id)
366
365
            wt.commit(message='rev %d' % (i+1),
367
366
                     rev_id=rev_id)
368
 
        eq = self.assertEquals
369
 
        eq(b.revision_history(), rev_ids)
370
367
        for i in range(4):
371
368
            self.assertThat(rev_ids[:i+1],
372
369
                MatchesAncestry(b.repository, rev_ids[i]))
465
462
                              rev_id='B',
466
463
                              working_tree=wt)
467
464
            branch = Branch.open(self.get_url('.'))
468
 
            self.assertEqual(branch.revision_history(), ['A'])
 
465
            self.assertEqual(branch.last_revision(), 'A')
469
466
            self.assertFalse(branch.repository.has_revision('B'))
470
467
        finally:
471
468
            bzrlib.gpg.GPGStrategy = oldstrategy