~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Andrew Bennetts
  • Date: 2009-08-25 01:25:57 UTC
  • mfrom: (4642 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4657.
  • Revision ID: andrew.bennetts@canonical.com-20090825012557-1ku5o09nv3ra9n12
Merge from bzr.dev.

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