/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/per_interbranch/test_push.py

  • Committer: Jelmer Vernooij
  • Date: 2018-11-16 10:50:21 UTC
  • mfrom: (7164 work)
  • mto: This revision was merged to the branch mainline in revision 7165.
  • Revision ID: jelmer@jelmer.uk-20181116105021-xl419v2rh4aus1au
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
179
179
            raise tests.TestNotApplicable(
180
180
                'push between branches of same format')
181
181
 
 
182
    def test_between_colocated(self):
 
183
        """Pushing from one colocated branch to another doesn't change the active branch."""
 
184
        source = self.make_from_branch_and_tree('source')
 
185
        target = self.make_to_branch('target')
 
186
 
 
187
        self.build_tree(['source/a'])
 
188
        source.add(['a'])
 
189
        revid1 = source.commit('a')
 
190
 
 
191
        self.build_tree(['source/b'])
 
192
        source.add(['b'])
 
193
        revid2 = source.commit('b')
 
194
 
 
195
        source_colo = source.controldir.create_branch('colo')
 
196
        source_colo.generate_revision_history(revid1)
 
197
        try:
 
198
            source_colo.push(target)
 
199
        except errors.NoRoundtrippingSupport:
 
200
            raise tests.TestNotApplicable(
 
201
                'push between branches of different format')
 
202
        self.assertEqual(source_colo.last_revision(), revid1)
 
203
        self.assertEqual(source.last_revision(), revid2)
 
204
        self.assertEqual(target.last_revision(), revid1)
 
205
 
182
206
    def test_push_within_repository(self):
183
207
        """Push from one branch to another inside the same repository."""
184
208
        try: