/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-07-03 01:51:19 UTC
  • mfrom: (6973.14.14 python3-m)
  • Revision ID: breezy.the.bot@gmail.com-20180703015119-8wqoc0wqw45irl6r
Fix more tests on Python3.

Merged from https://code.launchpad.net/~jelmer/brz/python3-m/+merge/348800

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
 
49
49
        os.chdir('tree')
50
50
        out, err = self.run_bzr('uncommit --dry-run --force')
51
 
        self.assertContainsRe(out, 'Dry-run')
52
 
        self.assertNotContainsRe(out, 'initial commit')
53
 
        self.assertContainsRe(out, 'second commit')
 
51
        self.assertContainsRe(out, b'Dry-run')
 
52
        self.assertNotContainsRe(out, b'initial commit')
 
53
        self.assertContainsRe(out, b'second commit')
54
54
 
55
55
        # Nothing has changed
56
 
        self.assertEqual(['a2'], wt.get_parent_ids())
 
56
        self.assertEqual([b'a2'], wt.get_parent_ids())
57
57
 
58
58
        # Uncommit, don't prompt
59
59
        out, err = self.run_bzr('uncommit --force')
60
 
        self.assertNotContainsRe(out, 'initial commit')
61
 
        self.assertContainsRe(out, 'second commit')
 
60
        self.assertNotContainsRe(out, b'initial commit')
 
61
        self.assertContainsRe(out, b'second commit')
62
62
 
63
63
        # This should look like we are back in revno 1
64
 
        self.assertEqual(['a1'], wt.get_parent_ids())
 
64
        self.assertEqual([b'a1'], wt.get_parent_ids())
65
65
        out, err = self.run_bzr('status')
66
 
        self.assertEqual(out, 'modified:\n  a\n')
 
66
        self.assertEqual(out, b'modified:\n  a\n')
67
67
 
68
68
    def test_uncommit_interactive(self):
69
69
        """Uncommit seeks confirmation, and doesn't proceed without it."""
70
70
        wt = self.create_simple_tree()
71
71
        os.chdir('tree')
72
 
        run_script(self, """    
 
72
        run_script(self, """
73
73
        $ brz uncommit
74
74
        ...
75
75
        The above revision(s) will be removed.
77
77
        <n
78
78
        Canceled
79
79
        """)
80
 
        self.assertEqual(['a2'], wt.get_parent_ids())
 
80
        self.assertEqual([b'a2'], wt.get_parent_ids())
81
81
 
82
82
    def test_uncommit_no_history(self):
83
83
        wt = self.make_branch_and_tree('tree')
147
147
        os.chdir('tree')
148
148
        out, err = self.run_bzr('uncommit -r1 --force')
149
149
 
150
 
        self.assertNotContainsRe(out, 'initial commit')
151
 
        self.assertContainsRe(out, 'second commit')
 
150
        self.assertNotContainsRe(out, b'initial commit')
 
151
        self.assertContainsRe(out, b'second commit')
152
152
        self.assertEqual([b'a1'], wt.get_parent_ids())
153
153
        self.assertEqual(b'a1', wt.branch.last_revision())
154
154