/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
2052.3.2 by John Arbash Meinel
Change Copyright .. by Canonical to Copyright ... Canonical
1
# Copyright (C) 2005, 2006 Canonical Ltd
1887.1.1 by Adeodato Simó
Do not separate paragraphs in the copyright statement with blank lines,
2
#
1508.1.22 by Robert Collins
implement out of date working tree checks in commit.
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
1887.1.1 by Adeodato Simó
Do not separate paragraphs in the copyright statement with blank lines,
7
#
1508.1.22 by Robert Collins
implement out of date working tree checks in commit.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
1887.1.1 by Adeodato Simó
Do not separate paragraphs in the copyright statement with blank lines,
12
#
1508.1.22 by Robert Collins
implement out of date working tree checks in commit.
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
17
18
"""Tests for the commit CLI of bzr."""
19
20
import os
21
1551.9.5 by Aaron Bentley
Revert broken save-commit-message code
22
from bzrlib import (
23
    ignores,
24
    )
1669.2.1 by Martin Pool
verbose commit now specifically identifies modified/renamed/reparented files
25
from bzrlib.bzrdir import BzrDir
1508.1.22 by Robert Collins
implement out of date working tree checks in commit.
26
from bzrlib.tests.blackbox import ExternalBase
27
28
29
class TestCommit(ExternalBase):
30
1616.1.3 by Martin Pool
Clean up cut&pasted test for verbose commit
31
    def test_05_empty_commit(self):
32
        """Commit of tree with no versioned files should fail"""
33
        # If forced, it should succeed, but this is not tested here.
2664.13.2 by Daniel Watkins
tests.blackbox.test_commit now uses internals where appropriate.
34
        self.make_branch_and_tree('.')
1508.1.22 by Robert Collins
implement out of date working tree checks in commit.
35
        self.build_tree(['hello.txt'])
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
36
        out,err = self.run_bzr('commit -m empty', retcode=3)
2089.1.1 by wang
If a commit fails, the commit message is stored in a file at the root of
37
        self.assertEqual('', out)
2747.6.7 by Daniel Watkins
Modify tests to reflect change in commit output.
38
        self.assertContainsRe(err, 'bzr: ERROR: no changes to commit\.'
2089.1.1 by wang
If a commit fails, the commit message is stored in a file at the root of
39
                                  ' use --unchanged to commit anyhow\n')
40
41
    def test_commit_success(self):
42
        """Successful commit should not leave behind a bzr-commit-* file"""
2664.13.2 by Daniel Watkins
tests.blackbox.test_commit now uses internals where appropriate.
43
        self.make_branch_and_tree('.')
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
44
        self.run_bzr('commit --unchanged -m message')
2552.2.2 by Vincent Ladeuil
Enforce run_bzr(string) where possible.
45
        self.assertEqual('', self.run_bzr('unknowns')[0])
2089.1.1 by wang
If a commit fails, the commit message is stored in a file at the root of
46
47
        # same for unicode messages
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
48
        self.run_bzr(["commit", "--unchanged", "-m", u'foo\xb5'])
2552.2.2 by Vincent Ladeuil
Enforce run_bzr(string) where possible.
49
        self.assertEqual('', self.run_bzr('unknowns')[0])
1616.1.3 by Martin Pool
Clean up cut&pasted test for verbose commit
50
1704.2.11 by Martin Pool
Handle 'bzr commit DIR' when dir contains pending merges.
51
    def test_commit_with_path(self):
52
        """Commit tree with path of root specified"""
2664.13.2 by Daniel Watkins
tests.blackbox.test_commit now uses internals where appropriate.
53
        a_tree = self.make_branch_and_tree('a')
1704.2.11 by Martin Pool
Handle 'bzr commit DIR' when dir contains pending merges.
54
        self.build_tree(['a/a_file'])
2664.13.2 by Daniel Watkins
tests.blackbox.test_commit now uses internals where appropriate.
55
        a_tree.add('a_file')
2552.2.5 by Vincent Ladeuil
Revert the intrusive run_bzr('commit') rewritings.
56
        self.run_bzr(['commit', '-m', 'first commit', 'a'])
1704.2.11 by Martin Pool
Handle 'bzr commit DIR' when dir contains pending merges.
57
2664.13.2 by Daniel Watkins
tests.blackbox.test_commit now uses internals where appropriate.
58
        b_tree = a_tree.bzrdir.sprout('b').open_workingtree()
1704.2.11 by Martin Pool
Handle 'bzr commit DIR' when dir contains pending merges.
59
        self.build_tree_contents([('b/a_file', 'changes in b')])
2552.2.5 by Vincent Ladeuil
Revert the intrusive run_bzr('commit') rewritings.
60
        self.run_bzr(['commit', '-m', 'first commit in b', 'b'])
1704.2.11 by Martin Pool
Handle 'bzr commit DIR' when dir contains pending merges.
61
62
        self.build_tree_contents([('a/a_file', 'new contents')])
2552.2.5 by Vincent Ladeuil
Revert the intrusive run_bzr('commit') rewritings.
63
        self.run_bzr(['commit', '-m', 'change in a', 'a'])
1704.2.11 by Martin Pool
Handle 'bzr commit DIR' when dir contains pending merges.
64
2664.13.2 by Daniel Watkins
tests.blackbox.test_commit now uses internals where appropriate.
65
        b_tree.merge_from_branch(a_tree.branch)
2738.4.2 by Daniel Watkins
Now test for conflicts where appropriate.
66
        self.assertEqual(len(b_tree.conflicts()), 1)
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
67
        self.run_bzr('resolved b/a_file')
2552.2.5 by Vincent Ladeuil
Revert the intrusive run_bzr('commit') rewritings.
68
        self.run_bzr(['commit', '-m', 'merge into b', 'b'])
1704.2.11 by Martin Pool
Handle 'bzr commit DIR' when dir contains pending merges.
69
70
1616.1.3 by Martin Pool
Clean up cut&pasted test for verbose commit
71
    def test_10_verbose_commit(self):
