~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2011-04-09 19:25:42 UTC
  • mto: (5777.5.1 inventoryworkingtree)
  • mto: This revision was merged to the branch mainline in revision 5781.
  • Revision ID: jelmer@samba.org-20110409192542-8bbedp36s7nj928e
Split InventoryTree out of Tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import os
20
20
 
21
 
from bzrlib import uncommit
 
21
from bzrlib import uncommit, workingtree
22
22
from bzrlib.bzrdir import BzrDirMetaFormat1
23
 
from bzrlib.errors import BoundBranchOutOfDate
 
23
from bzrlib.errors import BzrError, BoundBranchOutOfDate
24
24
from bzrlib.tests import TestCaseWithTransport
25
25
from bzrlib.tests.script import (
26
26
    run_script,
72
72
        $ bzr uncommit
73
73
        ...
74
74
        The above revision(s) will be removed.
75
 
        2>Uncommit these revisions? ([y]es, [n]o): no
 
75
        2>Uncommit these revisions? [y/n]: 
76
76
        <n
77
77
        Canceled
78
78
        """)
119
119
        t_a.commit('commit 3')
120
120
        b = t_a.branch.create_checkout('b').branch
121
121
        uncommit.uncommit(b)
122
 
        self.assertEqual(b.last_revision_info()[0], 2)
123
 
        self.assertEqual(t_a.branch.last_revision_info()[0], 2)
 
122
        self.assertEqual(len(b.revision_history()), 2)
 
123
        self.assertEqual(len(t_a.branch.revision_history()), 2)
124
124
        # update A's tree to not have the uncommitted revision referenced.
125
125
        t_a.update()
126
126
        t_a.commit('commit 3b')
280
280
        tree.commit(u'\u1234 message')
281
281
        out, err = self.run_bzr('uncommit --force tree', encoding='ascii')
282
282
        self.assertContainsRe(out, r'\? message')
283
 
 
284
 
    def test_uncommit_removes_tags(self):
285
 
        tree = self.make_branch_and_tree('tree')
286
 
        revid = tree.commit('message')
287
 
        tree.branch.tags.set_tag("atag", revid)
288
 
        out, err = self.run_bzr('uncommit --force tree')
289
 
        self.assertEquals({}, tree.branch.tags.get_tag_dict())
290
 
 
291
 
    def test_uncommit_keep_tags(self):
292
 
        tree = self.make_branch_and_tree('tree')
293
 
        revid = tree.commit('message')
294
 
        tree.branch.tags.set_tag("atag", revid)
295
 
        out, err = self.run_bzr('uncommit --keep-tags --force tree')
296
 
        self.assertEquals({"atag": revid}, tree.branch.tags.get_tag_dict())