~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-06-12 02:17:42 UTC
  • mfrom: (2521.1.1 56322)
  • Revision ID: pqm@pqm.ubuntu.com-20070612021742-uetsy3g747iq3xkk
mergeĀ initĀ --create-prefix

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
        self.assertEqual('', err)
74
74
        WorkingTree.open('subdir1')
75
75
        
 
76
        self.run_bzr_error(['Parent directory of subdir2/nothere does not exist'],
 
77
                            'init', 'subdir2/nothere')
76
78
        out, err = self.run_bzr('init', 'subdir2/nothere', retcode=3)
77
79
        self.assertEqual('', out)
78
 
        self.assertContainsRe(err,
79
 
            r'^bzr: ERROR: No such file: .*'
80
 
            '\[Err(no|or) 2\]')
81
80
        
82
81
        os.mkdir('subdir2')
83
82
        out, err = self.run_bzr('init', 'subdir2')
120
119
        # try to init unicode dir
121
120
        self.run_bzr('init', u'mu-\xb5')
122
121
 
 
122
    def create_simple_tree(self):
 
123
        tree = self.make_branch_and_tree('tree')
 
124
        self.build_tree(['tree/a'])
 
125
        tree.add(['a'], ['a-id'])
 
126
        tree.commit('one', rev_id='r1')
 
127
        return tree
 
128
 
 
129
    def test_init_create_prefix(self):
 
130
        """'bzr init --create-prefix; will create leading directories."""
 
131
        tree = self.create_simple_tree()
 
132
 
 
133
        self.run_bzr_error(['Parent directory of ../new/tree does not exist'],
 
134
                            'init', '../new/tree',
 
135
                            working_dir='tree')
 
136
        self.run_bzr('init', '../new/tree', '--create-prefix',
 
137
                        working_dir='tree')
 
138
        self.failUnlessExists('new/tree/.bzr')
 
139
 
123
140
 
124
141
class TestSFTPInit(TestCaseWithSFTPServer):
125
142