~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Aaron Bentley
  • Date: 2006-08-02 13:02:47 UTC
  • mfrom: (1907 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1934.
  • Revision ID: abentley@panoramicfeedback.com-20060802130247-bf2502d680abed61
Rough merge of bzr.dev

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'])
31
35
        self.build_tree_contents([('.bzrignore', 'CVS\n')])
38
42
                           'added dir',
39
43
                           'added dir/sub.txt',
40
44
                           'added top.txt',
41
 
                           'ignored 1 file(s).'],
 
45
                           'ignored 2 file(s).'],
42
46
                          results)
43
47
        out = self.run_bzr_captured(['add', '-v'], retcode=0)[0]
44
48
        results = sorted(out.rstrip('\n').split('\n'))
45
49
        self.assertEquals(['If you wish to add some of these files, please'\
46
50
                           ' add them by name.',
 
51
                           'ignored .bazaar matching "./.bazaar"',
47
52
                           'ignored CVS matching "CVS"'],
48
53
                          results)
49
54
 
61
66
 
62
67
        "bzr add" should add the parent(s) as necessary.
63
68
        """
 
69
        ignores._set_user_ignores(['./.bazaar'])
 
70
 
64
71
        self.runbzr('init')
65
72
        self.build_tree(['inertiatic/', 'inertiatic/esp'])
66
73
        self.assertEquals(self.capture('unknowns'), 'inertiatic\n')
84
91
 
85
92
        "bzr add" should do this happily.
86
93
        """
 
94
        ignores._set_user_ignores(['./.bazaar'])
 
95
 
87
96
        self.runbzr('init')
88
97
        self.build_tree(['inertiatic/', 'inertiatic/esp'])
89
98
        self.assertEquals(self.capture('unknowns'), 'inertiatic\n')
95
104
    def test_subdir_add(self):
96
105
        """Add in subdirectory should add only things from there down"""
97
106
        from bzrlib.workingtree import WorkingTree
98
 
        
 
107
 
 
108
        ignores._set_user_ignores(['./.bazaar'])
99
109
        eq = self.assertEqual
100
 
        ass = self.assert_
 
110
        ass = self.assertTrue
101
111
        chdir = os.chdir
102
112
        
103
113
        t = self.make_branch_and_tree('.')