~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_workingtree/test_smart_add.py

  • Committer: Jelmer Vernooij
  • Date: 2012-02-20 12:19:29 UTC
  • mfrom: (6437.23.11 2.5)
  • mto: (6581.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 6582.
  • Revision ID: jelmer@samba.org-20120220121929-7ni2psvjoatm1yp4
Merge bzr/2.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    ignores,
26
26
    osutils,
27
27
    tests,
 
28
    trace,
28
29
    )
29
30
from bzrlib.tests import (
30
31
    features,
91
92
        for path in paths:
92
93
            self.assertNotEqual(wt.path2id(path), None)
93
94
 
 
95
    def test_skip_nested_trees(self):
 
96
        """Test smart-adding a nested tree ignors it and warns."""
 
97
        wt = self.make_branch_and_tree('.')
 
98
        nested_wt = self.make_branch_and_tree('nested')
 
99
        warnings = []
 
100
        def warning(*args):
 
101
            warnings.append(args[0] % args[1:])
 
102
        self.overrideAttr(trace, 'warning', warning)
 
103
        wt.smart_add((u".",))
 
104
        self.assertIs(wt.path2id("nested"), None)
 
105
        self.assertEquals(
 
106
            ['skipping nested tree %r' % nested_wt.basedir], warnings)
 
107
 
94
108
    def test_add_dot_from_subdir(self):
95
109
        """Test adding . from a subdir of the tree."""
96
110
        paths = ("original/", "original/file1", "original/file2")
150
164
        self.build_tree(tree_shape)
151
165
        wt.smart_add(add_paths)
152
166
        for path in expected_paths:
153
 
            self.assertNotEqual(wt.path2id(path), None, "No id added for %s" % path)
 
167
            self.assertNotEqual(wt.path2id(path), None,
 
168
                "No id added for %s" % path)
154
169
 
155
170
    def test_add_non_existant(self):
156
171
        """Test smart-adding a file that does not exist."""