/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/per_repository/test_fetch.py

  • Committer: Matt Nordhoff
  • Date: 2009-04-04 02:50:01 UTC
  • mfrom: (4253 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4256.
  • Revision ID: mnordhoff@mattnordhoff.com-20090404025001-z1403k0tatmc8l91
Merge bzr.dev, fixing conflicts.

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
"""Tests for fetch between repositories of the same type."""
18
18
 
31
31
 
32
32
    def test_fetch(self):
33
33
        # smoke test fetch to ensure that the convenience function works.
34
 
        # it is defined as a convenience function with the underlying 
 
34
        # it is defined as a convenience function with the underlying
35
35
        # functionality provided by an InterRepository
36
36
        tree_a = self.make_branch_and_tree('a')
37
37
        self.build_tree(['a/foo'])
44
44
            raise TestSkipped('Cannot fetch from model2 to model1')
45
45
        repo.fetch(tree_a.branch.repository,
46
46
                   revision_id=None)
47
 
                   ## pb=bzrlib.progress.DummyProgress())
48
 
 
49
 
    def test_fetch_knit3(self):
 
47
 
 
48
    def test_fetch_fails_in_write_group(self):
 
49
        # fetch() manages a write group itself, fetching within one isn't safe.
 
50
        repo = self.make_repository('a')
 
51
        repo.lock_write()
 
52
        self.addCleanup(repo.unlock)
 
53
        repo.start_write_group()
 
54
        self.addCleanup(repo.abort_write_group)
 
55
        # Don't need a specific class - not expecting flow control based on
 
56
        # this.
 
57
        self.assertRaises(errors.BzrError, repo.fetch, repo)
 
58
 
 
59
    def test_fetch_to_knit3(self):
50
60
        # create a repository of the sort we are testing.
51
61
        tree_a = self.make_branch_and_tree('a')
52
62
        self.build_tree(['a/foo'])
80
90
        try:
81
91
            tree_b = b_bzrdir.create_workingtree()
82
92
        except errors.NotLocalUrl:
83
 
            raise TestSkipped("cannot make working tree with transport %r"
 
93
            try:
 
94
                tree_b = b_branch.create_checkout('b', lightweight=True)
 
95
            except errors.NotLocalUrl:
 
96
                raise TestSkipped("cannot make working tree with transport %r"
84
97
                              % b_bzrdir.transport)
85
98
        tree_b.commit('no change', rev_id='rev2')
86
99
        rev2_tree = knit3_repo.revision_tree('rev2')