~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_bundle.py

  • Committer: Robert Collins
  • Date: 2007-07-04 08:08:13 UTC
  • mfrom: (2572 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2587.
  • Revision ID: robertc@robertcollins.net-20070704080813-wzebx0r88fvwj5rq
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006 by Canonical Ltd
 
1
# Copyright (C) 2006 Canonical Ltd
2
2
# Authors: Aaron Bentley
3
3
#
4
4
# This program is free software; you can redistribute it and/or modify
21
21
 
22
22
from bzrlib.bundle.serializer import read_bundle
23
23
from bzrlib.bzrdir import BzrDir
24
 
from bzrlib.tests import TestCaseInTempDir
25
 
 
26
 
 
27
 
class TestBundle(TestCaseInTempDir):
 
24
from bzrlib import tests
 
25
 
 
26
 
 
27
class TestBundle(tests.TestCaseWithTransport):
28
28
 
29
29
    def make_trees(self):
30
30
        grandparent_tree = BzrDir.create_standalone_workingtree('grandparent')
37
37
 
38
38
    def test_uses_parent(self):
39
39
        """Parent location is used as a basis by default"""
40
 
        self.make_trees()        
 
40
        self.make_trees()
41
41
        os.chdir('grandparent')
42
42
        errmsg = self.run_bzr('bundle', retcode=3)[1]
43
43
        self.assertContainsRe(errmsg, 'No base branch known or specified')
82
82
        bi = read_bundle(StringIO(self.run_bzr('bundle', '-r', '-2..-1')[0]))
83
83
        self.assertRevisions(bi, ['revision3'])
84
84
        self.run_bzr('bundle', '../grandparent', '-r', '-2..-1', retcode=3)
 
85
 
 
86
    def test_output(self):
 
87
        # check output for consistency
 
88
        # win32 stdout converts LF to CRLF,
 
89
        # and this is breaks the created bundle
 
90
        self.make_trees()        
 
91
        os.chdir('branch')
 
92
        stdout = self.run_bzr_subprocess('bundle')[0]
 
93
        br = read_bundle(StringIO(stdout))
 
94
        self.assertRevisions(br, ['revision3'])
 
95
 
 
96
    def test_no_common_ancestor(self):
 
97
        foo = self.make_branch_and_tree('foo')
 
98
        bar = self.make_branch_and_tree('bar')
 
99
        os.chdir('foo')
 
100
        self.run_bzr('bundle', '../bar')