72
        """Add one file and examine verbose commit output"""
2664.13.2 by Daniel Watkins
tests.blackbox.test_commit now uses internals where appropriate.
73
        tree = self.make_branch_and_tree('.')
1616.1.3 by Martin Pool
Clean up cut&pasted test for verbose commit
74
        self.build_tree(['hello.txt'])
2664.13.2 by Daniel Watkins
tests.blackbox.test_commit now uses internals where appropriate.
75
        tree.add("hello.txt")
2789.2.1 by Ian Clatworthy
Make commit less verbose by default
76
        out,err = self.run_bzr('commit -v -m added')
1616.1.3 by Martin Pool
Clean up cut&pasted test for verbose commit
77
        self.assertEqual('', out)
2789.2.7 by Ian Clatworthy
merge bzr.dev including updates to test_commit
78
        self.assertContainsRe(err, '^Committing revision 1 to ".*"\.\n'
79
            'added hello.txt\n'
80
            'Committed revision 1 \(1 change made\).\n$',)
1616.1.3 by Martin Pool
Clean up cut&pasted test for verbose commit
81
2789.2.1 by Ian Clatworthy
Make commit less verbose by default
82
    def test_10_quiet_commit(self):
83
        """Add one file and examine quiet commit output"""
2789.2.5 by Ian Clatworthy
Upgrade commit tests to reflect new reporting formats
84
        tree = self.make_branch_and_tree('.')
2789.2.1 by Ian Clatworthy
Make commit less verbose by default
85
        self.build_tree(['hello.txt'])
2789.2.5 by Ian Clatworthy
Upgrade commit tests to reflect new reporting formats
86
        tree.add("hello.txt")
2789.2.1 by Ian Clatworthy
Make commit less verbose by default
87
        out,err = self.run_bzr('commit -q -m added')
88
        self.assertEqual('', out)
89
        self.assertEqual('', err)
90
91
    def test_10_normal_commit(self):
92
        """Add one file and examine normal commit output"""
2789.2.5 by Ian Clatworthy
Upgrade commit tests to reflect new reporting formats
93
        tree = self.make_branch_and_tree('.')
2789.2.1 by Ian Clatworthy
Make commit less verbose by default
94
        self.build_tree(['hello.txt'])
2789.2.5 by Ian Clatworthy
Upgrade commit tests to reflect new reporting formats
95
        tree.add("hello.txt")
2789.2.1 by Ian Clatworthy
Make commit less verbose by default
96
        out,err = self.run_bzr('commit -m added')
97
        self.assertEqual('', out)
2747.6.7 by Daniel Watkins
Modify tests to reflect change in commit output.
98
        self.assertContainsRe(err, '^Committing revision 1 to ".*"\.\n'
2789.2.7 by Ian Clatworthy
merge bzr.dev including updates to test_commit
99
                              'Committed revision 1 \(1 change made\).\n$',)
2789.2.1 by Ian Clatworthy
Make commit less verbose by default
100
1669.2.1 by Martin Pool
verbose commit now specifically identifies modified/renamed/reparented files
101
    def prepare_simple_history(self):
102
        """Prepare and return a working tree with one commit of one file"""
103
        # Commit with modified file should say so
104
        wt = BzrDir.create_standalone_workingtree('.')
105
        self.build_tree(['hello.txt', 'extra.txt'])
106
        wt.add(['hello.txt'])
107
        wt.commit(message='added')
108
        return wt
109
2789.2.1 by Ian Clatworthy
Make commit less verbose by default
110
    def test_normal_commit_modified(self):
111
        # Normal commit of modified file should say just the new revision
112
        wt = self.prepare_simple_history()
113
        self.build_tree_contents([('hello.txt', 'new contents')])
114
        out, err = self.run_bzr('commit -m modified')
115
        self.assertEqual('', out)
2789.2.7 by Ian Clatworthy
merge bzr.dev including updates to test_commit
116
        self.assertContainsRe(err, '^Committing revision 2 to ".*"\.\n'
117
            'modified hello.txt\n'
118
            'Committed revision 2.\n$')
2789.2.1 by Ian Clatworthy
Make commit less verbose by default
119
1669.2.1 by Martin Pool
verbose commit now specifically identifies modified/renamed/reparented files
120
    def test_verbose_commit_modified(self):
121
        # Verbose commit of modified file should say so
122
        wt = self.prepare_simple_history()
123
        self.build_tree_contents([('hello.txt', 'new contents')])
2789.2.1 by Ian Clatworthy
Make commit less verbose by default
124
        out, err = self.run_bzr('commit -v -m modified')
1669.2.1 by Martin Pool
verbose commit now specifically identifies modified/renamed/reparented files
125
        self.assertEqual('', out)
2747.6.7 by Daniel Watkins
Modify tests to reflect change in commit output.
126
        self.assertContainsRe(err, '^Committing revision 2 to ".*"\.\n'
127
                              'modified hello\.txt\n'
2789.2.7 by Ian Clatworthy
merge bzr.dev including updates to test_commit
128
                              'Committed revision 2 \(1 change made\)\.\n$')
2789.2.1 by Ian Clatworthy
Make commit less verbose by default
129
1669.2.1 by Martin Pool
verbose commit now specifically identifies modified/renamed/reparented files
130
    def test_verbose_commit_renamed(self):
131
        # Verbose commit of renamed file should say so
132
        wt = self.prepare_simple_history()
133
        wt.rename_one('hello.txt', 'gutentag.txt')
2789.2.1 by Ian Clatworthy
Make commit less verbose by default
134
        out, err = self.run_bzr('commit -v -m renamed')
1669.2.1 by Martin Pool
verbose commit now specifically identifies modified/renamed/reparented files
135
        self.assertEqual('', out)
2747.6.7 by Daniel Watkins
Modify tests to reflect change in commit output.
136
        self.assertContainsRe(err, '^Committing revision 2 to ".*"\.\n'
137
                              'renamed hello\.txt => gutentag\.txt\n'
2789.2.7 by Ian Clatworthy
merge bzr.dev including updates to test_commit
138
                              'Committed revision 2 \(1 change made\)\.$\n')
