~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: 2011-08-17 18:13:57 UTC
  • mfrom: (5268.7.29 transport-segments)
  • Revision ID: pqm@pqm.ubuntu.com-20110817181357-y5q5eth1hk8bl3om
(jelmer) Allow specifying the colocated branch to use in the branch URL,
 and retrieving the branch name using ControlDir._get_selected_branch.
 (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2008, 2010 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
from bzrlib.tests.script import (
 
26
    run_script,
 
27
    ScriptRunner,
 
28
    )
26
29
 
27
30
 
28
31
class TestUncommit(TestCaseWithTransport):
61
64
        out, err = self.run_bzr('status')
62
65
        self.assertEquals(out, 'modified:\n  a\n')
63
66
 
 
67
    def test_uncommit_interactive(self):
 
68
        """Uncommit seeks confirmation, and doesn't proceed without it."""
 
69
        wt = self.create_simple_tree()
 
70
        os.chdir('tree')
 
71
        run_script(self, """    
 
72
        $ bzr uncommit
 
73
        ...
 
74
        The above revision(s) will be removed.
 
75
        2>Uncommit these revisions? [y/n]: 
 
76
        <n
 
77
        Canceled
 
78
        """)
 
79
        self.assertEqual(['a2'], wt.get_parent_ids())
 
80
 
64
81
    def test_uncommit_no_history(self):
65
82
        wt = self.make_branch_and_tree('tree')
66
83
        out, err = self.run_bzr('uncommit --force', retcode=1)
216
233
 
217
234
    def test_uncommit_shows_log_with_revision_id(self):
218
235
        wt = self.create_simple_tree()
219
 
        
 
236
 
220
237
        script = ScriptRunner()
221
238
        script.run_script(self, """
222
239
$ cd tree