~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2011-01-12 21:27:00 UTC
  • mto: This revision was merged to the branch mainline in revision 5605.
  • Revision ID: john@arbash-meinel.com-20110112212700-esqmtrmevddxrsq2
Clean up the test slightly, hoping to avoid race conditions, update NEWS

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.assertPathDoesNotExist('push-to/file')
 
138
        self.failIfExists('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.assertPathExists('to-one')
 
202
        self.failUnlessExists('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.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()))
 
205
        self.failUnlessExists('to-two')
222
206
 
223
207
    def test_push_smart_non_stacked_streaming_acceptance(self):
224
208
        self.setup_smart_server_with_call_log()
324
308
                     working_dir='tree')
325
309
        new_tree = workingtree.WorkingTree.open('new/tree')
326
310
        self.assertEqual(tree.last_revision(), new_tree.last_revision())
327
 
        self.assertPathExists('new/tree/a')
 
311
        self.failUnlessExists('new/tree/a')
328
312
 
329
313
    def test_push_use_existing(self):
330
314
        """'bzr push --use-existing-dir' can push into an existing dir.
345
329
        new_tree = workingtree.WorkingTree.open('target')
346
330
        self.assertEqual(tree.last_revision(), new_tree.last_revision())
347
331
        # The push should have created target/a
348
 
        self.assertPathExists('target/a')
 
332
        self.failUnlessExists('target/a')
349
333
 
350
334
    def test_push_use_existing_into_empty_bzrdir(self):
351
335
        """'bzr push --use-existing-dir' into a dir with an empty .bzr dir