/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/tests/test_shelf_ui.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
 
18
 
from cStringIO import StringIO
19
18
import os
20
19
import sys
21
20
from textwrap import dedent
22
21
 
23
 
from bzrlib import (
 
22
from .. import (
24
23
    errors,
25
24
    shelf_ui,
26
25
    revision,
27
26
    tests,
28
 
)
29
 
from bzrlib.tests import script
30
 
from bzrlib.tests import (
 
27
    )
 
28
from ..sixish import (
 
29
    BytesIO,
 
30
    )
 
31
from . import script
 
32
from . import (
31
33
    features,
32
34
    )
33
35
 
42
44
                                  auto, auto_apply, file_list, message,
43
45
                                  destroy, reporter=reporter)
44
46
        self.expected = []
45
 
        self.diff_writer = StringIO()
 
47
        self.diff_writer = BytesIO()
46
48
 
47
49
    def expect(self, message, response):
48
50
        self.expected.append((message, response))
512
514
 
513
515
    def test_unshelve_args_preview(self):
514
516
        tree = self.create_tree_with_shelf()
515
 
        write_diff_to = StringIO()
 
517
        write_diff_to = BytesIO()
516
518
        unshelver = shelf_ui.Unshelver.from_args(
517
519
            directory='tree', action='preview', write_diff_to=write_diff_to)
518
520
        try:
578
580
        self.create_tree_with_shelf()
579
581
        self.run_script("""
580
582
$ cd tree
581
 
$ bzr unshelve --keep
 
583
$ brz unshelve --keep
582
584
2>Using changes with id "1".
583
585
2> M  foo
584
586
2>All changes applied successfully.
588
590
        self.create_tree_with_shelf()
589
591
        self.run_script("""
590
592
$ cd tree
591
 
$ bzr unshelve --delete-only
 
593
$ brz unshelve --delete-only
592
594
2>Deleted changes with id "1".
593
595
""")
594
596
 
596
598
        self.create_tree_with_shelf()
597
599
        self.run_script("""
598
600
$ cd tree
599
 
$ bzr unshelve --apply
 
601
$ brz unshelve --apply
600
602
2>Using changes with id "1".
601
603
2> M  foo
602
604
2>All changes applied successfully.
607
609
        self.create_tree_with_shelf()
608
610
        self.run_script("""
609
611
$ cd tree
610
 
$ bzr unshelve --dry-run
 
612
$ brz unshelve --dry-run
611
613
2>Using changes with id "1".
612
614
2> M  foo
613
615
""")