~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2011-05-10 07:46:15 UTC
  • mfrom: (5844 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5845.
  • Revision ID: jelmer@samba.org-20110510074615-eptod049ndjxc4i7
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
135
135
        out, err = self.run_bzr('push --no-tree -d push-from push-to')
136
136
        self.assertEqual('', out)
137
137
        self.assertEqual('Created new branch.\n', err)
138
 
        self.failIfExists('push-to/file')
 
138
        self.assertPathDoesNotExist('push-to/file')
139
139
 
140
140
    def test_push_new_branch_revision_count(self):
141
141
        # bzr push of a branch with revisions to a new location
199
199
        t.commit(allow_pointless=True,
200
200
                message='first commit')
201
201
        self.run_bzr('push -d from to-one')
202
 
        self.failUnlessExists('to-one')
 
202
        self.assertPathExists('to-one')
203
203
        self.run_bzr('push -d %s %s'
204
204
            % tuple(map(urlutils.local_path_to_url, ['from', 'to-two'])))
205
 
        self.failUnlessExists('to-two')
 
205
        self.assertPathExists('to-two')
 
206
 
 
207
    def test_push_repository_no_branch_doesnt_fetch_all_revs(self):
 
208
        # See https://bugs.launchpad.net/bzr/+bug/465517
 
209
        target_repo = self.make_repository('target')
 
210
        source = self.make_branch_builder('source')
 
211
        source.start_series()
 
212
        source.build_snapshot('A', None, [
 
213
            ('add', ('', 'root-id', 'directory', None))])
 
214
        source.build_snapshot('B', ['A'], [])
 
215
        source.build_snapshot('C', ['A'], [])
 
216
        source.finish_series()
 
217
        self.run_bzr('push target -d source')
 
218
        self.addCleanup(target_repo.lock_read().unlock)
 
219
        # We should have pushed 'C', but not 'B', since it isn't in the
 
220
        # ancestry
 
221
        self.assertEqual([('A',), ('C',)], sorted(target_repo.revisions.keys()))
206
222
 
207
223
    def test_push_smart_non_stacked_streaming_acceptance(self):
208
224
        self.setup_smart_server_with_call_log()
308
324
                     working_dir='tree')
309
325
        new_tree = workingtree.WorkingTree.open('new/tree')
310
326
        self.assertEqual(tree.last_revision(), new_tree.last_revision())
311
 
        self.failUnlessExists('new/tree/a')
 
327
        self.assertPathExists('new/tree/a')
312
328
 
313
329
    def test_push_use_existing(self):
314
330
        """'bzr push --use-existing-dir' can push into an existing dir.
329
345
        new_tree = workingtree.WorkingTree.open('target')
330
346
        self.assertEqual(tree.last_revision(), new_tree.last_revision())
331
347
        # The push should have created target/a
332
 
        self.failUnlessExists('target/a')
 
348
        self.assertPathExists('target/a')
333
349
 
334
350
    def test_push_use_existing_into_empty_bzrdir(self):
335
351
        """'bzr push --use-existing-dir' into a dir with an empty .bzr dir