/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 bzrlib/tests/blackbox/test_push.py

MergeĀ upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
 
18
18
"""Black-box tests for bzr push."""
196
196
        t.commit(allow_pointless=True, message='first commit')
197
197
        self.reset_smart_call_log()
198
198
        self.run_bzr(['push', self.get_url('to-one')], working_dir='from')
199
 
        rpc_count = len(self.hpss_calls)
200
199
        # This figure represent the amount of work to perform this use case. It
201
200
        # is entirely ok to reduce this number if a test fails due to rpc_count
202
201
        # being too low. If rpc_count increases, more network roundtrips have
203
202
        # become necessary for this use case. Please do not adjust this number
204
203
        # upwards without agreement from bzr's network support maintainers.
205
 
        self.assertEqual(20, rpc_count)
 
204
        self.assertLength(20, self.hpss_calls)
206
205
 
207
206
    def test_push_smart_stacked_streaming_acceptance(self):
208
207
        self.setup_smart_server_with_call_log()
213
212
        self.reset_smart_call_log()
214
213
        self.run_bzr(['push', '--stacked', '--stacked-on', '../parent',
215
214
            self.get_url('public')], working_dir='local')
216
 
        rpc_count = len(self.hpss_calls)
217
215
        # This figure represent the amount of work to perform this use case. It
218
216
        # is entirely ok to reduce this number if a test fails due to rpc_count
219
217
        # being too low. If rpc_count increases, more network roundtrips have
220
218
        # become necessary for this use case. Please do not adjust this number
221
219
        # upwards without agreement from bzr's network support maintainers.
222
 
        self.assertEqual(56, rpc_count)
 
220
        self.assertLength(56, self.hpss_calls)
223
221
        remote = Branch.open('public')
224
222
        self.assertEndsWith(remote.get_stacked_on_url(), '/parent')
225
223
 
394
392
        self.assertContainsRe(err,
395
393
                              'Using default stacking branch stack_on at .*')
396
394
 
 
395
    def test_push_stacks_with_default_stacking_if_target_is_stackable(self):
 
396
        self.make_branch('stack_on', format='1.6')
 
397
        self.make_bzrdir('.').get_config().set_default_stack_on('stack_on')
 
398
        self.make_branch('from', format='pack-0.92')
 
399
        out, err = self.run_bzr('push -d from to')
 
400
        branch = Branch.open('to')
 
401
        self.assertEqual('../stack_on', branch.get_stacked_on_url())
 
402
 
 
403
    def test_push_does_not_change_format_with_default_if_target_cannot(self):
 
404
        self.make_branch('stack_on', format='pack-0.92')
 
405
        self.make_bzrdir('.').get_config().set_default_stack_on('stack_on')
 
406
        self.make_branch('from', format='pack-0.92')
 
407
        out, err = self.run_bzr('push -d from to')
 
408
        branch = Branch.open('to')
 
409
        self.assertRaises(errors.UnstackableBranchFormat,
 
410
            branch.get_stacked_on_url)
 
411
 
397
412
    def test_push_doesnt_create_broken_branch(self):
398
413
        """Pushing a new standalone branch works even when there's a default
399
414
        stacking policy at the destination.