1669.2.1 by Martin Pool
verbose commit now specifically identifies modified/renamed/reparented files
139
2789.2.1 by Ian Clatworthy
Make commit less verbose by default
140
    def test_normal_commit_moved(self):
141
        # Verbose commit of file moved to new directory should say just
142
        # the new revision
143
        wt = self.prepare_simple_history()
144
        os.mkdir('subdir')
145
        wt.add(['subdir'])
146
        wt.rename_one('hello.txt', 'subdir/hello.txt')
147
        out, err = self.run_bzr('commit -m renamed')
148
        self.assertEqual('', out)
2789.2.7 by Ian Clatworthy
merge bzr.dev including updates to test_commit
149
        self.assertContainsRe(err, '^Committing revision 2 to ".*"\.\n'
150
                              'added subdir\n'
151
                              'renamed hello\.txt => subdir/hello\.txt\n'
152
                              'Committed revision 2\.\n$')
2789.2.1 by Ian Clatworthy
Make commit less verbose by default
153
1669.2.1 by Martin Pool
verbose commit now specifically identifies modified/renamed/reparented files
154
    def test_verbose_commit_moved(self):
155
        # Verbose commit of file moved to new directory should say so
156
        wt = self.prepare_simple_history()
157
        os.mkdir('subdir')
158
        wt.add(['subdir'])
159
        wt.rename_one('hello.txt', 'subdir/hello.txt')
2789.2.1 by Ian Clatworthy
Make commit less verbose by default
160
        out, err = self.run_bzr('commit -v -m renamed')
1669.2.1 by Martin Pool
verbose commit now specifically identifies modified/renamed/reparented files
161
        self.assertEqual('', out)
2747.6.7 by Daniel Watkins
Modify tests to reflect change in commit output.
162
        self.assertContainsRe(err, '^Committing revision 2 to ".*"\.\n'
163
                              'added subdir\n'
164
                              'renamed hello\.txt => subdir/hello\.txt\n'
2789.2.7 by Ian Clatworthy
merge bzr.dev including updates to test_commit
165
                              'Committed revision 2 \(2 changes made\)\.\n$')
1669.2.1 by Martin Pool
verbose commit now specifically identifies modified/renamed/reparented files
166
2789.2.1 by Ian Clatworthy
Make commit less verbose by default
167
    def test_normal_commit_with_unknown(self):
168
        """Unknown files should not be listed by default in normal output"""
169
        # Is that really the best policy?
170
        wt = BzrDir.create_standalone_workingtree('.')
171
        self.build_tree(['hello.txt', 'extra.txt'])
172
        wt.add(['hello.txt'])
173
        out,err = self.run_bzr('commit -m added')
174
        self.assertEqual('', out)
2789.2.7 by Ian Clatworthy
merge bzr.dev including updates to test_commit
175
        self.assertContainsRe(err, '^Committing revision 1 to ".*"\.\n'
176
            'Committed revision 1 \(1 change made\).\n$',)
2789.2.1 by Ian Clatworthy
Make commit less verbose by default
177
1669.2.1 by Martin Pool
verbose commit now specifically identifies modified/renamed/reparented files
178
    def test_verbose_commit_with_unknown(self):
1616.1.3 by Martin Pool
Clean up cut&pasted test for verbose commit
179
        """Unknown files should not be listed by default in verbose output"""
180
        # Is that really the best policy?
1669.2.1 by Martin Pool
verbose commit now specifically identifies modified/renamed/reparented files
181
        wt = BzrDir.create_standalone_workingtree('.')
1616.1.3 by Martin Pool
Clean up cut&pasted test for verbose commit
182
        self.build_tree(['hello.txt', 'extra.txt'])
1669.2.1 by Martin Pool
verbose commit now specifically identifies modified/renamed/reparented files
183
        wt.add(['hello.txt'])
2789.2.1 by Ian Clatworthy
Make commit less verbose by default
184
        out,err = self.run_bzr('commit -v -m added')
1616.1.3 by Martin Pool
Clean up cut&pasted test for verbose commit
185
        self.assertEqual('', out)
2789.2.7 by Ian Clatworthy
merge bzr.dev including updates to test_commit
186
        self.assertContainsRe(err, '^Committing revision 1 to ".*"\.\n'
187
            'added hello.txt\n'
188
            'Committed revision 1 \(1 change made\).\n$',)
1616.1.3 by Martin Pool
Clean up cut&pasted test for verbose commit
189
2789.2.1 by Ian Clatworthy
Make commit less verbose by default
190
    def test_normal_commit_with_unchanged(self):
191
        """Unchanged files should not be listed by default in normal output"""
2789.2.5 by Ian Clatworthy
Upgrade commit tests to reflect new reporting formats
192
        tree = self.make_branch_and_tree('.')
2789.2.1 by Ian Clatworthy
Make commit less verbose by default
193
        self.build_tree(['hello.txt', 'unchanged.txt'])
2789.2.5 by Ian Clatworthy
Upgrade commit tests to reflect new reporting formats
194
        tree.add('unchanged.txt')
2789.2.1 by Ian Clatworthy
Make commit less verbose by default
195
        self.run_bzr('commit -m unchanged unchanged.txt')
196
        self.run_bzr("add hello.txt")
197
        out,err = self.run_bzr('commit -m added')
198
        self.assertEqual('', out)
2789.2.7 by Ian Clatworthy
merge bzr.dev including updates to test_commit
199
        self.assertContainsRe(err, '^Committing revision 2 to ".*"\.\n'
2747.6.7 by Daniel Watkins
Modify tests to reflect change in commit output.
200
                              'added hello\.txt\n'
2789.2.7 by Ian Clatworthy
merge bzr.dev including updates to test_commit
201
                              'Committed revision 2\.\n$')
