~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2011-09-22 14:12:18 UTC
  • mfrom: (6155.3.1 jam)
  • Revision ID: pqm@pqm.ubuntu.com-20110922141218-86s4uu6nqvourw4f
(jameinel) Cleanup comments bzrlib/smart/__init__.py (John A Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
        self.assertEqual('', err)
42
42
        self.assertEqual('  1: Foo\n', out)
43
43
 
 
44
    def test_shelve_list_via_directory(self):
 
45
        tree = self.make_branch_and_tree('tree')
 
46
        creator = self.make_creator(tree)
 
47
        shelf_id = tree.get_shelf_manager().shelve_changes(creator, 'Foo')
 
48
        out, err = self.run_bzr('shelve -d tree --list', retcode=1)
 
49
        self.assertEqual('', err)
 
50
        self.assertEqual('  1: Foo\n', out)
 
51
 
44
52
    def test_shelve_no_message(self):
45
53
        tree = self.make_branch_and_tree('.')
46
54
        creator = self.make_creator(tree)
64
72
        self.build_tree(['file'])
65
73
        tree.add('file')
66
74
        self.run_bzr('shelve --all --destroy')
67
 
        self.failIfExists('file')
 
75
        self.assertPathDoesNotExist('file')
68
76
        self.assertIs(None, tree.get_shelf_manager().last_shelf())
69
77
 
70
78
    def test_unshelve_keep(self):
77
85
        sr = ScriptRunner()
78
86
        sr.run_script(self, '''
79
87
$ bzr add file
 
88
adding file
80
89
$ bzr shelve --all -m Foo
 
90
2>Selected changes:
 
91
2>-D  file
 
92
2>Changes shelved with id "1".
81
93
$ bzr shelve --list
82
94
  1: Foo
83
95
$ bzr unshelve --keep
 
96
2>Using changes with id "1".
 
97
2>Message: Foo
 
98
2>+N  file
 
99
2>All changes applied successfully.
84
100
$ bzr shelve --list
85
101
  1: Foo
86
102
$ cat file
117
133
        os.chdir('tree/dir')
118
134
        self.run_bzr('shelve --all ../file')
119
135
 
 
136
    def test_shelve_via_directory(self):
 
137
        tree = self.make_branch_and_tree('tree')
 
138
        self.build_tree(['tree/file', 'tree/dir/'])
 
139
        tree.add('file')
 
140
        self.run_bzr('shelve -d tree/dir --all ../file')
 
141
 
120
142
 
121
143
class TestShelveUnshelve(TestCaseWithTransport):
122
144