~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin Pool
  • Date: 2010-02-23 07:43:11 UTC
  • mfrom: (4797.2.20 2.1)
  • mto: This revision was merged to the branch mainline in revision 5055.
  • Revision ID: mbp@sourcefrog.net-20100223074311-gnj55xdhrgz9l94e
Merge 2.1 back to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2008 Canonical Ltd
 
1
# Copyright (C) 2005-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
22
22
from bzrlib.bzrdir import BzrDirMetaFormat1
23
23
from bzrlib.errors import BzrError, BoundBranchOutOfDate
24
24
from bzrlib.tests import TestCaseWithTransport
 
25
from bzrlib.tests.script import ScriptRunner
25
26
 
26
27
 
27
28
class TestUncommit(TestCaseWithTransport):
215
216
 
216
217
    def test_uncommit_shows_log_with_revision_id(self):
217
218
        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')
 
219
        
 
220
        script = ScriptRunner()
 
221
        script.run_script(self, """
 
222
$ cd tree
 
223
$ bzr uncommit --force 
 
224
    2 ...
 
225
      second commit
 
226
...
 
227
The above revision(s) will be removed.
 
228
You can restore the old tip by running:
 
229
  bzr pull . -r revid:a2
 
230
""")
223
231
 
224
232
    def test_uncommit_octopus_merge(self):
225
233
        # Check that uncommit keeps the pending merges in the same order