2789.2.1 by Ian Clatworthy
Make commit less verbose by default
202
1668.1.5 by Martin Pool
[broken] fix up display of files changed by a commit
203
    def test_verbose_commit_with_unchanged(self):
1616.1.4 by Martin Pool
Verbose commit shouldn't talk about every unchanged file.
204
        """Unchanged files should not be listed by default in verbose output"""
2664.13.2 by Daniel Watkins
tests.blackbox.test_commit now uses internals where appropriate.
205
        tree = self.make_branch_and_tree('.')
1616.1.4 by Martin Pool
Verbose commit shouldn't talk about every unchanged file.
206
        self.build_tree(['hello.txt', 'unchanged.txt'])
2664.13.2 by Daniel Watkins
tests.blackbox.test_commit now uses internals where appropriate.
207
        tree.add('unchanged.txt')
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
208
        self.run_bzr('commit -m unchanged unchanged.txt')
2664.13.2 by Daniel Watkins
tests.blackbox.test_commit now uses internals where appropriate.
209
        tree.add("hello.txt")
2789.2.1 by Ian Clatworthy
Make commit less verbose by default
210
        out,err = self.run_bzr('commit -v -m added')
1616.1.4 by Martin Pool
Verbose commit shouldn't talk about every unchanged file.
211
        self.assertEqual('', out)
2747.6.7 by Daniel Watkins
Modify tests to reflect change in commit output.
212
        self.assertContainsRe(err, '^Committing revision 2 to ".*"\.\n'
213
                              'added hello\.txt\n'
2789.2.7 by Ian Clatworthy
merge bzr.dev including updates to test_commit
214
                              'Committed revision 2 \(1 change made\)\.$\n')
1508.1.22 by Robert Collins
implement out of date working tree checks in commit.
215
2747.6.13 by Daniel Watkins
Renamed test to reflect what it is actually doing.
216
    def test_verbose_commit_includes_master_location(self):
2747.6.4 by Daniel Watkins
Modified test as suggested on-list.
217
        """Location of master is displayed when committing to bound branch"""
2747.6.2 by Daniel Watkins
Added test for behaviour.
218
        a_tree = self.make_branch_and_tree('a')
219
        self.build_tree(['a/b'])
220
        a_tree.add('b')
221
        a_tree.commit(message='Initial message')
222
223
        b_tree = a_tree.branch.create_checkout('b')
2747.6.12 by Daniel Watkins
Modified tests to match new output.
224
        expected = "%s/" % (os.path.abspath('a'), )
2747.6.4 by Daniel Watkins
Modified test as suggested on-list.
225
        out, err = self.run_bzr('commit -m blah --unchanged', working_dir='b')
2747.6.7 by Daniel Watkins
Modify tests to reflect change in commit output.
226
        self.assertEqual(err, 'Committing revision 2 to "%s".\n'
227
                         'Committed revision 2.\n' % expected)
2747.6.2 by Daniel Watkins
Added test for behaviour.
228
1668.1.5 by Martin Pool
[broken] fix up display of files changed by a commit
229
    def test_commit_merge_reports_all_modified_files(self):
230
        # the commit command should show all the files that are shown by
231
        # bzr diff or bzr status when committing, even when they were not
232
        # changed by the user but rather through doing a merge.
233
        this_tree = self.make_branch_and_tree('this')
234
        # we need a bunch of files and dirs, to perform one action on each.
235
        self.build_tree([
236
            'this/dirtorename/',
237
            'this/dirtoreparent/',
238
            'this/dirtoleave/',
239
            'this/dirtoremove/',
240
            'this/filetoreparent',
241
            'this/filetorename',
242
            'this/filetomodify',
243
            'this/filetoremove',
244
            'this/filetoleave']
245
            )
246
        this_tree.add([
247
            'dirtorename',
248
            'dirtoreparent',
249
            'dirtoleave',
250
            'dirtoremove',
251
            'filetoreparent',
252
            'filetorename',
253
            'filetomodify',
254
            'filetoremove',
255
            'filetoleave']
256
            )
257
        this_tree.commit('create_files')
258
        other_dir = this_tree.bzrdir.sprout('other')
259
        other_tree = other_dir.open_workingtree()
260
        other_tree.lock_write()
261
        # perform the needed actions on the files and dirs.
262
        try:
263
            other_tree.rename_one('dirtorename', 'renameddir')
264
            other_tree.rename_one('dirtoreparent', 'renameddir/reparenteddir')
265
            other_tree.rename_one('filetorename', 'renamedfile')
2738.4.6 by Daniel Watkins
Rewrapped lines longer than 79 characters.
266
            other_tree.rename_one('filetoreparent',
267
                                  'renameddir/reparentedfile')
1668.1.5 by Martin Pool
[broken] fix up display of files changed by a commit
268
            other_tree.remove(['dirtoremove', 'filetoremove'])
269
            self.build_tree_contents([
2738.4.5 by Daniel Watkins
Fixed whitespace issues.
270
                ('other/newdir/',),
1668.1.5 by Martin Pool
[broken] fix up display of files changed by a commit
271
                ('other/filetomodify', 'new content'),
272
                ('other/newfile', 'new file content')])
273
            other_tree.add('newfile')
274
            other_tree.add('newdir/')
275
            other_tree.commit('modify all sample files and dirs.')
276
        finally:
277
            other_tree.unlock()
1979.2.1 by Robert Collins
(robertc) adds a convenience method "merge_from_branch" to WorkingTree.
278
        this_tree.merge_from_branch(other_tree.branch)
1668.1.5 by Martin Pool
[broken] fix up display of files changed by a commit
279
        os.chdir('this')
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
280
        out,err = self.run_bzr('commit -m added')
1668.1.5 by Martin Pool
[broken] fix up display of files changed by a commit
281
        self.assertEqual('', out)
2747.6.12 by Daniel Watkins
Modified tests to match new output.
282
        expected = '%s/' % (os.getcwd(), )
