~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Samuel Bronson
  • Date: 2012-08-30 20:36:18 UTC
  • mto: (6015.57.3 2.4)
  • mto: This revision was merged to the branch mainline in revision 6558.
  • Revision ID: naesten@gmail.com-20120830203618-y2dzw91nqpvpgxvx
Update INSTALL for switch to Python 2.6 and up.

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
        mine.merge_from_branch(other.branch)
54
54
        mine.commit('merge my change', rev_id='P2')
55
55
        result = mine.branch.push(other.branch)
56
 
        self.assertEqual('P2', other.branch.last_revision())
 
56
        self.assertEqual(['P1', 'P2'], other.branch.revision_history())
57
57
        # result object contains some structured data
58
58
        self.assertEqual(result.old_revid, 'M1')
59
59
        self.assertEqual(result.new_revid, 'P2')
78
78
        mine.merge_from_branch(other.branch)
79
79
        mine.commit('merge other', rev_id='P2')
80
80
        mine.branch.push(target.branch)
81
 
        self.assertEqual('P2', target.branch.last_revision())
 
81
        self.assertEqual(['P1', 'P2'], target.branch.revision_history())
82
82
 
83
83
    def test_push_to_checkout_updates_master(self):
84
84
        """Pushing into a checkout updates the checkout and the master branch"""
95
95
        rev2 = other.commit('other commit')
96
96
        # now push, which should update both checkout and master.
97
97
        other.branch.push(checkout.branch)
98
 
        self.assertEqual(rev2, checkout.branch.last_revision())
99
 
        self.assertEqual(rev2, master_tree.branch.last_revision())
 
98
        self.assertEqual([rev1, rev2], checkout.branch.revision_history())
 
99
        self.assertEqual([rev1, rev2], master_tree.branch.revision_history())
100
100
 
101
101
    def test_push_raises_specific_error_on_master_connection_error(self):
102
102
        master_tree = self.make_branch_and_tree('master')
157
157
        except (errors.IncompatibleFormat, errors.UninitializableFormat):
158
158
            # This Branch format cannot create shared repositories
159
159
            return
160
 
        if not repo._format.supports_nesting_repositories:
161
 
            return
162
160
        # This is a little bit trickier because make_branch_and_tree will not
163
161
        # re-use a shared repository.
164
162
        a_bzrdir = self.make_bzrdir('repo/tree')
253
251
        self.addCleanup(repo.lock_read().unlock)
254
252
        # We should have pushed 'C', but not 'B', since it isn't in the
255
253
        # ancestry
256
 
        self.assertEqual(['A', 'C'], sorted(repo.all_revision_ids()))
 
254
        self.assertEqual([('A',), ('C',)], sorted(repo.revisions.keys()))
257
255
 
258
256
    def test_push_with_default_stacking_does_not_create_broken_branch(self):
259
257
        """Pushing a new standalone branch works even when there's a default
426
424
    def test_empty_branch_api(self):
427
425
        """The branch_obj.push API should make a limited number of HPSS calls.
428
426
        """
429
 
        t = transport.get_transport_from_url(self.smart_server.get_url()).clone('target')
 
427
        t = transport.get_transport(self.smart_server.get_url()).clone('target')
430
428
        target = branch.Branch.open_from_transport(t)
431
429
        self.empty_branch.push(target)
432
430
        self.assertEqual(