~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-08-14 15:22:39 UTC
  • mfrom: (4523.4.21 1.18-lock-warnings)
  • Revision ID: pqm@pqm.ubuntu.com-20090814152239-m0ybwy7vfs32exeh
(jam) Update the test suite to cause failures when we take out
        multiple locks on the same file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
134
134
 
135
135
    def test_push_without_tree(self):
136
136
        # bzr push from a branch that does not have a checkout should work.
 
137
        self.thisFailsStrictLockCheck()
137
138
        b = self.make_branch('.')
138
139
        out, err = self.run_bzr('push pushed-location')
139
140
        self.assertEqual('', out)
145
146
        # bzr push of a branch with revisions to a new location
146
147
        # should print the number of revisions equal to the length of the
147
148
        # local branch.
 
149
        self.thisFailsStrictLockCheck()
148
150
        t = self.make_branch_and_tree('tree')
149
151
        self.build_tree(['tree/file'])
150
152
        t.add('file')
155
157
 
156
158
    def test_push_only_pushes_history(self):
157
159
        # Knit branches should only push the history for the current revision.
 
160
        self.thisFailsStrictLockCheck()
158
161
        format = bzrdir.BzrDirMetaFormat1()
159
162
        format.repository_format = knitrepo.RepositoryFormatKnit1()
160
163
        shared_repo = self.make_repository('repo', format=format, shared=True)
192
195
        self.assertTrue(pushed_repo.has_revision('b-1'))
193
196
 
194
197
    def test_push_funky_id(self):
 
198
        self.thisFailsStrictLockCheck()
195
199
        t = self.make_branch_and_tree('tree')
196
200
        self.build_tree(['tree/filename'])
197
201
        t.add('filename', 'funky-chars<>%&;"\'')
199
203
        self.run_bzr('push -d tree new-tree')
200
204
 
201
205
    def test_push_dash_d(self):
 
206
        self.thisFailsStrictLockCheck()
202
207
        t = self.make_branch_and_tree('from')
203
208
        t.commit(allow_pointless=True,
204
209
                message='first commit')
287
292
 
288
293
    def test_push_create_prefix(self):
289
294
        """'bzr push --create-prefix' will create leading directories."""
 
295
        self.thisFailsStrictLockCheck()
290
296
        tree = self.create_simple_tree()
291
297
 
292
298
        self.run_bzr_error(['Parent directory of ../new/tree does not exist'],
303
309
 
304
310
        By default, 'bzr push' will not use an existing, non-versioned dir.
305
311
        """
 
312
        self.thisFailsStrictLockCheck()
306
313
        tree = self.create_simple_tree()
307
314
        self.build_tree(['target/'])
308
315
 
351
358
 
352
359
    def test_push_with_revisionspec(self):
353
360
        """We should be able to push a revision older than the tip."""
 
361
        self.thisFailsStrictLockCheck()
354
362
        tree_from = self.make_branch_and_tree('from')
355
363
        tree_from.commit("One.", rev_id="from-1")
356
364
        tree_from.commit("Two.", rev_id="from-2")
392
400
 
393
401
    def test_push_new_branch_stacked_on(self):
394
402
        """Pushing a new branch with --stacked-on creates a stacked branch."""
 
403
        self.thisFailsStrictLockCheck()
395
404
        trunk_tree, branch_tree = self.create_trunk_and_feature_branch()
396
405
        # we publish branch_tree with a reference to the mainline.
397
406
        out, err = self.run_bzr(['push', '--stacked-on', trunk_tree.branch.base,
404
413
 
405
414
    def test_push_new_branch_stacked_uses_parent_when_no_public_url(self):
406
415
        """When the parent has no public url the parent is used as-is."""
 
416
        self.thisFailsStrictLockCheck()
407
417
        trunk_tree, branch_tree = self.create_trunk_and_feature_branch()
408
418
        # now we do a stacked push, which should determine the public location
409
419
        # for us.
417
427
 
418
428
    def test_push_new_branch_stacked_uses_parent_public(self):
419
429
        """Pushing a new branch with --stacked creates a stacked branch."""
 
430
        self.thisFailsStrictLockCheck()
420
431
        trunk_tree, branch_tree = self.create_trunk_and_feature_branch()
421
432
        # the trunk is published on a web server
422
433
        self.transport_readonly_server = http_server.HttpServer
501
512
        out, err = self.run_bzr('push -d repo/local remote -r 3')
502
513
 
503
514
    def test_push_verbose_shows_log(self):
 
515
        self.thisFailsStrictLockCheck()
504
516
        tree = self.make_branch_and_tree('source')
505
517
        tree.commit('rev1')
506
518
        out, err = self.run_bzr('push -v -d source target')
514
526
        self.assertNotContainsRe(out, 'rev1')
515
527
 
516
528
    def test_push_from_subdir(self):
 
529
        self.thisFailsStrictLockCheck()
517
530
        t = self.make_branch_and_tree('tree')
518
531
        self.build_tree(['tree/dir/', 'tree/dir/file'])
519
532
        t.add('dir', 'dir/file')
657
670
        self.make_local_branch_and_tree()
658
671
 
659
672
    def test_push_default(self):
 
673
        self.thisFailsStrictLockCheck()
660
674
        self.assertPushSucceeds([])
661
675
 
662
676
    def test_push_strict(self):
 
677
        self.thisFailsStrictLockCheck()
663
678
        self.assertPushSucceeds(['--strict'])
664
679
 
665
680
    def test_push_no_strict(self):
 
681
        self.thisFailsStrictLockCheck()
666
682
        self.assertPushSucceeds(['--no-strict'])
667
683
 
668
684
    def test_push_config_var_strict(self):
 
685
        self.thisFailsStrictLockCheck()
669
686
        self.set_config_push_strict('true')
670
687
        self.assertPushSucceeds([])
671
688
 
672
689
    def test_push_config_var_no_strict(self):
 
690
        self.thisFailsStrictLockCheck()
673
691
        self.set_config_push_strict('false')
674
692
        self.assertPushSucceeds([])
675
693
 
716
734
        self.assertPushFails([])
717
735
 
718
736
    def test_push_with_revision(self):
 
737
        self.thisFailsStrictLockCheck()
719
738
        self.assertPushSucceeds(['-r', 'revid:added'], pushed_revid='added')
720
739
 
721
740
    def test_push_no_strict(self):
 
741
        self.thisFailsStrictLockCheck()
722
742
        self.assertPushSucceeds(['--no-strict'])
723
743
 
724
744
    def test_push_strict_with_changes(self):
733
753
        self.assertPushFails([])
734
754
 
735
755
    def test_push_no_strict_command_line_override_config(self):
 
756
        self.thisFailsStrictLockCheck()
736
757
        self.set_config_push_strict('yES')
737
758
        self.assertPushFails([])
738
759
        self.assertPushSucceeds(['--no-strict'])
739
760
 
740
761
    def test_push_strict_command_line_override_config(self):
 
762
        self.thisFailsStrictLockCheck()
741
763
        self.set_config_push_strict('oFF')
742
764
        self.assertPushFails(['--strict'])
743
765
        self.assertPushSucceeds([])