1668.1.5 by Martin Pool
[broken] fix up display of files changed by a commit
283
        self.assertEqualDiff(
2747.6.7 by Daniel Watkins
Modify tests to reflect change in commit output.
284
            'Committing revision 2 to "%s".\n'
1668.1.5 by Martin Pool
[broken] fix up display of files changed by a commit
285
            'modified filetomodify\n'
286
            'added newdir\n'
287
            'added newfile\n'
288
            'renamed dirtorename => renameddir\n'
289
            'renamed dirtoreparent => renameddir/reparenteddir\n'
290
            'renamed filetoreparent => renameddir/reparentedfile\n'
2484.1.25 by John Arbash Meinel
[merge] bzr.dev 2612
291
            'renamed filetorename => renamedfile\n'
1668.1.5 by Martin Pool
[broken] fix up display of files changed by a commit
292
            'deleted dirtoremove\n'
293
            'deleted filetoremove\n'
2747.6.12 by Daniel Watkins
Modified tests to match new output.
294
            'Committed revision 2.\n' % (expected, ),
1668.1.5 by Martin Pool
[broken] fix up display of files changed by a commit
295
            err)
296
1508.1.22 by Robert Collins
implement out of date working tree checks in commit.
297
    def test_empty_commit_message(self):
2664.13.2 by Daniel Watkins
tests.blackbox.test_commit now uses internals where appropriate.
298
        tree = self.make_branch_and_tree('.')
299
        self.build_tree_contents([('foo.c', 'int main() {}')])
300
        tree.add('foo.c')
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
301
        self.run_bzr('commit -m ""', retcode=3)
1508.1.22 by Robert Collins
implement out of date working tree checks in commit.
302
2625.9.2 by Daniel Watkins
Added test to ensure correct error message is given if an unencodable commit message is given at the command line.
303
    def test_unsupported_encoding_commit_message(self):
304
        tree = self.make_branch_and_tree('.')
305
        self.build_tree_contents([('foo.c', 'int main() {}')])
306
        tree.add('foo.c')
307
        out,err = self.run_bzr_subprocess('commit -m "\xff"', retcode=1,
308
                                                    env_changes={'LANG': 'C'})
309
        self.assertContainsRe(err, r'bzrlib.errors.BzrError: Parameter.*is '
310
                                    'unsupported by the current encoding.')
311
1508.1.22 by Robert Collins
implement out of date working tree checks in commit.
312
    def test_other_branch_commit(self):
313
        # this branch is to ensure consistent behaviour, whether we're run
314
        # inside a branch, or not.
2664.13.2 by Daniel Watkins
tests.blackbox.test_commit now uses internals where appropriate.
315
        outer_tree = self.make_branch_and_tree('.')
316
        inner_tree = self.make_branch_and_tree('branch')
317
        self.build_tree_contents([
318
            ('branch/foo.c', 'int main() {}'),
319
            ('branch/bar.c', 'int main() {}')])
320
        inner_tree.add('foo.c')
321
        inner_tree.add('bar.c')
1508.1.22 by Robert Collins
implement out of date working tree checks in commit.
322
        # can't commit files in different trees; sane error
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
323
        self.run_bzr('commit -m newstuff branch/foo.c .', retcode=3)
324
        self.run_bzr('commit -m newstuff branch/foo.c')
325
        self.run_bzr('commit -m newstuff branch')
326
        self.run_bzr('commit -m newstuff branch', retcode=3)
1508.1.22 by Robert Collins
implement out of date working tree checks in commit.
327
328
    def test_out_of_date_tree_commit(self):
329
        # check we get an error code and a clear message committing with an out
330
        # of date checkout
2664.13.2 by Daniel Watkins
tests.blackbox.test_commit now uses internals where appropriate.
331
        tree = self.make_branch_and_tree('branch')
1508.1.22 by Robert Collins
implement out of date working tree checks in commit.
332
        # make a checkout
2664.13.2 by Daniel Watkins
tests.blackbox.test_commit now uses internals where appropriate.
333
        checkout = tree.branch.create_checkout('checkout', lightweight=True)
1508.1.22 by Robert Collins
implement out of date working tree checks in commit.
334
        # commit to the original branch to make the checkout out of date
2664.13.2 by Daniel Watkins
tests.blackbox.test_commit now uses internals where appropriate.
335
        tree.commit('message branch', allow_pointless=True)
1508.1.22 by Robert Collins
implement out of date working tree checks in commit.
336
        # now commit to the checkout should emit
337
        # ERROR: Out of date with the branch, 'bzr update' is suggested
2530.3.1 by Martin Pool
Cleanup old variations on run_bzr in the test suite
338
        output = self.run_bzr('commit --unchanged -m checkout_message '
1508.1.22 by Robert Collins
implement out of date working tree checks in commit.
339
                             'checkout', retcode=3)
340
        self.assertEqual(output,
341
                         ('',
2738.4.6 by Daniel Watkins
Rewrapped lines longer than 79 characters.
342
                          "bzr: ERROR: Working tree is out of date, please "
343
                          "run 'bzr update'.\n"))
1587.1.8 by Robert Collins
Local commits on unbound branches fail.
344
345
    def test_local_commit_unbound(self):
346
        # a --local commit on an unbound branch is an error
347
        self.make_branch_and_tree('.')
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
348
        out, err = self.run_bzr('commit --local', retcode=3)
1587.1.8 by Robert Collins
Local commits on unbound branches fail.
349
        self.assertEqualDiff('', out)
350
        self.assertEqualDiff('bzr: ERROR: Cannot perform local-only commits '
351
                             'on unbound branches.\n', err)
