/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 bzrlib/tests/blackbox/test_commit.py

  • Committer: Ian Clatworthy
  • Date: 2007-09-13 05:36:27 UTC
  • mto: (2819.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 2820.
  • Revision ID: ian.clatworthy@internode.on.net-20070913053627-7pyodcq5oe2qdhhn
remove more reporting stuff

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
        tree = self.make_branch_and_tree('.')
74
74
        self.build_tree(['hello.txt'])
75
75
        tree.add("hello.txt")
76
 
        out,err = self.run_bzr('commit -v -m added')
77
 
        self.assertEqual('', out)
78
 
        self.assertContainsRe(err, '^Committing revision 1 to ".*"\.\n'
79
 
            'added hello.txt\n'
80
 
            'Committed revision 1 \(1 change made\).\n$',)
81
 
 
82
 
    def test_10_quiet_commit(self):
83
 
        """Add one file and examine quiet commit output"""
84
 
        tree = self.make_branch_and_tree('.')
85
 
        self.build_tree(['hello.txt'])
86
 
        tree.add("hello.txt")
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"""
93
 
        tree = self.make_branch_and_tree('.')
94
 
        self.build_tree(['hello.txt'])
95
 
        tree.add("hello.txt")
96
76
        out,err = self.run_bzr('commit -m added')
97
77
        self.assertEqual('', out)
98
78
        self.assertContainsRe(err, '^Committing revision 1 to ".*"\.\n'
99
 
                              'Committed revision 1 \(1 change made\).\n$',)
 
79
                              'added hello.txt\n'
 
80
                              'Committed revision 1.\n$',)
100
81
 
101
82
    def prepare_simple_history(self):
102
83
        """Prepare and return a working tree with one commit of one file"""
107
88
        wt.commit(message='added')
108
89
        return wt
109
90
 
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)
116
 
        self.assertContainsRe(err, '^Committing revision 2 to ".*"\.\n'
117
 
            'modified hello.txt\n'
118
 
            'Committed revision 2.\n$')
119
 
 
120
91
    def test_verbose_commit_modified(self):
121
92
        # Verbose commit of modified file should say so
122
93
        wt = self.prepare_simple_history()
123
94
        self.build_tree_contents([('hello.txt', 'new contents')])
124
 
        out, err = self.run_bzr('commit -v -m modified')
 
95
        out, err = self.run_bzr('commit -m modified')
125
96
        self.assertEqual('', out)
126
97
        self.assertContainsRe(err, '^Committing revision 2 to ".*"\.\n'
127
98
                              'modified hello\.txt\n'
128
 
                              'Committed revision 2 \(1 change made\)\.\n$')
 
99
                              'Committed revision 2\.\n$')
129
100
 
130
101
    def test_verbose_commit_renamed(self):
131
102
        # Verbose commit of renamed file should say so
132
103
        wt = self.prepare_simple_history()
133
104
        wt.rename_one('hello.txt', 'gutentag.txt')
134
 
        out, err = self.run_bzr('commit -v -m renamed')
 
105
        out, err = self.run_bzr('commit -m renamed')
135
106
        self.assertEqual('', out)
136
107
        self.assertContainsRe(err, '^Committing revision 2 to ".*"\.\n'
137
108
                              'renamed hello\.txt => gutentag\.txt\n'
138
 
                              'Committed revision 2 \(1 change made\)\.$\n')
139
 
 
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)
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$')
 
109
                              'Committed revision 2\.$\n')
153
110
 
154
111
    def test_verbose_commit_moved(self):
155
112
        # Verbose commit of file moved to new directory should say so
157
114
        os.mkdir('subdir')
158
115
        wt.add(['subdir'])
159
116
        wt.rename_one('hello.txt', 'subdir/hello.txt')
160
 
        out, err = self.run_bzr('commit -v -m renamed')
 
117
        out, err = self.run_bzr('commit -m renamed')
161
118
        self.assertEqual('', out)
162
119
        self.assertContainsRe(err, '^Committing revision 2 to ".*"\.\n'
163
120
                              'added subdir\n'
164
121
                              'renamed hello\.txt => subdir/hello\.txt\n'
165
 
                              'Committed revision 2 \(2 changes made\)\.\n$')
166
 
 
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)
175
 
        self.assertContainsRe(err, '^Committing revision 1 to ".*"\.\n'
176
 
            'Committed revision 1 \(1 change made\).\n$',)
 
122
                              'Committed revision 2\.\n$')
177
123
 
178
124
    def test_verbose_commit_with_unknown(self):
179
125
        """Unknown files should not be listed by default in verbose output"""
181
127
        wt = BzrDir.create_standalone_workingtree('.')
182
128
        self.build_tree(['hello.txt', 'extra.txt'])
183
129
        wt.add(['hello.txt'])
184
 
        out,err = self.run_bzr('commit -v -m added')
 
130
        out,err = self.run_bzr('commit -m added')
185
131
        self.assertEqual('', out)
186
132
        self.assertContainsRe(err, '^Committing revision 1 to ".*"\.\n'
187
 
            'added hello.txt\n'
188
 
            'Committed revision 1 \(1 change made\).\n$',)
189
 
 
190
 
    def test_normal_commit_with_unchanged(self):
191
 
        """Unchanged files should not be listed by default in normal output"""
192
 
        tree = self.make_branch_and_tree('.')
193
 
        self.build_tree(['hello.txt', 'unchanged.txt'])
194
 
        tree.add('unchanged.txt')
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)
199
 
        self.assertContainsRe(err, '^Committing revision 2 to ".*"\.\n'
200
133
                              'added hello\.txt\n'
201
 
                              'Committed revision 2\.\n$')
 
134
                              'Committed revision 1\.\n$')
202
135
 
203
136
    def test_verbose_commit_with_unchanged(self):
204
137
        """Unchanged files should not be listed by default in verbose output"""
207
140
        tree.add('unchanged.txt')
208
141
        self.run_bzr('commit -m unchanged unchanged.txt')
209
142
        tree.add("hello.txt")
210
 
        out,err = self.run_bzr('commit -v -m added')
 
143
        out,err = self.run_bzr('commit -m added')
211
144
        self.assertEqual('', out)
212
145
        self.assertContainsRe(err, '^Committing revision 2 to ".*"\.\n'
213
146
                              'added hello\.txt\n'
214
 
                              'Committed revision 2 \(1 change made\)\.$\n')
 
147
                              'Committed revision 2\.$\n')
215
148
 
216
149
    def test_verbose_commit_includes_master_location(self):
217
150
        """Location of master is displayed when committing to bound branch"""
446
379
        self.build_tree(['tree/hello.txt'])
447
380
        tree.add('hello.txt')
448
381
        output, err = self.run_bzr(
449
 
            'commit -v -m hello --fixes=lp:23452 tree/hello.txt')
 
382
            'commit -m hello --fixes=lp:23452 tree/hello.txt')
450
383
        self.assertEqual('', output)
451
384
        self.assertContainsRe(err, 'Committing revision 1 to ".*"\.\n'
452
385
                              'added hello\.txt\n'
453
 
                              'Committed revision 1 \(1 change made\)\.\n')
 
386
                              'Committed revision 1\.\n')
454
387
 
455
388
    def test_no_bugs_no_properties(self):
456
389
        """If no bugs are fixed, the bugs property is not set.