~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2007-06-26 20:32:49 UTC
  • mto: (2581.1.1 cleanup-runbzr)
  • mto: This revision was merged to the branch mainline in revision 2588.
  • Revision ID: v.ladeuil+lp@free.fr-20070626203249-sqm4afiai5dxofum
Deprecate the varargs syntax and fix the tests.

* bzrlib/tests/__init__.py:
(TestCase.run_bzr): Activate the deprecation warning.
(TestCase.run_bzr_error): Add error_regexes to kwargs or run_bzr
get confused.

* bzrlib/tests/blackbox/test_selftest.py:
(TestRunBzr.test_args): Activate.

* bzrlib/tests/blackbox/test_inventory.py:
(TestInventory.assertInventoryEqual): Build the command from args
if not None.

* bzrlib/tests/blackbox/test_ls.py:
(TestLS.ls_equals): Build the command from args if not None.

* bzrlib/tests/blackbox/test_remove_tree.py:
(TestRemoveTree.test_remove_tree_lightweight_checkout_explicit):
Nice catch, we were calling run_bzr instead of run_bzr_error. This
went unnoticed for some time...

Show diffs side-by-side

added added

removed removed

Lines of Context:
153
153
        os.chdir('a')
154
154
        bzr('init')
155
155
        open('foo', 'wb').write('original\n')
156
 
        bzr('add', 'foo')
157
 
        bzr('commit', '-m', 'initial commit')
 
156
        bzr('add foo')
 
157
        bzr('commit -m initial_commit')
158
158
 
159
159
        os.chdir('..')
160
 
        bzr('branch', 'a', 'b')
 
160
        bzr('branch a b')
161
161
 
162
162
        os.chdir('a')
163
163
        open('foo', 'wb').write('changed\n')
164
 
        bzr('commit', '-m', 'later change')
 
164
        bzr('commit -m later_change')
165
165
 
166
166
        open('foo', 'wb').write('another\n')
167
 
        bzr('commit', '-m', 'a third change')
 
167
        bzr('commit -m a_third_change')
168
168
 
169
169
        rev_history_a = get_rh(3)
170
170
 
171
171
        os.chdir('../b')
172
 
        bzr('merge', '../a')
173
 
        bzr('commit', '-m', 'merge')
 
172
        bzr('merge ../a')
 
173
        bzr('commit -m merge')
174
174
 
175
175
        rev_history_b = get_rh(2)
176
176
 
177
 
        bzr('pull', '--overwrite', '../a')
 
177
        bzr('pull --overwrite ../a')
178
178
        rev_history_b = get_rh(3)
179
179
 
180
180
        self.assertEqual(rev_history_b, rev_history_a)
195
195
        os.chdir('a')
196
196
        bzr('init')
197
197
        open('foo', 'wb').write('original\n')
198
 
        bzr('add', 'foo')
199
 
        bzr('commit', '-m', 'initial commit')
 
198
        bzr('add foo')
 
199
        bzr('commit -m initial_commit')
200
200
 
201
201
        os.chdir('..')
202
 
        bzr('branch', 'a', 'b')
 
202
        bzr('branch a b')
203
203
 
204
204
        os.chdir('a')
205
205
        open('foo', 'wb').write('changed\n')
206
 
        bzr('commit', '-m', 'later change')
 
206
        bzr('commit -m later_change')
207
207
 
208
208
        open('foo', 'wb').write('another\n')
209
 
        bzr('commit', '-m', 'a third change')
 
209
        bzr('commit -m a_third_change')
210
210
 
211
211
        rev_history_a = get_rh(3)
212
212
 
213
213
        os.chdir('../b')
214
 
        bzr('merge', '../a')
215
 
        bzr('commit', '-m', 'merge')
 
214
        bzr('merge ../a')
 
215
        bzr('commit -m merge')
216
216
 
217
217
        rev_history_b = get_rh(2)
218
218
 
219
219
        os.chdir('../a')
220
220
        open('foo', 'wb').write('a fourth change\n')
221
 
        bzr('commit', '-m', 'a fourth change')
 
221
        bzr('commit -m a_fourth_change')
222
222
 
223
223
        rev_history_a = get_rh(4)
224
224
 
225
225
        # With convergence, we could just pull over the
226
226
        # new change, but with --overwrite, we want to switch our history
227
227
        os.chdir('../b')
228
 
        bzr('pull', '--overwrite', '../a')
 
228
        bzr('pull --overwrite ../a')
229
229
        rev_history_b = get_rh(4)
230
230
 
231
231
        self.assertEqual(rev_history_b, rev_history_a)
294
294
        # Create the bundle for 'b' to pull
295
295
        os.chdir('branch_a')
296
296
        bundle_file = open('../bundle', 'wb')
297
 
        bundle_file.write(self.run_bzr('bundle', '../branch_b')[0])
 
297
        bundle_file.write(self.run_bzr('bundle ../branch_b')[0])
298
298
        bundle_file.close()
299
299
 
300
300
        os.chdir('../branch_b')
301
 
        out, err = self.run_bzr('pull', '../bundle')
 
301
        out, err = self.run_bzr('pull ../bundle')
302
302
        self.assertEqual(out,
303
303
                         'Now on revision 2.\n')
304
304
        self.assertEqual(err,
315
315
                             testament_b.as_text())
316
316
 
317
317
        # it is legal to attempt to pull an already-merged bundle
318
 
        out, err = self.run_bzr('pull', '../bundle')
 
318
        out, err = self.run_bzr('pull ../bundle')
319
319
        self.assertEqual(err, '')
320
320
        self.assertEqual(out, 'No revisions to pull.\n')