1668.1.3 by Martin Pool
[patch] use the correct transaction when committing snapshot (Malone: #43959)
352
353
    def test_commit_a_text_merge_in_a_checkout(self):
354
        # checkouts perform multiple actions in a transaction across bond
355
        # branches and their master, and have been observed to fail in the
356
        # past. This is a user story reported to fail in bug #43959 where 
357
        # a merge done in a checkout (using the update command) failed to
358
        # commit correctly.
2664.13.2 by Daniel Watkins
tests.blackbox.test_commit now uses internals where appropriate.
359
        trunk = self.make_branch_and_tree('trunk')
1668.1.3 by Martin Pool
[patch] use the correct transaction when committing snapshot (Malone: #43959)
360
2664.13.2 by Daniel Watkins
tests.blackbox.test_commit now uses internals where appropriate.
361
        u1 = trunk.branch.create_checkout('u1')
1668.1.3 by Martin Pool
[patch] use the correct transaction when committing snapshot (Malone: #43959)
362
        self.build_tree_contents([('u1/hosts', 'initial contents')])
2664.13.2 by Daniel Watkins
tests.blackbox.test_commit now uses internals where appropriate.
363
        u1.add('hosts')
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
364
        self.run_bzr('commit -m add-hosts u1')
1668.1.3 by Martin Pool
[patch] use the correct transaction when committing snapshot (Malone: #43959)
365
2664.13.2 by Daniel Watkins
tests.blackbox.test_commit now uses internals where appropriate.
366
        u2 = trunk.branch.create_checkout('u2')
1668.1.3 by Martin Pool
[patch] use the correct transaction when committing snapshot (Malone: #43959)
367
        self.build_tree_contents([('u2/hosts', 'altered in u2')])
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
368
        self.run_bzr('commit -m checkin-from-u2 u2')
1668.1.3 by Martin Pool
[patch] use the correct transaction when committing snapshot (Malone: #43959)
369
370
        # make an offline commits
371
        self.build_tree_contents([('u1/hosts', 'first offline change in u1')])
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
372
        self.run_bzr('commit -m checkin-offline --local u1')
1668.1.3 by Martin Pool
[patch] use the correct transaction when committing snapshot (Malone: #43959)
373
374
        # now try to pull in online work from u2, and then commit our offline
375
        # work as a merge
376
        # retcode 1 as we expect a text conflict
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
377
        self.run_bzr('update u1', retcode=1)
378
        self.run_bzr('resolved u1/hosts')
1668.1.3 by Martin Pool
[patch] use the correct transaction when committing snapshot (Malone: #43959)
379
        # add a text change here to represent resolving the merge conflicts in
380
        # favour of a new version of the file not identical to either the u1
381
        # version or the u2 version.
382
        self.build_tree_contents([('u1/hosts', 'merge resolution\n')])
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
383
        self.run_bzr('commit -m checkin-merge-of-the-offline-work-from-u1 u1')
1551.7.24 by Aaron Bentley
Ensure commit respects file spec when committing removals
384
385
    def test_commit_respects_spec_for_removals(self):
386
        """Commit with a file spec should only commit removals that match"""
387
        t = self.make_branch_and_tree('.')
388
        self.build_tree(['file-a', 'dir-a/', 'dir-a/file-b'])
389
        t.add(['file-a', 'dir-a', 'dir-a/file-b'])
390
        t.commit('Create')
391
        t.remove(['file-a', 'dir-a/file-b'])
392
        os.chdir('dir-a')
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
393
        result = self.run_bzr('commit . -m removed-file-b')[1]
1551.7.24 by Aaron Bentley
Ensure commit respects file spec when committing removals
394
        self.assertNotContainsRe(result, 'file-a')
395
        result = self.run_bzr('status')[0]
396
        self.assertContainsRe(result, 'removed:\n  file-a')
2116.2.1 by John Arbash Meinel
Add commit --strict tests, and add a default ignore so that commit --strict works again
397
398
    def test_strict_commit(self):
399
        """Commit with --strict works if everything is known"""
1551.9.5 by Aaron Bentley
Revert broken save-commit-message code
400
        ignores._set_user_ignores([])
2116.2.1 by John Arbash Meinel
Add commit --strict tests, and add a default ignore so that commit --strict works again
401
        tree = self.make_branch_and_tree('tree')
402
        self.build_tree(['tree/a'])
403
        tree.add('a')
404
        # A simple change should just work
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
405
        self.run_bzr('commit --strict -m adding-a',
2116.2.1 by John Arbash Meinel
Add commit --strict tests, and add a default ignore so that commit --strict works again
406
                     working_dir='tree')
407
408
    def test_strict_commit_no_changes(self):
409
        """commit --strict gives "no changes" if there is nothing to commit"""
410
        tree = self.make_branch_and_tree('tree')
411
        self.build_tree(['tree/a'])
412
        tree.add('a')
413
        tree.commit('adding a')
414
415
        # With no changes, it should just be 'no changes'
416
        # Make sure that commit is failing because there is nothing to do
417
        self.run_bzr_error(['no changes to commit'],
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
418
                           'commit --strict -m no-changes',
2116.2.1 by John Arbash Meinel
Add commit --strict tests, and add a default ignore so that commit --strict works again
419
                           working_dir='tree')
420
421
        # But --strict doesn't care if you supply --unchanged
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
422
        self.run_bzr('commit --strict --unchanged -m no-changes',
2116.2.1 by John Arbash Meinel
Add commit --strict tests, and add a default ignore so that commit --strict works again
423
                     working_dir='tree')
424
425
    def test_strict_commit_unknown(self):
426
        """commit --strict fails if a file is unknown"""
427
        tree = self.make_branch_and_tree('tree')
428
        self.build_tree(['tree/a'])
429
        tree.add('a')
430
        tree.commit('adding a')
431
432
        # Add one file so there is a change, but forget the other
433
        self.build_tree(['tree/b', 'tree/c'])
434
        tree.add('b')
435
        self.run_bzr_error(['Commit refused because there are unknown files'],
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
436
                           'commit --strict -m add-b',
2116.2.1 by John Arbash Meinel
Add commit --strict tests, and add a default ignore so that commit --strict works again
437
                           working_dir='tree')
438
439
        # --no-strict overrides --strict
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
440
        self.run_bzr('commit --strict -m add-b --no-strict',
2116.2.1 by John Arbash Meinel
Add commit --strict tests, and add a default ignore so that commit --strict works again
441
                     working_dir='tree')
2376.4.1 by jml at canonical
Blackbox-driven --fixes option to commit.
442
443
    def test_fixes_bug_output(self):
444
        """commit --fixes=lp:23452 succeeds without output."""
2376.4.22 by Jonathan Lange
Variety of whitespace cleanups, tightening of tests and docstring changes in
445
        tree = self.make_branch_and_tree('tree')
446
        self.build_tree(['tree/hello.txt'])
447
        tree.add('hello.txt')
2376.4.12 by Jonathan Lange
Update NEWS file.
448
        output, err = self.run_bzr(
2789.2.1 by Ian Clatworthy
Make commit less verbose by default
449
            'commit -v -m hello --fixes=lp:23452 tree/hello.txt')
2376.4.1 by jml at canonical
Blackbox-driven --fixes option to commit.
450
        self.assertEqual('', output)
2747.6.7 by Daniel Watkins
Modify tests to reflect change in commit output.
451
        self.assertContainsRe(err, 'Committing revision 1 to ".*"\.\n'
452
                              'added hello\.txt\n'
2789.2.7 by Ian Clatworthy
merge bzr.dev including updates to test_commit
453
                              'Committed revision 1 \(1 change made\)\.\n')
2376.4.1 by jml at canonical
Blackbox-driven --fixes option to commit.
454
2453.2.1 by Martin Pool
Don't set the bugs property unless bugs are actually set
455
    def test_no_bugs_no_properties(self):
456
        """If no bugs are fixed, the bugs property is not set.
457
458
        see https://beta.launchpad.net/bzr/+bug/109613
459
        """
460
        tree = self.make_branch_and_tree('tree')
461
        self.build_tree(['tree/hello.txt'])
462
        tree.add('hello.txt')
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
463
        self.run_bzr( 'commit -m hello tree/hello.txt')
2453.2.1 by Martin Pool
Don't set the bugs property unless bugs are actually set
464
        # Get the revision properties, ignoring the branch-nick property, which
465
        # we don't care about for this test.
466
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
467
        properties = dict(last_rev.properties)
468
        del properties['branch-nick']
469
        self.assertFalse('bugs' in properties)
470
2376.4.1 by jml at canonical
Blackbox-driven --fixes option to commit.
471
    def test_fixes_bug_sets_property(self):
2376.4.2 by jml at canonical
More sophisticated error handling for --fixes option
472
        """commit --fixes=lp:234 sets the lp:234 revprop to 'fixed'."""
2376.4.1 by jml at canonical
Blackbox-driven --fixes option to commit.
473
        tree = self.make_branch_and_tree('tree')
474
        self.build_tree(['tree/hello.txt'])
475
        tree.add('hello.txt')
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
476
        self.run_bzr('commit -m hello --fixes=lp:234 tree/hello.txt')
2376.4.1 by jml at canonical
Blackbox-driven --fixes option to commit.
477
478
        # Get the revision properties, ignoring the branch-nick property, which
479
        # we don't care about for this test.
480
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
481
        properties = dict(last_rev.properties)
482
        del properties['branch-nick']
483
2376.4.18 by Jonathan Lange
Store all bug fix URLs in a single property.
484
        self.assertEqual({'bugs': 'https://launchpad.net/bugs/234 fixed'},
2376.4.7 by jml at canonical
- Add docstrings to tests.
485
                         properties)
2376.4.1 by jml at canonical
Blackbox-driven --fixes option to commit.
486
487
    def test_fixes_multiple_bugs_sets_properties(self):
488
        """--fixes can be used more than once to show that bugs are fixed."""
489
        tree = self.make_branch_and_tree('tree')
490
        self.build_tree(['tree/hello.txt'])
491
        tree.add('hello.txt')
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
492
        self.run_bzr('commit -m hello --fixes=lp:123 --fixes=lp:235'
493
                     ' tree/hello.txt')
2376.4.1 by jml at canonical
Blackbox-driven --fixes option to commit.
494
495
        # Get the revision properties, ignoring the branch-nick property, which
496
        # we don't care about for this test.
497
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
498
        properties = dict(last_rev.properties)
499
        del properties['branch-nick']
500
2376.4.18 by Jonathan Lange
Store all bug fix URLs in a single property.
501
        self.assertEqual(
2376.4.21 by Jonathan Lange
Change the bugs separator to \n from ,
502
            {'bugs': 'https://launchpad.net/bugs/123 fixed\n'
2376.4.18 by Jonathan Lange
Store all bug fix URLs in a single property.
503
                     'https://launchpad.net/bugs/235 fixed'},
504
            properties)
2376.4.7 by jml at canonical
- Add docstrings to tests.
505
506
    def test_fixes_bug_with_alternate_trackers(self):
507
        """--fixes can be used on a properly configured branch to mark bug
508
        fixes on multiple trackers.
509
        """
510
        tree = self.make_branch_and_tree('tree')
511
        tree.branch.get_config().set_user_option(
512
            'trac_twisted_url', 'http://twistedmatrix.com/trac')
513
        self.build_tree(['tree/hello.txt'])
514
        tree.add('hello.txt')
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
515
        self.run_bzr('commit -m hello --fixes=lp:123 --fixes=twisted:235 tree/')
2376.4.7 by jml at canonical
- Add docstrings to tests.
516
517
        # Get the revision properties, ignoring the branch-nick property, which
518
        # we don't care about for this test.
519
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
520
        properties = dict(last_rev.properties)
521
        del properties['branch-nick']
522
2376.4.18 by Jonathan Lange
Store all bug fix URLs in a single property.
523
        self.assertEqual(
2376.4.21 by Jonathan Lange
Change the bugs separator to \n from ,
524
            {'bugs': 'https://launchpad.net/bugs/123 fixed\n'
2376.4.18 by Jonathan Lange
Store all bug fix URLs in a single property.
525
                     'http://twistedmatrix.com/trac/ticket/235 fixed'},
526
            properties)
2376.4.2 by jml at canonical
More sophisticated error handling for --fixes option
527
528
    def test_fixes_unknown_bug_prefix(self):
529
        tree = self.make_branch_and_tree('tree')
530
        self.build_tree(['tree/hello.txt'])
531
        tree.add('hello.txt')
532
        self.run_bzr_error(
533
            ["Unrecognized bug %s. Commit refused." % 'xxx:123'],
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
534
            'commit -m add-b --fixes=xxx:123',
2376.4.2 by jml at canonical
More sophisticated error handling for --fixes option
535
            working_dir='tree')
536
537
    def test_fixes_invalid_bug_number(self):
538
        tree = self.make_branch_and_tree('tree')
539
        self.build_tree(['tree/hello.txt'])
540
        tree.add('hello.txt')
541
        self.run_bzr_error(
2376.4.7 by jml at canonical
- Add docstrings to tests.
542
            ["Invalid bug identifier for %s. Commit refused." % 'lp:orange'],
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
543
            'commit -m add-b --fixes=lp:orange',
2376.4.2 by jml at canonical
More sophisticated error handling for --fixes option
544
            working_dir='tree')
2376.4.7 by jml at canonical
- Add docstrings to tests.
545
546
    def test_fixes_invalid_argument(self):
547
        """Raise an appropriate error when the fixes argument isn't tag:id."""
548
        tree = self.make_branch_and_tree('tree')
549
        self.build_tree(['tree/hello.txt'])
550
        tree.add('hello.txt')
551
        self.run_bzr_error(
2376.4.13 by Jonathan Lange
Some stylistic cleanups
552
            [r"Invalid bug orange. Must be in the form of 'tag:id'\. "
553
             r"Commit refused\."],
2552.2.3 by Vincent Ladeuil
Deprecate the varargs syntax and fix the tests.
554
            'commit -m add-b --fixes=orange',
2376.4.7 by jml at canonical
- Add docstrings to tests.
555
            working_dir='tree')
2671.2.1 by Lukáš Lalinský
Add --author option to 'bzr commit' to record the author's name, if it's different from the committer.
556
557
    def test_no_author(self):
558
        """If the author is not specified, the author property is not set."""
559
        tree = self.make_branch_and_tree('tree')
560
        self.build_tree(['tree/hello.txt'])
561
        tree.add('hello.txt')
562
        self.run_bzr( 'commit -m hello tree/hello.txt')
563
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
2671.2.2 by Lukáš Lalinský
Move setting of the author revision property to MutableTree.commit. Don't use try/except KeyError in LongLogFormatter to display authors and branch-nicks. Removed warning about missing e-mail in the authors name.
564
        properties = last_rev.properties
2671.2.1 by Lukáš Lalinský
Add --author option to 'bzr commit' to record the author's name, if it's different from the committer.
565
        self.assertFalse('author' in properties)
566
567
    def test_author_sets_property(self):
2671.2.2 by Lukáš Lalinský
Move setting of the author revision property to MutableTree.commit. Don't use try/except KeyError in LongLogFormatter to display authors and branch-nicks. Removed warning about missing e-mail in the authors name.
568
        """commit --author='John Doe <jdoe@example.com>' sets the author
569
           revprop.
570
        """
2671.2.1 by Lukáš Lalinský
Add --author option to 'bzr commit' to record the author's name, if it's different from the committer.
571
        tree = self.make_branch_and_tree('tree')
572
        self.build_tree(['tree/hello.txt'])
573
        tree.add('hello.txt')
2671.2.4 by Lukáš Lalinský
Fixed broken test_author_* blackbox tests.
574
        self.run_bzr("commit -m hello --author='John Doe <jdoe@example.com>' "
2671.2.2 by Lukáš Lalinský
Move setting of the author revision property to MutableTree.commit. Don't use try/except KeyError in LongLogFormatter to display authors and branch-nicks. Removed warning about missing e-mail in the authors name.
575
                     "tree/hello.txt")
2671.2.1 by Lukáš Lalinský
Add --author option to 'bzr commit' to record the author's name, if it's different from the committer.
576
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
2671.2.2 by Lukáš Lalinský
Move setting of the author revision property to MutableTree.commit. Don't use try/except KeyError in LongLogFormatter to display authors and branch-nicks. Removed warning about missing e-mail in the authors name.
577
        properties = last_rev.properties
578
        self.assertEqual('John Doe <jdoe@example.com>', properties['author'])
2671.2.1 by Lukáš Lalinský
Add --author option to 'bzr commit' to record the author's name, if it's different from the committer.
579
580
    def test_author_no_email(self):
2671.2.2 by Lukáš Lalinský
Move setting of the author revision property to MutableTree.commit. Don't use try/except KeyError in LongLogFormatter to display authors and branch-nicks. Removed warning about missing e-mail in the authors name.
581
        """Author's name without an email address is allowed, too."""
2671.2.1 by Lukáš Lalinský
Add --author option to 'bzr commit' to record the author's name, if it's different from the committer.
582
        tree = self.make_branch_and_tree('tree')
583
        self.build_tree(['tree/hello.txt'])
584
        tree.add('hello.txt')
2671.2.4 by Lukáš Lalinský
Fixed broken test_author_* blackbox tests.
585
        out, err = self.run_bzr("commit -m hello --author='John Doe' "
2671.2.2 by Lukáš Lalinský
Move setting of the author revision property to MutableTree.commit. Don't use try/except KeyError in LongLogFormatter to display authors and branch-nicks. Removed warning about missing e-mail in the authors name.
586
                                "tree/hello.txt")
2671.2.1 by Lukáš Lalinský
Add --author option to 'bzr commit' to record the author's name, if it's different from the committer.
587
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
2671.2.2 by Lukáš Lalinský
Move setting of the author revision property to MutableTree.commit. Don't use try/except KeyError in LongLogFormatter to display authors and branch-nicks. Removed warning about missing e-mail in the authors name.
588
        properties = last_rev.properties
2671.2.1 by Lukáš Lalinský
Add --author option to 'bzr commit' to record the author's name, if it's different from the committer.
589
        self.assertEqual('John Doe', properties['author'])