/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

  • Committer: Jelmer Vernooij
  • Date: 2010-03-21 21:39:33 UTC
  • mfrom: (5102 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5143.
  • Revision ID: jelmer@samba.org-20100321213933-fexeh9zcoz8oaju2
merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2007, 2008 Canonical Ltd
 
1
# Copyright (C) 2006-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
31
31
    workingtree
32
32
    )
33
33
from bzrlib.repofmt import knitrepo
34
 
from bzrlib.tests import http_server
 
34
from bzrlib.tests import (
 
35
    blackbox,
 
36
    http_server,
 
37
    test_foreign,
 
38
    test_server,
 
39
    )
35
40
from bzrlib.transport import memory
36
41
 
37
42
 
580
585
 
581
586
class RedirectingMemoryServer(memory.MemoryServer):
582
587
 
583
 
    def setUp(self):
 
588
    def start_server(self):
584
589
        self._dirs = {'/': None}
585
590
        self._files = {}
586
591
        self._locks = {}
594
599
        result._locks = self._locks
595
600
        return result
596
601
 
597
 
    def tearDown(self):
 
602
    def stop_server(self):
598
603
        transport.unregister_transport(self._scheme, self._memory_factory)
599
604
 
600
605
 
768
773
        self.set_config_push_strict('oFF')
769
774
        self.assertPushFails(['--strict'])
770
775
        self.assertPushSucceeds([])
 
776
 
 
777
 
 
778
class TestPushForeign(blackbox.ExternalBase):
 
779
 
 
780
    def setUp(self):
 
781
        super(TestPushForeign, self).setUp()
 
782
        test_foreign.register_dummy_foreign_for_test(self)
 
783
 
 
784
    def make_dummy_builder(self, relpath):
 
785
        builder = self.make_branch_builder(
 
786
            relpath, format=test_foreign.DummyForeignVcsDirFormat())
 
787
        builder.build_snapshot('revid', None,
 
788
            [('add', ('', 'TREE_ROOT', 'directory', None)),
 
789
             ('add', ('foo', 'fooid', 'file', 'bar'))])
 
790
        return builder
 
791
 
 
792
    def test_no_roundtripping(self):
 
793
        target_branch = self.make_dummy_builder('dp').get_branch()
 
794
        source_tree = self.make_branch_and_tree("dc")
 
795
        output, error = self.run_bzr("push -d dc dp", retcode=3)
 
796
        self.assertEquals("", output)
 
797
        self.assertEquals(error, "bzr: ERROR: It is not possible to losslessly"
 
798
            " push to dummy. You may want to use dpush instead.\n")