79
79
self.run_bzr("init")
80
80
self.build_tree(['hello.txt'])
81
81
self.run_bzr("add hello.txt")
82
out,err = self.run_bzr('commit -m added')
82
out,err = self.run_bzr('commit -v -m added')
83
83
self.assertEqual('', out)
84
84
self.assertEqual('added hello.txt\n'
85
85
'Committed revision 1.\n',
88
def test_10_quiet_commit(self):
89
"""Add one file and examine quiet commit output"""
91
self.build_tree(['hello.txt'])
92
self.run_bzr("add hello.txt")
93
out,err = self.run_bzr('commit -q -m added')
94
self.assertEqual('', out)
95
self.assertEqual('', err)
97
def test_10_normal_commit(self):
98
"""Add one file and examine normal commit output"""
100
self.build_tree(['hello.txt'])
101
self.run_bzr("add hello.txt")
102
out,err = self.run_bzr('commit -m added')
103
self.assertEqual('', out)
104
self.assertEqual('Committed revision 1.\n',
88
107
def prepare_simple_history(self):
89
108
"""Prepare and return a working tree with one commit of one file"""
90
109
# Commit with modified file should say so
94
113
wt.commit(message='added')
116
def test_normal_commit_modified(self):
117
# Normal commit of modified file should say just the new revision
118
wt = self.prepare_simple_history()
119
self.build_tree_contents([('hello.txt', 'new contents')])
120
out, err = self.run_bzr('commit -m modified')
121
self.assertEqual('', out)
122
self.assertEqual('Committed revision 2.\n',
97
125
def test_verbose_commit_modified(self):
98
126
# Verbose commit of modified file should say so
99
127
wt = self.prepare_simple_history()
100
128
self.build_tree_contents([('hello.txt', 'new contents')])
101
out, err = self.run_bzr('commit -m modified')
129
out, err = self.run_bzr('commit -v -m modified')
102
130
self.assertEqual('', out)
103
131
self.assertEqual('modified hello.txt\n'
104
132
'Committed revision 2.\n',
135
def test_normal_commit_renamed(self):
136
# Verbose commit of renamed file should say just the new revision
137
wt = self.prepare_simple_history()
138
wt.rename_one('hello.txt', 'gutentag.txt')
139
out, err = self.run_bzr('commit -m renamed')
140
self.assertEqual('', out)
141
self.assertEqual('Committed revision 2.\n',
107
144
def test_verbose_commit_renamed(self):
108
145
# Verbose commit of renamed file should say so
109
146
wt = self.prepare_simple_history()
110
147
wt.rename_one('hello.txt', 'gutentag.txt')
111
out, err = self.run_bzr('commit -m renamed')
148
out, err = self.run_bzr('commit -v -m renamed')
112
149
self.assertEqual('', out)
113
150
self.assertEqual('renamed hello.txt => gutentag.txt\n'
114
151
'Committed revision 2.\n',
154
def test_normal_commit_moved(self):
155
# Verbose commit of file moved to new directory should say just
157
wt = self.prepare_simple_history()
160
wt.rename_one('hello.txt', 'subdir/hello.txt')
161
out, err = self.run_bzr('commit -m renamed')
162
self.assertEqual('', out)
163
self.assertEqualDiff('Committed revision 2.\n',
117
166
def test_verbose_commit_moved(self):
118
167
# Verbose commit of file moved to new directory should say so
119
168
wt = self.prepare_simple_history()
120
169
os.mkdir('subdir')
121
170
wt.add(['subdir'])
122
171
wt.rename_one('hello.txt', 'subdir/hello.txt')
123
out, err = self.run_bzr('commit -m renamed')
172
out, err = self.run_bzr('commit -v -m renamed')
124
173
self.assertEqual('', out)
125
174
self.assertEqualDiff('added subdir\n'
126
175
'renamed hello.txt => subdir/hello.txt\n'
127
176
'Committed revision 2.\n',
179
def test_normal_commit_with_unknown(self):
180
"""Unknown files should not be listed by default in normal output"""
181
# Is that really the best policy?
182
wt = BzrDir.create_standalone_workingtree('.')
183
self.build_tree(['hello.txt', 'extra.txt'])
184
wt.add(['hello.txt'])
185
out,err = self.run_bzr('commit -m added')
186
self.assertEqual('', out)
187
self.assertEqual('Committed revision 1.\n',
130
190
def test_verbose_commit_with_unknown(self):
131
191
"""Unknown files should not be listed by default in verbose output"""
132
192
# Is that really the best policy?
133
193
wt = BzrDir.create_standalone_workingtree('.')
134
194
self.build_tree(['hello.txt', 'extra.txt'])
135
195
wt.add(['hello.txt'])
136
out,err = self.run_bzr('commit -m added')
196
out,err = self.run_bzr('commit -v -m added')
137
197
self.assertEqual('', out)
138
198
self.assertEqual('added hello.txt\n'
139
199
'Committed revision 1.\n',
202
def test_normal_commit_with_unchanged(self):
203
"""Unchanged files should not be listed by default in normal output"""
205
self.build_tree(['hello.txt', 'unchanged.txt'])
206
self.run_bzr('add unchanged.txt')
207
self.run_bzr('commit -m unchanged unchanged.txt')
208
self.run_bzr("add hello.txt")
209
out,err = self.run_bzr('commit -m added')
210
self.assertEqual('', out)
211
self.assertEqual('Committed revision 2.\n',
142
214
def test_verbose_commit_with_unchanged(self):
143
215
"""Unchanged files should not be listed by default in verbose output"""
144
216
self.run_bzr("init")