~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-07-31 04:52:48 UTC
  • mfrom: (1897.1.2 fix os.walkdirs)
  • Revision ID: pqm@pqm.ubuntu.com-20060731045248-d2a1c838e7fcfc6a
(robertc) Add current-directory information to osutils.walkdirs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
import os
21
21
 
 
22
from bzrlib import ignores
 
23
 
22
24
from bzrlib.tests.blackbox import ExternalBase
23
25
 
24
26
 
26
28
        
27
29
    def test_add_reports(self):
28
30
        """add command prints the names of added files."""
 
31
        ignores._set_user_ignores(['./.bazaar'])
 
32
 
29
33
        self.runbzr('init')
30
34
        self.build_tree(['top.txt', 'dir/', 'dir/sub.txt', 'CVS'])
 
35
        self.build_tree_contents([('.bzrignore', 'CVS\n')])
31
36
        out = self.run_bzr_captured(['add'], retcode=0)[0]
32
37
        # the ordering is not defined at the moment
33
38
        results = sorted(out.rstrip('\n').split('\n'))
34
39
        self.assertEquals(['If you wish to add some of these files, please'\
35
40
                           ' add them by name.',
 
41
                           'added .bzrignore',
36
42
                           'added dir',
37
43
                           'added dir/sub.txt',
38
44
                           'added top.txt',
39
 
                           'ignored 1 file(s).'],
 
45
                           'ignored 2 file(s).'],
40
46
                          results)
41
47
        out = self.run_bzr_captured(['add', '-v'], retcode=0)[0]
42
48
        results = sorted(out.rstrip('\n').split('\n'))
43
49
        self.assertEquals(['If you wish to add some of these files, please'\
44
50
                           ' add them by name.',
 
51
                           'ignored .bazaar matching "./.bazaar"',
45
52
                           'ignored CVS matching "CVS"'],
46
53
                          results)
47
54
 
59
66
 
60
67
        "bzr add" should add the parent(s) as necessary.
61
68
        """
 
69
        ignores._set_user_ignores(['./.bazaar'])
 
70
 
62
71
        self.runbzr('init')
63
72
        self.build_tree(['inertiatic/', 'inertiatic/esp'])
64
73
        self.assertEquals(self.capture('unknowns'), 'inertiatic\n')
82
91
 
83
92
        "bzr add" should do this happily.
84
93
        """
 
94
        ignores._set_user_ignores(['./.bazaar'])
 
95
 
85
96
        self.runbzr('init')
86
97
        self.build_tree(['inertiatic/', 'inertiatic/esp'])
87
98
        self.assertEquals(self.capture('unknowns'), 'inertiatic\n')
93
104
    def test_subdir_add(self):
94
105
        """Add in subdirectory should add only things from there down"""
95
106
        from bzrlib.workingtree import WorkingTree
96
 
        
 
107
 
 
108
        ignores._set_user_ignores(['./.bazaar'])
97
109
        eq = self.assertEqual
98
 
        ass = self.assert_
 
110
        ass = self.assertTrue
99
111
        chdir = os.chdir
100
112
        
101
113
        t = self.make_branch_and_tree('.')