~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_commit.py

  • Committer: Patch Queue Manager
  • Date: 2011-09-08 11:01:15 UTC
  • mfrom: (6123.1.16 gpg-typo)
  • Revision ID: pqm@cupuasso-20110908110115-gbb9benwkdksvzk5
(jelmer) Fix a typo (invalid format identifier) in an error message in
 bzrlib.gpg. (Jelmer Vernooij)

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
 
        rev1 = wt.commit(message='add hello')
 
93
        wt.commit(message='add hello')
94
94
        file_id = wt.path2id('hello')
95
95
 
96
96
        file('hello', 'w').write('version 2')
97
 
        rev2 = wt.commit(message='commit 2')
 
97
        wt.commit(message='commit 2')
98
98
 
99
99
        eq = self.assertEquals
100
100
        eq(b.revno(), 2)
101
 
        rev = b.repository.get_revision(rev1)
 
101
        rh = b.revision_history()
 
102
        rev = b.repository.get_revision(rh[0])
102
103
        eq(rev.message, 'add hello')
103
104
 
104
 
        tree1 = b.repository.revision_tree(rev1)
 
105
        tree1 = b.repository.revision_tree(rh[0])
105
106
        tree1.lock_read()
106
107
        text = tree1.get_file_text(file_id)
107
108
        tree1.unlock()
108
109
        self.assertEqual('hello world', text)
109
110
 
110
 
        tree2 = b.repository.revision_tree(rev2)
 
111
        tree2 = b.repository.revision_tree(rh[1])
111
112
        tree2.lock_read()
112
113
        text = tree2.get_file_text(file_id)
113
114
        tree2.unlock()
160
161
        wt.commit(message='add hello')
161
162
 
162
163
        os.remove('hello')
163
 
        reporter = CapturingReporter()
164
 
        wt.commit('removed hello', rev_id='rev2', reporter=reporter)
165
 
        self.assertEquals(
166
 
            [('missing', u'hello'), ('deleted', u'hello')],
167
 
            reporter.calls)
 
164
        wt.commit('removed hello', rev_id='rev2')
168
165
 
169
166
        tree = b.repository.revision_tree('rev2')
170
167
        self.assertFalse(tree.has_id('hello-id'))
464
461
                              rev_id='B',
465
462
                              working_tree=wt)
466
463
            branch = Branch.open(self.get_url('.'))
467
 
            self.assertEqual(branch.last_revision(), 'A')
 
464
            self.assertEqual(branch.revision_history(), ['A'])
468
465
            self.assertFalse(branch.repository.has_revision('B'))
469
466
        finally:
470
467
            bzrlib.gpg.GPGStrategy = oldstrategy