~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Rory Yorke
  • Date: 2010-10-20 14:38:53 UTC
  • mto: This revision was merged to the branch mainline in revision 5519.
  • Revision ID: rory.yorke@gmail.com-20101020143853-9kfd2ldcjfroh8jw
Show missing files in bzr status (bug 134168).

"bzr status" will now show missing files, that is, those added with "bzr
add" and then removed by non bzr means (e.g., rm).

Blackbox tests were added for this case, and tests were also added to
test_delta, since the implementation change is in bzrlib.delta.

Might also affect bug 189709.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2011 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
47
47
        self.assertIsDirectory('.bzr/checkout', t)
48
48
        self.assertIsDirectory('.bzr/checkout/lock', t)
49
49
 
 
50
    def test_init_weave(self):
 
51
        # --format=weave should be accepted to allow interoperation with
 
52
        # old releases when desired.
 
53
        out, err = self.run_bzr('init --format=weave')
 
54
        self.assertEqual("""Created a standalone tree (format: weave)\n""",
 
55
            out)
 
56
        self.assertEqual('', err)
 
57
 
50
58
    def test_init_format_2a(self):
51
59
        """Smoke test for constructing a format 2a repoistory."""
52
60
        out, err = self.run_bzr('init --format=2a')
100
108
        # init an existing branch.
101
109
        out, err = self.run_bzr('init subdir2', retcode=3)
102
110
        self.assertEqual('', out)
103
 
        self.assertTrue(err.startswith('bzr: ERROR: Already a branch:'))
 
111
        self.failUnless(err.startswith('bzr: ERROR: Already a branch:'))
104
112
 
105
113
    def test_init_branch_quiet(self):
106
114
        out, err = self.run_bzr('init -q')
154
162
        self.run_bzr_error(['Parent directory of ../new/tree does not exist'],
155
163
                            'init ../new/tree', working_dir='tree')
156
164
        self.run_bzr('init ../new/tree --create-prefix', working_dir='tree')
157
 
        self.assertPathExists('new/tree/.bzr')
 
165
        self.failUnlessExists('new/tree/.bzr')
158
166
 
159
167
    def test_init_default_format_option(self):
160
168
        """bzr init should read default format from option default_format"""
218
226
        # and uses whoami only in a lock file. Without whoami the login name
219
227
        # is used. This test is to ensure that init passes even when whoami
220
228
        # is not available.
221
 
        self.overrideEnv('EMAIL', None)
222
 
        self.overrideEnv('BZR_EMAIL', None)
 
229
        osutils.set_or_unset_env('EMAIL', None)
 
230
        osutils.set_or_unset_env('BZR_EMAIL', None)
223
231
        out, err = self.run_bzr(['init', 'foo'])
224
232
        self.assertEqual(err, '')
225
233
        self.assertTrue(os.path.exists('foo'))
226
 
 
 
234