~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_uncommit.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-08-16 00:09:54 UTC
  • mfrom: (3629.1.4 uncommit_ids)
  • Revision ID: pqm@pqm.ubuntu.com-20080816000954-t0401ff8s3ydnkr6
(jam) bzr uncommit now gives the revision id to restore the branch to
        the old tip.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
        wt.add(['a', 'b', 'c'])
33
33
        wt.commit('initial commit', rev_id='a1')
34
34
 
35
 
        open('tree/a', 'wb').write('new contents of a\n')
 
35
        self.build_tree_contents([('tree/a', 'new contents of a\n')])
36
36
        wt.commit('second commit', rev_id='a2')
37
37
 
38
38
        return wt
213
213
 
214
214
        self.assertEqual(['a2', 'b3', 'c3'], wt.get_parent_ids())
215
215
 
 
216
    def test_uncommit_shows_log_with_revision_id(self):
 
217
        wt = self.create_simple_tree()
 
218
 
 
219
        out, err = self.run_bzr('uncommit --force', working_dir='tree')
 
220
        self.assertContainsRe(out, r'second commit')
 
221
        self.assertContainsRe(err, r'You can restore the old tip by running')
 
222
        self.assertContainsRe(err, r'bzr pull . -r revid:a2')
 
223
 
216
224
    def test_uncommit_octopus_merge(self):
217
225
        # Check that uncommit keeps the pending merges in the same order
218
226
        # though it will also filter out ones in the ancestry
223
231
 
224
232
        tree2.commit('unchanged', rev_id='b3')
225
233
        tree3.commit('unchanged', rev_id='c3')
226
 
        
 
234
 
227
235
        wt.merge_from_branch(tree2.branch)
228
236
        wt.merge_from_branch(tree3.branch)
229
237
        wt.commit('merge b3, c3', rev_id='a3')