~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin Packman
  • Date: 2012-01-05 09:50:04 UTC
  • mfrom: (6424 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6426.
  • Revision ID: martin.packman@canonical.com-20120105095004-mia9xb7y0efmto0v
Merge bzr.dev to resolve conflicts in bzrlib.builtins

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(['P1', 'P2'], other.branch.revision_history())
 
56
        self.assertEqual('P2', other.branch.last_revision())
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(['P1', 'P2'], target.branch.revision_history())
 
81
        self.assertEqual('P2', target.branch.last_revision())
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([rev1, rev2], checkout.branch.revision_history())
99
 
        self.assertEqual([rev1, rev2], master_tree.branch.revision_history())
 
98
        self.assertEqual(rev2, checkout.branch.last_revision())
 
99
        self.assertEqual(rev2, master_tree.branch.last_revision())
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
160
162
        # This is a little bit trickier because make_branch_and_tree will not
161
163
        # re-use a shared repository.
162
164
        a_bzrdir = self.make_bzrdir('repo/tree')
251
253
        self.addCleanup(repo.lock_read().unlock)
252
254
        # We should have pushed 'C', but not 'B', since it isn't in the
253
255
        # ancestry
254
 
        self.assertEqual([('A',), ('C',)], sorted(repo.revisions.keys()))
 
256
        self.assertEqual(['A', 'C'], sorted(repo.all_revision_ids()))
255
257
 
256
258
    def test_push_with_default_stacking_does_not_create_broken_branch(self):
257
259
        """Pushing a new standalone branch works even when there's a default